/* =========================================================================
   Academia Militar General Tomás Cipriano de Mosquera
   Hoja de estilos principal — mobile-first, CSS3 moderno, sin frameworks.
   ========================================================================= */

/* ---------- 1. Tokens / Design System -------------------------------- */
/* Paleta editorial: negro/antracita + dorado discreto + rojo para CTA.
   Los nombres --brass/--maroon se conservan por compatibilidad con el
   resto de la hoja de estilos: --brass* ahora es la familia dorada y
   --maroon* la familia roja. */
:root {
  /* Superficies: negro carbón 100% sólido, sin matiz azul */
  --ink: #0a0a0a;
  --ink-2: #141414;
  --ink-3: #1f1f1f;
  --paper: #f9fafb;
  --paper-2: #f3f4f6;
  --white: #ffffff;

  /* Acentos institucionales */
  --brass: #c5a059;
  --brass-light: #dec28a;
  --brass-dark: #96762f;
  --maroon: #b91c1c;
  --maroon-light: #d93636;
  --maroon-dark: #8b1414;

  /* Texto */
  --text: #111827;
  --text-muted: #4b5563;
  --text-soft: #6b7280;
  --text-inverse: #ffffff;
  --text-inverse-muted: #e5e7eb;

  /* Bordes */
  --border: #e5e7eb;
  --border-dark: rgba(255, 255, 255, 0.1);

  /* Tipografía */
  --font-head: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Espaciado fluido */
  --space-section: clamp(3rem, 5vw, 5.5rem);
  --space-gap: clamp(1.5rem, 3vw, 3rem);

  /* Otros */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.06), 0 1px 3px rgba(10, 10, 10, 0.08);
  --shadow-md: 0 8px 20px -6px rgba(10, 10, 10, 0.1);
  --shadow-lg: 0 16px 36px -12px rgba(10, 10, 10, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1240px;
}

/* ---------- 2. Reset ---------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Foco visible accesible en toda la web */
:focus-visible {
  outline: 3px solid var(--maroon);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 999;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- 3. Layout helpers ------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 640px) {
  .container { padding-inline: 2rem; }
}

.section {
  padding-block: var(--space-section);
}

.section--dark {
  background: var(--ink);
  color: var(--text-inverse);
  position: relative;
  overflow: hidden;
}

.section--alt {
  background: var(--paper-2);
}

/* Acerca la sección "Nuestra propuesta educativa" a los botones 01/02/03 del hero */
#propuesta.section {
  padding-top: clamp(1.5rem, 2.5vw, 2.5rem);
}

.section__head {
  max-width: 42rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-dark);
}

.section--dark .eyebrow,
.hero .eyebrow {
  color: var(--brass-light);
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.eyebrow--crest::before {
  display: none;
}

.eyebrow__crest {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  flex-shrink: 0;
}

.section__title {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 700;
  line-height: 1.08;
  margin-top: 0.85rem;
  margin-bottom: 1.1rem;
}

.section__lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.7;
}

.section--dark .section__lead {
  color: var(--text-inverse-muted);
}

/* Fondos sólidos y continuos: sin patrones de grilla ni glows de color */
.pattern-grid {
  background-image: none;
}

.glow {
  display: none;
}

/* ---------- 4. Botones -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.75rem;
  border-radius: 10px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease), color .25s var(--ease);
  min-height: 48px;
  border: 2px solid transparent;
}

.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--maroon);
  color: var(--white);
  box-shadow: 0 10px 22px -10px rgba(185, 28, 28, 0.45);
}

.btn--primary:hover {
  background: var(--maroon-dark);
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text-inverse);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.btn--outline {
  border-color: var(--maroon);
  color: var(--maroon);
}

.btn--outline:hover {
  background: var(--maroon);
  color: var(--white);
}

.btn:active {
  transform: scale(0.97);
}

.btn--sm {
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  min-height: 40px;
}

.btn--block {
  width: 100%;
}

/* ---------- 6. Header / navegación --------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 10, 10, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--brass);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-lg);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  gap: 1rem;
  padding-block: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  transition: transform 160ms var(--ease);
}

.brand:active {
  transform: scale(0.97);
}

.brand__crest {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
}

.brand__crest svg,
.brand__crest img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Aparición y giro sutil al entrar en pantalla; el tilt interactivo lo controla main.js */
.crest-anim {
  opacity: 0;
  transform: scale(0.8) rotate(-10deg);
  transition: opacity 550ms var(--ease), transform 550ms var(--ease);
  will-change: transform;
}

