/* ============================================================
   Paramitha Sinhala Language School — Design System
   Colours inspired by the Buddhist flag & Sinhalese temple art

   EDITING: Change colours in :root. Change fonts in :root.
   Mobile-first: base styles = mobile, then scale up with min-width queries.
   ============================================================ */

:root {
  --saffron:   #C75B2C;
  --maroon:    #7A2E2E;
  --gold:      #D9A441;
  --teal:      #1F4E45;
  --cream:     #FBF3E4;
  --cream-2:   #F4E8D4;
  --ink:       #2C231B;
  --ink-soft:  #5b4d3f;

  --font-display: 'Fraunces', 'Noto Serif Sinhala', serif;
  --font-body:    'Inter', 'Noto Sans Sinhala', sans-serif;

  --radius: 14px;
  --container: 1180px;
  --gap: 16px;       /* base grid gap */
}

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

html {
  scroll-behavior: smooth;
  background: var(--cream); /* fallback colour behind canvas */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: transparent; /* canvas shows through */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* overflow-x on html, not body — body overflow creates stacking context on mobile Safari */
  /* which breaks sticky z-index. Instead clip at html level. */
  /* NO position:relative — that creates a stacking context that buries the canvas */
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 18px;
}
@media (min-width: 480px)  { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

/* ============================================================
   CANVAS (animated background)
   z-index: 0. Everything else is z-index: 1+ via the slots below.
   ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* All visible page layers sit above the canvas */

#site-footer-slot,
main { position: relative; z-index: 1; }

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
}
.skip-link:focus {
  left: 8px; top: 8px;
  background: var(--maroon); color: #fff;
  padding: 8px 14px; border-radius: 8px;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  background: var(--maroon);
  color: var(--cream);
  font-size: 0.78rem;
  text-align: center;
  padding: 6px 18px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
/* Hide the Sinhala script on tiny screens — saves space */
.topbar .sinhala { display: none; }
@media (min-width: 600px) {
  .topbar .sinhala { display: inline; margin-left: 8px; }
  .topbar { font-size: 0.82rem; }
}

/* ============================================================
   HEADER & NAV
   Mobile-first: hamburger by default, horizontal on >=900px
   ============================================================ */
header.site-header {
  position: relative;     /* dropdown anchor — DO NOT change to sticky here */
  z-index: 10;
  /* Solid background — always readable, never see-through on mobile */
  background: var(--cream);
  border-bottom: 2px solid rgba(122,46,46,0.14);
  /* Sticky behaviour comes from the SLOT, not the header element itself */
}

/* Slot wrapper is what sticks to the top */
#site-header-slot {
  position: sticky !important;
  top: 0;
  z-index: 300 !important;  /* above everything including canvas and sections */
  /* NEVER add overflow:hidden here — it would clip the dropdown */
}

/* Blur as progressive enhancement — safe because it can't break layout */
@supports (backdrop-filter: blur(1px)) {
  header.site-header {
    background: rgba(251,243,228,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  max-width: var(--container);
  margin: 0 auto;
}
@media (min-width: 480px) { .nav-wrap { padding: 12px 24px; } }

/* --- Logo / brand --- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  /* Shrink so hamburger always fits */
  flex: 1;
  min-width: 0;
}
.brand-mark {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 6px;
}
@media (min-width: 480px) { .brand-mark { width: 46px; height: 46px; } }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0; /* allow text-overflow to work */
}
.brand-text .sinhala-name {
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 0.72rem;
  color: var(--maroon);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text .eng-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 480px) {
  .brand-text .sinhala-name { font-size: 0.82rem; }
  .brand-text .eng-name     { font-size: 0.96rem; }
}
@media (min-width: 900px) {
  .brand-text .eng-name { font-size: 1.02rem; }
}

/* --- Hamburger button --- */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px; height: 42px;
  background: var(--maroon);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  /* always visible until desktop breakpoint */
}
.nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- Mobile dropdown nav --- */
nav.main-nav {
  /* Positioned absolute relative to header.site-header (position:relative) */
  position: absolute;
  top: 100%;   /* immediately below the header bar */
  left: 0;
  right: 0;
  /* ALWAYS solid — never transparent/blurred on mobile */
  background: var(--cream);
  border-bottom: 2px solid rgba(122,46,46,0.14);
  box-shadow: 0 12px 32px -8px rgba(44,35,27,0.28);
  /* Slide open with max-height transition */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
  /* z-index is inherited from header stacking context — no need to set */
}
nav.main-nav.open { max-height: 560px; }

