/* Monte Libre: tokens de marca, base, cabecera, portadas, pie, anuncios, afiliación, formularios y páginas estáticas.
   La usan index.html y las páginas que genera herramientas/generar_paginas.mjs. Guía de marca: docs/marca.md.
   Estilo: papel claro, tinta verde bosque, titulares en serifa, curvas de nivel. Pocas sombras y esquinas contenidas. */
:root {
  --bg: #f7f4ec;
  --surface: #fffdf8;
  --surface-2: #f0ece1;
  --ink: #1d2621;
  --muted: #56615a;
  --faint: #8a918a;
  --line: #e2dccf;
  --line-2: #d3ccbc;
  --brand: #2f6b4f;
  --brand-ink: #ffffff;
  --brand-text: #2a6248;
  --brand-soft: #e3ece2;
  --accent: #e0a13a;
  --accent-ink: #855607;
  --accent-soft: #f7ecd5;
  --warn-ink: #8a5a00;
  --warn-soft: #f8edd3;
  --ok-ink: #2d7448;
  --ok-soft: #e0efe2;
  --st-no: #d9666f;   --st-no-ink: #9b2531;   --st-no-soft: #f8e3e2;
  --st-lim: #e8b04a;  --st-lim-ink: #7d5200;  --st-lim-soft: #f8ecd2;
  --st-perm: #5a9bcf; --st-perm-ink: #1c5d8c; --st-perm-soft: #e2edf6;
  --st-gris: #cdd1c8; --st-gris-ink: #4c5750; --st-gris-soft: #ebebe4;
  --ref-g: #2f6b4f;  --ref-l: #d08a1e;  --ref-c: #8b6b4e;  /* refugios: guardado, libre, cabaña */
  --hatch: #a3ada6;
  --map-edge: #ffffff;
  --shadow: 0 1px 2px rgba(60, 50, 25, .06);
  --shadow-lg: 0 8px 28px rgba(60, 50, 25, .14);
  --radius: 10px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- cabecera: logo y pestañas subrayadas ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font: 600 21px/1 var(--serif); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-text i { color: var(--brand-text); }
.tabs { display: flex; gap: 4px; margin-left: auto; align-self: stretch; }
.tab { border: 0; background: transparent; padding: 0 12px; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 7px; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tab .ico { width: 16px; height: 16px; }
.list-btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.zero { background: var(--surface-2); color: var(--muted); }
@media (max-width: 640px) {
  .logo-text, .list-btn .lbl { display: none; }
  .tabs { margin-left: 0; flex: 1; }
  .tab { flex: 1; justify-content: center; padding: 0 6px; }
}

/* ---------- portadas: papel claro con curvas de nivel ---------- */
.hero { position: relative; overflow: hidden; margin-top: 20px; padding: 40px 36px 34px; border-radius: 14px; border: 1px solid var(--line); background: url("../marca/curvas.svg") right -60px center / 640px auto no-repeat, var(--surface-2); isolation: isolate; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 12px; text-wrap: balance; max-width: 16ch; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; max-width: 50ch; }
.hero .kick { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--brand-text); display: flex; align-items: center; gap: 6px; }
.hero .kick .ico { width: 16px; height: 16px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 10px; font-size: 13.5px; color: var(--muted); }
.stat b { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .hero { padding: 28px 20px 24px; background-size: 460px auto; background-position: right -180px top -40px; } }
/* Portada con foto del lugar (fichas estáticas) y crédito de la foto, que la licencia obliga a mostrar. */
.hero.con-foto { min-height: 340px; display: flex; flex-direction: column; justify-content: flex-end; border: 0; background: var(--ink); color: #fff; }
.hero.con-foto::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(14, 22, 17, .82) 0%, rgba(14, 22, 17, .35) 50%, rgba(14, 22, 17, 0) 75%); }
.hero.con-foto p, .hero.con-foto .kick { color: rgba(255, 255, 255, .88); }
.hero.con-foto .stat { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(4px); }
.hero-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.credito { position: absolute; z-index: 1; font-size: 10.5px; color: rgba(255, 255, 255, .9); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(20, 26, 22, .45); padding: 2px 6px; border-radius: 4px; }
.credito:hover { color: #fff; text-decoration: underline; }
.hero .credito { top: 12px; right: 16px; max-width: 60%; }

/* ---------- botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 8px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #275b43; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #2b1a05; }
.btn.block { width: 100%; }
.campo { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.campo input, .campo select, .campo textarea { width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; background: var(--surface); font-weight: 400; color: var(--ink); font-size: 15px; }
.campo textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.campo small { font-weight: 400; color: var(--faint); }
.casilla { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.casilla input { margin-top: 3px; }

/* ---------- anuncios: solo se ven con AdSense configurado (o con ?demo) ---------- */
.anuncio { display: grid; gap: 4px; margin: 26px 0 0; min-height: 0; }
.anuncio::before { content: "Publicidad"; font-size: 11.5px; color: var(--faint); }
.anuncio:empty, .anuncio:not(.on) { display: none; }
.pagina .anuncio { margin: 16px 0; }
.anuncio .demo { display: grid; place-items: center; min-height: 110px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--faint); font-size: 13px; background: var(--surface); }

