/* Guía de Casetas
   Concepto: cuaderno de obra de jardín. Verde bosque profundo, papel de croquis y cotas en monoespaciada
   (las medidas son el dato central de una caseta). Botón de oferta en naranja tostado con texto blanco. */
:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --ink: #18211b;
  --muted: #586259;
  --line: #d9ded6;
  --soft: #e9ede5;
  --brand: #1f4a33;
  --brand-ink: #ffffff;
  --accent: #2e6b49;
  --cta: #b9470f;
  --cta-hover: #9c3a0a;
  --on-cta: #ffffff;
  --good: #2e6b49;
  --bad: #a83a2e;
  --grid: rgba(31, 74, 51, 0.07);

  --f-display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --f-body: "Figtree", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 4px;
  --wrap: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121714; --surface: #19201b; --ink: #e6ebe5; --muted: #a3ada4; --line: #2b352e; --soft: #212a23;
    --brand: #173a27; --brand-ink: #ffffff; --accent: #7cc49b; --cta: #d25a1c; --cta-hover: #e46b2b; --on-cta: #ffffff;
    --good: #7cc49b; --bad: #f08d80; --grid: rgba(124, 196, 155, 0.06); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121714; --surface: #19201b; --ink: #e6ebe5; --muted: #a3ada4; --line: #2b352e; --soft: #212a23;
  --brand: #173a27; --brand-ink: #ffffff; --accent: #7cc49b; --cta: #d25a1c; --cta-hover: #e46b2b; --on-cta: #ffffff;
  --good: #7cc49b; --bad: #f08d80; --grid: rgba(124, 196, 155, 0.06); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.08rem/1.65 var(--f-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
.eyebrow { font: 600 0.76rem/1 var(--f-data); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }

/* Cabecera: banda verde */
.site-header { background: var(--brand); color: var(--brand-ink); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1.4rem; min-height: 62px; flex-wrap: wrap; padding-block: 0.4rem; }
.logo { display: flex; align-items: center; gap: 0.55rem; color: var(--brand-ink); text-decoration: none; font: 800 1.2rem/1 var(--f-display); letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 0.2rem 1.2rem; flex-wrap: wrap; font: 600 0.95rem/1.2 var(--f-body); }
.nav a { color: var(--brand-ink); text-decoration: none; padding-block: 0.4rem; opacity: 0.92; }
.nav a:hover, .nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 680px) { .nav { width: 100%; font-size: 0.9rem; gap: 0.1rem 0.9rem; } }

/* Cabecera de página con cuadrícula de croquis */
.hero { background-color: var(--surface); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; border-bottom: 1px solid var(--line); padding-block: clamp(1.8rem, 5vw, 3.2rem); }
.hero .wrap { display: grid; gap: 0.9rem; }
.hero .lead { font-size: 1.22rem; color: var(--muted); max-width: 62ch; margin: 0; }
.meta { font: 500 0.8rem/1.4 var(--f-data); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0; }

.crumbs { font: 500 0.8rem/1.4 var(--f-data); color: var(--muted); padding-block: 0.9rem 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.35rem; }
.crumbs a { color: var(--muted); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; font: 700 0.98rem/1.1 var(--f-body); text-decoration: none; padding: 0.85rem 1.15rem; border-radius: var(--radius); border: 0; cursor: pointer; transition: background .15s; text-align: center; }
.btn-cta { background: var(--cta); color: var(--on-cta); }
.btn-cta:hover { background: var(--cta-hover); }
.btn-cta small { font: 500 0.76rem/1 var(--f-data); opacity: 0.92; }
.btn-line { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }

