/* =============================================================================
   CASITA DEL BOSQUE — web pública.

   CRITERIOS (están aquí porque son fáciles de deshacer sin querer):

   · LA INTERFAZ NO TIENE COLOR. Hueso sobre verde casi negro y nada más. El
     único color de la página lo ponen las fotografías: la terracota de la
     fachada, el azul de la piscina, el verde del monte. Un color de acento
     —dorado, ámbar, el que sea— compite con las fotos y hace que la página
     parezca decorada en vez de compuesta.
   · La jerarquía se hace con TAMAÑO, PESO e INTERLETRAJE, no pintando de otro
     color. Es lo que separa una maqueta editorial de una plantilla.
   · Nada de rejillas de tarjetas con iconito. Los datos van en una hoja
     tipográfica: filas y filetes.
   · Composición asimétrica: las fotos salen a sangre por el borde de la
     pantalla, el texto va en columna estrecha y descentrada.
   · Solo se anima la foto al entrar, con una cortinilla.

   Va siempre en oscuro: es dirección de arte, no preferencia del sistema.
   ========================================================================== */

/* --- Tipografía propia, servida desde aquí ---------------------------------
   Fraunces (SIL Open Font License 1.1, ver assets/fonts/Fraunces-OFL.txt).
   Variable: un fichero cubre todos los grosores. Los ejes SOFT y WONK son los
   que le dan el trazo irregular que la distingue de una serif cualquiera. */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-latin-ext.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2C60-2C7F;
}

:root {
  color-scheme: dark;

  /* Verde casi negro, frío. Nada de negros calientes tirando a marrón. */
  --fondo:    #0A0E0A;
  --fondo-2:  #0E130D;
  --fondo-3:  #141A13;
  /* Hueso neutro, no crema amarillenta. */
  --hueso:    #E9E7DE;
  --hueso-2:  #ABAB9F;
  --hueso-3:  #828275;
  --filete:   rgba(233,231,222,.13);
  --filete-2: rgba(233,231,222,.28);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: 'Fraunces', 'Iowan Old Style', Palatino, Georgia, serif;

  --ease: cubic-bezier(.22,.9,.24,1);
  --ancho: 1220px;
  --margen: clamp(20px, 5vw, 64px);
  --barra-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem; line-height: 1.72;
  color: var(--hueso-2); background: var(--fondo);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--hueso); color: var(--fondo); }
:focus-visible { outline: 2px solid var(--hueso); outline-offset: 3px; }

/* --- Escala tipográfica ------------------------------------------------------ */
.display {
  font-family: var(--display); font-weight: 400; line-height: .98;
  letter-spacing: -.022em; color: var(--hueso);
  font-variation-settings: 'opsz' 120, 'SOFT' 24, 'WONK' 1;
  text-wrap: balance;
}
h1.display { font-size: clamp(2.9rem, 9.5vw, 6.4rem); }
h2.display { font-size: clamp(2.1rem, 5.6vw, 3.9rem); line-height: 1.02; }

.meta { font-size: .715rem; font-weight: 620; letter-spacing: .2em;
  text-transform: uppercase; color: var(--hueso-3); }
/* El rótulo que "manda" no cambia de color: sube de peso y de claridad. */
.meta--fuerte { color: var(--hueso); font-weight: 700; }

.texto { max-width: 58ch; }
.texto p + p { margin-top: 1.05em; }
.texto--grande { font-size: clamp(1.1rem, 1.9vw, 1.32rem); line-height: 1.62; }

/* --- Contenedores -------------------------------------------------------------- */
.eje { width: 100%; max-width: var(--ancho); margin-inline: auto;
  padding-inline: max(var(--margen), env(safe-area-inset-left)); }
.tramo { padding-block: clamp(72px, 12vw, 148px); }

/* Rótulo de sección: una línea fina y nada más. */
.epigrafe { display: flex; align-items: center; gap: 18px; margin-bottom: clamp(26px, 4vw, 42px); }
.epigrafe::after { content: ""; flex: 1; height: 1px; background: var(--filete); }

/* --- Enlaces y botones ---------------------------------------------------------- */
.accion {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 1px;
  background: var(--hueso); color: var(--fondo);
  font-size: .8rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--hueso);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.accion:hover { background: transparent; color: var(--hueso); }
.accion--linea { background: transparent; color: var(--hueso); border-color: var(--filete-2); }
.accion--linea:hover { background: var(--hueso); color: var(--fondo); border-color: var(--hueso); }
.acciones { display: flex; gap: 12px; flex-wrap: wrap; }