.crest-anim.is-visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  .crest-anim {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.brand__text {
  line-height: 1.25;
}

.brand__line1 {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand__line2 {
  display: block;
  color: var(--text-inverse-muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

@media (max-width: 399px) {
  .brand__line2 {
    white-space: normal;
    max-width: 11rem;
  }
}

@media (min-width: 480px) {
  .brand__line1 { font-size: 0.92rem; }
  .brand__line2 { font-size: 0.72rem; }
}

.nav__menu {
  display: none;
}

.nav__cta {
  display: none;
}

@media (min-width: 1080px) {
  .nav__menu {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    font-weight: 500;
    color: var(--text-inverse-muted);
    font-size: 0.86rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    border-radius: 999px;
    padding: 0.25rem;
  }

  .nav__menu a {
    position: relative;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    text-align: center;
    line-height: 1.25;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease), transform 160ms var(--ease);
  }

  .nav__menu a:hover,
  .nav__menu a:focus-visible {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
  }

  .nav__menu a:active {
    transform: scale(0.96);
  }

  .nav__cta {
    display: inline-flex;
  }
}

.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-inverse);
  flex-shrink: 0;
  transition: transform 150ms var(--ease);
}

.nav__toggle:active {
  transform: scale(0.9);
}

.nav__toggle svg {
  width: 28px;
  height: 28px;
}

.nav__toggle .icon-close { display: none; }

.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

@media (min-width: 1080px) {
  .nav__toggle { display: none; }
}

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 320ms var(--ease), visibility 0s linear 320ms;
  border-top: 1px solid var(--border-dark);
}

.mobile-menu.is-open {
  max-height: 37rem;
  visibility: visible;
  transition: max-height 320ms var(--ease), visibility 0s linear 0s;
}

.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-block: 1rem 1.5rem;
  min-height: 0;
  overflow: hidden;
}

.mobile-menu a {
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-inverse-muted);
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 150ms var(--ease);
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.mobile-menu a:active {
  transform: scale(0.98);
}

.mobile-menu__cta {
  margin-top: 0.6rem;
}

@media (min-width: 1080px) {
  .mobile-menu { display: none; }
}

/* ---------- 7. Hero / Slider ---------------------------------------------- */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--text-inverse);
  overflow: hidden;
}

.hero__slides {
  position: relative;
  min-height: 640px;
  display: grid;
}

@media (min-width: 700px) {
  .hero__slides { min-height: 88vh; }
}

.hero__slide {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 640px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s var(--ease);
}

@media (min-width: 700px) {
  .hero__slide { min-height: 88vh; align-items: center; }
}

.hero__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--ink);
}

.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* slide 1: cadetes frente al helicóptero (foto 4:3). En pantallas anchas se recorta
   el cielo y parte del rotor arriba y el asfalto vacío abajo, dejando el grupo
   completo (boinas a botas) con el helicóptero de fondo */
#hero-slider .hero__slide:nth-of-type(1) .hero__media img {
  object-position: 50% 58%;
}

/* En celular (vertical) la foto se recorta a los lados: se centra en el grupo
   que está sentado en la puerta del helicóptero */
@media (max-width: 699px) {
  #hero-slider .hero__slide:nth-of-type(1) .hero__media img {
    object-position: 52% 50%;
  }
}

