/* ==========================================================================
   layout.css — Header, navegación, rejillas, secciones y footer
   ========================================================================== */

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}

.site-header.is-stuck {
  background: var(--c-black);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12);
}

/* Barra de progreso de lectura en el borde inferior del header */
.site-header__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--c-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .1s linear;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

/* ---------- Marca ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* El logotipo se muestra en blanco puro sobre los fondos oscuros del
   header y del pie. El filtro convierte cualquier PNG a blanco sólido,
   así no hace falta una versión aparte del archivo. */
.brand__logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: transform .35s var(--ease);
}

.brand:hover .brand__logo { transform: rotate(-6deg) scale(1.06); }

.brand__text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--c-white);
  line-height: 1;
}
.brand__text em { font-style: normal; color: var(--c-yellow); }

/* ---------- Navegación ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.nav__link {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-paper-85);
  padding: var(--sp-2) 0;
  transition: color .2s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--c-yellow);
  transition: width .25s var(--ease);
}

.nav__link:hover,
.nav__link.is-active { color: var(--c-white); }
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }

/* ---------- Botón hamburguesa ---------- */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ---------- Secciones ---------- */
.section { padding-block: var(--sp-9); }

.section--dark {
  background: var(--c-black);
  color: var(--c-white);
}
.section--dark .section__lead { color: var(--c-paper-70); }

.section--yellow {
  background: var(--c-yellow);
  color: var(--c-black);
}
.section--yellow .section__lead { color: var(--c-ink-70); }

.section__head {
  max-width: 780px;
  margin: 0 auto var(--sp-8);
  text-align: center;
}

.section__head--sub { margin-block: var(--sp-8) var(--sp-5); }

.section__title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--sp-4);
}

/* Franja de separación fina entre bloques claros consecutivos */
.section + .section:not(.section--dark):not(.section--yellow) {
  border-top: 1px solid var(--c-ink-12);
}

.section__subtitle { font-size: var(--fs-xl); }

.section__lead {
  color: var(--c-text-soft);
  font-size: var(--fs-lg);
  line-height: 1.65;
  font-weight: 400;
}

.section__foot {
  margin-top: var(--sp-7);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}

/* Párrafo extra de contexto (bueno para SEO, discreto en pantalla) */
.section__seo {
  max-width: 820px;
  margin: var(--sp-7) auto 0;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--c-ink-55);
}
.section--dark .section__seo { color: var(--c-paper-70); }
.section--yellow .section__seo { color: var(--c-ink-70); }

/* ---------- Rejillas ---------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-black);
  color: var(--c-paper-70);
  padding-top: var(--sp-8);
  border-top: 4px solid var(--c-yellow);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: var(--sp-6);
  padding-bottom: var(--sp-7);
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.site-footer__brand .brand__logo {
  width: 96px;
  height: 96px;
}

.site-footer__claim {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--c-white);
  line-height: 1.15;
  max-width: 14ch;
}

.site-footer__nav h3,
.site-footer__nav h4 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--c-yellow);
  margin-bottom: var(--sp-4);
}

.site-footer__nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.site-footer__nav a,
.site-footer__nav li {
  font-size: var(--fs-sm);
  transition: color .2s var(--ease);
}
.site-footer__nav a:hover { color: var(--c-yellow); }

.site-footer__bottom {
  border-top: 1px solid var(--c-border-invert);
  padding-block: var(--sp-4);
  font-size: var(--fs-xs);
  text-align: center;
  color: var(--c-paper-70);
}

.site-footer__bottom a { text-decoration: underline; }

.site-footer__credit { margin-top: var(--sp-2); opacity: .75; }
