/* =====================================================================
   Ambition India School — Design System  (base.css)
   Editorial academy: navy + ivory, gold used as a hairline accent only.
   Motif: the ARCH (a gateway — "your child's journey begins here").
   ===================================================================== */

:root {
  /* colour */
  --navy: #0B1F3A; --navy-2: #071426; --navy-3: #13294B; --navy-ink: #0E2647;
  --gold: #C9A44C; --gold-2: #B08A2E; --gold-soft: #EFE4C8; --gold-wash: #F7F1E1;
  --ivory: #FAF7F0; --paper: #FFFFFF; --sand: #F1ECE1;
  --ink: #14213D; --slate: #5A6478; --mute: #8A93A6; --line: #E7E1D3; --line-2: #D9D2C0;
  --wa: #1FA855; --ok: #157347; --err: #B42318;

  /* type */
  --serif: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: .78rem; --fs-sm: .9rem; --fs-base: 1.0625rem; --fs-md: 1.2rem;
  --fs-lg: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --fs-xl: clamp(1.8rem, 1.3rem + 2.2vw, 2.75rem);
  --fs-2xl: clamp(2.3rem, 1.5rem + 3.6vw, 4.2rem);
  --fs-3xl: clamp(2.7rem, 1.6rem + 5vw, 5.6rem);

  /* space & shape */
  --gutter: clamp(16px, 4vw, 40px); --max: 1240px; --max-narrow: 820px;
  --sec: clamp(72px, 9vw, 136px);
  --r: 2px; --r-arch: 999px 999px 0 0;
  --shadow: 0 1px 2px rgba(11,31,58,.05), 0 8px 24px -12px rgba(11,31,58,.18);
  --shadow-lg: 0 30px 60px -30px rgba(11,31,58,.35);
  --ease: cubic-bezier(.2,.7,.1,1); --ease-in-out: cubic-bezier(.65,0,.35,1);
  --header-h: 84px;
}

