/* ═══════════════════════════════════════════════════════════════
   MPS DESIGN SYSTEM — Design Tokens & Variables
   Mysore Public School · Premium Website
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────── FONTS ──────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

/* ──────────────────── ROOT TOKENS ──────────────────── */
:root {
  /* === COLORS === */
  --color-royal:        #0F3D91;
  --color-royal-dark:   #0a2d6e;
  --color-royal-light:  #1a52b8;
  --color-white:        #FFFFFF;
  --color-gold:         #C9A227;
  --color-gold-light:   #d9b347;
  --color-gold-dark:    #a8861f;
  --color-navy:         #111827;
  --color-navy-mid:     #1E2D4E;
  --color-navy-soft:    #243358;
  --color-slate:        #374151;
  --color-mist:         #F8F9FC;
  --color-mist-dark:    #F1F3F8;
  --color-border:       #E5E7EB;
  --color-border-dark:  #D1D5DB;
  --color-text:         #111827;
  --color-text-mid:     #374151;
  --color-text-soft:    #6B7280;
  --color-text-ghost:   #9CA3AF;

  /* Glass */
  --glass-bg:           rgba(255, 255, 255, 0.06);
  --glass-bg-strong:    rgba(255, 255, 255, 0.10);
  --glass-border:       rgba(255, 255, 255, 0.14);
  --glass-shadow:       0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-blur:         backdrop-filter: blur(20px) saturate(180%);

  /* === TYPOGRAPHY === */
  --font-display:       'Cormorant Garamond', Georgia, serif;
  --font-body:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Scale */
  --text-xs:            0.75rem;      /* 12px */
  --text-sm:            0.875rem;     /* 14px */
  --text-base:          1rem;         /* 16px */
  --text-lg:            1.125rem;     /* 18px */
  --text-xl:            1.25rem;      /* 20px */
  --text-2xl:           1.5rem;       /* 24px */
  --text-3xl:           1.875rem;     /* 30px */
  --text-4xl:           2.25rem;      /* 36px */
  --text-5xl:           3rem;         /* 48px */
  --text-6xl:           3.75rem;      /* 60px */
  --text-7xl:           4.5rem;       /* 72px */
  --text-8xl:           6rem;         /* 96px */

  /* Line Heights */
  --leading-tight:      1.1;
  --leading-snug:       1.25;
  --leading-normal:     1.5;
  --leading-relaxed:    1.7;
  --leading-loose:      1.9;

  /* Letter Spacing */
  --tracking-tightest:  -0.03em;
  --tracking-tight:     -0.02em;
  --tracking-normal:    0;
  --tracking-wide:      0.05em;
  --tracking-wider:     0.1em;
  --tracking-widest:    0.2em;

  /* === SPACING === */
  --space-1:    0.25rem;    /* 4px */
  --space-2:    0.5rem;     /* 8px */
  --space-3:    0.75rem;    /* 12px */
  --space-4:    1rem;       /* 16px */
  --space-5:    1.25rem;    /* 20px */
  --space-6:    1.5rem;     /* 24px */
  --space-8:    2rem;       /* 32px */
  --space-10:   2.5rem;     /* 40px */
  --space-12:   3rem;       /* 48px */
  --space-16:   4rem;       /* 64px */
  --space-20:   5rem;       /* 80px */
  --space-24:   6rem;       /* 96px */
  --space-32:   8rem;       /* 128px */
  --space-40:   10rem;      /* 160px */

  /* === RADIUS === */
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-2xl:   24px;
  --radius-3xl:   32px;
  --radius-full:  9999px;

  /* === SHADOWS === */
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.14);
  --shadow-xl:    0 16px 48px rgba(0,0,0,0.18);
  --shadow-2xl:   0 24px 64px rgba(0,0,0,0.22);
  --shadow-gold:  0 8px 32px rgba(201,162,39,0.25);
  --shadow-blue:  0 8px 32px rgba(15,61,145,0.4);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.1);
  --shadow-depth-1:  0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-depth-2:  0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --shadow-depth-3:  0 20px 56px rgba(0,0,0,0.18), 0 6px 16px rgba(0,0,0,0.10);
  --shadow-depth-4:  0 32px 80px rgba(0,0,0,0.24), 0 12px 28px rgba(0,0,0,0.14);
  --shadow-gold-glow: 0 0 40px rgba(201,162,39,0.22), 0 8px 24px rgba(201,162,39,0.12);
  --shadow-royal-glow: 0 0 40px rgba(15,61,145,0.30), 0 8px 24px rgba(15,61,145,0.15);

  /* Ambient Colors */
  --ambient-royal:   rgba(15,61,145,0.18);
  --ambient-gold:    rgba(201,162,39,0.14);
  --ambient-white:   rgba(255,255,255,0.06);
  --glass-ultra:     rgba(255,255,255,0.04);
  --glass-border-glow: rgba(201,162,39,0.18);

  /* 3D & Focus Micro-Tokens */
  --perspective-hero: 1200px;
  --perspective-card: 800px;
  --glow-gold-subtle: 0 0 24px rgba(201,162,39,0.18);
  --glow-royal-subtle: 0 0 24px rgba(15,61,145,0.22);
  --focus-ring:       0 0 0 3px rgba(201,162,39,0.45);

  /* === TRANSITIONS === */
  --ease-smooth:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:       cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:    cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-premium:   cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-elastic:   cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --dur-fast:       150ms;
  --dur-base:       250ms;
  --dur-slow:       400ms;
  --dur-slower:     600ms;
  --dur-slowest:    800ms;

  /* === LAYOUT === */
  --container-max:  1280px;
  --container-sm:   640px;
  --container-md:   768px;
  --container-lg:   1024px;
  --nav-h:          80px;

  /* === Z-INDEX === */
  --z-base:     0;
  --z-raised:   10;
  --z-overlay:  100;
  --z-sticky:   1000;
  --z-modal:    2000;
  --z-toast:    3000;
  --z-cursor:   99999;
  --z-loader:   100000;
}

