/* ════════════════════════════════════════════════════════════════════════
   EduKlass — Public Website Design System
   Shared across every /views/public/* page via views/layouts/public.php.
   --pr / --or / --nav-bg / --topbar-bg / --footer-bg / font-family are
   injected per-school by the layout <head> (CMS theme settings); everything
   below builds on top of those as the single source of visual truth.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand (fallbacks — layout overrides these per school) */
  --pr: #1E3A8A;
  --or: #F97316;
  --nav-bg: #ffffff;
  --topbar-bg: #0f1e4f;
  --footer-bg: #0f1e4f;

  /* Derived brand tints/shades (color-mix keeps these in sync with any
     school's custom theme color automatically — no hardcoded hex needed) */
  --pr-50:  color-mix(in srgb, var(--pr) 6%,  white);
  --pr-100: color-mix(in srgb, var(--pr) 12%, white);
  --pr-200: color-mix(in srgb, var(--pr) 22%, white);
  --pr-600: color-mix(in srgb, var(--pr) 88%, black);
  --pr-700: color-mix(in srgb, var(--pr) 76%, black);
  --or-50:  color-mix(in srgb, var(--or) 10%, white);
  --or-100: color-mix(in srgb, var(--or) 16%, white);
  --or-600: color-mix(in srgb, var(--or) 88%, black);

  /* Neutrals */
  --ink:      #0f172a;
  --ink-soft: #475569;
  --ink-mute: #64748b;
  --ink-faint:#94a3b8;
  --surface:      #ffffff;
  --surface-alt:  #f8fafc;
  --surface-tint: #f1f5f9;
  --border:       #e2e8f0;
  --border-soft:  rgba(15,23,42,.06);

  /* Type scale */
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-base: .9375rem; --fs-md: 1.0625rem;
  --fs-lg: 1.25rem; --fs-xl: 1.5rem; --fs-2xl: 1.875rem; --fs-3xl: 2.375rem;
  --fs-4xl: 3rem; --fs-5xl: 3.75rem;

  /* Spacing / radius / shadow */
  --radius-sm: 10px; --radius-md: 16px; --radius-lg: 22px; --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
  --shadow-sm: 0 2px 10px rgba(15,23,42,.06);
  --shadow-md: 0 8px 28px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.12);
  --shadow-brand: 0 10px 30px color-mix(in srgb, var(--pr) 22%, transparent);
  --shadow-accent: 0 10px 26px color-mix(in srgb, var(--or) 32%, transparent);

  --ease: cubic-bezier(.4,0,.2,1);
  --ease-out-back: cubic-bezier(.34,1.56,.64,1);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { letter-spacing: -.01em; }
::selection { background: var(--pr); color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--or); outline-offset: 2px; border-radius: 4px;
}

