/* ============================================================
   Brains International Schools — sistema visual "Editorial prestigio"
   Réplica simplificada de /centros/canarias y /centros/madrid
   Paleta:  navy #2A3165 · champagne #D9AE5F · papel #FAF8F3
   Tipos:   Fraunces (display) + Inter (texto/UI)
   ============================================================ */

:root {
  --navy:      #2A3165;
  --navy-deep: #1E244B;
  --gold:      #D9AE5F;
  --gold-soft: #EBD9A8;
  --paper:     #FAF8F3;
  --ink:       #23252E;
  --muted:     #6B6F82;
  --line:      #E4E0D6;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Inter", system-ui, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --section-y: clamp(64px, 8vw, 112px);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Accesibilidad: salto al contenido + foco visible */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 12px 18px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Eyebrow (etiqueta superior) ---------- */
.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
}
.eyebrow--onlight { color: #a8842f; }

/* ---------- Filete dorado bajo títulos ---------- */
.rule {
  width: 64px; height: 2px;
  background: var(--gold);
  border: 0;
  margin: 18px 0 26px;
}

/* ---------- Botón ---------- */
.btn {
  --btn-bg: var(--gold);
  --btn-fg: var(--navy-deep);
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
  padding: 15px 30px;
  border-radius: 2px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn::after { content: "→"; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30,36,75,.18); }
.btn:hover::after { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 248, 243, .88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 82px;
}
.site-header .logo img { height: 44px; width: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--section-y) 0;
  background:
    radial-gradient(120% 90% at 100% 0%, #fff 0%, var(--paper) 55%);
}
.hero .container {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  color: var(--navy);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.015em;
  margin: 0 0 20px;
}
.hero .subtitle {
  color: var(--ink);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 500;
  margin: 0;
  max-width: 34ch;
}
.hero .subtitle em {
  font-family: var(--display);
  font-style: italic;
  color: var(--navy);
}
.hero-cta { margin-top: 34px; }
.hero-figure {
  position: relative;
}
.hero-figure img {
  width: 100%; height: clamp(320px, 42vw, 480px);
  object-fit: cover;
  border-radius: 3px;
}
/* Marco dorado desplazado (detalle editorial) */
.hero-figure::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px;
  border: 1px solid var(--gold);
  border-radius: 3px; z-index: -1;
}

/* Filigrana del escudo (firma) */
.crest-mark {
  position: absolute; pointer-events: none; user-select: none;
  width: min(300px, 40vw); height: auto; z-index: 0;
}
.hero .crest-mark {
  top: -30px; left: -70px; opacity: .06;
  filter: brightness(0) saturate(0) opacity(.5);
}
.hero .container { position: relative; z-index: 1; }

/* ---------- Banda del formulario (Dynamics) ---------- */
.form-band {
  position: relative; overflow: hidden;
  background: var(--navy-deep);
  padding: var(--section-y) 0;
  color: #fff;
}
.form-band .crest-mark {
  right: -60px; top: -50px; opacity: .07;
  filter: brightness(0) invert(1);
}
.form-band .form-card {
  position: relative;
  max-width: 580px; margin: 0 auto;
}
.form-band h2 {
  font-family: var(--display); font-weight: 500;
  color: #fff; font-size: clamp(26px, 3.4vw, 36px);
  margin: 0;
}
.form-band .eyebrow { color: var(--gold-soft); }
/* El formulario de Dynamics 365 se inyecta dentro de .dyn-form */
.dyn-form { margin-top: 30px; }
.dyn-form__fallback {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 3px; padding: 22px; font-size: 15px;
}

