/* ===================================================================
   AAPRA · Home 2026 (diseño claro, portado del mockup Elementor)
   100% responsive. Solo se carga en la portada (is_front_page).
   Estructura: body.home -> chrome (header/footer claros)
               .aapra-home -> secciones del cuerpo
=================================================================== */
.aapra-home,
.ah-hero {
  --ah-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ah-bordo: #8c1f28;
  --ah-bordo-dark: #6f1820;
  --ah-ink: #232222;
  --ah-bg: #f8f8fa;
  --ah-dark: #232222;
  --ah-pad: clamp(24px, 6vw, 100px);
  font-family: var(--ah-font);
  color: var(--ah-ink);
}

/* ---- Fondo y texto base de la portada ---- */
body.home {
  background: var(--ah-bg) !important;
  color: #232222;
}
body.home #starfield { display: none !important; }
/* Nada en la portada genera scroll horizontal */
body.home { overflow-x: hidden; }
.aapra-home { width: 100%; max-width: 100%; overflow-x: clip; }

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

.aapra-home section { position: relative; }
.aapra-home h1,
.aapra-home h2,
.aapra-home h3,
.aapra-home p,
.aapra-home ul { margin: 0; font-family: var(--ah-font); }
.aapra-home img { display: block; max-width: 100%; height: auto; }
.aapra-home strong { font-weight: 800; }

/* ---- Eyebrow (rótulo de sección) ---- */
.ah-eyebrow {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ah-bordo);
}
.ah-eyebrow--dark { color: var(--ah-ink); }
.ah-eyebrow--center { text-align: center; }

/* ---- Botones ---- */
.ah-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ah-font);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 14px 24px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background .3s, color .3s, border-color .3s, transform .25s;
  white-space: nowrap;
}
.ah-btn span { transition: transform .25s; }
.ah-btn:hover span { transform: translateX(4px); }
.ah-btn--solid {
  background: var(--ah-bordo);
  color: #f8f8fa;
  border-color: var(--ah-bordo);
}
.ah-btn--solid:hover { background: var(--ah-bordo-dark); border-color: var(--ah-bordo-dark); }
.ah-btn--ghost {
  background: transparent;
  color: var(--ah-bordo);
  border-color: var(--ah-bordo);
}
.ah-btn--ghost:hover { background: var(--ah-bordo); color: #fff; }

/* ===================================================================
   1 · HERO
=================================================================== */
/* El hero son bloques nativos (grupo + encabezados + párrafos + columnas):
   editable desde el editor del sitio (texto, tamaños y tipografía). */
.ah-hero {
  position: relative;
  min-height: clamp(560px, 88vh, 800px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  /* el padding-top despeja el header fijo de dos niveles (~135px en desktop) */
  padding: clamp(150px, 16vw, 185px) var(--ah-pad) clamp(60px, 8vw, 90px);
  background:
    url('../img/hero.png')
    center center / cover no-repeat,
    var(--ah-bg);
  overflow: hidden;
}
.ah-hero *,
.ah-hero *::before,
.ah-hero *::after { box-sizing: border-box; }
/* Velo claro para legibilidad del texto oscuro sobre la foto */
.ah-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(248,248,250,0.92) 0%,
    rgba(248,248,250,0.78) 42%,
    rgba(248,248,250,0.30) 72%,
    rgba(248,248,250,0.05) 100%);
  z-index: 0;
}
/* hijos del grupo por encima del velo, alineados a la izquierda y acotados */
.ah-hero > * {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  margin-left: 0;
  margin-block: 0;
}
.ah-hero__eyebrow {
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 300;
  color: var(--ah-ink);
}
.ah-hero__eyebrow strong { font-weight: 700; }
.ah-hero__title {
  margin-top: 10px;
  font-weight: 800;
  font-size: clamp(24px, 6.2vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.5px;
  color: var(--ah-bordo);
  max-width: 18ch;
  /* las palabras NO se cortan: la tipografía escala para evitar desborde */
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.ah-hero__lead {
  margin-top: 18px;
  font-weight: 400;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
  color: rgba(35,34,34,0.70);
  max-width: 60ch;
}

/* Tarjetas = wp:columns / wp:column */
.ah-hero__cards {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 900px;
  gap: clamp(18px, 3vw, 36px);
  align-items: stretch;
}
.ah-card.wp-block-column {
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(35,34,34,0.08);
  border-radius: 8px;
  padding: clamp(20px, 2.4vw, 28px);
}
.ah-card__title {
  font-weight: 800;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  color: var(--ah-ink);
  overflow-wrap: normal;
  hyphens: none;
}
.ah-card__title--bordo { color: var(--ah-bordo); }
.ah-card__text {
  margin-top: 10px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(35,34,34,0.80);
}

/* Botones del hero (wp:button) */
.ah-hero__btns { margin-top: 20px; }
.ah-hero__btns .wp-block-button__link {
  display: inline-block;
  background: var(--ah-bordo);
  color: #f8f8fa;
  border: 1px solid var(--ah-bordo);
  border-radius: 4px;
  padding: 13px 24px;
  font-family: var(--ah-font);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  word-break: normal;
  transition: background .3s, border-color .3s;
}
.ah-hero__btns .wp-block-button__link:hover {
  background: var(--ah-bordo-dark);
  border-color: var(--ah-bordo-dark);
  color: #fff;
}

/* ===================================================================
   2 · STATS
=================================================================== */
.ah-stats {
  display: flex;
  flex-wrap: wrap;
  background: var(--ah-bg);
  border-top: 1px solid rgba(35,34,34,0.07);
  border-bottom: 1px solid rgba(35,34,34,0.07);
}
.ah-stat {
  flex: 1 1 25%;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: clamp(36px, 6vw, 56px) 16px;
  text-align: center;
}
.ah-stat + .ah-stat { border-left: 1px solid rgba(35,34,34,0.08); }
.ah-stat__num {
  font-weight: 900;
  font-size: clamp(28px, 4.5vw, 45px);
  line-height: 1;
  color: var(--ah-bordo);
}
.ah-stat__label {
  font-size: clamp(15px, 1.3vw, 18px);
  color: rgba(36,35,35,0.55);
}

/* ===================================================================
   3 · PILARES (¿Qué hace AAPRA?)
=================================================================== */
.ah-pillars {
  background: var(--ah-bg);
  padding: clamp(60px, 9vw, 100px) var(--ah-pad);
}
.ah-pillars__title {
  font-weight: 800;
  font-size: clamp(26px, 4.2vw, 45px);
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--ah-ink);
  margin: 14px 0 clamp(36px, 5vw, 56px);
  max-width: 18ch;
}
.ah-pillars__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  max-width: 1400px;
}
.ah-pillar__icon {
  display: inline-flex;
  color: var(--ah-bordo);
  margin-bottom: 16px;
}
.ah-pillar__icon svg { width: 40px; height: 40px; }
.ah-pillar h3 {
  font-weight: 600;
  font-size: 19px;
  color: var(--ah-ink);
  margin-bottom: 8px;
}
.ah-pillar p {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(35,34,34,0.70);
  max-width: 34ch;
}