/* Slim, unobtrusive scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--surface-alt); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ── Layout / sections ───────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-alt { background: var(--surface-alt); }
.section-dark { background: var(--pr); color: #fff; }

.section-label {
  font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--or-600); margin-bottom: 14px; display: inline-flex; align-items: center; gap: 8px;
}
.section-label::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: var(--or); display: inline-block; }
.section-title {
  font-size: var(--fs-3xl); font-weight: 800; line-height: 1.18; letter-spacing: -.02em;
  color: var(--pr); margin-bottom: 18px;
}
.section-title.white { color: #fff; }
.section-sub { color: var(--ink-mute); font-size: var(--fs-md); max-width: 580px; line-height: 1.75; }
.section-sub.white { color: rgba(255,255,255,.78); }

@media (min-width: 768px) { .section-title { font-size: var(--fs-4xl); } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-hero, .btn-ghost, .btn-primary-sm, .btn-orange-sm {
  font-family: inherit; border: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 9px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn-hero {
  background: var(--or); color: #fff; padding: 15px 34px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; box-shadow: var(--shadow-accent);
}
.btn-hero:hover { background: var(--or-600); transform: translateY(-2px); box-shadow: 0 16px 34px color-mix(in srgb, var(--or) 40%, transparent); }
.btn-hero:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255,255,255,.1); color: #fff; padding: 15px 34px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; border: 1.5px solid rgba(255,255,255,.28); backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.45); transform: translateY(-2px); }

.btn-primary-sm {
  background: var(--pr); color: #fff; padding: 11px 24px; border-radius: 11px;
  font-weight: 600; font-size: .875rem; box-shadow: var(--shadow-sm);
}
.btn-primary-sm:hover { background: var(--pr-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-orange-sm {
  background: var(--or); color: #fff; padding: 11px 24px; border-radius: 11px;
  font-weight: 600; font-size: .875rem; box-shadow: var(--shadow-sm);
}
.btn-orange-sm:hover { background: var(--or-600); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent; color: var(--pr); padding: 11px 24px; border-radius: 11px;
  font-weight: 600; font-size: .875rem; border: 1.5px solid var(--border); display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: all .2s var(--ease);
}
.btn-outline:hover { border-color: var(--pr); background: var(--pr-50); }

@media (max-width: 767px) {
  .btn-hero, .btn-ghost { padding: 13px 26px; font-size: .9rem; }
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.feature-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 30px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-soft);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--pr) 15%, transparent); }
.icon-box {
  width: 58px; height: 58px; border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; margin-bottom: 20px; transition: transform .25s var(--ease-out-back);
}
.feature-card:hover .icon-box { transform: scale(1.08) rotate(-3deg); }

.stat-item { text-align: center; }
.stat-num { font-size: var(--fs-3xl); font-weight: 900; color: #fff; letter-spacing: -.02em; }
.stat-label { font-size: .875rem; color: rgba(255,255,255,.68); margin-top: 6px; }

.news-card {
  background: var(--surface); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-soft);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.gallery-item { border-radius: var(--radius-md); overflow: hidden; position: relative; cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); display: block; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-overlay {
  position: absolute; inset: 0; background: linear-gradient(0deg, color-mix(in srgb, var(--pr) 78%, black) 0%, transparent 60%);
  opacity: 0; transition: opacity .3s var(--ease); display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 16px; color: #fff; font-size: 1.15rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

.staff-card {
  background: var(--surface); border-radius: var(--radius-md); overflow: hidden; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-soft);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.staff-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.staff-card .staff-img { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; object-position: center top; }

.admission-banner {
  background: linear-gradient(135deg, var(--or), color-mix(in srgb, var(--or) 70%, black));
  border-radius: var(--radius-xl); padding: 56px; text-align: center; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow-accent);
}
.admission-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.14), transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(255,255,255,.1), transparent 45%);
}
.admission-banner > * { position: relative; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  min-height: 92vh; position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 620px at 82% -10%, color-mix(in srgb, var(--or) 22%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--pr) 35%, transparent), transparent 60%),
    linear-gradient(150deg, var(--topbar-bg) 0%, var(--pr) 55%, color-mix(in srgb, var(--pr) 82%, black) 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-blob { position: absolute; border-radius: 50%; background: color-mix(in srgb, var(--or) 10%, transparent); filter: blur(90px); animation: heroFloat 12s ease-in-out infinite; }
.hero-blob:nth-child(2) { animation-delay: -6s; }
@keyframes heroFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-16px, 22px); } }
@media (prefers-reduced-motion: reduce) { .hero-blob { animation: none; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: 999px;
  font-size: .8125rem; font-weight: 700; margin-bottom: 26px;
  background: color-mix(in srgb, var(--or) 22%, transparent); color: #fdcf9d;
  border: 1px solid color-mix(in srgb, var(--or) 32%, transparent);
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--or); animation: pulseDot 1.8s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Top utility bar ─────────────────────────────────────────────────── */
.topbar { background: var(--topbar-bg); color: rgba(255,255,255,.75); font-size: .75rem; position: relative; z-index: 101; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.topbar-left { display: flex; align-items: center; gap: 16px; overflow: hidden; }
.topbar-left a { color: rgba(255,255,255,.62); text-decoration: none; display: flex; align-items: center; gap: 6px; transition: color .15s var(--ease); font-size: .73rem; white-space: nowrap; }
.topbar-left a:hover { color: var(--or); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.portal-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-decoration: none; white-space: nowrap; letter-spacing: .01em;
  transition: all .18s var(--ease);
}
.portal-pill:hover { transform: translateY(-1px); }
.portal-pill.pill-login { background: color-mix(in srgb, var(--or) 22%, transparent); color: #fbbf24; border: 1px solid color-mix(in srgb, var(--or) 32%, transparent); }
.portal-pill.pill-login:hover { background: color-mix(in srgb, var(--or) 38%, transparent); color: #fff; }

@media (max-width: 639px) {
  .topbar-left { display: none; }
  .topbar-inner { justify-content: center; padding: 6px 12px; min-height: unset; }
  .topbar-right { gap: 6px; flex-wrap: nowrap; justify-content: center; width: 100%; }
  .portal-pill { padding: 6px 12px; font-size: .73rem; flex: 1; justify-content: center; max-width: 84px; }
  .portal-pill .pill-text { display: none; }
  .portal-pill i { font-size: .85rem; }
}
@media (min-width: 640px) and (max-width: 767px) {
  .topbar-left a:not(:first-child) { display: none; }
  .portal-pill { padding: 5px 10px; font-size: .7rem; }
}

/* Language switcher */
.pub-lang-btn {
  display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.85);
  font-size: .72rem; font-weight: 700; transition: background .15s var(--ease); white-space: nowrap;
}
.pub-lang-btn:hover { background: rgba(255,255,255,.2); }
.pub-lang-drop {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: var(--radius-sm);
  min-width: 138px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-soft); z-index: 400; padding: 5px;
  animation: dropIn .16s var(--ease) both;
}
.pub-lang-drop.open { display: block; }
.pub-lang-item {
  width: 100%; text-align: left; padding: 9px 12px; font-size: .79rem; background: none; border: none; cursor: pointer;
  border-radius: 8px; display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-weight: 500;
  font-family: inherit; transition: background .12s var(--ease);
}
.pub-lang-item:hover { background: var(--pr-50); color: var(--pr); }
.pub-lang-item.active { color: var(--pr); font-weight: 700; }

/* ── Main navigation ─────────────────────────────────────────────────── */
.pub-nav {
  position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--nav-bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--border-soft); border-bottom: 1px solid var(--border-soft);
  transition: box-shadow .25s var(--ease);
}
.pub-nav.is-scrolled { box-shadow: var(--shadow-md); }
.pub-nav a { text-decoration: none; }
.nav-link-pub {
  padding: 8px 15px; font-size: .875rem; font-weight: 500; border-bottom: 3px solid transparent;
  transition: all .18s var(--ease); color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; height: 68px;
}
.nav-link-pub:hover { color: var(--pr); border-bottom-color: var(--or); }
.nav-link-pub.active { color: var(--pr); border-bottom-color: var(--or); font-weight: 700; }