nav.main-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
}
nav.main-nav li {
  border-bottom: 1px solid rgba(122,46,46,0.07);
}
nav.main-nav li:last-child { border-bottom: none; }
nav.main-nav a {
  display: block;
  padding: 13px 20px;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
nav.main-nav a:hover  { background: var(--cream-2); color: var(--saffron); }
nav.main-nav a.active {
  color: var(--maroon);
  font-weight: 700;
  background: rgba(122,46,46,0.05);
  border-left: 3px solid var(--gold);
  padding-left: 17px;
}

/* --- Desktop nav: horizontal bar inside nav-wrap --- */
@media (min-width: 900px) {
  .nav-toggle { display: none; }

  /* Move nav inside the flex row with nav-wrap on desktop */
  .nav-wrap {
    display: flex;
    align-items: center;
  }
  nav.main-nav {
    /* Reset all mobile dropdown styles */
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    transition: none;
    /* Sit inline with logo in the flex row */
    flex-shrink: 0;
    margin-left: auto;
  }
  nav.main-nav ul {
    flex-direction: row;
    gap: 2px;
    padding: 0;
  }
  nav.main-nav li  { border: none; }
  nav.main-nav a {
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: none !important;
    padding-left: 13px !important;
    white-space: nowrap;
  }
  nav.main-nav a.active {
    background: rgba(122,46,46,0.09);
    color: var(--maroon);
  }
  nav.main-nav a:hover  { background: var(--cream-2); color: var(--saffron); }
}

/* ============================================================
   HERO (homepage only)
   Mobile-first: stacked, then side-by-side on ≥860px
   ============================================================ */
.hero {
  padding: 48px 0 60px;
  background: linear-gradient(180deg,
    rgba(251,243,228,0.84) 0%,
    rgba(244,232,212,0.80) 100%);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px)  { .hero { padding: 68px 0 84px; } }
@media (min-width: 1024px) { .hero { padding: 90px 0 110px; } }

/* Faint dharma wheel watermark in hero background */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../images/dharma-wheel.svg') no-repeat 130% 40% / 380px;
  opacity: 0.05;
  pointer-events: none;
}
@media (min-width: 768px) {
  .hero::before { background-size: 500px; background-position: 108% 35%; }
}

.hero .container {
  display: grid;
  gap: 40px;
  position: relative; z-index: 1;
}
@media (min-width: 860px) {
  .hero .container {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
  }
}

/* Text column */
.hero-text { }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Noto Serif Sinhala', serif;
  color: var(--maroon);
  font-size: 0.95rem;
  margin-bottom: 14px;
  opacity: 0;
  animation: fadeUp .8s ease forwards 0.05s;
}
.hero-eyebrow .petal { width: 16px; height: 16px; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5.5vw, 3.7rem);
  line-height: 1.1;
  margin-bottom: 18px;
  font-weight: 600;
  opacity: 0;
  animation: fadeUp .8s ease forwards 0.15s;
}
.hero h1 em { font-style: italic; color: var(--saffron); }

.hero p.lead {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
  max-width: 54ch;
  opacity: 0;
  animation: fadeUp .8s ease forwards 0.25s;
}
@media (min-width: 600px) { .hero p.lead { font-size: 1.05rem; } }

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .8s ease forwards 0.35s;
}

/* Visual column */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.05;
  opacity: 0;
  animation: fadeIn 1.1s ease forwards 0.3s;
}
@media (min-width: 480px) { .hero-visual { max-width: 380px; } }
@media (min-width: 860px) { .hero-visual { max-width: none; } }

.hero-visual .frame {
  position: absolute;
  inset: 8%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 50px -20px rgba(44,35,27,0.4);
  border: 4px solid var(--cream);
}
.hero-visual .frame img { width: 100%; height: 100%; object-fit: cover; }

.hero-visual .badge {
  position: absolute;
  bottom: 0; left: 0;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 50%;
  width: 88px; height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.25;
  box-shadow: 0 10px 22px -8px rgba(217,164,65,0.8);
  border: 3px solid var(--cream);
}
@media (min-width: 480px) {
  .hero-visual .badge { width: 108px; height: 108px; font-size: 0.82rem; }
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .btn-primary:hover   { background: #8d3838; transform: translateY(-2px); }
  .btn-secondary:hover { background: var(--maroon); color: var(--cream); transform: translateY(-2px); }
  .btn-gold:hover      { transform: translateY(-2px); filter: brightness(1.05); }
}

.btn-primary {
  background: var(--maroon);
  color: var(--cream);
  box-shadow: 0 6px 18px -6px rgba(122,46,46,0.55);
}
.btn-secondary {
  background: transparent;
  color: var(--maroon);
  border-color: var(--maroon);
}
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 6px 18px -8px rgba(217,164,65,0.65);
}