/* ──────────────────── RESET & BASE ──────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}

/* Cursor: none on desktop only */
@media (hover: none) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

/* ──────────────────── ACCESSIBILITY ──────────────────── */
.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;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: var(--z-loader);
  padding: var(--space-3) var(--space-6);
  background: var(--color-royal);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-fade,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-particles { display: none !important; }
  .cursor { display: none !important; }
}

/* ──────────────────── TYPOGRAPHY SYSTEM ──────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-navy);
}

.h1, h1 {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl));
  font-weight: 600;
}

.h2, h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}

.h3, h3 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
}

.h2 em, h2 em {
  font-style: italic;
  color: var(--color-royal);
}

.h2-light em {
  color: var(--color-gold);
}

.h2-light {
  color: var(--color-white);
}

/* Eyebrow / Label */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-royal);
  margin-bottom: var(--space-4);
  display: block;
}

.eyebrow-gold { color: var(--color-gold); }

/* Section subtitle */
.section-sub {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-mid);
  max-width: 60ch;
  margin-top: var(--space-4);
}

.section-sub-light { color: rgba(255,255,255,0.75); }

/* ──────────────────── LAYOUT PRIMITIVES ──────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.section {
  padding: clamp(var(--space-16), 8vw, var(--space-32)) 0;
  position: relative;
}

.section-dark {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.section-blue {
  background: linear-gradient(135deg, var(--color-royal-dark) 0%, var(--color-royal) 60%, var(--color-navy-mid) 100%);
  color: var(--color-white);
}

.section-alt {
  background-color: var(--color-mist);
}

.section-hd {
  text-align: center;
  margin-bottom: clamp(var(--space-12), 5vw, var(--space-20));
}

.section-hd .section-sub {
  margin: var(--space-4) auto 0;
}

.section-hd-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

/* Two-column layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}

.two-col-layout--rev { direction: rtl; }
.two-col-layout--rev > * { direction: ltr; }

.col-text { display: flex; flex-direction: column; }
.col-visual { position: relative; }

/* ──────────────────── MEDIA SLOT SYSTEM ──────────────────── */
.media-slot {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #1a2744 0%, #0d1a35 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px dashed rgba(201,162,39,0.35);
  transition: border-color var(--dur-base) var(--ease-smooth);
}

.media-slot::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 default */
}

.media-slot[data-h][data-w]::before {
  padding-top: calc(attr(data-h) / attr(data-w) * 100%);
}

/* Aspect ratio variants via class */
.hero-bg-slot::before        { padding-top: 56.25%; }  /* 16:9 */
.acad-slot::before            { padding-top: 56.25%; }  /* 16:9 */
.boarding-slot::before        { padding-top: 75%; }     /* 4:3  */
.principal-slot::before       { padding-top: 133.33%; } /* 3:4  */
.tour-slot::before            { padding-top: 42.86%; }  /* 21:9 */
.fac-slot::before             { padding-top: 75%; }     /* 4:3  */
.sl-slot::before              { padding-top: 100%; }    /* 1:1  */
.news-slot::before            { padding-top: 56.25%; }  /* 16:9 */
.gal-slot::before             { padding-top: 75%; }     /* 4:3  */
.tst-avatar::before           { padding-top: 100%; }    /* 1:1  */