/* slide 2: formación de cadetes en cancha (foto horizontal); se sube el encuadre para no perder cabezas/boinas */
#hero-slider .hero__slide:nth-of-type(2) .hero__media img {
  object-position: 50% 32%;
}

/* slide 3: feria de robótica/proyectos escolares (foto horizontal 4:3); se centra
   en los rostros de los cadetes, recortando cielo/techo arriba y manteles abajo */
#hero-slider .hero__slide:nth-of-type(3) .hero__media img {
  object-position: 50% 42%;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(0deg, rgba(10, 10, 10, 0.78) 0%, rgba(10, 10, 10, 0.32) 45%, rgba(10, 10, 10, 0.08) 75%);
}

@media (min-width: 700px) {
  .hero__media::after {
    background:
      linear-gradient(100deg, rgba(10, 10, 10, 0.72) 0%, rgba(10, 10, 10, 0.42) 34%, rgba(10, 10, 10, 0.05) 62%),
      linear-gradient(0deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.1) 55%, rgba(10, 10, 10, 0.1) 100%);
  }
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-block: 7rem 3rem;
}

@media (min-width: 700px) {
  .hero__content { padding-block: 4rem; }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(197, 160, 89, 0.1);
  border: 1px solid rgba(197, 160, 89, 0.45);
  color: var(--brass-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem 0.5rem 1.4rem;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  margin-bottom: 1.5rem;
}

.hero__badge svg { width: 15px; height: 15px; }

.hero__title {
  font-size: clamp(2.35rem, 6vw, 4.6rem);
  font-weight: 700;
  line-height: 1.04;
  color: var(--white);
  max-width: 20ch;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  color: var(--brass-light);
}

.hero__text {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-inverse-muted);
  max-width: 34rem;
  margin-bottom: 2.25rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__controls {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero__dots {
  display: flex;
  gap: 0.5rem;
  counter-reset: hero-dot;
}

.hero__dot {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-inverse-muted);
  background: transparent;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background-color 0.3s var(--ease), transform 150ms var(--ease);
}

.hero__dot:active {
  transform: scale(0.9);
}

.hero__dot::before {
  counter-increment: hero-dot;
  content: counter(hero-dot, decimal-leading-zero);
}

.hero__dot.is-active {
  border-color: var(--maroon);
  color: var(--white);
  background: var(--maroon);
}

.hero__arrows {
  display: flex;
  gap: 0.6rem;
}

.hero__arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 150ms var(--ease);
}

.hero__arrow:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.hero__arrow:active {
  transform: scale(0.92);
}

.hero__arrow svg { width: 18px; height: 18px; }

/* ---------- 8. Propósito ---------------------------------------------------- */
.purpose {
  position: relative;
}

.purpose__grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .purpose__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: stretch;
  }

  .purpose__grid > .reveal:last-child {
    background: var(--ink-2);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.purpose__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

/* con align-items:stretch en el grid de escritorio, si el aspect-ratio se
   mantuviera aquí, la altura de la tarjeta de texto (variable) forzaría un
   ancho recalculado que se desborda de su columna; en desktop dejamos que
   el alto lo dé el stretch y que object-fit: cover recorte la foto. */
@media (min-width: 960px) {
  .purpose__media {
    aspect-ratio: auto;
  }
}

/* zoom sutil de la foto al pasar el cursor por el espacio de "Nuestro propósito" */
.purpose__media img {
  transition: transform 0.6s var(--ease);
}

.purpose__media:hover img,
.purpose__media:focus-within img {
  transform: scale(1.06);
}

/* foto de cadetes de cuerpo completo (retrato 3:4); centrada para no cortar
   ni los rostros arriba ni las botas abajo dentro del marco 4:5 */
.purpose__media img {
  object-position: 50% 42%;
}

.purpose__frame {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: calc(var(--radius) - 4px);
  z-index: 2;
  pointer-events: none;
}

.purpose__statement {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.8vw, 3.9rem);
  line-height: 1.03;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.purpose__statement span {
  display: block;
  color: var(--brass-light);
}

.purpose__text {
  color: var(--text-inverse-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 46rem;
  margin-bottom: 2.5rem;
}

.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  background: var(--ink-2);
  overflow: hidden;
}

.stats::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--brass);
  z-index: 1;
}

