/* ============================================================
   Colegio Le Petit Prince — base: reset, tipografía, shell
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: clip; /* el drawer móvil fixed fuera de pantalla no debe crear scroll-x */
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--tinta);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--azul-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--azul-real); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--azul-real);
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { text-wrap: pretty; max-width: 68ch; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.container-wide { max-width: 1320px; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }

.lead { font-size: var(--fs-lead); color: var(--tinta-suave); }

section { padding-block: var(--sp-section); }

/* Script de marca (eco del logo, máx. 1 por vista) */
.script { font-family: var(--font-script); font-weight: 400; color: var(--rojo); }

/* ------- Botones ------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  padding: 0.78rem 1.5rem; border-radius: 999px;
  background: var(--corona); color: var(--azul-noche);
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.18s;
  min-height: 44px;
}
.btn:hover { transform: translateY(-2px); background: var(--corona-600); color: var(--azul-noche); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 oklch(0.28 0.115 268 / 0.85); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.btn--ghost {
  background: transparent; color: var(--sobre-azul);
  border: 2px solid color-mix(in oklch, var(--sobre-azul) 45%, transparent);
  box-shadow: none;
}
.btn--ghost:hover { background: oklch(1 0 0 / 0.1); color: #fff; border-color: color-mix(in oklch, var(--sobre-azul) 75%, transparent); }

.btn--azul { background: var(--azul-real); color: #fff; box-shadow: 0 3px 0 var(--azul-noche); }
.btn--azul:hover { background: var(--azul-600); color: #fff; }

.btn--wa { background: var(--wa); color: oklch(0.2 0.05 155); box-shadow: 0 3px 0 oklch(0.45 0.12 155); }
.btn--wa:hover { background: oklch(0.78 0.19 152); color: oklch(0.2 0.05 155); }

/* ------- Header ------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--blanco);
  transition: box-shadow 0.25s;
}
.site-header.scrolled { box-shadow: 0 2px 18px oklch(0.32 0.13 268 / 0.14); }

.topbar { background: var(--azul-noche); color: var(--sobre-azul-suave); font-size: 0.85rem; }
.topbar .container-wide { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 1rem; }
.topbar a { color: var(--sobre-azul-suave); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; padding-block: 0.35rem; }
.topbar a:hover { color: #fff; }
.topbar svg { width: 14px; height: 14px; }
.tb-links { display: flex; gap: 1.2rem; }

.navbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.brand-lockup { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-lockup .logo { width: 56px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; color: var(--azul-real); }
.brand-sub { font-family: var(--font-script); font-size: 0.98rem; color: var(--rojo); margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: clamp(0.6rem, 1.6vw, 1.4rem); }
.nav-links a {
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem;
  color: var(--tinta); text-decoration: none; padding: 0.4rem 0.15rem;
  border-bottom: 3px solid transparent;
}
.nav-links a:hover { color: var(--azul-real); }
.nav-links a[aria-current="page"] { color: var(--azul-real); border-bottom-color: var(--corona); }

.nav-actions { display: flex; align-items: center; gap: 0.7rem; }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--azul-real); width: 44px; height: 44px; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-backdrop { display: none; }

@media (max-width: 920px) {
  .desktop-only { display: none !important; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw);
    background: var(--blanco); z-index: var(--z-drawer);
    flex-direction: column; align-items: flex-start; gap: 0.3rem;
    padding: 5.4rem 1.6rem 2rem;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease-out);
    box-shadow: -12px 0 32px oklch(0.22 0.09 268 / 0.18);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.15rem; padding: 0.55rem 0.2rem; width: 100%; }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: var(--z-backdrop);
    background: oklch(0.22 0.09 268 / 0.45);
    opacity: 0; pointer-events: none; transition: opacity 0.28s;
  }
  .nav-backdrop.open { opacity: 1; pointer-events: auto; }
  .nav-toggle { position: relative; z-index: calc(var(--z-drawer) + 1); }
}
@media (min-width: 921px) { .mobile-only { display: none !important; } }

/* ------- Almenas (borde castillo entre secciones) ------- */
.almenas { display: block; width: 100%; height: 26px; }
.almenas--sm { height: 18px; }

/* ------- Footer ------- */
.site-footer {
  background: var(--azul-noche); color: var(--sobre-azul-suave);
  padding-block: calc(var(--sp-section) * 0.8) 1.6rem;
  position: relative;
}
.site-footer a { color: var(--sobre-azul); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(1.6rem, 3vw, 3rem); margin-bottom: 2.6rem;
}
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 0.85rem; }
.footer-grid ul { list-style: none; display: grid; gap: 0.5rem; font-size: 0.94rem; }
.footer-brand .logo { width: 92px; height: auto; margin-bottom: 0.8rem; }
.footer-brand p { font-size: 0.94rem; }
.footer-bottom {
  border-top: 1px solid oklch(1 0 0 / 0.14); padding-top: 1.3rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

/* ------- WhatsApp flotante ------- */
.wa-float {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: var(--z-fab);
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--wa); color: #fff; text-decoration: none;
  padding: 0.75rem 1.05rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 8px 24px oklch(0.55 0.18 152 / 0.45);
  transition: transform 0.18s var(--ease-out);
}
.wa-float:hover { transform: translateY(-2px) scale(1.03); color: #fff; }
.wa-float svg { width: 22px; height: 22px; }
@media (max-width: 560px) { .wa-float .wa-label { display: none; } .wa-float { padding: 0.85rem; } }

/* ------- Reveal (visible por defecto; anima solo con html.js-reveal) ------- */
.reveal { opacity: 1; }
html.js-reveal .reveal {
  animation: revealIn 0.7s var(--ease-out) both;
  animation-delay: var(--rd, 60ms);
}
/* Solo desliza (sin ocultar por opacidad): el contenido NUNCA queda invisible
   si la animación no corre (rastreadores, pestañas suspendidas, headless). */
@keyframes revealIn {
  from { transform: translateY(16px); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ------- Utilidades ------- */
.center { text-align: center; }
.center p { margin-inline: auto; }
.section-head { max-width: 720px; margin-bottom: var(--sp-block); }
.section-head.center { margin-inline: auto; }
.section-head .lead { margin-top: 0.7rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 700; padding: 0.3rem 0.8rem;
  border-radius: 999px; border: 1.5px solid var(--linea);
  background: var(--blanco); color: var(--tinta-suave); text-decoration: none;
}