/* Gallery overrides */
.gal-tall .gal-slot::before   { padding-top: 150%; }   /* 2:3  */
.gal-wide .gal-slot::before   { padding-top: 56.25%; }  /* 16:9 */
.sl-tile-tall .sl-slot::before { padding-top: 150%; }  /* 2:3  */

.slot-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  text-align: center;
  color: rgba(201,162,39,0.7);
}

.slot-icon {
  opacity: 0.5;
  flex-shrink: 0;
}

.slot-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(201,162,39,0.85);
  line-height: 1.3;
}

.slot-dims {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

/* Build-time notes to whoever was wiring the slots up, e.g.
   "Replace: window.MPS_MEDIA['about-history-campus'] = {src:'...'}".
   These were rendering to real visitors on About, Academics, Boarding,
   Facilities and Home wherever a slot had no image yet. Every slot is now
   fillable from Admin > Media Slots (which names each one properly), so the
   on-page note is both redundant and unprofessional. The markup stays for
   whoever reads the source; it just never reaches the page. */
.slot-hint {
  display: none;
}

/* When real image is loaded, hide slot UI */
.media-slot.has-media .slot-inner { display: none; }
.media-slot.has-media {
  border-color: transparent;
  background: none;
}

.media-slot img,
.media-slot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Full-bleed (hero, tour) — no radius */
.media-slot.full-bleed {
  border-radius: 0;
  border: none;
}

/* Tst avatar */
.tst-avatar {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tst-avatar::before { padding-top: 100%; }

/* ──────────────────── BUTTONS ──────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition:
    background-color var(--dur-base) var(--ease-smooth),
    color var(--dur-base) var(--ease-smooth),
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-base) var(--ease-smooth),
    border-color var(--dur-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease-premium);
  pointer-events: none;
}

.btn:hover::before {
  left: 140%;
}

.btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

.btn:active {
  transform: translateY(1.5px) scale(0.985);
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--color-royal) 0%, var(--color-royal-light) 100%);
  color: var(--color-white);
  box-shadow: var(--shadow-blue), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-royal-light) 0%, var(--color-royal) 100%);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15,61,145,0.5), inset 0 1px 0 rgba(255,255,255,0.35);
}

/* Gold */
.btn-gold {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  color: var(--color-navy);
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(201,162,39,0.45), inset 0 1px 0 rgba(255,255,255,0.55);
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--color-royal);
  border: 1.5px solid var(--color-royal);
}
.btn-outline:hover {
  background: var(--color-royal);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15,61,145,0.25);
}

/* Ghost (light) */
.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
  border: 1.5px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(201,162,39,0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

/* Sizes */
.btn-lg { padding: 1.05rem 2.5rem; font-size: var(--text-base); }
.btn-sm { padding: 0.6rem 1.4rem; font-size: var(--text-xs); }

/* ──────────────────── GLASS CARDS ──────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  transition:
    transform var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease-smooth),
    border-color var(--dur-base) var(--ease-smooth);
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.22);
}

.glass-badge {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--glass-shadow);
}

.glass-card-blue {
  background: linear-gradient(135deg, var(--color-royal-dark) 0%, var(--color-navy-mid) 100%);
  border-radius: var(--radius-3xl);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-2xl);
}

/* ──────────────────── FLOAT BADGE ──────────────────── */
.float-badge {
  position: absolute;
  bottom: -1.5rem;
  right: -1.5rem;
  z-index: var(--z-raised);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fb-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-white);
}

.fb-sub {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

/* ──────────────────── CUSTOM CURSOR ──────────────────── */
#cursor,
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none !important;
  z-index: var(--z-cursor);
  /* Force own GPU compositing layer so z-index is respected absolutely */
  will-change: transform;
  transform: translateZ(0);
  /* NO mix-blend-mode — it creates a stacking context that defeats z-index */
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold);
  pointer-events: none !important;
  z-index: var(--z-cursor);
  will-change: transform;
  transform: translate(-50%, -50%);
  transition: width 120ms, height 120ms, background-color 150ms;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,162,39,0.6);
  pointer-events: none !important;
  z-index: var(--z-cursor);
  will-change: transform;
  transform: translate(-50%, -50%);
  transition:
    width 250ms var(--ease-smooth),
    height 250ms var(--ease-smooth),
    border-color 250ms,
    opacity 250ms;
}

