/* El Almario — shared styles for every page. */

@font-face {
  font-family: "Figtree";
  src: url("../fuentes/figtree-regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fuentes/figtree-seminegrita.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fuentes/figtree-negra.woff") format("woff");
  font-weight: 900;
  font-display: swap;
}

:root {
  --azul: #002564;
  --noche: #000f2b;
  --oro: #f6c610;
  --oro-suave: rgba(246, 198, 16, 0.16);
  --blanco: #ffffff;
  --texto: rgba(255, 255, 255, 0.92);
  --texto-suave: rgba(255, 255, 255, 0.72);
  --cristal: rgba(0, 22, 64, 0.55);
  --cristal-hover: rgba(0, 37, 100, 0.8);
  --borde: rgba(255, 255, 255, 0.18);
  --radio: 14px;
  --ancho: 1080px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 1.0625rem/1.65 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--texto);
  background-color: var(--noche);
}

/* Sky behind everything, darkened so text always reads. A fixed layer instead of
   background-attachment: fixed, which iOS ignores. JPEG first for browsers without
   image-set(type()); the WebP line wins where it works. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--noche);
  background-image:
    linear-gradient(180deg, rgba(0, 15, 43, 0.25) 0%, rgba(0, 15, 43, 0.6) 100%),
    url("../img/cielo-2400.jpg");
  background-image:
    linear-gradient(180deg, rgba(0, 15, 43, 0.25) 0%, rgba(0, 15, 43, 0.6) 100%),
    image-set(url("../img/cielo-2400.webp") type("image/webp"), url("../img/cielo-2400.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: center;
}
@media (max-aspect-ratio: 1/1) {
  body::before {
    background-image:
      linear-gradient(180deg, rgba(0, 15, 43, 0.2) 0%, rgba(0, 15, 43, 0.6) 100%),
      url("../img/cielo-vertical.jpg");
    background-image:
      linear-gradient(180deg, rgba(0, 15, 43, 0.2) 0%, rgba(0, 15, 43, 0.6) 100%),
      image-set(url("../img/cielo-vertical.webp") type("image/webp"), url("../img/cielo-vertical.jpg") type("image/jpeg"));
  }
}

a { color: var(--oro); text-underline-offset: 3px; }
a:hover { color: var(--blanco); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; color: var(--blanco); margin: 0 0 0.6em; }
p { margin: 0 0 1em; }

.oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.saltar {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--oro); color: var(--azul); padding: 8px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.saltar:focus { top: 12px; }

/* Logo with the warm halo of the YouTube banner. */
.logo {
  display: block;
  height: auto;
  filter: drop-shadow(0 0 28px rgba(246, 198, 16, 0.35));
}

/* ---------- Buttons ---------- */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 52px;
  padding: 0.7em 1.4em;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--cristal);
  color: var(--blanco);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  line-height: 1.2;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.boton:hover { background: var(--cristal-hover); border-color: rgba(255, 255, 255, 0.4); color: var(--blanco); transform: translateY(-1px); }