/* ===================================================================
   4 · DIRECTORIO + ÚLTIMAS PUBLICACIONES
=================================================================== */
.ah-dir {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  background: var(--ah-bg);
  padding: clamp(60px, 9vw, 100px) var(--ah-pad);
  align-items: start;
}
.ah-dir__title {
  font-weight: 800;
  font-size: clamp(26px, 4.2vw, 45px);
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--ah-ink);
  margin: 14px 0 18px;
}
.ah-dir__text {
  font-weight: 400;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
  color: rgba(35,34,34,0.70);
  margin-bottom: 28px;
  max-width: 46ch;
}
.ah-dir__posts .ah-eyebrow { margin-bottom: 20px; }

.ah-posts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ah-post {
  display: block;
  background: #fff;
  border: 1px solid rgba(35,34,34,0.08);
  border-left: 3px solid transparent;
  border-radius: 6px;
  padding: 18px 22px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.ah-post:hover {
  border-left-color: var(--ah-bordo);
  transform: translateX(3px);
  box-shadow: 0 8px 24px rgba(35,34,34,0.06);
}
.ah-post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ah-bordo);
  margin-bottom: 8px;
}
.ah-post__meta span { color: rgba(36,35,35,0.45); letter-spacing: .5px; }
.ah-post__title {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ah-ink);
}

/* ===================================================================
   5 · EMPRESAS (sección oscura)
=================================================================== */
.ah-empresas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
  background: var(--ah-dark);
  color: #f8f8fa;
  padding: clamp(60px, 9vw, 100px) var(--ah-pad);
}
.ah-empresas__title {
  font-weight: 800;
  font-size: clamp(26px, 4.2vw, 45px);
  line-height: 1.08;
  letter-spacing: -1px;
  color: #f8f8fa;
  margin: 14px 0 18px;
  max-width: 16ch;
}
.ah-empresas__lead {
  font-weight: 400;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.45;
  color: rgba(248,248,250,0.55);
  margin-bottom: 28px;
  max-width: 46ch;
}
.ah-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}
.ah-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-weight: 300;
  font-size: 19px;
  line-height: 1.4;
  color: #f8f8fa;
  padding: 18px 0;
  border-top: 1px solid rgba(248,248,250,0.18);
}
.ah-checklist li:last-child { border-bottom: 1px solid rgba(248,248,250,0.18); }
.ah-checklist svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--ah-bordo);
}
.ah-empresas__media img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