/* ============================================================
   SECTIONS
   Mobile-first padding
   ============================================================ */
section {
  padding: 52px 0;
}
@media (min-width: 768px)  { section { padding: 72px 0; } }
@media (min-width: 1024px) { section { padding: 88px 0; } }

/* Slightly transparent so the canvas shows through */
.section-cream { background: rgba(251,243,228,0.88); }
.section-tint  { background: rgba(244,232,212,0.86); }
.section-dark  {
  background: rgba(31,78,69,0.96);
  color: var(--cream);
}
.section-dark .eyebrow       { color: var(--gold); }
.section-dark h2             { color: var(--cream); }
.section-dark p              { color: rgba(251,243,228,0.85); }
.section-dark .section-intro { color: rgba(251,243,228,0.85); }

/* Section heading pieces */
.eyebrow {
  font-family: 'Noto Serif Sinhala', serif;
  color: var(--saffron);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  display: block;
}
h2.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.5vw, 2.8rem);
  margin-bottom: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.section-intro {
  max-width: 65ch;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
  padding: 40px 0 44px;
  background: linear-gradient(180deg,
    rgba(244,232,212,0.92) 0%,
    rgba(251,243,228,0.88) 100%);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) { .page-hero { padding: 60px 0 64px; } }

.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../images/lotus-outline.svg') no-repeat -30px -30px / 220px;
  opacity: 0.08;
  pointer-events: none;
}
.page-hero .eyebrow { margin-bottom: 10px; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5.5vw, 3.1rem);
  font-weight: 600;
  line-height: 1.1;
}
.page-hero p   { color: var(--ink-soft); margin-top: 12px; max-width: 58ch; }
.breadcrumb    { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 10px; }
.breadcrumb a  { color: var(--maroon); text-decoration: none; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   TWO-COLUMN LAYOUT
   Single column on mobile, side-by-side on ≥820px
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}
@media (min-width: 820px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 48px; }
}
.two-col > * { min-width: 0; }

/* ============================================================
   GRIDS
   All start as single column, expand at breakpoints
   ============================================================ */
.grid { display: grid; gap: var(--gap); }
@media (min-width: 640px)  { .grid { gap: 20px; } }
@media (min-width: 1024px) { .grid { gap: 26px; } }

/* grid-2: 1 col → 2 cols */
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: repeat(2,1fr); } }

/* grid-3: 1 col → 2 cols → 3 cols */
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3,1fr); } }

/* grid-4: 2 cols → 4 cols */
.grid-4 { grid-template-columns: repeat(2,1fr); }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4,1fr); } }

/* Prevent overflow inside grid cells */
.grid > *, .two-col > * { min-width: 0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 6px 20px -12px rgba(44,35,27,0.28);
  border: 1px solid rgba(122,46,46,0.06);
  transition: transform .28s ease, box-shadow .28s ease;
}
@media (min-width: 640px) { .card { padding: 28px 26px; } }
@media (hover: hover) {
  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px -12px rgba(44,35,27,0.3);
  }
}
.card .icon { width: 44px; height: 44px; margin-bottom: 14px; color: var(--saffron); }
.card h3    { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 8px; }
.card p     { color: var(--ink-soft); font-size: 0.93rem; }

/* ============================================================
   PHOTO CARDS
   ============================================================ */
.photo-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 22px -12px rgba(44,35,27,0.3);
  -webkit-tap-highlight-color: transparent;
}
.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .45s ease;
}
@media (hover: hover) { .photo-card:hover img { transform: scale(1.05); } }
.photo-card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  background: linear-gradient(to top, rgba(44,35,27,0.78), transparent);
  color: #fff;
  font-size: 0.85rem;
}

/* ============================================================
   TEAM
   ============================================================ */
.team-member     { text-align: center; }
.team-member .photo {
  width: 100px; height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 3px solid var(--gold);
  box-shadow: 0 6px 18px -8px rgba(122,46,46,0.38);
}
.team-member .photo img { width: 100%; height: 100%; object-fit: cover; }
.team-member h3   { font-family: var(--font-display); font-size: 0.95rem; margin-bottom: 4px; }
.team-member .role {
  color: var(--saffron);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-grid-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--maroon);
  margin: 36px 0 18px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
  padding-bottom: 4px;
}