@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}

.stat {
  padding: 1.5rem 1.25rem 0.25rem;
  border-right: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
}

.stat:nth-child(2n) {
  border-right: none;
}

@media (min-width: 560px) {
  .stat:nth-child(2n) { border-right: 1px solid var(--border-dark); }
  .stat:nth-child(4n) { border-right: none; }
}

.stat--full {
  grid-column: 1 / -1;
  border-right: none;
}

.stat__value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  color: var(--text-inverse);
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.stat__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  line-height: 1.4;
  padding-bottom: 1.25rem;
}

/* ---------- 9. Institución ------------------------------------------------- */
.institution__grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 960px) {
  .institution__grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 4.5rem;
    align-items: start;
  }

  /* Composición en espejo respecto a la sección "Propósito": aquí el
     contenido va primero y la fotografía queda a la derecha. */
  .institution__grid > :first-child { order: 2; }
  .institution__grid > :last-child { order: 1; }
}

.institution__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 5 / 4;
  box-shadow: var(--shadow-md);
}

/* Carruseles de fotos reales de tamaños/orientaciones mixtas (galería de
   "Formación militar" e intercambios ACOMIL): van a ancho completo (no dentro
   de un grid de 2 columnas como el de "Institución"), así que usan una
   proporción panorámica en vez de 5/4 para no quedar desproporcionadamente
   altos. Clase compartida .gallery-slider en vez de duplicar las reglas por id. */
.gallery-slider {
  aspect-ratio: 16 / 9;
  max-height: 560px;
  /* max-height obliga a recalcular el ancho a partir de la altura ya
     recortada, así que en pantallas grandes el marco termina más angosto
     que el contenedor. Sin margin-inline:auto, un bloque más angosto que su
     contenedor queda pegado al borde izquierdo en vez de quedar centrado. */
  margin-inline: auto;
  background: var(--ink);
}

@media (max-width: 640px) {
  .gallery-slider {
    aspect-ratio: 4 / 5;
    max-height: none;
  }
}

/* Las fotos reales de estas secciones llegan en tamaños y orientaciones muy
   distintas (retrato y paisaje, varias relaciones de aspecto). Forzarlas con
   object-fit: cover recortaría cabezas y pies en las verticales. En su lugar,
   cada foto se muestra completa (object-fit: contain) centrada sobre una copia
   de sí misma, ampliada y desenfocada, que rellena el marco de fondo — así
   todas se ven "a medida" sin barras vacías ni recortes agresivos. */
.gallery-slider .institution__slide-bg {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  filter: blur(32px) brightness(0.55) saturate(1.15);
  transform: translateZ(0);
  z-index: 0;
}

.gallery-slider .institution__slide-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}


.institution__media-tag {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  background: var(--ink);
  color: var(--brass-light);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem 0.5rem 1.3rem;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  border: 1px solid var(--border-dark);
  z-index: 2;
}

.institution__history {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--brass);
}

.institution__history h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.institution__history p {
  color: var(--text-muted);
  line-height: 1.75;
}

/* ---------- Carrusel de instalaciones (dentro de "Conoce nuestra institución") ---------- */
.institution__slides {
  position: absolute;
  inset: 0;
  display: grid;
  /* Sin esto, la única celda implícita del grid se autoajusta al contenido
     más alto (una foto vertical a su relación de aspecto natural), y esa
     celda sobrepasa por mucho el alto real del marco (fijado por inset:0).
     Fijarla a 100% fuerza a cada .institution__slide a estirarse exactamente
     al tamaño del marco, para que el img con object-fit: cover recorte bien
     sin importar si la foto es vertical u horizontal. */
  grid-template-columns: 100%;
  grid-template-rows: 100%;
}