/* ===================================================================
   6 · BOLETÍN
=================================================================== */
.ah-news {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--ah-bg);
  padding: clamp(60px, 9vw, 100px) var(--ah-pad);
}
.ah-news__title {
  font-weight: 800;
  font-size: clamp(26px, 4.2vw, 45px);
  line-height: 1.08;
  letter-spacing: -1px;
  color: var(--ah-ink);
  margin: 16px 0 14px;
  max-width: 12ch;
}
.ah-news__text {
  font-weight: 400;
  font-size: clamp(17px, 1.5vw, 20px);
  color: rgba(35,34,34,0.70);
  max-width: 42ch;
  margin-bottom: 28px;
}
.ah-news__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 480px;
}
.ah-news__form input,
.ah-news__form textarea {
  width: 100%;
  font-family: var(--ah-font);
  font-size: 16px;
  color: var(--ah-ink);
  background: #fff;
  border: 1px solid rgba(35,34,34,0.18);
  border-radius: 4px;
  padding: 14px 16px;
  transition: border-color .25s;
}
.ah-news__form textarea { resize: vertical; min-height: 90px; }
.ah-news__form input:focus,
.ah-news__form textarea:focus { outline: none; border-color: var(--ah-bordo); }
.ah-news__form button {
  font-family: var(--ah-font);
  font-weight: 500;
  font-size: 16px;
  color: #f8f8fa;
  background: var(--ah-bordo);
  border: none;
  border-radius: 4px;
  padding: 15px 20px;
  cursor: pointer;
  transition: background .3s;
}
.ah-news__form button:hover { background: var(--ah-bordo-dark); }
.ah-news__note {
  font-size: 15px;
  color: rgba(35,34,34,0.40);
  margin-top: 20px;
}

/* ===================================================================
   CHROME EN LA PORTADA (footer claro) — solo body.home
   (El header de dos niveles vive en main.css y es global.)
=================================================================== */
body.home .site-footer {
  background: #efeff2;
  border-top: 1px solid rgba(35,34,34,0.12);
}
body.home .footer-brand p { color: rgba(35,34,34,0.6); }
body.home .footer-col h5 { color: #232222; border-bottom-color: rgba(35,34,34,0.15); }
body.home .footer-col a,
body.home .footer-col li { color: rgba(35,34,34,0.75); }
body.home .footer-col a:hover { color: #8c1f28; }
body.home .footer-bottom { border-top-color: rgba(35,34,34,0.12); }
body.home .footer-bottom p,
body.home .footer-bottom a { color: rgba(35,34,34,0.5); }
body.home .footer-bottom a:hover { color: #8c1f28; }

/* ===================================================================
   RESPONSIVE
=================================================================== */
/* Tablet */
@media (max-width: 1024px) {
  .ah-dir { grid-template-columns: 1fr; }
  .ah-empresas { grid-template-columns: 1fr; }
  .ah-empresas__media { order: -1; }
  .ah-pillars__grid { gap: 36px; }
}

/* Mobile grande */
@media (max-width: 767px) {
  /* Hero más compacto y sin recortes en móvil */
  .ah-hero {
    min-height: auto;
    padding-top: 128px;
    padding-bottom: 56px;
    align-items: flex-start;
    background-position: center top;
  }
  .ah-hero__title { max-width: none; }
  .ah-hero__lead { max-width: none; }

  .ah-stat { flex-basis: 50%; }
  .ah-stat:nth-child(2) { border-left: none; }
  .ah-stat:nth-child(3) { border-left: none; }
  .ah-stat:nth-child(3),
  .ah-stat:nth-child(4) { border-top: 1px solid rgba(35,34,34,0.08); }
  .ah-pillars__grid { grid-template-columns: 1fr; }
  .ah-pillars__title { max-width: none; }
  .ah-pillar p { max-width: none; }
  .ah-hero__cards { max-width: none; }
  .ah-hero__btns .wp-block-button,
  .ah-hero__btns .wp-block-button__link { width: 100%; text-align: center; }
  .ah-btn { width: 100%; justify-content: center; }
  .ah-dir__col .ah-btn { width: auto; }
  .ah-empresas__title,
  .ah-news__title { max-width: none; }
}

/* Mobile chico */
@media (max-width: 480px) {
  .ah-stat { flex-basis: 100%; min-width: 0; }
  .ah-stat + .ah-stat { border-left: none; border-top: 1px solid rgba(35,34,34,0.08); }
  .ah-hero::before {
    background: linear-gradient(180deg,
      rgba(248,248,250,0.94) 0%,
      rgba(248,248,250,0.86) 60%,
      rgba(248,248,250,0.70) 100%);
  }
  .ah-card__text { font-size: 15px; }
  .ah-checklist li { font-size: 17px; }
}

/* Mobile muy angosto (p. ej. Galaxy Z Fold 5 cerrado, 344px) */
@media (max-width: 360px) {
  .aapra-home { --ah-pad: 18px; }
  .ah-hero__title { font-size: 24px; }
  .ah-hero__eyebrow { font-size: 13px; }
  .ah-stat__num { font-size: 30px; }
  .ah-pillars__title,
  .ah-dir__title,
  .ah-empresas__title,
  .ah-news__title { font-size: 26px; letter-spacing: -0.5px; }
}