/* Tarjetas de caseta */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; }
.card .img { background: #ffffff; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; max-width: 100%; border-bottom: 1px solid var(--line); position: relative; }
.card .img img { width: 100%; height: 100%; object-fit: contain; }
.card .tag { position: absolute; left: 0; top: 0; background: var(--brand); color: var(--brand-ink); font: 600 0.7rem/1 var(--f-data); letter-spacing: 0.06em; text-transform: uppercase; padding: 0.45rem 0.6rem; }
.card .body { padding: 1rem; display: grid; gap: 0.6rem; align-content: start; }
.card h3 { font-size: 1.1rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .marca { font: 600 0.74rem/1 var(--f-data); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card p { margin: 0; font-size: 0.98rem; }
.cotas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.cotas div { padding: 0.45rem 0.5rem; border-left: 1px solid var(--line); min-width: 0; }
.cotas div:first-child { border-left: 0; }
.cotas b { display: block; font: 700 0.95rem/1.2 var(--f-data); font-variant-numeric: tabular-nums; }
.cotas span { font: 500 0.66rem/1.2 var(--f-data); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.card .acciones { display: grid; gap: 0.45rem; margin-top: 0.2rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-block: 1.4rem; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-block: 1.4rem; }
@media (max-width: 900px) { .picks { grid-template-columns: 1fr; } }
.card.wide { grid-template-columns: 240px 1fr; grid-template-rows: auto; margin-block: 1.6rem; }
.card.wide .img { aspect-ratio: auto; height: 100%; min-height: 200px; border-bottom: 0; border-right: 1px solid var(--line); }
@media (max-width: 600px) { .card.wide { grid-template-columns: 1fr; } .card.wide .img { aspect-ratio: 4 / 3; border-right: 0; border-bottom: 1px solid var(--line); } }

/* Comparativa sin scroll lateral: en móvil cada fila es una tarjeta */
.compare { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 0.97rem; margin-block: 1.4rem; table-layout: fixed; }
.compare th, .compare td { text-align: left; padding: 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.compare thead th { font: 600 0.72rem/1.2 var(--f-data); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--soft); }
.compare td.n { font-family: var(--f-display); font-weight: 700; }
.compare td.n a { color: var(--ink); text-decoration: none; }
.compare td.d { font: 500 0.86rem/1.35 var(--f-data); }
.compare td .btn { width: 100%; padding: 0.6rem; font-size: 0.88rem; }
@media (max-width: 760px) {
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare thead { display: none; }
  .compare tr { border-bottom: 1px solid var(--line); padding-block: 0.5rem; }
  .compare td { border: 0; padding: 0.3rem 0.9rem; }
  .compare td[data-l]::before { content: attr(data-l) ": "; font: 600 0.72rem/1 var(--f-data); text-transform: uppercase; color: var(--muted); }
}

/* Artículo a todo el ancho; texto corrido limitado a ~75 caracteres */
.layout { padding-block: 1.4rem 4rem; }
.prose { min-width: 0; }
.prose > * + * { margin-top: 1.05em; }
.prose > p, .prose > ul, .prose > ol, .prose > h2, .prose > h3, .prose > blockquote { max-width: 75ch; }
.prose h2 { margin-top: 2.3em; scroll-margin-top: 1rem; }
.prose h3 { margin-top: 1.6em; scroll-margin-top: 1rem; }
.prose h2 + p, .prose h3 + p { margin-top: 0.6em; }
.prose p, .prose li { margin-block: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.prose blockquote { margin: 1.4rem 0; padding: 1rem 1.2rem; background: var(--soft); border-left: 3px solid var(--accent); }
.prose table:not(.compare) { width: 100%; border-collapse: collapse; font-size: 0.97rem; table-layout: fixed; background: var(--surface); }
.prose table:not(.compare) th, .prose table:not(.compare) td { border: 1px solid var(--line); padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.prose table:not(.compare) th { font: 600 0.74rem/1.25 var(--f-data); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--soft); }
.prose strong { font-weight: 700; }

.toc { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand); padding: 0.9rem 1.2rem 1rem; margin-block: 1.6rem; font: 500 0.98rem/1.4 var(--f-body); }
.toc p { margin: 0 0 0.6rem; }
.toc ol { display: block; margin: 0; padding-left: 1.2rem; columns: 2 260px; column-gap: 2.5rem; }
.toc li { break-inside: avoid; padding-block: 0.18rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.disclosure { font: 500 0.82rem/1.5 var(--f-data); color: var(--muted); border-left: 3px solid var(--cta); padding: 0.3rem 0 0.3rem 0.8rem; max-width: 75ch; }
.aviso-final { margin-top: 2.5rem; }

/* Filtro de listados */
.filtro { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-block: 1rem 0.2rem; }
.filtro a { font: 600 0.85rem/1 var(--f-body); text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 0.55rem 0.8rem; border-radius: 999px; }
.filtro a:hover, .filtro a[aria-current] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Portada: temas */
.section { padding-block: clamp(2rem, 5vw, 3.4rem); }
.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 0.5rem; margin-bottom: 1.3rem; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.6rem 2rem; }
.topic h3 { font: 600 0.78rem/1 var(--f-data); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.7rem; }
.topic ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.topic a { font: 650 1.04rem/1.3 var(--f-display); color: var(--ink); text-decoration: none; }
.topic a:hover { color: var(--accent); }

/* Ficha */
.ficha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; padding-block: 1.2rem 1rem; }
@media (max-width: 860px) { .ficha { grid-template-columns: 1fr; } }
.ficha .foto { background: #ffffff; border: 1px solid var(--line); aspect-ratio: 1 / 1; max-width: 100%; display: grid; place-items: center; overflow: hidden; }
.ficha .foto img { width: 100%; height: 100%; object-fit: contain; }
.ficha-info { display: grid; gap: 1rem; min-width: 0; }
.datos { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.datos th, .datos td { text-align: left; padding: 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.datos th { font: 600 0.76rem/1.4 var(--f-data); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); width: 40%; padding-right: 0.8rem; }
.datos td { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 900px; }
@media (max-width: 640px) { .proscons { grid-template-columns: 1fr; } }
.proscons > div { background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.1rem; }
.proscons h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.proscons ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.pros h3 { color: var(--good); }
.cons h3 { color: var(--bad); }

/* Pie */
.site-footer { background: var(--brand); color: var(--brand-ink); padding-block: 2.5rem; margin-top: 2rem; }
.site-footer a { color: var(--brand-ink); opacity: 0.88; }
.site-footer a:hover { opacity: 1; }
.site-footer p { margin: 0; max-width: 75ch; font-size: 0.97rem; opacity: 0.88; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.6rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { font: 600 0.76rem/1 var(--f-data); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.8rem; opacity: 0.75; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; font: 500 0.95rem/1.3 var(--f-body); }
.site-footer ul a { text-decoration: none; }
.legal { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.2); display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; font: 500 0.8rem/1.4 var(--f-data); }