.institution__slide {
  grid-area: 1 / 1;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease);
}

.institution__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.institution__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.institution__arrow:hover {
  background: rgba(10, 10, 10, 0.8);
}

.institution__arrow:active {
  transform: translateY(-50%) scale(0.92);
}

.institution__arrow svg {
  width: 16px;
  height: 16px;
}

.institution__arrow--prev { left: 0.75rem; }
.institution__arrow--next { right: 0.75rem; }

.institution__dots {
  position: absolute;
  z-index: 3;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.4rem;
  background: rgba(10, 10, 10, 0.4);
  padding: 0.4rem;
  border-radius: 999px;
}

.institution__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.institution__dot.is-active {
  background: var(--white);
  transform: scale(1.3);
}

.pillars {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pillar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--border);
}

.pillar:first-child { padding-top: 0; }
.pillar:last-child { border-bottom: none; }

.pillar__num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brass-dark);
  line-height: 1;
}

.pillar__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}

.pillar__text {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

.mv-cards {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

@media (min-width: 640px) {
  .mv-cards { grid-template-columns: 1fr 1fr; }
}

.mv-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 2px solid var(--brass);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .mv-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }
}

.mv-card__icon {
  width: 2.9rem;
  height: 2.9rem;
  clip-path: polygon(50% 0%, 100% 22%, 100% 78%, 50% 100%, 0% 78%, 0% 22%);
  background: var(--ink);
  color: var(--brass-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.mv-card__icon svg { width: 1.4rem; height: 1.4rem; }

.mv-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.mv-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

/* ---------- 10. Formación militar (mapa secuencial + detalle) ---------------- */
.phase-map {
  margin-bottom: 1.75rem;
}

.phase-map__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

/* La línea corre de centro a centro del primer y último círculo (cada nodo ocupa
   1/3 del track y su círculo queda centrado en su columna), no de borde a borde. */
.phase-map__track::before,
.phase-map__track::after {
  content: "";
  position: absolute;
  top: 1.35rem;
  left: calc(100% / 6);
  right: calc(100% / 6);
  height: 2px;
  z-index: 0;
}

.phase-map__track::before {
  background: var(--border);
}

.phase-map__track::after {
  background: var(--maroon);
  transform-origin: left center;
  transform: scaleX(var(--progress, 0.333));
  transition: transform 250ms cubic-bezier(0.77, 0, 0.175, 1);
}

.phase-map__node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.4rem;
  margin: -0.4rem;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 200ms var(--ease);
}

.phase-map__node:active {
  transform: scale(0.97);
}

.phase-map__node:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

.phase-map__num {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: border-color 200ms var(--ease), color 200ms var(--ease),
    background-color 200ms var(--ease), box-shadow 200ms var(--ease),
    transform 200ms var(--ease);
}

.phase-map__grade {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass-dark);
  transition: opacity 200ms var(--ease), color 200ms var(--ease);
}

.phase-map__name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  transition: opacity 200ms var(--ease), color 200ms var(--ease);
}

.phase-map__node:not(.is-active) .phase-map__grade,
.phase-map__node:not(.is-active) .phase-map__name {
  opacity: 0.55;
}

.phase-map__node.is-active .phase-map__num {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.14);
}

@media (hover: hover) and (pointer: fine) {
  .phase-map__node:hover {
    background: var(--paper-2);
  }

  .phase-map__node:not(.is-active):hover .phase-map__num {
    border-color: var(--brass);
    color: var(--brass-dark);
    transform: scale(1.06);
  }

  .phase-map__node:not(.is-active):hover .phase-map__grade,
  .phase-map__node:not(.is-active):hover .phase-map__name {
    opacity: 0.85;
  }
}