/* Leader message */
.leader-msg {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 6px 20px -12px rgba(44,35,27,0.25);
  margin-bottom: 20px;
}
@media (min-width: 560px) { .leader-msg { padding: 28px 30px; } }

.leader-msg .lhead {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.leader-msg .photo {
  width: 68px; height: 68px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--gold);
}
.leader-msg .photo img { width: 100%; height: 100%; object-fit: cover; }
.leader-msg h3    { font-family: var(--font-display); font-size: 1.05rem; }
.leader-msg .role { color: var(--saffron); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; }
.leader-msg p     { color: var(--ink-soft); font-size: 0.93rem; }
.leader-msg details summary {
  cursor: pointer;
  color: var(--maroon);
  font-weight: 600;
  margin-top: 8px;
  font-size: 0.93rem;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px -12px rgba(44,35,27,0.22);
}
table.schedule {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.88rem;
  min-width: 260px;
}
table.schedule th,
table.schedule td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--cream-2);
}
table.schedule th {
  background: var(--maroon);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}
table.schedule tr:last-child td { border-bottom: none; }
@media (hover: hover) { table.schedule tr:hover td { background: var(--cream-2); } }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--maroon);
  background: transparent;
  color: var(--maroon);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background .18s, color .18s;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active,
.tab-btn:hover { background: var(--maroon); color: var(--cream); }
.tab-panel         { display: none; }
.tab-panel.active  { display: block; animation: fadeIn .35s ease; }

/* ============================================================
   RESOURCE LIST
   ============================================================ */
.resource-list { list-style: none; display: grid; gap: 10px; }
.resource-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px -8px rgba(44,35,27,0.2);
  transition: background .18s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .resource-list a:hover { background: var(--cream-2); } }
.resource-list svg { width: 18px; height: 18px; color: var(--saffron); flex-shrink: 0; }

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.stat .label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 4px;
}

/* ============================================================
   PHILOSOPHY QUOTE
   ============================================================ */
.philosophy { text-align: center; max-width: 700px; margin: 0 auto; }
.philosophy .sinhala-quote {
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 14px;
}
.philosophy blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.8vw, 1.65rem);
  font-style: italic;
  line-height: 1.5;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 40px;
  max-width: 180px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, var(--gold));
}
.divider::after { --dir: left; }
.divider svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--saffron), var(--maroon));
  color: var(--cream);
  border-radius: 18px;
  padding: 26px 22px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  position: relative;
  overflow: hidden;
}
@media (min-width: 560px)  { .cta-banner { padding: 34px 32px; } }
@media (min-width: 820px)  { .cta-banner { grid-template-columns: 1.3fr 1fr; gap: 40px; padding: 42px 44px; } }

.cta-banner::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  background: url('../images/lotus-outline.svg') no-repeat center / contain;
  opacity: 0.12;
  pointer-events: none;
}
.cta-banner h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  margin-bottom: 10px;
  color: #fff;
}
.cta-banner p  { color: rgba(251,243,228,0.9); font-size: 0.93rem; }
.cta-banner ul { list-style: none; display: grid; gap: 10px; }
.cta-banner li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
}
.cta-banner li svg { width: 17px; height: 17px; color: var(--gold); flex-shrink: 0; margin-top: 3px; }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 820px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }

.contact-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 4px 16px -8px rgba(44,35,27,0.2);
  margin-bottom: 12px;
}
.contact-card svg { width: 20px; height: 20px; color: var(--saffron); flex-shrink: 0; margin-top: 3px; }
.contact-card h4  { font-family: var(--font-display); font-size: 0.95rem; margin-bottom: 4px; }
.contact-card p   { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 2px; }
.contact-card a   { color: var(--maroon); }

.map-frame {
  width: 100%;
  min-height: 280px;
  height: 100%;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px -12px rgba(44,35,27,0.25);
  display: block;
}
@media (min-width: 820px) { .map-frame { min-height: 400px; } }

/* Contact enquiry form */
.form-grid { display: grid; gap: 14px; }
.form-grid label {
  font-weight: 600;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}
.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid rgba(122,46,46,0.22);
  font-family: var(--font-body);
  font-size: 1rem; /* 16px minimum to prevent iOS zoom */
  background: #fff;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.form-grid input:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217,164,65,0.22);
}
.form-name-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 480px) {
  .form-name-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--ink);
  color: var(--cream);
  padding: 44px 0 18px;
  position: relative; z-index: 1;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