.boton svg { width: 1.35em; height: 1.35em; flex: none; fill: currentColor; }
.boton svg.trazo, .redes svg.trazo { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.boton--oro { background: var(--oro); border-color: var(--oro); color: var(--azul); }
.boton--oro:hover { background: #ffd83d; border-color: #ffd83d; color: var(--azul); }

/* ---------- Links page ---------- */

.enlaces {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 16px 32px;
  text-align: center;
}
.enlaces .logo { width: 170px; margin: 0 auto 14px; }
.enlaces h1 a { display: block; width: max-content; margin: 0 auto; border-radius: 12px; }
.enlaces .usuario { color: var(--oro); font-weight: 600; margin-bottom: 0.6em; }
.enlaces .lema { color: var(--texto-suave); margin: 0 auto 28px; max-width: 30ch; }
.enlaces ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.enlaces .boton { width: 100%; min-height: 58px; position: relative; padding-left: 3em; padding-right: 3em; }
.enlaces .boton svg { position: absolute; left: 1.1em; top: 50%; transform: translateY(-50%); }
.enlaces .boton small { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.8; margin-top: 2px; }
.enlaces footer { margin-top: 36px; color: var(--texto-suave); font-size: 0.95rem; }
.enlaces footer a { color: var(--texto-suave); }

/* ---------- Home page ---------- */

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 16px; }

.cabecera { padding: 18px 0; }
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cabecera .marca { display: flex; align-items: center; gap: 10px; color: var(--blanco); text-decoration: none; font-weight: 600; letter-spacing: 0.04em; }
.cabecera .marca img { width: 38px; height: auto; }
.cabecera nav { display: flex; align-items: center; gap: 18px; }
.cabecera nav a:not(.boton) { color: var(--texto); text-decoration: none; }
.cabecera nav a:not(.boton):hover { color: var(--oro); }
.cabecera .boton { min-height: 42px; padding: 0.45em 1em; font-size: 0.95rem; }
@media (max-width: 560px) { .cabecera nav .solo-ancho { display: none; } }

.portada {
  min-height: 78vh;
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px 72px;
}
.portada .logo { width: min(260px, 62vw); margin: 0 auto 28px; }
.portada .lema { font-size: clamp(1.6rem, 4.6vw, 2.6rem); font-weight: 600; color: var(--blanco); line-height: 1.2; margin-bottom: 0.4em; }
.portada .lema span { display: block; color: var(--oro); }
.portada .acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }

.seccion { padding: 72px 0; }
.seccion h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
.seccion .entrada { font-size: 1.25rem; color: var(--blanco); font-weight: 900; }
.seccion strong { font-weight: 900; color: var(--blanco); }
.texto > * { max-width: 680px; }
.texto p { color: var(--texto); }
.texto em { color: var(--oro); font-style: normal; }

.etiqueta {
  display: inline-block;
  color: var(--oro);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; margin-top: 32px; }
.tarjeta {
  background: var(--cristal);
  border: 1px solid var(--borde);
  border-top: 3px solid var(--oro);
  border-radius: var(--radio);
  padding: 26px 24px 20px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tarjeta h3 { font-size: 1.4rem; color: var(--oro); }
.tarjeta p:last-child { margin-bottom: 0; }

.nota { margin-top: 28px; color: var(--texto-suave); }
#que-es h2, #cada-episodio h2 { color: var(--oro); }
.texto > .destacado { max-width: none; }
.texto p.destacado, .destacado { margin-top: 40px; text-align: center; color: var(--oro); font-weight: 600; font-size: clamp(1.2rem, 3vw, 1.5rem); }

.contacto { text-align: center; }
.contacto .correo { font-size: clamp(1.3rem, 4.5vw, 2rem); font-weight: 600; overflow-wrap: anywhere; }
.redes { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.redes a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--borde); background: var(--cristal); color: var(--blanco);
  transition: background-color 0.2s, color 0.2s;
}
.redes a:hover { background: var(--oro); color: var(--azul); }
.redes svg { width: 22px; height: 22px; fill: currentColor; }

.pie { padding: 32px 0 40px; border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: 0.95rem; }
.pie .contenedor { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.pie a { color: var(--texto-suave); }
.pie a:hover { color: var(--oro); }
.pie ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Legal pages ---------- */

.documento { max-width: 720px; padding-top: 24px; padding-bottom: 72px; }
.documento h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.documento h2 { font-size: 1.3rem; margin-top: 2em; color: var(--oro); }
.documento dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1em; }
.documento dt { color: var(--texto-suave); }
.documento dd { margin: 0; }
.documento ul { padding-left: 1.2em; }
.documento .fecha { color: var(--texto-suave); }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .aparece { animation: aparece 0.8s ease-out both; }
  .aparece-2 { animation-delay: 0.15s; }
  .aparece-3 { animation-delay: 0.3s; }
  @keyframes aparece { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton, .redes a { transition: none; }
}