.nav-dropdown-wrap { height: 68px; }
.nav-dropdown {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(4px);
  background: #fff; border-radius: var(--radius-md); min-width: 210px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft); z-index: 200; padding: 7px; white-space: nowrap;
  opacity: 0; transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.nav-dropdown-wrap:hover .nav-dropdown { display: block; opacity: 1; transform: translateX(-50%) translateY(0); }
.nav-drop-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px; font-size: .8125rem; font-weight: 500;
  color: var(--ink-soft); border-radius: 9px; text-decoration: none; transition: all .12s var(--ease);
}
.nav-drop-item:hover { background: var(--pr-50); color: var(--pr); transform: translateX(2px); }
.nav-drop-item i { width: 16px; text-align: center; color: var(--or); font-size: .8rem; }

@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Mobile menu ─────────────────────────────────────────────────────── */
.mob-menu { display: none; position: fixed; inset: 0; background: #fff; z-index: 200; flex-direction: column; overflow-y: auto; }
.mob-menu.open { display: flex; animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mob-menu-header { background: linear-gradient(135deg, var(--topbar-bg), var(--pr)); padding: 22px 24px 20px; display: flex; align-items: center; justify-content: space-between; }
.mob-link {
  padding: 14px 20px; font-size: .95rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--surface-tint); text-decoration: none; display: flex; align-items: center; gap: 11px;
  transition: background .12s var(--ease);
}
.mob-link:hover { background: var(--surface-alt); color: var(--pr); }
.mob-link-section {
  font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-faint);
  padding: 13px 24px 6px; background: var(--surface-alt); display: block;
}
.mob-cta { padding: 18px 24px; display: flex; gap: 10px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.pub-footer { background: var(--footer-bg); color: rgba(255,255,255,.75); position: relative; }
.pub-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--or), var(--pr-200), var(--or));
}
.footer-link {
  color: rgba(255,255,255,.55); text-decoration: none; font-size: .8125rem; transition: color .15s var(--ease), transform .15s var(--ease);
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; line-height: 1.3;
}
.footer-link::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: color-mix(in srgb, var(--or) 55%, transparent); flex-shrink: 0; transition: background .15s var(--ease); }
.footer-link:hover { color: var(--or); transform: translateX(2px); }
.footer-link:hover::before { background: var(--or); }
.footer-link.no-dot::before { display: none; }
.footer-col-heading {
  color: rgba(255,255,255,.92); font-weight: 800; font-size: .6875rem; text-transform: uppercase; letter-spacing: .15em;
  margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.footer-col-heading::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
.footer-main-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 1100px) { .footer-main-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 720px)  { .footer-main-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px)  { .footer-main-grid { grid-template-columns: 1fr; } }
.footer-cta-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
@media (max-width: 600px)  { .footer-cta-strip { flex-direction: column; align-items: flex-start; } }

/* ── Forms ────────────────────────────────────────────────────────────── */
.contact-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 13px 16px;
  font-size: .9rem; font-family: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); background: #fff;
}
.contact-input:focus { outline: none; border-color: var(--pr); box-shadow: 0 0 0 4px var(--pr-50); }

/* ── Motion utilities ────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Global mobile responsiveness ────────────────────────────────────── */
@media (max-width: 767px) {
  .section { padding: 56px 0; }
  .container { padding: 0 16px; }
  .admission-banner { padding: 32px 22px; }
  .pub-nav .container { padding: 0 12px; }
}
@media (max-width: 479px) {
  .section { padding: 40px 0; }
  .stat-num { font-size: 2rem; }
  .hero { min-height: unset; padding: 64px 0 52px; }
}
