/* ==========================================================================
   El Buen Pastor — main styles. Mobile first; desktop layout from 900px.
   All colors and type come from tokens.css.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
p, h1, h2, h3, ul, dl, dd, blockquote, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; border-radius: 2px; }
address { font-style: normal; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--gold-500); color: var(--navy-900); padding: 10px 16px; border-radius: var(--radius-standard); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* Color helpers (token names) */
.c-ink { color: var(--ink); } .c-ink-muted { color: var(--ink-muted); }
.c-paper { color: var(--paper); } .c-navy-100 { color: var(--navy-100); } .c-navy-700 { color: var(--navy-700); }
.c-gold-500 { color: var(--gold-500); } .c-gold-700 { color: var(--gold-700); }

.section--paper { background: var(--paper); }
.section--white { background: var(--white); }
.section--navy { background: var(--navy-900); }
.section--navy-700 { background: var(--navy-700); }

.acento { display: block; width: 48px; height: 3px; background: var(--gold-500); }

/* ---------- Buttons & links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px; border-radius: var(--radius-standard); white-space: nowrap; transition: filter .2s, background-color .2s; }
.btn--gold { background: var(--gold-500); color: var(--navy-900); }
.btn--navy { background: var(--navy-700); color: var(--paper); }
.btn--outline { border: 1.5px solid var(--navy-700); color: var(--navy-700); }
.btn--gold:hover, .btn--navy:hover { filter: brightness(1.08); }
.btn--outline:hover { background: var(--navy-100); }
.link { display: inline-flex; gap: 6px; align-items: center; }
.link:hover span, .link:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-inline { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.btn-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.btn-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Icons (values & levels) ---------- */
.icono { width: 36px; height: 36px; flex: none; fill: none; stroke: var(--gold-500); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icono--nivel { width: 64px; height: 64px; stroke: var(--gold-600); stroke-width: 1.15; }

/* ==========================================================================
   NAV (fixed) + scroll progress
   ========================================================================== */
body { padding-top: var(--nav-h); }
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); background: var(--navy-900); }
.nav__inner { height: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.nav__logo img { height: 40px; width: auto; }
.nav__menu { display: none; }
.nav__toggle { display: grid; gap: 5px; width: 44px; height: 44px; place-content: center; margin-right: -10px; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--paper); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--navy-700); }
.progress__bar { height: 100%; width: 100%; background: var(--gold-500); transform-origin: left; transform: scaleX(0); }