.subrayado {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  color: var(--hueso); font-size: .8rem; font-weight: 620;
  letter-spacing: .15em; text-transform: uppercase;
  padding: 12px 0 6px; border-bottom: 1px solid var(--filete-2);
  transition: border-color .25s var(--ease);
}
.subrayado:hover { border-color: var(--hueso); }
.subrayado svg { width: 15px; height: 15px; stroke-width: 2; }

/* --- Cabecera -------------------------------------------------------------------
   Un filete y dos cosas: la marca y el teléfono. Sin menú central, sin pastilla
   de color en la esquina. El índice de secciones vive en la portada, que es
   donde alguien decide a dónde va. */
.barra {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; gap: 20px; min-height: var(--barra-h);
  padding: 0 max(var(--margen), env(safe-area-inset-right)) 0 max(var(--margen), env(safe-area-inset-left));
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.barra.fija {
  background: rgba(10,14,10,.86);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom-color: var(--filete);
}
.barra__marca { display: flex; align-items: center; padding-block: 10px; }
.barra__marca img { height: 40px; width: auto; transition: height .4s var(--ease); }
.barra.fija .barra__marca img { height: 30px; }

.barra__dcha { margin-left: auto; display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }

/* Cambio de idioma: dos letras, sin banderitas ni desplegable. Una bandera no
   es un idioma y un desplegable para dos opciones es una opción de más. */
.idioma {
  display: inline-flex; align-items: center; text-decoration: none;
  color: var(--hueso-3); font-size: .74rem; font-weight: 660;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 14px 0 8px; border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.idioma:hover { color: var(--hueso); border-bottom-color: var(--filete-2); }

/* El teléfono: texto con filete, no botón. Un botón relleno en la esquina
   superior derecha es el gesto más previsible que hay. */
.barra__tel {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--hueso);
  font-size: .74rem; font-weight: 660; letter-spacing: .16em; text-transform: uppercase;
  padding: 14px 0 8px; border-bottom: 1px solid var(--filete-2);
  transition: border-color .25s var(--ease);
}
.barra__tel:hover { border-color: var(--hueso); }
.barra__tel svg { width: 14px; height: 14px; stroke-width: 1.9; }
.barra__tel b { font-weight: 660; font-variant-numeric: tabular-nums; letter-spacing: .1em; }

@media (max-width: 720px) {
  :root { --barra-h: 60px; }
  .barra__marca img { height: 32px; }
  .barra.fija .barra__marca img { height: 28px; }
  /* En el móvil el número no se lee, se toca. */
  .barra__tel { border: 0; padding: 12px 0; min-width: 44px; justify-content: flex-end; }
  .barra__tel b { display: none; }
  .barra__tel svg { width: 20px; height: 20px; }
}

/* --- Portada ---------------------------------------------------------------------- */
.portada { position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  overflow: hidden; padding-bottom: clamp(40px, 6vw, 64px); }
.portada__lienzo { position: absolute; inset: 0; }
.portada__lienzo img {
  width: 100%; height: 100%; object-fit: cover;
  /* Menos apagada que antes: si el color de la página lo ponen las fotos,
     hay que dejarlas vivir. El velo de abajo se encarga de que el texto lea. */
  filter: saturate(.92) brightness(.62) contrast(1.02);
  transform: scale(1.08); animation: respirar 26s var(--ease) forwards;
}
.portada__lienzo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,14,10,.97) 0%, rgba(10,14,10,.72) 26%,
              rgba(10,14,10,.22) 60%, rgba(10,14,10,.62) 100%);
}
.portada__texto { position: relative; width: 100%; }
.portada h1 { margin: 16px 0 0; max-width: 15ch; }
.portada__lemas { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 24px; }

/* Índice de secciones: sustituye al menú de la cabecera. */
.indice { display: flex; gap: 0 30px; flex-wrap: wrap; margin-top: 34px;
  padding-top: 20px; border-top: 1px solid var(--filete); }
.indice a { display: flex; align-items: baseline; gap: 8px; text-decoration: none;
  padding: 10px 0; color: var(--hueso-2); transition: color .22s var(--ease); }
.indice a:hover { color: var(--hueso); }
.indice em { font-style: normal; font-family: var(--display); font-size: .72rem;
  font-variation-settings: 'opsz' 14; color: var(--hueso-3); }
.indice span { font-size: .78rem; font-weight: 620; letter-spacing: .13em; text-transform: uppercase; }