/* ---------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 400 var(--fs-base)/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold-soft); color: var(--navy); }
.sr-only { position: absolute !important; 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; left: 12px; top: -60px; z-index: 1000; background: var(--gold); color: var(--navy); padding: 10px 16px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- layout */
.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: calc(var(--max-narrow) + var(--gutter) * 2); }
.section { padding-block: var(--sec); position: relative; }
.section-tight { padding-block: calc(var(--sec) * .6); }
.section-ivory { background: var(--ivory); }
.section-paper { background: var(--paper); }
.section-sand { background: var(--sand); }
.section-navy { background: var(--navy); color: #E6EAF2; }
.section-navy h2, .section-navy h3 { color: #fff; }
.grid { display: grid; gap: clamp(20px, 3vw, 36px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.split-wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
@media (max-width: 900px) { .split, .split-wide { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ---------- typography */
.eyebrow { display: inline-flex; align-items: center; gap: .75em; font: 700 var(--fs-xs)/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 1.4rem; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.eyebrow .num { font-family: var(--serif); letter-spacing: .05em; font-size: .95rem; font-weight: 600; color: var(--navy); }
.section-navy .eyebrow { color: var(--gold); }
.section-navy .eyebrow .num { color: #fff; }
.display { font-family: var(--serif); font-size: var(--fs-2xl); font-weight: 600; color: var(--navy); line-height: 1.06; letter-spacing: -.02em; }
.display em, .h2 em, .h1 em { font-style: italic; font-weight: 500; color: var(--gold-2); }
.section-navy .display, .section-navy .h2 { color: #fff; }
.section-navy .display em, .section-navy .h2 em { color: var(--gold); }
.h1 { font-family: var(--serif); font-size: var(--fs-3xl); color: var(--navy); line-height: 1.02; letter-spacing: -.025em; }
.h2 { font-family: var(--serif); font-size: var(--fs-xl); color: var(--navy); }
.h3 { font-family: var(--serif); font-size: var(--fs-lg); color: var(--navy); }
.h4 { font: 700 1.05rem/1.35 var(--sans); color: var(--navy); }
.lead { font-size: var(--fs-md); line-height: 1.65; color: var(--slate); max-width: 62ch; }
.section-navy .lead { color: #B8C2D6; }
.muted { color: var(--slate); }
.small { font-size: var(--fs-sm); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head.center { margin-inline: auto; }
.section-head .lead { margin-top: 1.1rem; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head-row .section-head { margin-bottom: 0; }
.prose { max-width: 68ch; color: #2A3550; }
.prose h2 { font-family: var(--serif); font-size: var(--fs-lg); color: var(--navy); margin: 1.8em 0 .6em; }
.prose h3 { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); margin: 1.6em 0 .5em; }
.prose h4 { font-weight: 700; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .35em 0; }
.prose ul li::marker { color: var(--gold); }
.prose blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.4em; border-left: 2px solid var(--gold); font: italic 1.25rem/1.55 var(--serif); color: var(--navy); }
.prose img { margin: 1.4em 0; }
.prose a { color: var(--navy); font-weight: 600; text-decoration-color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .6em .5em; text-align: left; }
.prose .ql-align-center { text-align: center; } .prose .ql-align-right { text-align: right; } .prose .ql-align-justify { text-align: justify; }
.section-navy .prose { color: #C9D1E0; }
.rule { width: 56px; height: 1px; background: var(--gold); border: 0; margin: 1.6rem 0; }
.rule.center { margin-inline: auto; }

/* ---------- buttons */
.btn { --bg: var(--navy); --fg: #fff; --bd: var(--navy); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 52px; padding: .9em 1.6em; background: var(--bg); color: var(--fg); border: 1px solid var(--bd); border-radius: var(--r); font: 700 .95rem/1.1 var(--sans); letter-spacing: .02em; text-decoration: none; overflow: hidden; isolation: isolate; transition: color .35s var(--ease), border-color .35s var(--ease), transform .2s; white-space: nowrap; }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--hover, var(--gold)); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); z-index: -1; }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:hover, .btn:focus-visible { color: var(--hfg, var(--navy)); border-color: var(--hover, var(--gold)); }
.btn:active { transform: translateY(1px); }
.btn .icon { transition: transform .35s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(4px); }
.btn-gold { --bg: var(--gold); --fg: var(--navy); --bd: var(--gold); --hover: #fff; --hfg: var(--navy); }
.btn-ghost { --bg: transparent; --fg: var(--navy); --bd: var(--navy); --hover: var(--navy); --hfg: #fff; }
.btn-light { --bg: transparent; --fg: #fff; --bd: rgba(255,255,255,.45); --hover: #fff; --hfg: var(--navy); }
.btn-wa { --bg: var(--wa); --fg: #fff; --bd: var(--wa); --hover: #178A45; --hfg: #fff; }
.btn-sm { min-height: 42px; padding: .65em 1.15em; font-size: .88rem; }
.btn-block { width: 100%; }
.link-arrow { display: inline-flex; align-items: center; gap: .55em; font-weight: 700; color: var(--navy); text-decoration: none; padding-bottom: 4px; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 1px no-repeat; transition: background-size .4s var(--ease), gap .3s var(--ease); }
.link-arrow:hover { gap: .9em; background-size: 40% 1px; }
.section-navy .link-arrow { color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- media & frames */
.frame { position: relative; isolation: isolate; }
.frame::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 1px solid var(--gold); z-index: -1; pointer-events: none; transition: inset .6s var(--ease); }
.frame:hover::after { inset: 8px -8px -8px 8px; }
.frame img, .frame picture, .frame .img-fallback { width: 100%; }
.arch { border-radius: var(--r-arch); overflow: hidden; }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.frame.arch-frame::after { border-radius: var(--r-arch); }
.ratio { position: relative; overflow: hidden; background: var(--sand); }
.ratio > picture, .ratio > img, .ratio > .img-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.ratio img { width: 100%; height: 100%; object-fit: cover; }
.ratio-4x3 { aspect-ratio: 4/3; } .ratio-3x2 { aspect-ratio: 3/2; } .ratio-16x9 { aspect-ratio: 16/9; } .ratio-1 { aspect-ratio: 1; } .ratio-4x5 { aspect-ratio: 4/5; } .ratio-3x4 { aspect-ratio: 3/4; }
.img-fallback { display: block; background: var(--sand); }
.img-fallback img { width: 100%; height: 100%; object-fit: cover; }
.zoom img { transition: transform 1.2s var(--ease); }
.zoom:hover img, a:hover .zoom img, a:focus-visible .zoom img { transform: scale(1.05); }
.monogram { display: grid; place-items: center; width: 100%; height: 100%; background: var(--navy); color: var(--gold); font: 600 clamp(2rem, 5vw, 3rem)/1 var(--serif); letter-spacing: .04em; }

/* ---------- chips, badges, tags */
.chip { display: inline-flex; align-items: center; gap: .45em; padding: .45em .95em; border: 1px solid var(--line-2); border-radius: 40px; font: 600 .85rem/1 var(--sans); color: var(--navy); background: transparent; text-decoration: none; transition: background .25s, color .25s, border-color .25s; }
.chip:hover { border-color: var(--navy); }
.chip.is-active, .chip[aria-pressed="true"], .chip[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tag { display: inline-block; font: 700 .7rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); }
.badge-open { display: inline-flex; align-items: center; gap: .6em; padding: .55em 1em .55em .8em; background: var(--navy); color: #fff; font: 700 .78rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; border-radius: 40px; }
.badge-open .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(201,164,76,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(201,164,76,0); } 100% { box-shadow: 0 0 0 0 rgba(201,164,76,0); } }

/* ---------- cards (restrained — mostly flat with hairlines) */
.card { background: var(--paper); border: 1px solid var(--line); padding: clamp(22px, 3vw, 34px); position: relative; }
.card-link { text-decoration: none; display: block; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { display: block; text-decoration: none; color: inherit; }
.card-media .ratio { margin-bottom: 18px; }
.card-media h3 { font-family: var(--serif); font-size: 1.35rem; color: var(--navy); line-height: 1.25; margin: .35em 0 .4em; transition: color .3s; }
.card-media:hover h3 { color: var(--gold-2); }
.card-media p { color: var(--slate); font-size: .97rem; }
.meta { display: flex; flex-wrap: wrap; gap: .4em 1.2em; font-size: .85rem; color: var(--mute); align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: .4em; }

/* ---------- page hero (inner pages) */
.page-hero { position: relative; background: var(--navy); color: #fff; padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 clamp(56px, 7vw, 96px); overflow: hidden; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 500px at 85% 120%, rgba(201,164,76,.16), transparent 60%); z-index: -1; }
.page-hero .container { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 48px; align-items: end; }
.page-hero h1 { font-family: var(--serif); font-size: var(--fs-3xl); line-height: 1; letter-spacing: -.025em; color: #fff; }
.page-hero .lead { color: #B8C2D6; margin-top: 1.4rem; }
.page-hero-media { justify-self: end; width: min(380px, 100%); }
.page-hero-media .arch { aspect-ratio: 3/4; border: 1px solid rgba(201,164,76,.5); padding: 8px; }
.page-hero-media .arch picture, .page-hero-media .arch img { border-radius: var(--r-arch); height: 100%; width: 100%; object-fit: cover; }
.page-hero .hero-lines { position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none; }
@media (max-width: 900px) { .page-hero .container { grid-template-columns: 1fr; } .page-hero-media { display: none; } }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .5em; font-size: .82rem; color: #8E9AB2; margin-bottom: 1.6rem; letter-spacing: .04em; }
.breadcrumbs a { color: #C9D1E0; text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs li { display: inline-flex; gap: .5em; list-style: none; }
.breadcrumbs li + li::before { content: "/"; color: var(--gold); }

/* ---------- sub navigation (tabs for page groups) */
.subnav { position: sticky; top: calc(var(--header-h) - 1px); z-index: 20; background: rgba(250,247,240,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.subnav ul { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; list-style: none; padding: 12px 0; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { white-space: nowrap; }

/* ---------- forms */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field label, .label { display: block; font: 700 .82rem/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--navy); margin-bottom: 8px; }
.field .opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--mute); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 54px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font-size: 1rem; transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230B1F3A' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
.field textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(201,164,76,.35); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.field-error { color: var(--err); font-size: .88rem; margin: 6px 0 0; font-weight: 600; }
.form-note { font-size: .85rem; color: var(--mute); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.alert { display: flex; gap: 12px; padding: 16px 18px; border: 1px solid; font-weight: 500; margin-bottom: 20px; }
.alert-success { background: #EEF7F1; color: var(--ok); border-color: #BFE3CF; }
.alert-error { background: #FDF0EE; color: var(--err); border-color: #F5C2BC; }

/* ---------- empty states */
.empty-state { text-align: center; padding: clamp(40px, 6vw, 72px) 20px; border: 1px dashed var(--line-2); background: var(--paper); }
.empty-state .icon { width: 40px; height: 40px; color: var(--gold); margin: 0 auto 14px; }
.empty-state h3 { font-family: var(--serif); color: var(--navy); font-size: 1.4rem; margin-bottom: .4em; }
.empty-state p { color: var(--slate); max-width: 46ch; margin: 0 auto 1.2em; }

/* ---------- pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: clamp(40px, 5vw, 64px); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 46px; height: 46px; display: inline-grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); text-decoration: none; color: var(--navy); font-weight: 700; }
.pagination a:hover { border-color: var(--navy); }
.pagination .is-current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- reveal animations (JS adds .is-in) */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal="left"] { transform: translateX(-36px); }
.js [data-reveal="right"] { transform: translateX(36px); }
.js [data-reveal="zoom"] { transform: scale(.94); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* clip the children, not the element itself — a fully clipped target is invisible to IntersectionObserver */
.js [data-reveal-clip] > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease-in-out); transition-delay: var(--d, 0s); }
.js [data-reveal-clip].is-in > * { clip-path: inset(0 0 0 0); }
.split-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.split-line > span { display: block; }
.js [data-split] .split-line > span { transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--d, 0s) + var(--i, 0) * .09s); }
.js [data-split].is-in .split-line > span { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js [data-reveal-clip] > *, .js [data-split] .split-line > span { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

[hidden] { display: none !important; }

/* slide-in reveals start offset sideways; never let that create horizontal scroll (clip keeps position:sticky working) */
#main, .site-footer { overflow-x: clip; }
@media (max-width: 600px) { .frame::after { inset: 10px -10px -10px 10px; } .js [data-reveal="left"], .js [data-reveal="right"] { transform: translateY(24px); } }