@media (min-width: 900px) {
  .nav__logo img { height: 64px; }
  .nav__toggle { display: none; }
  .nav__menu { display: flex; align-items: center; }
  .nav__link { color: var(--paper); padding: 13px 20px; }
  .nav__link:hover { color: var(--gold-500); }
  .nav__menu .btn { margin-left: 24px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; height: 560px; overflow: hidden; background: var(--ink); display: flex; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.hero::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(to bottom, rgba(16,35,63,0), rgba(16,35,63,.9)); }
.hero__content { position: relative; z-index: 1; align-self: flex-end; padding-bottom: 40px; display: grid; gap: 20px; }
.hero__titulo { color: var(--paper); }
.hero__cta { width: 100%; }

@media (min-width: 900px) {
  .hero { height: min(751px, 80vh); min-height: 560px; }
  .hero__img { object-position: 50% 80%; }
  /* Soft left-side shade so the white title stays readable on bright photos */
  .hero::after { inset: 0; background: linear-gradient(to right, rgba(16,35,63,.55) 0%, rgba(16,35,63,.15) 45%, rgba(16,35,63,0) 65%); }
  .hero__content { align-self: center; padding-bottom: 0; }
  .hero__titulo { max-width: 770px; }
  .hero__cta { display: none; }
}

/* ==========================================================================
   BIENVENIDA
   ========================================================================== */
.bienvenida { padding-block: 64px; }
.bienvenida__grid { display: grid; gap: 16px; }
.bienvenida__etiqueta { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .bienvenida { padding-block: var(--space-section); }
  .bienvenida__grid { grid-template-columns: 232px 1fr; gap: 64px; align-items: start; }
  .bienvenida__etiqueta { padding-top: 14px; }
}

/* ==========================================================================
   MARQUEE
   ========================================================================== */
.marquee { background: var(--navy-700); overflow: hidden; padding-block: 18px; }
.marquee__track { display: flex; width: max-content; animation: deslizar 30s linear infinite; }
.marquee__group { display: flex; align-items: center; gap: 32px; padding-right: 32px; color: var(--paper); white-space: nowrap; }
.marquee__group img { width: 24px; height: auto; }
@media (min-width: 900px) {
  .marquee { padding-block: 28px; }
  .marquee__group { gap: 48px; padding-right: 48px; }
  .marquee__group img { width: 40px; }
}
@keyframes deslizar { to { transform: translateX(-50%); } }

/* ==========================================================================
   POR QUÉ
   ========================================================================== */
.porque { padding-block: 64px; }
.porque__grid { display: grid; gap: 32px; }
.porque__img { width: 100%; height: 360px; object-fit: cover; object-position: 50% 60%; border-radius: var(--radius-standard); }
.porque__texto { display: grid; gap: 20px; justify-items: start; }
@media (min-width: 900px) {
  .porque { padding-block: var(--space-section); }
  .porque__grid { grid-template-columns: minmax(0, 595fr) minmax(0, 509fr); gap: 96px; align-items: center; }
  .porque__img { height: 669px; object-position: 50% 87%; }
  .porque__texto { gap: 24px; }
}

/* ==========================================================================
   MISIÓN Y VISIÓN
   ========================================================================== */
.identidad { padding-block: 64px; }
.identidad .t-h2 { margin-top: 12px; }
.identidad__grid { display: grid; gap: 40px; margin-top: 40px; }
.identidad__item { border-top: 2px solid var(--gold-500); padding-top: 24px; display: grid; gap: 16px; align-content: start; }
@media (min-width: 900px) {
  .identidad { padding-block: var(--space-section) 96px; }
  .identidad .t-h2 { margin-top: 16px; }
  .identidad__grid { grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 56px; }
}

/* ==========================================================================
   VALORES
   ========================================================================== */
.valores { padding-bottom: 64px; }
.valores .container { border-top: 1px solid rgba(234,240,250,.2); padding-top: 40px; }
.valores__head { display: grid; gap: 12px; }
.valores__intro { display: none; }
.valores__grid { margin-top: 24px; }
.valor { display: flex; gap: 20px; padding-block: 24px; border-bottom: 1px solid var(--navy-700); }
.valor:last-child { border-bottom: 0; }
.valor div { display: grid; gap: 6px; }

@media (min-width: 900px) {
  .valores { padding-bottom: var(--space-section); }
  .valores .container { padding-top: 64px; }
  .valores__head { gap: 16px; }
  .valores__intro { display: block; }
  /* 4 columns on the first row, 3 centered on the second, thin dividers between */
  .valores__grid { margin-top: 56px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 80px; row-gap: 56px; }
  .valor { position: relative; flex: 0 0 calc((100% - 240px) / 4); flex-direction: column; gap: 28px; padding: 0; border-bottom: 0; }
  .valor::before { content: ""; position: absolute; left: -40px; top: 0; bottom: 0; width: 1px; background: var(--navy-700); }
  .valor:nth-child(1)::before, .valor:nth-child(5)::before { display: none; }
  .valor div { gap: 12px; }
  .icono { width: 44px; height: 44px; }
}

/* ==========================================================================
   NIVELES
   ========================================================================== */
.niveles { padding-block: 64px; }
.niveles__head { display: grid; gap: 12px; }
.niveles__grid { display: grid; gap: 16px; margin-top: 32px; }
.nivel-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-standard); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.nivel-card .icono--nivel { margin-bottom: 12px; }
.nivel-card__btn { margin-top: 12px; align-self: flex-start; }
.nivel-card__btn::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.nivel-card { position: relative; cursor: pointer; transition: box-shadow .2s, border-color .2s; }
.nivel-card:hover { border-color: var(--placeholder); box-shadow: 0 8px 24px rgba(16,35,63,.08); }

