/* =========================================================
   Escuela N°14 "María Montessori" — hoja de estilos
   Paleta inspirada en el escudo: techo rojo, sol dorado,
   cielo celeste, manos entrelazadas.
   ========================================================= */

:root {
  --bg: #F5F9FB;
  --paper: #FFFFFF;
  --ink: #21303C;
  --ink-soft: #4B5C69;
  --red: #D6473C;
  --red-dark: #B93A31;
  --yellow: #F0AC2E;
  --yellow-soft: #FBE6C4;
  --blue: #3E7C97;
  --blue-dark: #2C5C71;
  --blue-light: #DCEEF5;
  --line: #D7E4EA;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;

  --container: 1120px;
  --pad: clamp(1rem, 4vw, 2.2rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--ink);
}

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red-dark);
  margin: 0 0 0.9em;
}

/* subtle paper grain for warmth, very low opacity */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 249, 251, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--ink);
}

.brand-text em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--blue-dark);
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 1.9rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  padding: 0.2rem 0;
}

.site-nav a:hover,
.site-nav a:focus-visible { color: var(--red-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle span {
  width: 24px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Hero slider (header) ---------- */
/* Ocupa el 100% del ancho de pantalla en cualquier dispositivo;
   la altura se adapta con clamp() para no invadir el celular. */

.hero-slider {
  position: relative;
  width: 100%;
  height: clamp(420px, 78vh, 720px);
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
}

.slides {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  background-color: var(--ink);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.slide.is-active { opacity: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(33,48,60,0.55) 0%, rgba(33,48,60,0.35) 38%, rgba(33,48,60,0.78) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #FFFFFF;
}

.eyebrow-light { color: var(--yellow); }

.hero-content h1 {
  color: #FFFFFF;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(0,0,0,0.25);
}

.hero-lead {
  font-size: 1.1rem;
  max-width: 46ch;
  color: #EAF1F5;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.btn-ghost-light {
  border-color: rgba(255,255,255,0.7);
  color: #FFFFFF;
}

.btn-ghost-light:hover { background: rgba(255,255,255,0.14); }

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(33,48,60,0.4);
  color: #FFF;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.slider-arrow:hover { background: rgba(33,48,60,0.7); }
.slider-prev { left: clamp(0.6rem, 3vw, 2rem); }
.slider-next { right: clamp(0.6rem, 3vw, 2rem); }

.slider-dots {
  position: absolute;
  z-index: 3;
  bottom: clamp(1rem, 3vw, 1.8rem);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.slider-dots button {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #FFF;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.75;
}

.slider-dots button.is-active {
  background: #FFF;
  opacity: 1;
}

@media (max-width: 640px) {
  .hero-slider { height: clamp(480px, 88vh, 620px); }
  .slider-arrow { width: 36px; height: 36px; font-size: 1.3rem; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 2px solid transparent;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--red);
  color: #FFF7F1;
  box-shadow: 0 8px 20px -8px rgba(214, 71, 60, 0.55);
}

.btn-primary:hover { background: var(--red-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue-dark);
}

.btn-ghost:hover { background: var(--blue-light); }

.btn-large { padding: 1rem 2.1rem; font-size: 1rem; }

/* ---------- Hand-chain divider (signature element) ---------- */

.hand-divider {
  width: 100%;
  line-height: 0;
  background: var(--blue-light);
}

.hand-divider-alt { background: var(--yellow-soft); }

.hand-svg { width: 100%; height: 64px; display: block; }

/* ---------- Stats strip ---------- */

.stats-strip {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2.6rem var(--pad);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--red-dark);
  font-weight: 700;
}

.stat-label {
  display: block;
  font-size: 0.83rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
}

/* ---------- Generic section ---------- */

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.8rem, 7vw, 4.5rem) var(--pad);
}

.section-tinted { background: var(--blue-light); max-width: none; }
.section-tinted .section-head,
.section-tinted .card-grid { max-width: var(--container); margin: 0 auto; }

.section-head { max-width: 62ch; margin-bottom: 2.6rem; }

.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.section-lead { font-size: 1.03rem; }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--yellow);
  max-width: 68ch;
}

.timeline-item {
  position: relative;
  padding: 0 0 2.4rem 2.2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--yellow);
}