.phase-detail {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 2px solid var(--brass);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.phase-detail__body {
  transition: opacity 180ms ease, filter 180ms ease;
}

.phase-detail__body.is-swapping {
  opacity: 0;
  filter: blur(4px);
}

.phase-detail__body p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.phase-detail__body p:last-of-type {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .phase-detail__body,
  .phase-map__track::after {
    transition-duration: 0ms;
  }
}

@media (max-width: 560px) {
  .phase-map__grade,
  .phase-map__name {
    font-size: 0.7rem;
  }
  .phase-map__name {
    font-size: 0.82rem;
  }
}

.phase__areas {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.phase__areas-label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brass-dark);
  margin-bottom: 0.65rem;
}

.phase__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.phase__tags span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brass-dark);
  background: var(--paper-2);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem 0.35rem 1.05rem;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}

/* ---------- 10b. Formación integral (cápsulas proporcionales) ---------------- */
.formation__list {
  display: grid;
  gap: 1.25rem;
}

.formation__list--grid {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  align-items: start;
}

.formation__item {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.formation__item:hover {
  border-color: var(--brass);
  border-top-color: var(--brass);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.formation__item-icon {
  width: 2.6rem;
  height: 2.6rem;
  clip-path: polygon(50% 0%, 100% 22%, 100% 78%, 50% 100%, 0% 78%, 0% 22%);
  background: var(--paper-2);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.formation__item-icon svg { width: 1.3rem; height: 1.3rem; }

.formation__item h4 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.formation__item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- 10c. Lema institucional + Manual de convivencia (integrados a las cápsulas) --- */
.formation__item--motto .motto__list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.formation__item--motto .motto__row dt {
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brass-dark);
  margin-bottom: 0.15rem;
}

.formation__item--motto .motto__row dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.formation__item--handbook {
  flex-wrap: wrap;
}

.formation__item--handbook .handbook__btn {
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}

.handbook__btn svg {
  transition: transform 200ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .handbook__btn:hover svg {
    transform: translateY(3px);
  }
}

.handbook__btn.is-downloading {
  pointer-events: none;
  border-color: var(--brass);
  color: var(--brass-dark);
}

.handbook__btn.is-downloading svg {
  animation: handbook-bounce 0.6s var(--ease) infinite;
}

@keyframes handbook-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---------- 11. Vida académica (masonry editorial) --------------------------- */
.life-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 160px;
  grid-auto-flow: row dense;
}

@media (min-width: 700px) {
  .life-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 130px;
  }

  /* Reordena la composición (independiente del orden de lectura en el HTML)
     para que el bloque destacado no quede siempre arriba a la izquierda. */
  .life-item--a { order: 2; }
  .life-item--b { order: 4; }
  .life-item--c { order: 1; }
  .life-item--d { order: 5; }
  .life-item--e { order: 3; }
  .life-item--f { order: 6; }
}

.life-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  color: var(--text-inverse);
}

/* .life-item también lleva la clase .ph (placeholder) cuando falta la foto real.
   .ph por sí sola es position:absolute/inset:0 pensada para usarse en un div
   HIJO de un contenedor ya posicionado; aquí coincide sobre el mismo elemento
   que .life-item, así que sin esto .ph gana el empate de especificidad y la
   tarjeta se posiciona contra la sección completa en vez de su celda del grid. */
.life-item.ph {
  position: relative;
  inset: auto;
}

.life-item--a { grid-column: span 2; grid-row: span 2; }
.life-item--b { grid-column: span 1; grid-row: span 1; }
.life-item--c { grid-column: span 1; grid-row: span 1; }
.life-item--d { grid-column: span 2; grid-row: span 1; }
.life-item--e { grid-column: span 1; grid-row: span 1; }
.life-item--f { grid-column: span 1; grid-row: span 1; }

@media (min-width: 700px) {
  .life-item--a { grid-column: span 2; grid-row: span 2; }
  .life-item--b { grid-column: span 1; grid-row: span 1; }
  .life-item--c { grid-column: span 1; grid-row: span 1; }
  .life-item--d { grid-column: span 1; grid-row: span 2; }
  .life-item--e { grid-column: span 1; grid-row: span 1; }
  .life-item--f { grid-column: span 1; grid-row: span 1; }
}

