/* ==========================================================================
   layout.css — estructura de página: encabezado, portada, secciones y pie
   ========================================================================== */

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.6);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  min-height: var(--header-h);
}

.brand img {
  width: auto;
  height: 46px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
}

.nav-toggle .icon {
  width: 24px;
  height: 24px;
}

.nav-toggle .icon--close,
.nav-toggle[aria-expanded="true"] .icon--open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon--close {
  display: block;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.25rem;
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.9rem;
}

.nav__list a {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--on-dark);
  text-decoration: none;
  transition: color 0.2s;
}

.nav__list a::after {
  content: "";
  position: absolute;
  inset: auto 0 0.15rem 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav__list a:hover,
.nav__list a[aria-current="true"] {
  color: var(--white);
}

.nav__list a:hover::after,
.nav__list a[aria-current="true"]::after {
  transform: scaleX(1);
}

@media (max-width: 960px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 0.5rem var(--gutter) 1.75rem;
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.6);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }

  .js .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .js .nav__list {
    flex-direction: column;
    gap: 0;
  }

  .js .nav__list a {
    display: block;
    padding: 0.95rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .js .nav__list a::after {
    display: none;
  }

  .js .nav .btn {
    justify-content: center;
  }
}

/* ---------- Portada ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: min(88svh, 820px);
  color: var(--white);
  background: var(--navy);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 45%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(35, 25, 48, 0.94) 0%, rgba(35, 25, 48, 0.8) 38%, rgba(35, 25, 48, 0.3) 72%, rgba(35, 25, 48, 0.12) 100%),
    linear-gradient(0deg, rgba(35, 25, 48, 0.75) 0%, rgba(35, 25, 48, 0) 38%);
}

.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2rem, 5vw, 3.5rem);
}

.hero h1 {
  max-width: 14ch;
  font-size: var(--fs-h1);
  font-weight: 800;
  margin-block: 1rem 1.4rem;
}

.hero h1 .text-gold {
  display: block;
}

.hero__lead {
  max-width: 34rem;
  font-size: var(--fs-lead);
  color: var(--on-dark);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.25rem clamp(1rem, 2.4vw, 1.9rem);
  background: rgba(35, 25, 48, 0.62);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--on-dark);
}

.hero-stats strong {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold);
}

@media (max-width: 640px) {
  .hero::before {
    background: linear-gradient(180deg, rgba(35, 25, 48, 0.82) 0%, rgba(35, 25, 48, 0.7) 55%, rgba(35, 25, 48, 0.92) 100%);
  }

  .hero__media {
    object-position: 62% 50%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats li {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
  }

  .hero-stats strong {
    min-width: 5.2rem;
    font-size: 1.6rem;
  }
}

/* ---------- Secciones ---------- */
.section {
  padding-block: var(--section-y);
  background: var(--white);
}

.section--lilac {
  background: var(--lilac);
}

.section--dark {
  color: var(--white);
  background: var(--navy);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .title-rule::after {
  margin-inline: auto;
}

.section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  max-width: none;
}

.section-head--row > div {
  max-width: 42rem;
}

.section-head__aside {
  max-width: 17rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.big-number {
  display: block;
  font-size: clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--gold-text);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
}

.title-rule::after {
  content: "";
  display: block;
  width: 64px;
  height: 5px;
  margin-top: 1.15rem;
  background: var(--gold);
  border-radius: 3px;
}

.eyebrow {
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow--dark {
  color: var(--gold-text);
}

.lead {
  font-size: var(--fs-lead);
  font-weight: 600;
}

.notice {
  padding: 1.25rem 1.5rem;
  background: var(--lilac);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.section--dark .section-head .lead,
.section--dark p {
  color: var(--on-dark);
}

/* Dos columnas (texto + imagen) */
.split {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: 1.05fr 1fr;
  }
}

.split__text > * + * {
  margin-top: 1.15rem;
}

.split__text .title-rule {
  margin-bottom: 1.75rem;
}

.split__text p:not(.lead):not(.eyebrow) {
  color: var(--muted);
}

/* Rejillas */
.grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.75rem);
}

/* Rejillas con columnas explícitas para evitar filas huérfanas (4+2, 3+1). */
.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Pie de página ---------- */
.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem;
  color: var(--on-dark);
  background: var(--navy-800);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}

@media (min-width: 800px) {
  .footer__inner {
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: start;
  }
}

.footer__brand img {
  width: auto;
  height: 56px;
  margin-bottom: 1.1rem;
}

.footer__nav ul {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: start;
  gap: 0.5rem 2.5rem;
}

.site-footer a {
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--gold);
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-style: normal;
}

.footer__legal {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Página 404 ---------- */
.not-found__main {
  display: grid;
  min-height: 100svh;
  place-items: center;
  text-align: center;
}

.not-found__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 34rem;
}

.not-found__box img {
  width: auto;
  height: 72px;
  margin-bottom: 1.5rem;
}

.not-found__box h1 {
  font-size: var(--fs-h2);
  font-weight: 800;
}

.not-found__box .btn {
  margin-top: 1rem;
}