/* ---------- ofertas de afiliados ---------- */
.ofertas { display: grid; gap: 8px; }
.oferta { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; min-width: 0; }
.oferta:hover { border-color: var(--line-2); background: #fff; }
.oferta-ico { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.oferta-txt { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.oferta-txt small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.oferta > .ico { color: var(--faint); width: 15px; height: 15px; }
.afil-nota { margin: 2px 0 0; font-size: 11.5px; color: var(--faint); }

/* ---------- plazas libres (lo pinta js/comun.js con datos/plazas.js) ---------- */
.plazas { display: grid; gap: 6px; }
.plazas-txt { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.plazas-txt b { font-weight: 600; }
.punto { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.punto.si { background: var(--ok-ink); } .punto.no { background: var(--st-no); }
.plazas-dias { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.plazas-dias i { height: 8px; border-radius: 2px; background: var(--surface-2); }
.plazas-dias i.si { background: color-mix(in srgb, var(--ok-ink) 70%, white); }
.plazas-dias i.no { background: color-mix(in srgb, var(--st-no) 55%, white); }
.plazas.completo .plazas-dias { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.plazas.completo .plazas-dias i { height: 30px; border-radius: 5px; font: 600 12px/30px var(--font); font-style: normal; text-align: center; color: var(--ink); }
.plazas-meta { margin: 0; font-size: 12px; color: var(--faint); }
.plazas-meta.aviso { color: var(--warn-ink); }
.plazas-ley { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); align-items: center; }
.plazas-ley i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -6px; background: var(--surface-2); }
.plazas-ley i.si { background: color-mix(in srgb, var(--ok-ink) 70%, white); } .plazas-ley i.no { background: color-mix(in srgb, var(--st-no) 55%, white); }
.plazas-viejo { margin: 0; font-size: 13px; color: var(--muted); }
.plazas-aviso { position: relative; z-index: 1; justify-self: start; font-size: 13px; font-weight: 600; color: var(--brand-text); }

/* ---------- lista de espera de avisos ---------- */
.espera { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px 18px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); margin-top: 18px; }
.espera-ico { width: 40px; height: 40px; border-radius: 8px; background: var(--accent); color: #2b1a05; display: grid; place-items: center; }
.espera h2, .espera h3 { margin: 0; font-size: 18px; }
.espera p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.espera form { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.espera input[type="email"] { flex: 1 1 200px; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; background: var(--surface); min-width: 0; }
.espera .legal { flex-basis: 100%; display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--muted); }
.espera .legal a { color: inherit; }
/* .ancha: en una fila cuando hay sitio (portada); en la columna lateral se queda apilada. */
@media (min-width: 860px) { .espera.ancha { grid-template-columns: auto minmax(0, 1fr) minmax(0, 420px); } .espera.ancha form { grid-column: auto; } }
.aside-sticky .espera { margin-top: 0; }

/* ---------- buzón de sugerencias ---------- */
.buzon { display: grid; gap: 14px; max-width: 640px; }
.buzon .fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .buzon .fila { grid-template-columns: 1fr; } }
.buzon-ok { padding: 14px 16px; border-radius: 8px; background: var(--ok-soft); color: var(--ok-ink); font-weight: 600; }
.error-dato { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.error-dato:hover { color: var(--ink); text-decoration: underline; }
.error-dato .ico { width: 15px; height: 15px; }

/* ---------- pie ---------- */
footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: 14px; background: var(--surface-2); }
.foot { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 860px) { .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }
.foot-brand p { margin: 10px 0 0; max-width: 40ch; }
.foot h2 { margin: 0 0 10px; font-size: 16px; color: var(--ink); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot a, .foot button.lnk { color: var(--muted); text-decoration: none; }
.foot a:hover, .foot button.lnk:hover { color: var(--ink); text-decoration: underline; }
button.lnk { border: 0; background: none; padding: 0; cursor: pointer; font-size: inherit; text-align: left; }
.foot-legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--faint); display: grid; gap: 6px; }
.foot-legal p { margin: 0; max-width: 90ch; }

/* ---------- páginas estáticas (fichas de lugar, comunidades, parques, legal) ---------- */
.migas { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 18px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.migas li + li::before { content: "/"; margin-right: 6px; color: var(--faint); }
.migas a { color: var(--muted); text-decoration: none; }
.migas a:hover { color: var(--ink); text-decoration: underline; }
.pagina { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; margin-top: 22px; }
@media (max-width: 960px) { .pagina { grid-template-columns: minmax(0, 1fr); } }
.bloque { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; min-width: 0; }
.bloque + .bloque { margin-top: 16px; }
.bloque h2 { margin: 0 0 12px; font-size: 22px; }
.bloque p { margin: 0 0 10px; }
.bloque p:last-child { margin-bottom: 0; }
.datos { display: grid; gap: 0; margin: 0; }
.datos > div { display: grid; grid-template-columns: 30px 130px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); align-items: start; }
.datos > div:first-child { border-top: 0; padding-top: 0; }
.datos dt { font-weight: 600; font-size: 14px; }
.datos dd { margin: 0; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }
.datos .ico { color: var(--brand-text); margin-top: 2px; }
@media (max-width: 520px) { .datos > div { grid-template-columns: 26px minmax(0, 1fr); } .datos dd { grid-column: 2; } }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { border-top: 0; padding-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 600; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.fuentes-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.fuentes-l a { display: flex; gap: 8px; align-items: flex-start; text-decoration: none; font-size: 14px; color: var(--brand-text); font-weight: 600; }
.fuentes-l a:hover { text-decoration: underline; }
.fuentes-l a .ico { width: 15px; height: 15px; margin-top: 3px; }
.fuentes-l li > span { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); font-weight: 600; }
.fuentes-l li > span .ico { width: 15px; height: 15px; margin-top: 3px; }
.aside-sticky { position: sticky; top: 80px; display: grid; gap: 16px; }
@media (max-width: 960px) { .aside-sticky { position: static; } }
.rel { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.rel a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.rel li:first-child a { border-top: 0; padding-top: 0; }
.rel a:hover { color: var(--brand-text); }
.rel a small { color: var(--muted); font-weight: 400; text-align: right; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.rejilla a { display: grid; gap: 6px; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.rejilla a:hover { border-color: var(--line-2); }
.rejilla a b { font: 600 18px/1.2 var(--serif); }
.rejilla a span { display: flex; flex-wrap: wrap; gap: 6px; }
.seccion-h { margin: 32px 0 12px; font-size: 24px; }
.nota, .bloque .nota { font-size: 13px; color: var(--faint); margin: 14px 0 0; }
.texto-legal h2 { font-size: 21px; margin: 26px 0 8px; }
.texto-legal h2:first-child { margin-top: 0; }
.texto-legal p, .texto-legal li { color: var(--muted); }
.pendiente { background: var(--warn-soft); color: var(--warn-ink); border-radius: 4px; padding: 0 4px; font-weight: 600; }

/* estados de las normas (también en index.html) */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.no { background: var(--st-no-soft); color: var(--st-no-ink); }
.st.lim { background: var(--st-lim-soft); color: var(--st-lim-ink); }
.st.perm { background: var(--st-perm-soft); color: var(--st-perm-ink); }
.st.gris, .st.ver { background: var(--st-gris-soft); color: var(--st-gris-ink); }
.st.ver i { background: transparent; border: 1.5px dashed currentColor; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
