/* Reducir foto a KB — papel milimetrado, tinta azul, marcador ámbar, regla de medir */

:root {
  --paper: #f2f6f3;
  --card: #ffffff;
  --ink: #112a3a;
  --pencil: #4d626e;
  --line: rgba(17, 42, 58, 0.14);
  --amber: #f2b632;
  --amber-soft: rgba(242, 182, 50, 0.32);
  --yes: #1d6f55;
  --no: #a8324a;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h2 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

main, .top, .foot { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.brand { font-family: var(--serif); font-size: 1.1rem; text-decoration: none; }
.top nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.top nav a { text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { border-bottom-color: var(--amber); }

/* Intro */
.intro { padding: 0.6rem 0 1.2rem; max-width: 46rem; }
.intro h1 { font-size: clamp(1.85rem, 6vw, 3.2rem); margin-bottom: 0.5rem; }
.lede { font-size: 1.05rem; color: var(--pencil); max-width: 40rem; margin: 0; }

/* Workbench */
.workbench { display: grid; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 880px) {
  .workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
}

.tool {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 7px 7px 0 var(--amber);
  padding: 1.1rem;
}
.field-label { display: block; font-weight: 700; margin: 0 0 0.5rem; }

/* Chips */
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
.chip {
  font: inherit; font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums;
  min-height: 46px; padding: 0.3rem 0.2rem;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.2rem;
}
.chip:hover { background: var(--amber-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip-other { cursor: text; padding-inline: 0.35rem; }
.chip-other input {
  width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; color: inherit;
  text-align: right; padding: 0;
}
.chip-other input::placeholder { color: var(--pencil); font-weight: 500; }
.chip-other input:focus { outline: none; }
.chip-other:focus-within { outline: 3px solid var(--amber); outline-offset: 2px; }
.chip-other.on { background: var(--ink); color: var(--paper); }
.chip-other.on input::placeholder { color: var(--paper); }

/* Drop zone */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  width: 100%; min-height: 112px; margin-top: 0.9rem; padding: 1rem;
  font: inherit; color: var(--ink); text-align: center; cursor: pointer;
  background: var(--paper);
  border: 2px dashed var(--ink); border-radius: 6px;
}
.drop:hover, .drop.over { background: var(--amber-soft); border-style: solid; }
.drop-big { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; }
.drop-small { font-size: 0.85rem; color: var(--pencil); }

/* More options */
.more { margin-top: 0.8rem; }
.more summary { cursor: pointer; font-weight: 500; font-size: 0.95rem; padding: 0.3rem 0; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 0.6rem; }
.more-grid label { font-size: 0.88rem; font-weight: 700; display: flex; flex-direction: column; justify-content: space-between; gap: 0.3rem; }
.more input[type="number"] {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 4px; padding: 0.5rem 0.6rem;
}
.check { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }

.hint { font-size: 0.88rem; color: var(--pencil); margin: 0.4rem 0 0; }
.form-msg { min-height: 0; margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--no); font-weight: 500; }
.form-msg:empty { display: none; }

/* Result */
.result { border-top: 2px solid var(--ink); padding-top: 1rem; }
.readout { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin-bottom: 0.9rem; }
.read-big { font-family: var(--serif); font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.read-sub { color: var(--pencil); font-weight: 500; }

.gauge {
  position: relative; height: 56px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden;
}
.g-ticks {
  position: absolute; inset: auto 0 0 0; height: 100%;
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 10%),
    repeating-linear-gradient(90deg, var(--pencil) 0 1px, transparent 1px 2%);
  background-size: 100% 22px, 100% 10px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
}
.g-zone { position: absolute; top: 0; bottom: 0; left: 0; width: 80%; background: var(--amber-soft); }
.g-limit {
  position: absolute; top: 0; bottom: 0; left: 80%; width: 0;
  border-left: 3px solid var(--ink);
}
.g-limit span {
  position: absolute; top: 4px; right: 6px; white-space: nowrap;
  font-size: 0.75rem; font-weight: 700; background: var(--amber); padding: 0 0.35rem; border-radius: 2px;
}
.g-needle {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0; opacity: 0;
  transition: left 1.1s cubic-bezier(.2,.8,.25,1), opacity 0.2s;
}
.g-needle::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: var(--no);
}
.g-needle::after {
  content: ""; position: absolute; bottom: 0; left: -8px;
  border: 8px solid transparent; border-bottom: 12px solid var(--no); border-top: 0;
}
.g-needle.show { opacity: 1; }
.g-scale { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--pencil); margin-top: 0.2rem; font-variant-numeric: tabular-nums; }

.progress { height: 8px; margin-top: 0.8rem; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--card); }
.progress i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.2s; }

.res-msg { margin: 0.8rem 0 0; font-weight: 500; }
.res-msg:empty { display: none; }
.res-msg.ok { color: var(--yes); }
.res-msg.warn { background: var(--amber-soft); border-left: 4px solid var(--amber); padding: 0.5rem 0.7rem; color: var(--ink); }
.res-msg.err { color: var(--no); }
.res-msg small { display: block; font-weight: 400; color: var(--pencil); margin-top: 0.3rem; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1rem; }
.compare figure { margin: 0; }
.ph {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden;
}
.ph img { max-width: 100%; max-height: 100%; display: block; }
.compare figcaption { font-size: 0.85rem; color: var(--pencil); margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.compare figcaption b { color: var(--ink); display: block; }

.btn-primary {
  display: block; width: 100%; margin-top: 1rem; text-align: center; text-decoration: none;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 4px;
  padding: 0.85rem 1.2rem; font-weight: 700; font-size: 1.05rem;
}
.btn-primary:hover { background: #0b1d29; }
[hidden] { display: none !important; }

/* Ad slots (placeholders) */
.ad-slot {
  min-height: 90px; margin: 2rem 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 4px;
  color: rgba(77, 98, 110, 0.55); font-size: 0.8rem;
}

/* Content sections */
.how, .seo, .faq { max-width: 46rem; margin: 3rem 0; }
.how h2, .faq h2 { margin-bottom: 1rem; }
.seo h2 { margin: 1.8rem 0 0.8rem; }
.seo h2:first-child { margin-top: 0; }
.steps { padding-left: 1.4rem; margin: 0; }
.steps li { margin-bottom: 0.8rem; padding-left: 0.3rem; }
.seo p { max-width: 42rem; }

.sizes { margin: 2.5rem 0; }
.sizes h2 { margin-bottom: 0.8rem; }
.sizes ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.sizes a {
  display: inline-block; padding: 0.5rem 0.9rem; border: 2px solid var(--ink); border-radius: 8px;
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 500;
  box-shadow: 3px 3px 0 var(--amber);
}
.sizes a:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--amber); }
.sizes a[aria-current="page"] { background: var(--amber); box-shadow: none; }

.faq summary { cursor: pointer; font-weight: 500; }
.faq details { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq details p { margin: 0.6rem 0 0; color: var(--pencil); }

.foot { padding: 2rem 0 3rem; border-top: 2px solid var(--ink); color: var(--pencil); font-size: 0.9rem; }
.foot p { margin: 0; }
.noscript { background: var(--amber); padding: 1rem; text-align: center; margin: 0; }

@media (max-width: 420px) {
  .top nav a[href="#preguntas"] { display: none; }
  .chip { font-size: 0.88rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .g-needle, .progress i { transition: none; }
}

/* Escondido hasta que AdSense apruebe; entonces borrar esta regla y poner los bloques. */
.ad-slot { display: none !important; }