/* --- Hoja de datos (sustituye a la rejilla de tarjetas) ---------------------------- */
.hoja { margin: 0; border-top: 1px solid var(--filete); }
.hoja__fila { display: grid; gap: 4px 40px; padding: 22px 0; border-bottom: 1px solid var(--filete); }
@media (min-width: 720px) { .hoja__fila { grid-template-columns: 190px 1fr; gap: 0 40px; align-items: baseline; } }
/* La etiqueta destaca por claridad y espaciado, no por ser de otro color. */
.hoja dt { color: var(--hueso); font-size: .715rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; padding-top: .35em; }
.hoja dd { margin: 0; color: var(--hueso-2); }
.hoja dd b { color: var(--hueso); font-weight: 600; }

/* --- Preguntas frecuentes ----------------------------------------------------------
   <details> nativo: se abre y cierra sin una línea de JavaScript, funciona con
   teclado y con lector de pantalla, y el buscador lee el texto aunque esté
   plegado. */
.preguntas { border-top: 1px solid var(--filete); }
.pregunta { border-bottom: 1px solid var(--filete); }
.pregunta summary {
  display: flex; align-items: flex-start; gap: 20px; justify-content: space-between;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-family: var(--display); font-size: clamp(1.02rem, 1.7vw, 1.16rem);
  font-variation-settings: 'opsz' 20, 'SOFT' 18, 'WONK' 0;
  font-weight: 500; color: var(--hueso); line-height: 1.35;
  transition: color .2s var(--ease);
}
.pregunta summary::-webkit-details-marker { display: none; }
.pregunta summary:hover { color: var(--hueso); }
/* Cruz que gira a menos: dos filetes, sin icono. */
.pregunta summary i { position: relative; flex: none; width: 13px; height: 13px; margin-top: 7px; }
.pregunta summary i::before, .pregunta summary i::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; height: 1px;
  background: var(--hueso-3); transition: transform .3s var(--ease), background .2s var(--ease);
}
.pregunta summary i::after { transform: rotate(90deg); }
.pregunta[open] summary i::after { transform: rotate(0deg); }
.pregunta[open] summary i::before, .pregunta[open] summary i::after { background: var(--hueso); }
.pregunta__r { padding: 0 40px 22px 0; max-width: 62ch; }
.pregunta__r p { color: var(--hueso-2); }

/* --- Bloque partido: la foto sale a sangre por el borde ---------------------------- */
.partido { display: grid; align-items: center; gap: clamp(30px, 5vw, 0px); }
.partido__media { position: relative; overflow: hidden; }
.partido__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.partido__texto { padding-inline: var(--margen); }
@media (min-width: 900px) {
  .partido { grid-template-columns: 1fr 1fr; gap: 0; }
  .partido__media img { aspect-ratio: 3 / 3.4; }
  .partido__texto { padding-inline: clamp(38px, 6vw, 92px); max-width: 640px; }
  .partido--dcha .partido__media { order: 2; }
}

/* --- Galería editorial -------------------------------------------------------------- */
.piezas { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(10px, 1.3vw, 18px); }
.pieza { grid-column: span 6; margin: 0; }
.pieza__marco { display: block; width: 100%; overflow: hidden; background: var(--fondo-3);
  border: 0; padding: 0; cursor: zoom-in; }
.pieza img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3;
  transition: transform .8s var(--ease); }
.pieza__marco:hover img { transform: scale(1.045); }
.pieza figcaption { display: flex; gap: 10px; align-items: baseline; padding-top: 11px; }
/* La numeración de las fotos es convención de reportaje, no adorno. */
.pieza figcaption i { font-style: normal; font-family: var(--display); font-size: .76rem;
  font-variation-settings: 'opsz' 14; color: var(--hueso-3); }
.pieza figcaption span { font-size: .76rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--hueso-3); font-weight: 600; }

@media (min-width: 860px) {
  /* Anchos y proporciones distintos a propósito: una rejilla de piezas iguales
     es exactamente lo que delata una plantilla. */
  .pieza:nth-child(1) { grid-column: span 4; } .pieza:nth-child(1) img { aspect-ratio: 16 / 10; }
  .pieza:nth-child(2) { grid-column: span 2; } .pieza:nth-child(2) img { aspect-ratio: 3 / 4; }
  .pieza:nth-child(3) { grid-column: span 3; }
  .pieza:nth-child(4) { grid-column: span 3; }
  .pieza:nth-child(5) { grid-column: span 2; } .pieza:nth-child(5) img { aspect-ratio: 3 / 4; }
  .pieza:nth-child(6) { grid-column: span 4; } .pieza:nth-child(6) img { aspect-ratio: 16 / 10; }
  .pieza:nth-child(7) { grid-column: span 3; }
  .pieza:nth-child(8) { grid-column: span 3; }
  .pieza:nth-child(9) { grid-column: span 6; } .pieza:nth-child(9) img { aspect-ratio: 24 / 9; }
}