/* ---------- Intro "¿Por qué elegir Brains?" ---------- */
.intro { padding: var(--section-y) 0; text-align: center; }
.intro .container { max-width: 820px; }
.intro .eyebrow { color: #a8842f; }
.intro h2 {
  font-family: var(--display); font-weight: 500;
  color: var(--navy); font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.08; margin: 0;
}
.intro .rule { margin-left: auto; margin-right: auto; }
.intro .lead {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(20px, 2.4vw, 25px); line-height: 1.5;
  color: var(--navy); margin: 0 auto 22px; max-width: 40ch;
}
.intro p { color: #4a4c58; margin: 0 auto 16px; max-width: 62ch; }

/* ---------- Tarjetas de centros ---------- */
.campus {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
}
.campus__text {
  background: var(--navy); color: #fff;
  padding: clamp(44px, 5vw, 76px) var(--gutter);
  display: flex; flex-direction: column; justify-content: center;
}
.campus__text .eyebrow { color: var(--gold-soft); }
.campus__media { position: relative; overflow: hidden; min-height: 440px; }
/* Imagen única (Madrid) */
.campus__media > picture img,
.campus__media > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .9s var(--ease);
}
.campus:hover .campus__media > picture img { transform: scale(1.05); }
/* Carrusel Swiper (Canarias) */
.campus__media .swiper { position: absolute; inset: 0; height: 100%; }
.campus__media .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.campus__media .swiper-pagination-bullet { background: #fff; opacity: .55; }
.campus__media .swiper-pagination-bullet-active { background: var(--gold); opacity: 1; }
/* Flechas — bloque sólido, sin borde redondeado */
.campus-swiper { --swiper-navigation-size: 18px; }
.campus__media .swiper-button-prev,
.campus__media .swiper-button-next {
  width: 46px; height: 46px; color: #fff; margin: 0;
  background: var(--navy); border: 0; border-radius: 0;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.campus__media .swiper-button-prev { left: 18px; }
.campus__media .swiper-button-next { right: 18px; }
.campus__media .swiper-button-prev:hover,
.campus__media .swiper-button-next:hover { background: var(--gold); color: var(--navy-deep); }

.campus--reverse .campus__text  { order: 2; }
.campus--reverse .campus__media { order: 1; }

.campus h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(27px, 3.2vw, 38px); line-height: 1.05;
  margin: 0;
}
.campus .address {
  font-weight: 600; font-size: 17px; margin: 0 0 22px;
  display: flex; align-items: baseline; gap: 8px; color: var(--gold-soft);
}
.campus .address svg { width: 14px; height: 14px; flex: none; translate: 0 2px; }
.campus .note {
  font-family: var(--display); font-style: italic;
  color: var(--gold-soft); margin: 0 0 16px; font-size: 16px;
}
.campus .lead { margin: 0 0 18px; color: #dfe1ee; }
.campus ul { list-style: none; padding: 0; margin: 0 0 32px; }
.campus li { position: relative; padding-left: 26px; margin-bottom: 13px; color: #eceef6; }
.campus li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 14px; height: 2px; background: var(--gold);
}
.campus li strong { color: #fff; font-weight: 600; }
.campus .btn { align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; overflow: hidden;
  background: var(--navy-deep); color: #b9bdd4;
  padding: clamp(48px, 6vw, 72px) 0 40px; text-align: center;
}
.site-footer .crest-mark { left: 50%; translate: -50% 0; top: -50px; opacity: .06; filter: brightness(0) invert(1); }
.site-footer .container { position: relative; z-index: 1; }
.site-footer .foot-logo { height: 46px; width: auto; margin: 0 auto 24px; }
.site-footer nav {
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: center;
  margin: 0 0 26px; font-size: 14px;
}
.site-footer nav a { text-decoration: none; opacity: .85; transition: opacity .2s; }
.site-footer nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.site-footer .copyright { font-size: 13px; opacity: .6; margin: 0; }

/* ---------- Reveal al hacer scroll (fail-safe: solo se oculta si el JS corre) ---------- */
.reveal { opacity: 1; transform: none; }
.js-anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js-anim .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .hero-figure::before { inset: 12px -12px -12px 12px; }
  .campus { grid-template-columns: 1fr; }
  /* En móvil la imagen SIEMPRE arriba y el texto debajo, en todas las tarjetas */
  .campus__media { min-height: 280px; order: 1; }
  .campus__text  { order: 2; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