.life-item__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(0deg, rgba(10, 10, 10, 0.85), transparent);
}

/* ---------- 12. Placeholders fotográficos ------------------------------------ */
/*
  .ph = panel de marcador de posición para fotografías institucionales pendientes.
  Se ve intencional (patrón + escudo sutil) y desaparece automáticamente en cuanto
  se agrega una imagen real vía <img>: si la imagen carga, cubre el placeholder;
  si el archivo no existe todavía, el fondo decorativo permanece visible.
*/
.ph {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}

.ph svg {
  position: relative;
  width: 20%;
  min-width: 34px;
  max-width: 72px;
  height: auto;
  color: rgba(255, 255, 255, 0.25);
}

.ph--light {
  background: var(--paper-2);
}

.ph--light svg {
  color: rgba(17, 24, 39, 0.18);
}

.media-frame {
  position: relative;
}

.media-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 13. Galería + Lightbox -------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

.gallery__item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: none;
  padding: 0;
  width: 100%;
  transition: transform 160ms var(--ease);
}

/* Foto destacada 2x2: con 21 fotos suma 24 celdas, que llenan filas
   completas en 2, 3 y 4 columnas sin dejar huecos al final. */
.gallery__item--feature {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery__item:active {
  transform: scale(0.96);
}

.gallery__item img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.gallery__item:hover img,
.gallery__item:focus-visible img {
  transform: scale(1.06);
}

.gallery__zoom {
  position: absolute;
  z-index: 2;
  top: 0.6rem;
  right: 0.6rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.25s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .gallery__zoom {
    opacity: 0;
  }

  .gallery__item:hover .gallery__zoom,
  .gallery__item:focus-visible .gallery__zoom {
    opacity: 1;
  }
}

.gallery__zoom svg { width: 16px; height: 16px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 10, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms var(--ease), visibility 0s linear 200ms;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms var(--ease), visibility 0s linear 0s;
}

.lightbox__figure {
  position: relative;
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  transform: scale(0.95);
  transition: transform 220ms var(--ease);
}

.lightbox.is-open .lightbox__figure {
  transform: scale(1);
}

.lightbox__figure img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 6px;
  object-fit: contain;
}

.lightbox__caption {
  color: var(--text-inverse-muted);
  text-align: center;
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: fixed;
  color: var(--text-inverse);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 150ms var(--ease);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.6);
}

.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.lightbox__close:active {
  transform: scale(0.9);
}

.lightbox__prev:active,
.lightbox__next:active {
  transform: translateY(-50%) scale(0.9);
}

.lightbox__close svg,
.lightbox__prev svg,
.lightbox__next svg { width: 20px; height: 20px; }

/* ---------- 14. Admisiones ----------------------------------------------------- */
.admissions__grid {
  display: grid;
  /* minmax(0,1fr): sin esto la columna crece al ancho mínimo del formulario
     y en celulares de 320 px la página se desborda hacia los lados */
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

@media (min-width: 960px) {
  .admissions__grid {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 3.5rem;
    align-items: start;
  }
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
}

.step__num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brass-light);
  font-family: var(--font-head);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step h3 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  position: relative;
}

@media (min-width: 640px) {
  .form-card { padding: 2.5rem; }
}

.form-card__badge {
  position: absolute;
  top: -1rem;
  left: 2rem;
  background: var(--brass);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 1.05rem 0.5rem 1.35rem;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  gap: 1.35rem;
  margin-top: 1rem;
}

@media (min-width: 560px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}

.field { display: flex; flex-direction: column; }

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.field input,
.field select {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--white);
  min-height: 48px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input:focus,
.field select:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
  outline: none;
}

.field input.is-invalid,
.field select.is-invalid {
  border-color: var(--maroon);
}