@media (min-width: 900px) {
  .niveles { padding-block: var(--space-section); }
  .niveles__head { gap: 16px; max-width: 780px; }
  .niveles__grid { grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 56px; }
  .nivel-card { padding: 40px; }
  .nivel-card p { flex: 1; }
}

/* ==========================================================================
   AFILIACIONES (logo ribbon)
   ========================================================================== */
.afiliaciones { padding-block: 64px; }
.cinta { overflow: hidden; margin-top: 32px; }
.cinta__track { display: flex; align-items: center; gap: 56px; width: max-content; padding-left: var(--gutter); animation: deslizar 40s linear infinite; }
.cinta:hover .cinta__track { animation-play-state: paused; }
.logo-afil { width: auto; filter: grayscale(1); }
.logo-afil--sais { height: 33px; } .logo-afil--naes { height: 35px; } .logo-afil--cb { height: 21px; opacity: .8; }
.logo-afil--anepbh { height: 54px; } .logo-afil--absh { height: 66px; }
@media (min-width: 900px) {
  .afiliaciones { padding-block: 96px; }
  .cinta { margin-top: 48px; }
  .cinta__track { gap: 96px; }
  .logo-afil--sais { height: 44px; } .logo-afil--naes { height: 46px; } .logo-afil--cb { height: 28px; }
  .logo-afil--anepbh { height: 72px; } .logo-afil--absh { height: 88px; }
}

/* ==========================================================================
   RESULTADOS (reseñas)
   ========================================================================== */
.resenas { padding-top: 64px; padding-bottom: 40px; }
.resenas__head { display: grid; gap: 12px; }
.resenas__scroller { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-top: 32px; }
.resenas__scroller::-webkit-scrollbar { display: none; }
.resenas__grid { display: flex; gap: 16px; width: max-content; max-width: none; }
.resena { flex: 0 0 300px; scroll-snap-align: start; scroll-margin-left: var(--gutter); background: var(--navy-900); border-radius: var(--radius-standard); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.resena blockquote { font-size: 18px; line-height: 1.6; font-family: var(--font-sans); } /* Lead-movil on mobile */
.resena__comilla { display: block; height: 44px; line-height: .8; }
.resena__autor { display: grid; gap: 6px; padding-top: 20px; margin-top: auto; }
.resena__autor .acento { margin-bottom: 10px; }
.resena cite { font-style: normal; }

@media (min-width: 900px) {
  .resenas { padding-top: var(--space-section); padding-bottom: 64px; }
  .resenas__head { gap: 16px; }
  .resenas__scroller { overflow: visible; margin-top: 48px; }
  .resenas__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); }
  .resena { padding: 40px; gap: 20px; }
  .resena blockquote { font: 400 24px/1.45 var(--font-serif); } /* Cita */
}

/* ==========================================================================
   CIFRAS
   ========================================================================== */
.cifras { padding-bottom: 64px; }
.cifras .container { border-top: 1px solid rgba(234,240,250,.25); }
.cifras__grid { display: grid; gap: 40px; padding-top: 32px; }
.cifra { display: grid; gap: 16px; }
.cifra strong { font-weight: 600; }
@media (min-width: 900px) {
  .cifras { padding-bottom: 120px; }
  .cifras__grid { grid-template-columns: repeat(3, 1fr); gap: 64px; padding-top: 56px; }
  .cifra span:last-child { max-width: 290px; }
}

/* ==========================================================================
   COMUNIDAD (mosaic)
   ========================================================================== */