.cursor.is-hover .cursor-dot {
  width: 12px;
  height: 12px;
  background: var(--color-royal-light);
}

.cursor.is-hover .cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(15,61,145,0.55);
}

.cursor.is-clicking .cursor-dot {
  transform: translate(-50%, -50%) scale(0.75);
  background: var(--color-gold-dark);
}


/* ──────────────────── PAGE LOADER ──────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-slower) var(--ease-smooth), visibility var(--dur-slower);
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* The fade above is a CSS transition, and a transition does not run while the
   tab is not compositing — open the site in a background tab and come back and
   the loader can still be sitting there at full opacity, mid-transition,
   covering the page. `display: none` is not a transition, so this is the state
   that actually guarantees the loader is gone. main.js adds it once the fade
   has either finished or timed out. */
.page-loader.is-gone {
  display: none !important;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

.loader-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  animation: loaderFadeIn 0.6s ease both;
}

.loader-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loader-mps {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: var(--tracking-wider);
}

.loader-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  letter-spacing: var(--tracking-wide);
}

.loader-circle {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: loaderCircle 1.2s ease forwards 0.2s;
  transform-origin: center;
}

.loader-bar-track {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-royal), var(--color-gold));
  border-radius: var(--radius-full);
  transition: width 0.05s linear;
}

@keyframes loaderCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes loaderFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── COMPLETE-IMAGE DISPLAY (default) ───────────────────────────────────────
   Slots render their photograph with object-fit:contain so the WHOLE image is
   visible whatever its shape - portrait, landscape, square or anything odd.
   Cropping now only happens when an admin picks "Fill frame" for that slot.
   The letterbox is filled by a heavily blurred copy of the same photograph, so
   the frame still looks composed instead of empty, and no second asset and no
   stock imagery is involved. */
.mps-fit-contain { position: relative; overflow: hidden; background: #0a1633; }
.mps-fit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) saturate(130%) brightness(.6);
  transform: scale(1.3);
  z-index: 0;
  pointer-events: none;
}
/* The photograph itself. It MUST stay absolutely positioned inside the slot.
   This rule used to say `position: relative`, purely to lift the photo above
   the backdrop's z-index, and that one word was the source of the broken
   facility/boarding tiles: `.media-slot` is a flex container whose height is
   set by an aspect-ratio spacer (`::before`, e.g. padding-top 56.25%). A
   relatively-positioned image is back IN FLOW, so it becomes a second flex
   item and its own intrinsic ratio — not the spacer — decides how tall the
   slot ends up. Measured on facilities.html at 1280px before this fix:
   dining-hall rendered 517x775 instead of 517x291 (a portrait photo), and
   boarding-facility-1/2 rendered 1201x1476 each. The blurred backdrop is
   `inset: 0`, so it grew with the box and bled across the neighbouring tile.
   Absolute + z-index gives the same stacking with none of that: every slot
   keeps the frame its design asked for, and the backdrop can never reach
   outside it. */
.mps-fit-contain > img:not(.mps-fit-bg) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mps-fit-bg { transition: none; }
}
/* ─── LOADER ─────────────────────────────────────────────────────────────────
   The original loader, restored. An earlier pass added a halo, a sweeping ring
   and an entrance animation; it read as busier, not more premium, so it is
   gone. The only thing kept from that work is the fade-out, and the crest is
   the real uploaded logo (cms.js swaps it) rather than a lettered monogram. */
.page-loader { transition: opacity .45s var(--ease-premium), visibility .45s; }
.loader-logo > img,
.loader-logo > svg { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .page-loader { transition: none; }
}

/* ─── MULTI-IMAGE SLOT (carousel) ────────────────────────────────────────────
   Every frame is stacked in the same box and only opacity moves, so there is no
   scrolling container, no layout shift and nothing for a touch gesture to fight
   with — the page scrolls normally over the top of it. Photographs obey the
   same contain-by-default rule as single-image slots. */
.mps-carousel { position: relative; overflow: hidden; }
.mps-carousel-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease-premium);
  pointer-events: none;
}
.mps-carousel-frame.is-active { opacity: 1; }
.mps-carousel-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  max-width: 100%;
  max-height: 100%;
}
/* Keep the slot's own height: the frames are absolute, so without this the box
   would collapse to nothing. */
.mps-carousel::after { content: ''; display: block; padding-top: 62%; }
.media-slot.mps-carousel { height: auto; }

@media (prefers-reduced-motion: reduce) {
  /* cms.js also stops advancing; this makes the first frame static regardless. */
  .mps-carousel-frame { transition: none; }
}