.timeline-year {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--blue-dark);
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.timeline-body h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.timeline-body p { margin: 0; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.3rem;
}

.card {
  background: var(--paper);
  border-radius: var(--radius-m);
  padding: 1.7rem 1.8rem;
  border: 1px solid var(--line);
}

.card h3 {
  font-size: 1.08rem;
  color: var(--red-dark);
  margin-bottom: 0.5rem;
}

.card p { margin: 0; font-size: 0.95rem; }

/* tarjetas con foto: la imagen ocupa todo el ancho de la tarjeta */
.card-media {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  background: var(--blue-light);
}

.card-media .card-body { padding: 1.5rem 1.8rem 1.7rem; }
.card-media .card-body h3 { margin-bottom: 0.5rem; }
.card-media .card-body p { margin: 0; }

/* ---------- Levels ---------- */

.levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-bottom: 2.6rem;
}

.level {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--yellow);
  border-radius: var(--radius-s);
  padding: 1.4rem 1.2rem;
}

.level:nth-child(2) { border-top-color: var(--red); }
.level:nth-child(3) { border-top-color: var(--blue); }
.level:nth-child(4) { border-top-color: var(--blue-dark); }

.level-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.level h3 { font-size: 1.02rem; margin: 0; }

.callout {
  background: linear-gradient(135deg, var(--yellow-soft), var(--paper));
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 2rem 2.2rem;
}

.callout h3 { color: var(--red-dark); font-size: 1.2rem; }
.callout p { margin: 0 0 1.4rem; }

.callout-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.callout-photos img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

/* ---------- Family section ---------- */

.section-family {
  background: var(--ink);
  max-width: none;
  padding: clamp(3rem, 7vw, 4.8rem) var(--pad);
}

.family-inner { max-width: 68ch; margin: 0 auto; }

.section-family .eyebrow { color: var(--yellow); }
.section-family h2 { color: #FBF9F4; }
.section-family p { color: #C9D3D9; }

.family-inner-grid {
  max-width: var(--container);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.6rem;
  align-items: center;
}

.family-text p:last-child { margin-bottom: 0; }

.family-photos {
  display: grid;
  gap: 1rem;
}

.family-photos img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-m);
}

/* ---------- Galería ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  padding: 0;
  border: none;
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--blue-light);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.gallery-item:hover img { transform: scale(1.06); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 27, 33, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius-s);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #FFF;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Contact ---------- */

.section-contact { text-align: center; }
.contact-inner { max-width: 56ch; margin: 0 auto; }
.contact-address {
  margin-top: 1.4rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 3rem var(--pad);
  border-top: 1px solid var(--line);
}

.footer-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 0.9rem;
}

.site-footer p {
  font-size: 0.85rem;
  margin: 0 0 0.3rem;
}

.site-footer a {
  font-size: 0.85rem;
  color: var(--blue-dark);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(2, 1fr); }
  .callout-photos { grid-template-columns: repeat(3, 1fr); }
  .family-inner-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .family-photos { grid-template-columns: repeat(2, 1fr); }
  .family-photos img { height: 160px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.open { max-height: 320px; }

  .site-nav a {
    padding: 0.9rem var(--pad);
    border-top: 1px solid var(--line);
  }

  .nav-toggle { display: flex; }
}

@media (max-width: 540px) {
  .levels { grid-template-columns: 1fr; }
  .header-inner { padding: 0.6rem 1.1rem; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 1.1rem 1rem; }
  .callout { padding: 1.6rem 1.4rem; }
  .card:not(.card-media) { padding: 1.4rem 1.4rem; }
  .card-media .card-body { padding: 1.3rem 1.4rem 1.5rem; }
  .callout-photos { grid-template-columns: 1fr 1fr; }
  .family-photos { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .stats-strip { grid-template-columns: 1fr; }
  .brand-text strong { font-size: 0.92rem; }
  .brand-text em { font-size: 0.68rem; }
}

/* Desktops muy anchos: se evita que el contenido se sienta perdido
   sin dejar de usar todo el ancho para fondos y divisores */
@media (min-width: 1600px) {
  :root { --container: 1280px; }
  .hero h1 { font-size: 3.7rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
