/* ==========================================================================
   SSG English School CMS - public stylesheet
   Palette is driven by CSS variables (--primary/--accent/--secondary)
   injected inline from admin settings.
   ========================================================================== */

:root {
  --primary: #0b3d66;
  --accent: #f5b301;
  --secondary: #1a7f5a;
  --ink: #1f2d3d;
  --muted: #5b6b7d;
  --line: #e4eaf1;
  --bg: #ffffff;
  --bg-alt: #f3f7fb;
  --radius: 14px;
  --shadow-sm: 0 4px 14px rgba(11, 61, 102, .08);
  --shadow: 0 14px 40px rgba(11, 61, 102, .12);
  --maxw: 1180px;
  --font-head: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--primary); margin: 0 0 .5em; }
p { margin: 0 0 1rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 820px; }
.section { padding: 74px 0; }
.alt-bg { background: var(--bg-alt); }
.text-center { text-align: center; }
.mb-lg { margin-bottom: 2.5rem; }
.empty-note { text-align: center; color: var(--muted); padding: 40px 0; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 8px 14px; z-index: 200; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; font-family: var(--font-head); font-weight: 600;
  padding: 12px 26px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  font-size: .95rem; line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #402f00; box-shadow: 0 8px 20px rgba(245, 179, 1, .35); }
.btn-outline { background: transparent; border-color: currentColor; color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-lg { padding: 15px 34px; font-size: 1.05rem; }

/* ---------------- Topbar ---------------- */
.topbar { background: var(--primary); color: #dfe9f3; font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 40px; flex-wrap: wrap; gap: 6px; }
.topbar a { color: #dfe9f3; margin-right: 18px; }
.topbar a:hover { color: #fff; }
.topbar-social a { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; margin: 0 0 0 6px; font-size: .7rem; text-transform: uppercase; }

/* ---------------- Header / Nav ---------------- */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: var(--shadow-sm); }
.site-header.scrolled { box-shadow: 0 6px 22px rgba(11,61,102,.15); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 20px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-width: 0; }
.brand img { height: 46px; width: auto; max-width: 200px; object-fit: contain; }

.main-nav { display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 1; }
.nav-list { list-style: none; display: flex; align-items: center; gap: 1px; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-item > a { display: flex; align-items: center; gap: 5px; padding: 9px 8px; font-family: var(--font-head); font-weight: 500; font-size: .84rem; color: var(--ink); border-radius: 8px; white-space: nowrap; }
.nav-item > a:hover, .nav-item.active > a { color: var(--primary); background: var(--bg-alt); }
.caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .2s; }
.nav-item.has-children:hover .caret { transform: rotate(-135deg); margin-top: 2px; }

.dropdown {
  list-style: none; margin: 0; padding: 8px; position: absolute;
  min-width: 260px; background: #fff; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  border: 1px solid var(--line); z-index: 120;
}
.nav-item.has-children { position: relative; }
.nav-item.has-children:hover .dropdown,
.nav-item.has-children:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a { display: block; padding: 10px 14px; border-radius: 8px; font-size: .9rem; color: var(--ink); }
.dropdown li a:hover { background: var(--bg-alt); color: var(--primary); }
.nav-cta { padding: 10px 22px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--primary); border-radius: 3px; transition: .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------------- Hero ---------------- */
.hero { position: relative; background: linear-gradient(135deg, var(--primary) 0%, #0d5a95 100%); color: #fff; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 480px; height: 480px; background: radial-gradient(circle, rgba(245,179,1,.25), transparent 70%); top: -160px; right: -120px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 70px 0 110px; position: relative; z-index: 2; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); padding: 6px 16px; border-radius: 999px; font-size: .82rem; font-weight: 600; margin-bottom: 18px; }
.hero-text h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 16px; }
.hero-sub { font-size: 1.12rem; color: #e6eef7; max-width: 520px; margin-bottom: 22px; }
.hero-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 26px; }
.hero-rating .star { color: rgba(255,255,255,.35); font-size: 1.2rem; }
.hero-rating .star.filled { color: var(--accent); }
.rating-text { font-size: .86rem; color: #d7e3f0; margin-left: 8px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions .btn-outline { color: #fff; }
.hero-actions .btn-outline:hover { background: #fff; color: var(--primary); }
.hero-media { position: relative; }
.hero-slider { position: relative; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.hero-slides { position: relative; width: 100%; aspect-ratio: 5/4.4; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 18px 16px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: .95rem; font-weight: 500; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--primary); font-size: 1.5rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3; transition: .2s; opacity: 0; }
.hero-slider:hover .hero-nav { opacity: 1; }
.hero-nav:hover { background: #fff; }
.hero-nav.prev { left: 12px; }
.hero-nav.next { right: 12px; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; transition: .2s; }
.hero-dot.active { background: var(--accent); transform: scale(1.15); }
.hero-badge-float { position: absolute; left: max(8px, 0px); bottom: 28px; z-index: 4; background: #fff; color: var(--ink); border-radius: 14px; padding: 14px 20px; box-shadow: var(--shadow); text-align: center; max-width: calc(100% - 16px); }
.hero-badge-float strong { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--secondary); }
.hero-badge-float span { font-size: .78rem; color: var(--muted); }
.hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; height: 60px; background: var(--bg); clip-path: ellipse(75% 100% at 50% 100%); }

/* ---------------- Section heads ---------------- */
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { color: var(--muted); }
.section-cta { text-align: center; margin-top: 36px; }

/* ---------------- Welcome ---------------- */
.welcome-inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: 50px; align-items: center; }
.welcome-media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.welcome-text h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.stat-row { display: flex; gap: 30px; margin-top: 28px; flex-wrap: wrap; }
.stat { }
.stat-num { display: block; font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--accent); }
.stat-label { font-size: .86rem; color: var(--muted); }

/* ---------------- Features ---------------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px; text-align: center; transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-icon { width: 66px; height: 66px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--primary), #0d5a95); color: #fff; }
.feature-card h3 { font-size: 1.2rem; }
.feature-card p { color: var(--muted); margin: 0; }

/* ---------------- Video ---------------- */
.video-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 42px; align-items: center; }
.video-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-frame video { width: 100%; display: block; }

/* ---------------- Gallery ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery-item { overflow: hidden; border-radius: 12px; aspect-ratio: 1/1; position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after { content: "\002B"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.8rem; background: rgba(11,61,102,.45); opacity: 0; transition: .25s; }
.gallery-item:hover::after { opacity: 1; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(9,20,35,.92); display: none; align-items: center; justify-content: center; z-index: 300; padding: 30px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-caption { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: .95rem; }
.lightbox-close, .lightbox-nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lightbox-close { top: 22px; right: 22px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-nav:hover, .lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ---------------- Events ---------------- */
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.event-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.event-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.event-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; }
.event-body { padding: 20px 22px; }
.event-date { display: inline-block; background: var(--bg-alt); color: var(--secondary); font-weight: 600; font-size: .78rem; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.event-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.event-body h3 a { color: var(--primary); }
.event-body p { color: var(--muted); font-size: .92rem; }
.read-more { font-weight: 600; font-family: var(--font-head); font-size: .88rem; }
.event-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.event-date-lg { color: var(--secondary); font-weight: 600; }
.back-link { margin-top: 30px; }

/* ---------------- CTA band ---------------- */
.cta-band { background: linear-gradient(120deg, var(--secondary), #12674a); color: #fff; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 48px 0; flex-wrap: wrap; }
.cta-inner h2 { color: #fff; margin-bottom: 6px; }
.cta-inner p { color: #e2f3ec; margin: 0; }

/* ---------------- Page banner / breadcrumb ---------------- */
.page-banner { background: linear-gradient(135deg, var(--primary), #0d5a95); color: #fff; padding: 54px 0; }
.page-banner h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 8px; }
.breadcrumb { font-size: .88rem; color: #cfe0f0; }
.breadcrumb a { color: #fff; }
.breadcrumb span { margin: 0 6px; opacity: .6; }

/* ---------------- Rich content ---------------- */
.rich-content { font-size: 1.02rem; color: #33404f; overflow-wrap: anywhere; }
.rich-content h2 { font-size: 1.5rem; margin-top: 1.6em; }
.rich-content h3 { font-size: 1.2rem; margin-top: 1.4em; }
.rich-content ul, .rich-content ol { padding-left: 1.4em; margin-bottom: 1rem; }
.rich-content li { margin-bottom: .4em; }
.rich-content img { border-radius: 10px; margin: 1rem 0; box-shadow: var(--shadow-sm); }
.rich-content a { color: var(--secondary); text-decoration: underline; }
.rich-content blockquote { border-left: 4px solid var(--accent); background: var(--bg-alt); padding: 14px 20px; margin: 1rem 0; border-radius: 0 10px 10px 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.rich-content th, .rich-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }

/* ---------------- Faculty ---------------- */
.faculty-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.faculty-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px; text-align: center; transition: transform .2s, box-shadow .2s; }
.faculty-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.faculty-photo { width: 104px; height: 104px; margin: 0 auto 16px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: grid; place-items: center; }
.faculty-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 2rem; }
.faculty-card h3 { font-size: 1.1rem; margin-bottom: 2px; }
.faculty-role { color: var(--secondary); font-weight: 600; font-size: .88rem; margin-bottom: 10px; }
.faculty-bio { color: var(--muted); font-size: .88rem; margin: 0; }

/* ---------------- Contact ---------------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 46px; align-items: start; }
.contact-details { list-style: none; padding: 0; margin: 20px 0 0; }
.contact-details li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ci-label { display: block; font-family: var(--font-head); font-weight: 600; color: var(--primary); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.contact-form-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.contact-form .row { display: flex; gap: 16px; flex-wrap: wrap; }
.contact-form .field { flex: 1; min-width: 180px; margin-bottom: 16px; }
.contact-form label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 5px; color: var(--ink); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-family: var(--font-body); font-size: .95rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,61,102,.12); }
.field-hp { position: absolute; left: -5000px; }

/* ---------------- Alerts ---------------- */
.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; }
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-ok { background: #e7f6ee; color: #0f5132; border: 1px solid #b7e4c7; }
.alert-err { background: #fdecea; color: #8b1a10; border: 1px solid #f5c6c0; }

/* ---------------- Footer ---------------- */
.site-footer { background: #0a2c48; color: #c7d6e6; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding: 60px 0 40px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand img { height: 46px; background: #fff; border-radius: 8px; padding: 4px; }
.footer-brand span { font-family: var(--font-head); font-weight: 700; color: #fff; font-size: 1.1rem; }
.footer-about p { font-size: .92rem; }
.footer-col h4 { color: #fff; font-size: 1.05rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #c7d6e6; font-size: .92rem; }
.footer-col a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 14px; margin-top: 16px; }
.footer-social a { color: #c7d6e6; font-size: .88rem; }
/* App download band */
.footer-apps { border-top: 1px solid rgba(255,255,255,.1); padding: 26px 0; }
.footer-apps .container { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.apps-head h4 { color: #fff; margin: 0 0 4px; font-size: 1.05rem; }
.apps-head p { margin: 0; color: #90a6bd; font-size: .88rem; }
.app-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.store-badge { display: inline-flex; align-items: center; gap: 10px; background: #000; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; padding: 8px 15px; color: #fff; text-decoration: none; transition: .2s; }
.store-badge:hover { background: #111; border-color: rgba(255,255,255,.6); transform: translateY(-1px); }
.store-badge .sb-icon { display: flex; align-items: center; }
.store-badge .sb-text { display: flex; flex-direction: column; line-height: 1.05; }
.store-badge .sb-text small { font-size: .62rem; opacity: .85; text-transform: uppercase; letter-spacing: .03em; }
.store-badge .sb-text strong { font-size: 1.02rem; font-family: var(--font-head); font-weight: 600; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; padding: 18px 0; color: #90a6bd; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-bottom-inner .powered-by a { color: #c7d6e6; font-weight: 600; text-decoration: none; }
.footer-bottom-inner .powered-by a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 640px) { .footer-bottom-inner { justify-content: center; text-align: center; } }

/* ---------------- Back to top ---------------- */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 1.2rem; cursor: pointer; opacity: 0; visibility: hidden; transition: .25s; box-shadow: var(--shadow); z-index: 90; }
.to-top.show { opacity: 1; visibility: visible; }

/* ---------------- 404 ---------------- */
.error-page { padding: 100px 0; }
.error-code { font-size: 6rem; color: var(--accent); margin: 0; line-height: 1; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; padding: 50px 0 90px; }
  .hero-media { max-width: 520px; }
  .hero-nav { opacity: 1; background: rgba(255,255,255,.7); }
  .welcome-inner, .video-inner, .contact-layout { grid-template-columns: 1fr; gap: 32px; }
  .feature-grid, .events-grid { grid-template-columns: repeat(2, 1fr); }
  .faculty-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Collapse the full menu into a slide-in drawer: school templates ship 10+ top-level
   items (logo + CTA do not fit on laptops). Use transform so the closed drawer
   does not widen the page and cause horizontal scroll. */
@media (max-width: 1500px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; top: 0; right: 0; width: min(300px, 100vw); height: 100vh; height: 100dvh;
    background: #fff; flex-direction: column; align-items: stretch; gap: 0;
    padding: 80px 18px 30px; box-shadow: -10px 0 40px rgba(0,0,0,.2);
    transition: transform .3s ease, visibility .3s; overflow-y: auto; z-index: 110;
    transform: translateX(100%); visibility: hidden;
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item > a { padding: 13px 12px; border-radius: 8px; justify-content: space-between; }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 6px 12px;
    padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-item.has-children.open .dropdown { max-height: 1500px; }
  .nav-item.has-children:hover .dropdown { opacity: 1; } /* keep tap behaviour */
  .nav-cta { margin-top: 12px; text-align: center; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 105; opacity: 0; visibility: hidden; transition: .3s; }
  .nav-backdrop.show { opacity: 1; visibility: visible; }
}

@media (max-width: 560px) {
  .section { padding: 54px 0; }
  .brand img { height: 42px; }
  .feature-grid, .events-grid, .faculty-grid, .gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .cta-inner { flex-direction: column; text-align: center; align-items: center; }
  .stat-row { gap: 20px; }
  .topbar-inner { justify-content: center; }
  /* Wide editor tables scroll horizontally instead of breaking the layout. */
  .rich-content table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 400px) {
  .feature-grid, .events-grid, .faculty-grid { grid-template-columns: 1fr; }
}