@media (min-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; } }

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.footer-brand .brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.footer-brand .sinhala-name {
  font-family: 'Noto Serif Sinhala', serif;
  color: var(--gold);
  font-size: 0.85rem;
  display: block;
}
.footer-brand .eng-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cream);
}

footer p   { color: rgba(251,243,228,0.68); font-size: 0.85rem; margin-bottom: 12px; line-height: 1.6; }
footer h5  { font-family: var(--font-display); color: var(--gold); margin-bottom: 12px; font-size: 0.95rem; }
footer ul  { list-style: none; display: grid; gap: 8px; }
footer li  { font-size: 0.85rem; color: rgba(251,243,228,0.75); line-height: 1.5; }
footer a   { color: rgba(251,243,228,0.8); text-decoration: none; transition: color .18s; }
footer a:hover { color: var(--gold); }

.contact-meta {
  display: block;
  font-size: 0.76rem;
  opacity: 0.6;
  margin-top: 1px;
}

.social-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.social-row a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(251,243,228,0.1);
  transition: background .18s;
  flex-shrink: 0;
  color: rgba(251,243,228,0.8);
}
.social-row a:hover { background: var(--gold); color: var(--ink); }
.social-row svg { width: 16px; height: 16px; }

.footer-bottom {
  border-top: 1px solid rgba(251,243,228,0.1);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(251,243,228,0.45);
}
@media (min-width: 560px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ============================================================
   VISION & MISSION  (our-school.html)
   ============================================================ */
.vision-mission-block {
  max-width: 820px;
}
.vision-mission-block + .vm-divider {
  border: none;
  border-top: 1px solid rgba(217,164,65,0.25);
  margin: 48px 0;
}
.vision-mission-block .section-intro {
  color: rgba(251,243,228,0.9);
  font-size: 1.08rem;
  margin-bottom: 20px;
}
/* Sinhala script paragraph */
.vm-sinhala {
  font-family: 'Noto Serif Sinhala', serif;
  font-size: 0.95rem;
  color: rgba(217,164,65,0.75);
  line-height: 1.9;
  margin-top: 14px;
  padding-left: 16px;
  border-left: 2px solid rgba(217,164,65,0.3);
}
/* Sinhala bullet list — inherits vm-sinhala font/colour, overrides layout */
ul.vm-list.vm-sinhala {
  border-left: none;
  padding-left: 0;
}
/* Mission bullet list */
.vm-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.vm-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: rgba(251,243,228,0.88);
  font-size: 1rem;
  line-height: 1.6;
}
.vm-list li::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
}
/* Closing philosophy paragraph */
.vm-closing {
  color: rgba(251,243,228,0.88);
  font-size: 1rem;
  line-height: 1.75;
  font-style: italic;
  margin-bottom: 16px;
  padding: 20px 22px;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,0.05);
  border-radius: 0 10px 10px 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.img-rounded {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 28px -14px rgba(44,35,27,0.3);
}
.tag {
  display: inline-block;
  background: var(--cream-2);
  color: var(--maroon);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  margin: 0 5px 5px 0;
}

/* Lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(44,35,27,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .28s ease;
  z-index: 500;
  padding: 20px;
  cursor: zoom-out;
}
#lightbox.open { opacity: 1; visibility: visible; }
#lightbox img  { max-width: 90vw; max-height: 85vh; border-radius: 10px; }

/* ============================================================
   REDUCE MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   TEAM ROSTER (Our Team page — leadership trio & teacher grades)
   ============================================================ */
.roster-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.roster-card {
  flex: 0 1 150px;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 16px 22px;
  text-align: center;
  box-shadow: 0 6px 20px -12px rgba(44,35,27,0.22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.roster-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px -14px rgba(44,35,27,0.3);
}
.roster-card .photo {
  width: 108px; height: 108px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 14px;
  border: 3px solid var(--gold);
  box-shadow: 0 6px 18px -8px rgba(122,46,46,0.38);
}
.roster-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.roster-card h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.25;
  margin-bottom: 5px;
}
.roster-card .role {
  color: var(--saffron);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Grade block — groups a grade's teacher(s) in a labelled module */
.grade-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 860px) {
  .grade-grid { grid-template-columns: 1fr 1fr; }
}
.grade-block {
  background: var(--cream);
  border: 1px solid rgba(217,164,65,0.35);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
}
.grade-block .grade-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--maroon);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.grade-block .roster-card {
  box-shadow: 0 4px 14px -10px rgba(44,35,27,0.2);
}

@media (min-width: 640px) {
  .grade-block { padding: 26px 28px 28px; }
}