/* --- Reservar ------------------------------------------------------------------------ */
.telefono {
  display: inline-block; text-decoration: none; margin-top: 6px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.9rem, 7.5vw, 4.6rem); line-height: 1.1;
  letter-spacing: -.02em; color: var(--hueso);
  font-variation-settings: 'opsz' 120, 'SOFT' 20, 'WONK' 0;
  font-variant-numeric: lining-nums tabular-nums;
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.telefono:hover { border-bottom-color: var(--filete-2); }
.notas { display: flex; gap: 12px 34px; flex-wrap: wrap; margin-top: 26px;
  padding-top: 22px; border-top: 1px solid var(--filete); }
.nota { font-size: .86rem; color: var(--hueso-2); }

/* --- Mapa ------------------------------------------------------------------------------ */
.mapa { display: block; overflow: hidden; border: 1px solid var(--filete); }
.mapa img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  filter: saturate(.5) brightness(.86); transition: filter .5s var(--ease); }
.mapa:hover img { filter: saturate(.8) brightness(1); }
@media (min-width: 760px) { .mapa img { aspect-ratio: 16 / 10; } }
.direccion { font-style: normal; font-size: 1.06rem; line-height: 1.75; color: var(--hueso-2); }
.direccion b { display: block; font-family: var(--display); font-size: 1.5rem; color: var(--hueso);
  font-weight: 500; font-variation-settings: 'opsz' 28, 'SOFT' 20; margin-bottom: 6px; letter-spacing: -.01em; }

/* --- Pie --------------------------------------------------------------------------------- */
.pie { border-top: 1px solid var(--filete); padding-block: clamp(44px, 6vw, 70px)
       calc(clamp(30px, 4vw, 46px) + env(safe-area-inset-bottom)); }
.pie__fila { display: flex; gap: 30px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pie__marca img { height: 44px; width: auto; opacity: .8; }
.pie__lemas { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.pie__legal { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--filete);
  display: flex; gap: 4px 26px; flex-wrap: wrap; justify-content: space-between;
  font-size: .82rem; color: var(--hueso-3); }
.pie__legal a { color: var(--hueso-2); text-decoration: none; display: inline-block; padding: 10px 0; }
.pie__legal a:hover { color: var(--hueso); }

/* --- Visor de fotos ------------------------------------------------------------------------ */
.visor { position: fixed; inset: 0; z-index: 110; display: none; place-items: center;
  background: rgba(7,10,7,.97); padding: clamp(16px, 4vw, 48px); }
.visor.abierto { display: grid; }
.visor figure { margin: 0; text-align: center; max-width: 100%; }
.visor img { max-width: 100%; max-height: 80svh; margin-inline: auto; animation: entrar .45s var(--ease); }
.visor figcaption { margin-top: 16px; display: flex; gap: 10px; justify-content: center; align-items: baseline; }
.visor figcaption i { font-style: normal; font-family: var(--display); font-size: .78rem; color: var(--hueso-3); }
.visor figcaption span { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--hueso-2); }
.visor button {
  position: absolute; width: 50px; height: 50px; border: 1px solid var(--filete-2);
  background: transparent; color: var(--hueso); cursor: pointer; display: grid; place-items: center;
  border-radius: 999px; transition: background .2s var(--ease); }
.visor button:hover { background: rgba(233,231,222,.12); }
.visor button svg { width: 22px; height: 22px; stroke-width: 1.7; }
.visor__x { top: max(18px, env(safe-area-inset-top)); right: clamp(16px, 4vw, 48px); }
.visor__ant { left: clamp(12px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.visor__sig { right: clamp(12px, 3vw, 40px); top: 50%; transform: translateY(-50%); }

/* --- Movimiento ------------------------------------------------------------------------------ */
@keyframes respirar { from { transform: scale(1.12) } to { transform: scale(1.01) } }
@keyframes entrar   { from { opacity: 0; transform: scale(.985) } to { opacity: 1; transform: none } }

/* Solo las FOTOS se revelan, y con cortinilla. Desvanecer cada párrafo al
   aparecer es el tic más reconocible que hay. */
.cortina { clip-path: inset(0 0 100% 0); transition: clip-path 1.05s var(--ease); }
.cortina.dentro { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .cortina { clip-path: none; }
  .portada__lienzo img { animation: none; transform: scale(1.01); }
}