.comunidad { padding-block: 64px; }
.comunidad__head { display: grid; gap: 12px; }
.mosaico { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.mosaico__tile { position: relative; height: 165px; border-radius: var(--radius-standard); background: var(--placeholder) center / cover no-repeat; display: flex; align-items: flex-end; padding: 12px; text-align: left; transition: filter .2s; }
.mosaico__tile:hover { filter: brightness(1.05); }
.mosaico__tile--cic { background-image: image-set(url("../img/comunidad/cic-700.webp") 1x, url("../img/comunidad/cic-1200.webp") 2x); }
.mosaico__tile[data-galeria="extracurriculares"] {
  background-image: image-set(
    url("../img/galeria/extracurriculares-01-1000.webp") 1x,
    url("../img/galeria/extracurriculares-01-1600.webp") 2x
  );
}
.mosaico__tile--dia-tipico { background-image: image-set(url("../img/comunidad/dia-tipico-700.webp") 1x, url("../img/comunidad/dia-tipico-1200.webp") 2x); }
.mosaico__tile--desfile { background-image: image-set(url("../img/comunidad/desfile-700.webp") 1x, url("../img/comunidad/desfile-1200.webp") 2x); background-position: center 55%; }
.mosaico__tile--dia-a-dia { background-image: image-set(url("../img/comunidad/dia-a-dia-700.webp") 1x, url("../img/comunidad/dia-a-dia-1200.webp") 2x); }
@media (min-width: 900px) { .mosaico__tile--dia-a-dia { background-image: url("../img/comunidad/dia-a-dia-1200.webp"); } }
.mosaico__tile--grande { grid-column: 1 / -1; height: 220px; }
.pill { background: var(--paper); border-radius: var(--radius-standard); padding: 8px 12px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .comunidad { padding-block: var(--space-section); }
  .comunidad__head { gap: 16px; max-width: 780px; }
  .mosaico { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 260px 260px; gap: 24px; margin-top: 48px; }
  .mosaico__tile { height: auto; padding: 16px; }
  .mosaico__tile--grande { grid-column: 1; grid-row: 1 / span 2; }
  .pill { overflow-wrap: normal; }
}

/* ==========================================================================
   CTA
   ========================================================================== */
.cta { display: grid; background: var(--gold-100); }
.cta__img { width: 100%; height: 240px; object-fit: cover; }
.cta__panel { padding: 64px var(--gutter); display: grid; gap: 20px; align-content: center; }
.cta__acciones { display: grid; gap: 12px; }
@media (min-width: 900px) {
  .cta { grid-template-columns: 1fr 1fr; min-height: 600px; }
  .cta picture { display: block; min-height: 100%; }
  .cta__img { height: 100%; min-height: 600px; }
  .cta__panel { padding: 96px clamp(48px, 8.33vw, 120px) 96px 96px; gap: 24px; max-width: 720px; }
  .cta__acciones { display: flex; gap: 16px; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { background: var(--navy-900); padding-block: 64px 32px; }
.footer__cols { display: grid; gap: 40px; }
.footer__marca { display: grid; gap: 24px; justify-items: start; }
.footer__marca > img { width: 233px; height: auto; }
.footer__redes { display: flex; gap: 12px; }
.footer__enlaces { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.footer__col { display: grid; gap: 10px; align-content: start; justify-items: start; }
.footer__col > p { margin-bottom: 2px; }
.footer__col a:hover { color: var(--gold-500); }
.footer__sep { border: 0; border-top: 1px solid rgba(234,240,250,.25); margin: 40px 0 32px; }
@media (min-width: 900px) {
  .footer { padding-block: 96px 40px; }
  .footer__cols { grid-template-columns: 340px auto auto; justify-content: space-between; gap: 64px; }
  .footer__enlaces { display: flex; gap: 64px; }
  .footer__sep { margin: 56px 0 40px; }
}

/* ==========================================================================
   WHATSAPP (floating)
   ========================================================================== */
.whatsapp { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 6px 20px rgba(0,0,0,.2); transition: transform .2s; }
.whatsapp:hover { transform: scale(1.06); }
@media (min-width: 900px) { .whatsapp { right: 24px; bottom: 24px; } }

/* ==========================================================================
   DIALOGS — shared
   ========================================================================== */
dialog { border: 0; padding: 0; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(16,35,63,.6); }
body.no-scroll { overflow: hidden; }

/* Mobile menu: full screen, slides in from the right */
.menu { width: 100%; height: 100%; margin: 0; background: var(--navy-900); color: var(--paper); display: none; flex-direction: column; }
.menu[open] { display: flex; animation: entrar-der .25s ease-out; }
.menu__head { height: 64px; padding: 0 14px 0 24px; display: flex; align-items: center; justify-content: space-between; flex: none; }
.menu__head img { height: 40px; width: auto; }
.menu__links { flex: 1; padding: 32px 24px 0; display: flex; flex-direction: column; }
.menu__links a { padding: 20px 0; border-bottom: 1px solid var(--navy-700); }
.menu__acciones { padding: 32px 24px 40px; display: grid; gap: 16px; }
@keyframes entrar-der { from { transform: translateX(100%); } }

/* Level sheets: full screen on mobile (slide up), centered modal on desktop */
.hoja { width: 100%; height: 100%; margin: 0; background: var(--white); overflow-y: auto; overscroll-behavior: contain; }
.hoja[open] { animation: subir .3s ease-out; }
.hoja__cerrar { position: sticky; top: 16px; float: right; margin: 16px 16px 0 0; background: var(--paper); color: var(--ink); z-index: 2; }
.hoja__contenido { padding: 32px 24px 0; display: grid; gap: 20px; }
.hoja__contenido > .t-eyebrow { margin-bottom: -12px; }
.datos { display: grid; border-block: 1px solid var(--line); }
.datos > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 14px; }
.datos > div + div { border-top: 1px solid var(--line); }
.datos dd { text-align: right; }
.puntos { display: grid; gap: 12px; padding-left: 20px; list-style: disc; }
.hoja__acciones { display: flex; flex-direction: column-reverse; gap: 12px; margin-inline: -24px; padding: 16px 24px 24px; position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--line); }
@keyframes subir { from { transform: translateY(100%); } }

@media (min-width: 900px) {
  .hoja { width: min(800px, calc(100% - 48px)); height: fit-content; max-height: calc(100% - 48px); margin: auto; border-radius: var(--radius-standard); }
  .hoja[open] { animation: aparecer .2s ease-out; }
  .hoja__cerrar { margin: 16px 16px 0 0; }
  .hoja__contenido { padding: 48px; gap: 24px; }
  .datos { grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); border-top: 0; padding-bottom: 32px; gap: 32px; }
  .datos > div { display: grid; gap: 4px; padding: 0; justify-content: start; }
  .datos > div + div { border-top: 0; }
  .datos dd { text-align: left; }
  .hoja__acciones { position: static; flex-direction: row; margin: 8px 0 0; padding: 0; border: 0; }
}
@keyframes aparecer { from { opacity: 0; transform: translateY(12px); } }

/* Gallery: full-screen navy viewer on mobile, large modal on desktop */
.galeria { width: 100%; height: 100%; margin: 0; background: var(--navy-900); color: var(--paper); display: none; flex-direction: column; gap: 24px; padding: 16px 0 32px; }
.galeria[open] { display: flex; animation: aparecer .2s ease-out; }
.galeria__head { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 0 24px; }
.galeria__head > div:first-child { display: grid; gap: 4px; }
.galeria__controles { display: flex; gap: 4px; }
.galeria__prev, .galeria__next { display: none; }
.galeria__pista { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: 24px; scroll-padding-inline: 24px; scrollbar-width: none; flex: 1; min-height: 0; }
.galeria__pista::-webkit-scrollbar { display: none; }
.galeria__pista li { flex: 0 0 calc(100% - 48px); scroll-snap-align: start; border-radius: var(--radius-standard); background: var(--placeholder); overflow: hidden; max-height: 528px; }
.galeria__pista li.con-foto { background: rgba(234,240,250,.06); }
.galeria__pista img { width: 100%; height: 100%; object-fit: contain; }
.galeria__detalle { padding-inline: 24px; display: grid; gap: 8px; }
@media (min-width: 900px) {
  .galeria { width: min(1200px, calc(100% - 48px)); height: min(868px, calc(100% - 48px)); margin: auto; border-radius: var(--radius-standard); padding: 32px; }
  .galeria__head, .galeria__pista, .galeria__detalle { padding-inline: 0; }
  .galeria__pista { scroll-padding-inline: 0; }
  .galeria__pista li { flex-basis: 100%; max-height: none; }
  .galeria__prev, .galeria__next { display: inline-grid; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track, .cinta__track { animation: none; }
  .cinta__track { width: auto; flex-wrap: wrap; justify-content: center; }
  .cinta__track li[aria-hidden="true"], .marquee__group[aria-hidden="true"] { display: none; }
  dialog[open] { animation: none !important; }
}