.field__error {
  display: none;
  color: var(--maroon);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.field input.is-invalid ~ .field__error,
.field select.is-invalid ~ .field__error {
  display: block;
}

.form-note {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 1rem;
  line-height: 1.6;
}

.success-box {
  display: none;
  align-items: flex-start;
  gap: 0.85rem;
  background: #eef7ee;
  border: 1px solid #bfe3bf;
  color: #204d20;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-top: 1.25rem;
}

.success-box.is-visible { display: flex; }

.success-box svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.success-box strong { display: block; margin-bottom: 0.2rem; }
.success-box p { font-size: 0.9rem; line-height: 1.5; }

/* ---------- 15. Contacto -------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

@media (min-width: 960px) {
  .contact__grid { grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: stretch; }
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-list__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.contact-list__item a { overflow-wrap: anywhere; }

.contact-list__icon {
  width: 2.9rem;
  height: 2.9rem;
  clip-path: polygon(50% 0%, 100% 22%, 100% 78%, 50% 100%, 0% 78%, 0% 22%);
  background: var(--ink);
  color: var(--brass-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-list__icon svg { width: 1.3rem; height: 1.3rem; }

.contact-list__item h3 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.contact-list__item p,
.contact-list__item a {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.contact-list__item a:hover {
  color: var(--ink);
}

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 320px;
  box-shadow: var(--shadow-md);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* ---------- 16. Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--ink);
  color: var(--text-inverse-muted);
  padding-top: clamp(3.5rem, 6vw, 5.5rem);
  border-top: 1px solid var(--brass);
  position: relative;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  gap: 2.75rem;
  padding-bottom: 3rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1080px) {
  .footer-grid { grid-template-columns: 1.3fr 0.8fr 0.9fr 1fr; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.footer-brand__crest { width: 2.5rem; height: 2.5rem; flex-shrink: 0; }
.footer-brand__crest svg,
.footer-brand__crest img { width: 100%; height: 100%; object-fit: contain; display: block; }

.footer-brand__text {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--white);
  font-size: 0.85rem;
  line-height: 1.3;
}

.footer-brand__text span {
  display: block;
  color: var(--text-inverse-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.footer-about p {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 30rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.footer-social a {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 150ms var(--ease);
}

.footer-social a:hover {
  background: var(--brass-light);
  color: var(--ink);
}

.footer-social a:active {
  transform: scale(0.9);
}

.footer-social svg { width: 1rem; height: 1rem; }

.footer-heading {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-light);
  margin-bottom: 1.35rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.9rem;
}

.footer-links a { transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--white); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.88rem;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  line-height: 1.5;
}

.footer-contact svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--text-inverse-muted);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
  font-size: 0.82rem;
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ---------- 17. WhatsApp flotante --------------------------------------------------- */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px -8px rgba(37, 211, 102, 0.55);
  transition: transform 160ms var(--ease);
  animation: wa-pulse 2.6s ease-out 3;
}

.whatsapp-fab:hover {
  transform: scale(1.08);
}

.whatsapp-fab:active {
  transform: scale(0.94);
}

.whatsapp-fab svg {
  width: 32px;
  height: 32px;
  color: var(--white);
}

@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab { animation: none; }
}

/* ---------- 18. Animación de aparición al hacer scroll ------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* el retraso escalonado solo aplica a la entrada; al terminar, main.js añade
   .is-revealed y hover/press responden al instante */
.reveal-stagger > .reveal {
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal-stagger > .reveal.is-revealed {
  transition-delay: 0ms;
}

/* .reveal pisa la transición propia de .gallery__item: el press (:active)
   debe seguir siendo de 160ms, no de 0.7s (una vez terminada la entrada) */
.gallery__item.reveal.is-revealed {
  transition: transform 160ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 19. Utilidades tipográficas ---------------------------------------------- */
.text-brass { color: var(--brass); }
.text-inverse-muted { color: var(--text-inverse-muted); }
