@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --primary: #1a56db;
  --primary-dark: #1240a8;
  --primary-light: #e8f0fe;
  --accent: #059669;
  --accent-light: #d1fae5;
  --gold: #f59e0b;
  --gold-light: #fef3c7;
  --red: #dc2626;
  --bg: #f0f4f8;
  --bg-soft: #e8edf5;
  --card: #ffffff;
  --text: #0d1b2e;
  --text-light: #374151;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.07);
  --shadow: 0 20px 60px rgba(10, 20, 50, 0.12);
  --shadow-soft: 0 8px 32px rgba(10, 20, 50, 0.08);
  --shadow-hover: 0 24px 64px rgba(10, 20, 50, 0.18);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --container: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Cairo", "Tahoma", sans-serif; background: var(--bg); color: var(--text); line-height: 1.8; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; max-width: 100%; }
button, input, textarea, select { font: inherit; }

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.section { padding: 96px 0; }
.section-soft { background: linear-gradient(180deg, #f8faff 0%, #eef3fc 100%); }

/* TOP STRIP */
.top-strip {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: rgba(255,255,255,0.9);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 0;
}
.top-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.top-strip-left, .top-strip-right { display: flex; align-items: center; gap: 12px; }
.top-strip-right a { color: rgba(255,255,255,0.9); transition: color 0.2s; }
.top-strip-right a:hover { color: #fff; }
.divider { opacity: 0.4; }

.firebase-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 1rem;
  grid-column: 1 / -1;
}
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e0e7ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.empty-section {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.9;
}
.empty-section-icon {
  font-size: 1rem;
  line-height: 1;
}

.top-strip-fb-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:8px;
  background:#1877f2;
  color:#fff !important;
  font-weight:800;
  font-size:.95rem;
  text-decoration:none;
  line-height:1;
  box-shadow:0 8px 20px rgba(24,119,242,.18);
  transition:transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.top-strip-fb-link:hover{
  color:#fff !important;
  transform:translateY(-1px);
}


/* HEADER / NAV */
.topbar {
  position: relative;
  z-index: auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(10, 20, 50, 0.06);
  transition: all 0.3s;
}
.topbar-sticky-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
}
.topbar.scrolled { box-shadow: 0 4px 30px rgba(10, 20, 50, 0.10); }
.nav {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-badge {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 50%, var(--accent) 100%);
  box-shadow: 0 8px 20px rgba(26, 86, 219, 0.35);
  overflow: hidden; display: grid; place-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.brand:hover .brand-badge { transform: rotate(-5deg) scale(1.05); }
.brand-badge svg { width: 32px; height: 32px; }
.brand-text-wrap { display: flex; flex-direction: column; }
.brand-title { font-family: "Tajawal", sans-serif; font-size: 1rem; font-weight: 900; color: var(--text); line-height: 1.2; }
.brand-sub { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* MENU */
.menu { display: flex; align-items: center; justify-content: center; gap: 2px; position: relative; }
.menu > a, .menu-parent {
  position: relative; padding: 8px 14px; border-radius: 10px;
  font-size: 0.93rem; font-weight: 700; color: var(--text-light);
  transition: all 0.2s ease; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.menu > a:hover, .menu > a.active, .menu-parent:hover, .menu-parent.active {
  color: var(--primary); background: var(--primary-light);
}
.menu > a.active, .menu-parent.active { font-weight: 800; }
.arrow { font-size: 0.7rem; transition: transform 0.2s; }

/* Results wide CTA bar — between nav and ticker */
.results-cta-bar {
  background: var(--topbar-bg, #0f1f45);
  padding: 6px 0;
}
.results-cta-link {
  display: block;
  width: 100%;
  background: linear-gradient(90deg, #1a56db 0%, #2563eb 60%, #3b7ff5 100%);
  color: #fff !important;
  text-align: center;
  border-radius: 10px;
  padding: 11px 20px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: filter 0.2s, transform 0.2s;
  text-decoration: none;
}
.results-cta-link:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.menu-dropdown { position: relative; }
.menu-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 20px;
}
.menu-dropdown.open .arrow,
.menu-dropdown:focus-within .arrow,
.menu-dropdown:hover .arrow { transform: rotate(180deg); }
.dropdown-panel {
  position: absolute; top: 100%; right: 0; padding-top: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 8px; min-width: 200px;
  display: none; flex-direction: column; gap: 2px; z-index: 1000;
}
.menu-dropdown.open .dropdown-panel,
.menu-dropdown:focus-within .dropdown-panel,
.menu-dropdown:hover .dropdown-panel { display: flex; }
.dropdown-panel a {
  padding: 10px 14px; border-radius: 10px; font-size: 0.9rem; font-weight: 700;
  color: var(--text-light); transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.dropdown-panel a:hover { background: var(--primary-light); color: var(--primary); }

.menu-toggle {
  display: none; width: 44px; height: 44px;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px; transition: all 0.2s;
}
.menu-toggle:hover { border-color: var(--primary); background: var(--primary-light); }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 999px; transition: 0.25s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 26px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff; font-weight: 800; font-size: 0.95rem; cursor: pointer;
  box-shadow: 0 8px 24px rgba(26, 86, 219, 0.30);
  transition: all 0.25s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(26, 86, 219, 0.38); }
.btn:active { transform: translateY(-1px); }
.btn.outline { background: rgba(255,255,255,0.12); color: #fff; border: 1.5px solid rgba(255,255,255,0.35); box-shadow: none; }
.btn.outline:hover { background: rgba(255,255,255,0.20); }
.btn.outline-dark { background: transparent; color: var(--primary); border: 2px solid var(--primary); box-shadow: none; }
.btn.outline-dark:hover { background: var(--primary-light); }
.btn.white { background: #fff; color: var(--primary); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.btn.white:hover { transform: translateY(-3px); }
.nav-cta { font-size: 0.87rem; min-height: 40px; padding: 9px 20px; }
.btn-sm {
  padding: 6px 16px; border-radius: 999px; border: 1.5px solid var(--primary);
  color: var(--primary); background: var(--primary-light); font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-sm:hover { background: var(--primary); color: #fff; }

/* HERO */
.hero {
  position: relative;
  min-height: calc(100vh - 110px);
  background:
    linear-gradient(125deg, rgba(5,15,40,0.92) 0%, rgba(18,64,168,0.60) 60%, rgba(5,150,105,0.25) 100%),
    url('../images/school-main.png') center center / cover no-repeat;
  color: #fff;
  overflow: hidden; display: flex; align-items: center;
}
.hero-bg-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.shape {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,86,219,0.15) 0%, transparent 70%);
}
.shape-1 { width: 800px; height: 800px; top: -200px; left: -200px; }
.shape-2 { width: 600px; height: 600px; bottom: -150px; right: -100px; background: radial-gradient(circle, rgba(5,150,105,0.12) 0%, transparent 70%); }

.hero-layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 420px;
  gap: 48px; align-items: center; width: 100%;
  padding: 80px 0;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  font-size: 0.85rem; font-weight: 700; margin-bottom: 20px; width: fit-content;
  backdrop-filter: blur(8px);
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.6;transform:scale(1.3)} }
.hero h1 {
  font-family: "Tajawal", sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 18px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.highlight {
  background: linear-gradient(135deg, #60a5fa, #34d399);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-p { font-size: 1.05rem; color: rgba(255,255,255,0.88); line-height: 1.9; max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.hero-stats { display: flex; align-items: center; gap: 0; }
.hstat { text-align: center; padding: 0 28px; }
.hstat:first-child { padding-right: 0; }
.hstat strong { display: block; font-family: "Tajawal", sans-serif; font-size: 1.9rem; font-weight: 900; line-height: 1; }
.hstat span { font-size: 0.85rem; color: rgba(255,255,255,0.75); }
.hstat-sep { width: 1px; height: 40px; background: rgba(255,255,255,0.2); }

/* QUICK LINKS CARD */
.quick-links-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(24px);
  border-radius: 24px;
  padding: 24px 24px 20px;
  box-shadow: 0 28px 72px rgba(0,0,0,0.22);
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.6);
}
.quick-links-card h3 {
  font-family: "Tajawal", sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid rgba(15,23,42,0.07);
  display: flex;
  align-items: center;
  gap: 7px;
}

.ql-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.ql-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 8px;
  border-radius: 14px;
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--text);
  transition: all 0.22s ease;
  border: 1.5px solid rgba(15,23,42,0.06);
  cursor: pointer;
  background: #f8faff;
  text-align: center;
  line-height: 1.3;
}
.ql-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(26,86,219,0.14);
  border-color: rgba(26,86,219,0.25);
  background: #e8f0fe;
  color: var(--primary);
}
.ql-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
}

/* Light mode quick link colors */
.ql-results  { background: #eef2ff; border-color: #c7d7fc; }
.ql-results:hover  { background: #dbe4ff; color: var(--primary); }

.ql-news     { background: #fffbeb; border-color: #fde68a; }
.ql-news:hover     { background: #fef3c7; color: #92400e; }

.ql-articles { background: #f0fdf4; border-color: #bbf7d0; }
.ql-articles:hover { background: #dcfce7; color: #166534; }

.ql-announce { background: #fff1f2; border-color: #fecdd3; }
.ql-announce:hover { background: #ffe4e6; color: #9f1239; }

.ql-activities { background: #f5f3ff; border-color: #ddd6fe; }
.ql-activities:hover { background: #ede9fe; color: #5b21b6; }

.ql-gallery  { background: #fdf4ff; border-color: #f5d0fe; }
.ql-gallery:hover  { background: #fae8ff; color: #86198f; }

/* ALERT CARD */
.alert-card {
  background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(251,191,36,0.06) 100%);
  border: 1.5px solid rgba(245,158,11,0.35);
  border-right: 4px solid #f59e0b;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.alert-card strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 4px;
}
.alert-card p {
  font-size: 0.83rem;
  color: #78350f;
  margin: 0;
  line-height: 1.65;
  opacity: 0.85;
}

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.5); z-index: 1;
  animation: bounce 2s ease infinite;
}
.scroll-hint svg { width: 20px; height: 20px; }
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(8px)} }

/* TICKER */
.ticker-bar {
  background: var(--text); color: rgba(255,255,255,0.9);
  padding: 12px 0; overflow: hidden;
  position: relative; z-index: 2;
}
.ticker-inner { display: flex; align-items: center; gap: 20px; }
.ticker-label {
  background: var(--red); color: #fff;
  padding: 4px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 800;
  flex-shrink: 0; white-space: nowrap;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-items {
  display: flex; gap: 40px; white-space: nowrap;
  animation: ticker 28s linear infinite;
}
.ticker-items span { font-size: 0.88rem; font-weight: 600; }
.ticker-items .sep { opacity: 0.4; }
.ticker-entry-default{color:#eef6ff;font-weight:700;}
.ticker-entry-default .ticker-dot{background:rgba(255,255,255,.14);color:#dbeafe;}
@keyframes ticker { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

/* SECTION HEADERS */
.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700;
  background: var(--primary-light); color: var(--primary); margin-bottom: 14px;
}
.section-kicker.light { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.9); }
.section-head h2 {
  font-family: "Tajawal", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  font-weight: 900; line-height: 1.2; color: var(--text); margin-bottom: 12px;
}
.section-head p { color: var(--muted); font-size: 1rem; line-height: 1.9; }
.section-cta { text-align: center; margin-top: 40px; }

/* NEWS LAYOUT */
.news-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; }
.news-featured { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid var(--border); display: flex; flex-direction: column; transition: all 0.3s; }
.news-featured:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.news-featured-img { position: relative; overflow: hidden; }
.news-featured-img img { height: 280px; object-fit: cover; transition: transform 0.5s; }
.news-featured:hover img { transform: scale(1.04); }
.featured-tag {
  position: absolute; top: 16px; right: 16px;
  background: var(--primary); color: #fff;
  padding: 5px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 800;
}
.news-featured-body { padding: 26px; flex: 1; display: flex; flex-direction: column; }
.meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.meta-date { font-size: 0.83rem; color: var(--muted); font-weight: 600; }
.meta-author { font-size: 0.83rem; color: var(--muted); font-weight: 600; }
.news-featured-body h3 { font-size: 1.2rem; font-weight: 800; line-height: 1.5; color: var(--text); margin-bottom: 12px; }
.news-featured-body p { color: var(--muted); font-size: 0.95rem; line-height: 1.8; flex: 1; }
.read-more-btn {
  display: inline-flex; align-items: center; margin-top: 18px;
  color: var(--primary); font-weight: 800; font-size: 0.92rem;
  transition: gap 0.2s;
}
.read-more-btn:hover { gap: 6px; }

.news-side { display: flex; flex-direction: column; gap: 14px; }
.news-mini {
  background: var(--card); border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-soft); border: 1px solid var(--border);
  display: flex; align-items: stretch; transition: all 0.3s; flex: 1;
}
.news-mini:hover { transform: translateX(-4px); box-shadow: var(--shadow-hover); }
.news-mini-img { width: 110px; flex-shrink: 0; overflow: hidden; }
.news-mini-img img { height: 100%; object-fit: cover; transition: transform 0.4s; }
.news-mini:hover img { transform: scale(1.06); }
.news-mini-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.news-mini-body h4 { font-size: 0.92rem; font-weight: 800; line-height: 1.45; color: var(--text); }
.mini-link { font-size: 0.82rem; color: var(--primary); font-weight: 700; margin-top: auto; }
.mini-link:hover { text-decoration: underline; }

/* TAGS */
.tag {
  display: inline-flex; align-items: center; min-height: 26px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary);
  font-size: 0.78rem; font-weight: 800;
}
.tag.green { background: var(--accent-light); color: var(--accent); }
.tag.gold { background: var(--gold-light); color: #92400e; }
.tag-sm { padding: 3px 10px; font-size: 0.73rem; font-weight: 700; border-radius: 999px; background: var(--primary-light); color: var(--primary); }

/* RESULTS SECTION */
.results-section {
  background: linear-gradient(135deg, #0d1b2e 0%, #1240a8 60%, #059669 100%);
  padding: 80px 0; color: #fff;
}
.results-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.results-text h2 { font-family: "Tajawal",sans-serif; font-size: 2.2rem; font-weight: 900; margin: 12px 0 16px; }
.results-text p { color: rgba(255,255,255,0.8); line-height: 1.9; margin-bottom: 24px; }
.results-info { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.result-badge {
  padding: 8px 16px; border-radius: 10px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.88rem; font-weight: 700;
}
.result-badge.muted { opacity: 0.65; }
.grades-preview {
  background: rgba(255,255,255,0.1); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; overflow: hidden;
}
.grade-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s;
}
.grade-row:last-child { border-bottom: none; }
.grade-row:hover { background: rgba(255,255,255,0.06); }
.grade-name { font-size: 0.92rem; font-weight: 700; color: rgba(255,255,255,0.9); }
.grade-status { padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.grade-status.available { background: rgba(52,211,153,0.2); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.grade-status.coming { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }

/* ARTICLES GRID */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: all 0.35s;
}
.article-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.article-icon-wrap { padding: 28px; display: flex; justify-content: center; align-items: center; }
.article-body { padding: 0 24px 24px; flex: 1; display: flex; flex-direction: column; }
.article-body h3 { font-size: 1.05rem; font-weight: 800; line-height: 1.55; color: var(--text); margin: 12px 0 10px; }
.article-body p { color: var(--muted); font-size: 0.93rem; line-height: 1.75; flex: 1; }
.article-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.83rem; color: var(--muted); }

/* ACTIVITIES */
.activities-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.activity-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 380px; box-shadow: var(--shadow-soft); cursor: pointer;
}
.activity-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,15,40,0.92) 0%, rgba(5,15,40,0.35) 45%, rgba(5,15,40,0.03) 100%);
}
.activity-card img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.activity-card:hover img { transform: scale(1.1); }
.activity-overlay {
  position: absolute; right: 0; left: 0; bottom: 0; z-index: 1;
  padding: 24px; color: #fff;
  transform: translateY(6px); transition: transform 0.4s ease;
}
.activity-card:hover .activity-overlay { transform: translateY(0); }
.activity-tag {
  display: inline-flex; padding: 4px 12px; border-radius: 999px;
  background: rgba(26,86,219,0.75); font-size: 0.76rem; font-weight: 700; margin-bottom: 8px;
}
.activity-overlay h3 { font-size: 1.15rem; font-weight: 800; line-height: 1.4; margin-bottom: 6px; }
.activity-overlay p { font-size: 0.88rem; color: rgba(255,255,255,0.82); }

/* STATS */
.stats-section { background: var(--text); padding: 64px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-card {
  background: rgba(255,255,255,0.06); border-radius: var(--radius);
  padding: 34px 22px; text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative; overflow: hidden; transition: all 0.3s;
  min-height: 214px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.stat-card::before {
  content: ""; position: absolute; top: 0; right: 0; left: 0;
  height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent));
}
.stat-card:hover { background: rgba(255,255,255,0.10); transform: translateY(-4px); }
.stat-icon {
  font-size: 1.95rem;
  margin-bottom: 8px;
}
.stat-card strong {
  display: block;
  margin-bottom: 0;
  color: #ffffff;
  font-family: "Tajawal",sans-serif;
  font-size: 1.34rem;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: 0;
  text-wrap: balance;
}
.stat-card span {
  color: rgba(255,255,255,0.72);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.8;
}

@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card {
    min-height: auto;
    padding: 28px 18px;
  }
  .stat-card strong { font-size: 1.16rem; }
  .stat-card span { font-size: 0.92rem; }
}

/* ABOUT */
.about-wrap { display: grid; grid-template-columns: 1.1fr 0.95fr; gap: 40px; align-items: center; }
.about-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 460px; position: relative; }
.about-image img { height: 100%; object-fit: cover; transition: transform 0.6s; }
.about-image:hover img { transform: scale(1.04); }
.about-badge {
  position: absolute; bottom: 20px; right: 20px;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  border-radius: 14px; padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); text-align: center;
}
.about-badge strong { display: block; font-family: "Tajawal",sans-serif; font-size: 1.3rem; font-weight: 900; color: var(--primary); line-height: 1; }
.about-badge span { font-size: 0.78rem; color: var(--muted); }
.about-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 40px; border: 1px solid var(--border); }
.about-card h2 { font-family: "Tajawal",sans-serif; font-size: 1.85rem; font-weight: 900; margin: 10px 0 16px; line-height: 1.3; }
.about-card p { color: var(--muted); margin-bottom: 16px; line-height: 1.9; }
.about-features { display: grid; gap: 10px; margin: 20px 0 26px; }
.about-feature-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-xs);
  background: #f8faff; border: 1px solid rgba(26,86,219,0.07);
  font-size: 0.94rem; font-weight: 600; color: var(--text-light);
}
.about-feature-icon {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--primary-light); font-size: 1.05rem; flex-shrink: 0;
}

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.contact-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 36px; border: 1px solid var(--border); }
.contact-card h3 { font-family: "Tajawal",sans-serif; font-size: 1.3rem; font-weight: 900; margin-bottom: 20px; }
.contact-list { display: grid; gap: 10px; }
.contact-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--radius-xs);
  background: #f8faff; border: 1px solid rgba(26,86,219,0.07); transition: all 0.2s;
}
.contact-item:hover { background: var(--primary-light); border-color: rgba(26,86,219,0.15); }
.contact-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; background: var(--primary-light); color: var(--primary);
  font-size: 1rem; flex-shrink: 0;
}
.contact-item div strong { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.contact-item div span { font-size: 0.92rem; color: var(--text); font-weight: 700; }

/* CONTACT FORM */
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.87rem; font-weight: 700; color: var(--text-light); }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border);
  background: #f8faff; color: var(--text); font-size: 0.93rem;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-group textarea { resize: vertical; }

/* PAGE HERO (inner pages) */
.page-hero {
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
  padding: 56px 0 48px; color: #fff;
}
.page-hero-results { background: linear-gradient(135deg, #0d1b2e 0%, #1240a8 60%, #059669 100%); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 16px; }
.breadcrumb a { color: rgba(255,255,255,0.7); transition: color 0.2s; }
.breadcrumb a:hover { color: #fff; }
.page-hero h1 { font-family: "Tajawal",sans-serif; font-size: 2.4rem; font-weight: 900; margin-bottom: 10px; }
.page-hero p { color: rgba(255,255,255,0.8); font-size: 1rem; }

/* CONTENT FILTER */
.content-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-btn {
  padding: 9px 20px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-light); font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* NEWS FULL GRID (news page) */
.news-full-grid { display: grid; gap: 24px; }
.news-card-full {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); border: 1px solid var(--border);
  display: grid; grid-template-columns: 320px 1fr; transition: all 0.35s;
}
.news-card-full:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.news-card-img { overflow: hidden; }
.news-card-img img { height: 100%; object-fit: cover; min-height: 220px; transition: transform 0.5s; }
.news-card-full:hover img { transform: scale(1.05); }
.news-card-body { padding: 28px 32px; display: flex; flex-direction: column; }
.news-card-body h3 { font-size: 1.2rem; font-weight: 800; line-height: 1.5; color: var(--text); margin-bottom: 12px; }
.news-card-body p { color: var(--muted); line-height: 1.85; flex: 1; }

/* ARTICLES FULL (articles page) */
.articles-full-grid { display: grid; gap: 28px; }
.article-full-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); border: 1px solid var(--border);
  display: grid; grid-template-columns: 200px 1fr; transition: all 0.3s;
}
.article-full-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.article-full-header { display: flex; align-items: center; justify-content: center; min-height: 160px; }
.article-full-body { padding: 28px 32px; display: flex; flex-direction: column; }
.article-full-body h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.5; color: var(--text); margin: 12px 0 10px; }
.article-full-body p { color: var(--muted); line-height: 1.85; flex: 1; }
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }

/* RESULTS PAGE */
.results-lookup-card {
  background: var(--card); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 32px;
}
.results-lookup-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.results-lookup-icon { font-size: 2.5rem; }
.results-lookup-header h2 { font-family: "Tajawal",sans-serif; font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.results-lookup-header p { color: var(--muted); font-size: 0.95rem; }
.results-form { display: flex; flex-direction: column; gap: 16px; }

.result-display { background: var(--card); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); border: 2px solid var(--primary); margin-bottom: 48px; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.result-student-info { display: flex; align-items: center; gap: 16px; }
.result-avatar { font-size: 3rem; width: 72px; height: 72px; background: var(--primary-light); border-radius: 50%; display: grid; place-items: center; }
.result-student-info h3 { font-family: "Tajawal",sans-serif; font-size: 1.4rem; font-weight: 900; margin-bottom: 4px; }
.result-student-info span { color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.result-total-badge { text-align: center; background: var(--primary-light); border-radius: 16px; padding: 16px 24px; }
.result-total-badge strong { display: block; font-family: "Tajawal",sans-serif; font-size: 2.2rem; font-weight: 900; color: var(--primary); }
.result-total-badge span { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.subjects-grid { display: grid; gap: 12px; margin-bottom: 24px; }
.subject-row { display: grid; grid-template-columns: 180px 1fr 80px 90px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.subject-name { font-size: 0.93rem; font-weight: 700; color: var(--text); }
.subject-bar-wrap { height: 8px; background: #f0f4f8; border-radius: 999px; overflow: hidden; }
.subject-bar { height: 100%; border-radius: 999px; transition: width 1s ease; }
.subject-score { font-size: 0.88rem; font-weight: 700; color: var(--text-light); text-align: center; }
.subject-grade { padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; text-align: center; }
.grade-a { background: var(--accent-light); color: var(--accent); }
.grade-b { background: var(--primary-light); color: var(--primary); }
.grade-c { background: var(--gold-light); color: #92400e; }

.result-footer { display: flex; align-items: center; justify-content: space-between; }
.result-status { padding: 10px 20px; border-radius: 12px; font-weight: 800; font-size: 1rem; }
.result-status.pass { background: var(--accent-light); color: var(--accent); }
.result-status.fail { background: #fee2e2; color: var(--red); }

.grades-section { margin-top: 64px; }
.grades-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.grade-card {
  background: var(--card); border-radius: var(--radius-sm); padding: 24px 16px;
  text-align: center; box-shadow: var(--shadow-soft); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: all 0.3s;
}
.grade-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.grade-card-num {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-family: "Tajawal",sans-serif; font-size: 1.5rem; font-weight: 900;
}
.grade-card h4 { font-size: 0.92rem; font-weight: 800; color: var(--text); }

/* FOOTER */
.footer { background: var(--text); color: rgba(255,255,255,0.85); }
.footer-main { padding: 56px 0 40px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand-badge {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-family: "Tajawal",sans-serif; font-size: 1.15rem; font-weight: 900;
}
.footer-brand-name { font-family: "Tajawal",sans-serif; font-size: 0.97rem; font-weight: 800; color: #fff; line-height: 1.3; }
.footer-desc { color: rgba(255,255,255,0.45); font-size: 0.9rem; line-height: 1.85; margin-bottom: 16px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(255,255,255,0.08); transition: background 0.2s; font-size: 1.1rem;
}
.footer-social a:hover { background: rgba(255,255,255,0.16); }
.footer-col h4 { font-family: "Tajawal",sans-serif; font-size: 1rem; font-weight: 800; color: #fff; margin-bottom: 18px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  color: rgba(255,255,255,0.5); font-size: 0.9rem; transition: color 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.footer-links a::before { content: "←"; font-size: 0.75rem; transition: transform 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-links a:hover::before { transform: translateX(-3px); }
.footer-contact-item { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.5); font-size: 0.88rem; margin-bottom: 10px; }
.footer-bottom {
  padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: rgba(255,255,255,0.35); font-size: 0.85rem;
}

/* REVEAL ANIMATION */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.75s cubic-bezier(0.22,1,0.36,1), transform 0.75s cubic-bezier(0.22,1,0.36,1); }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-card-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .ql-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .grades-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .nav { grid-template-columns: auto 1fr auto; }
  .nav-end-group { grid-column: 2; grid-row: 1; justify-self: end; margin-left: 4px; }
  .menu-toggle { display: inline-flex; grid-column: 3; grid-row: 1; }
  .nav-cta { display: none; }
  .menu {
    position: absolute; top: calc(100% + 8px); right: 20px; left: 20px;
    display: none; flex-direction: column; align-items: stretch;
    gap: 4px; padding: 12px; background: var(--card);
    border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  }
  .menu.open { display: flex; }
  .menu > a, .menu-parent { padding: 12px 16px; border-radius: 12px; }
  .dropdown-panel { position: static; box-shadow: none; border: none; padding: 4px 0 4px 20px; display: none; }
  .menu-dropdown.open .dropdown-panel,
  .menu-dropdown:focus-within .dropdown-panel { display: flex; }
  .news-layout, .results-inner, .about-wrap, .contact-grid { grid-template-columns: 1fr; }
  .activities-grid, .articles-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
  .news-card-full { grid-template-columns: 1fr; }
  .news-card-img img { min-height: 200px; max-height: 220px; }
  .article-full-card { grid-template-columns: 1fr; }
  .article-full-header { min-height: 100px; }
  .subject-row { grid-template-columns: 1fr 1fr 60px 80px; }
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero-layout { padding: 60px 0; }
  .activities-grid, .articles-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grades-cards { grid-template-columns: repeat(2, 1fr); }
  .hero-card-panel { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .subject-row { grid-template-columns: 1fr 60px; }
  .subject-bar-wrap, .subject-grade { display: none; }
  .top-strip-right { display: none; }
}



/* PROFESSIONAL UI ENHANCEMENTS */
html { scrollbar-width: thin; scrollbar-color: rgba(26,86,219,0.45) transparent; }
body {
  transition: background-color .35s ease, color .35s ease;
}
body::selection {
  background: rgba(26,86,219,0.18);
}
.skip-link {
  position: fixed;
  top: 14px;
  right: 14px;
  transform: translateY(-160%);
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 2500;
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease;
}
.skip-link:focus { transform: translateY(0); }
.page-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 2200;
  pointer-events: none;
}
.page-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 18px rgba(26,86,219,.35);
  transition: width .1s linear;
}

/* .theme-toggle — حُذف في P5: الثيم تلقائي من النظام */

/* ── زر الثيم + بصمة CodeKenz في التوب بار ── */
.nav-end-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.site-theme-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.site-theme-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
body[data-theme="light"] .site-theme-btn {
  border-color: rgba(0,0,0,.15);
  background: rgba(0,0,0,.06);
  color: #334155;
}
body[data-theme="light"] .site-theme-btn:hover { background: rgba(0,0,0,.1); }
.topbar-dev-badge {
  font-size: .68rem;
  font-weight: 800;
  color: rgba(255,255,255,.88);
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,.32);
  background: rgba(255,255,255,.08);
  padding: 3px 10px;
  border-radius: 20px;
  transition: all .2s;
  white-space: nowrap;
  letter-spacing: .2px;
}
.topbar-dev-badge:hover {
  color: #fff;
  border-color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.15);
}
body[data-theme="light"] .topbar-dev-badge {
  color: #1d4ed8;
  border-color: rgba(29,78,216,.3);
  background: rgba(29,78,216,.06);
}
body[data-theme="light"] .topbar-dev-badge:hover {
  color: #1d4ed8;
  border-color: #1d4ed8;
  background: rgba(29,78,216,.1);
}
@media (max-width: 480px) { .topbar-dev-badge { font-size: .6rem; padding: 2px 7px; } }

.back-to-top {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 18px 32px rgba(13, 27, 46, .18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
  z-index: 1300;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topbar {
  background: color-mix(in srgb, var(--card) 88%, transparent);
}
.topbar.scrolled {
  background: color-mix(in srgb, var(--card) 94%, transparent);
}
.menu > a:focus-visible,
.menu-parent:focus-visible,
.dropdown-panel a:focus-visible,
.btn:focus-visible,
.filter-btn:focus-visible,
.menu-toggle:focus-visible,
.back-to-top:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(26,86,219,.18);
  outline-offset: 2px;
}

.section-head,
.results-inner,
.about-card,
.about-image,
.contact-card,
.news-card-full,
.article-full-card,
.grade-card,
.quick-links-card,
.alert-card,
.stat-card,
.result-display,
.results-lookup-card,
.news-featured,
.news-mini,
.activity-card,
.gallery-item,
.announcement-card {
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, background-color .28s ease;
}

.section-shell {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 86%, transparent), color-mix(in srgb, var(--card) 98%, transparent));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.staff-card {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
.staff-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.staff-avatar {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border-radius: 18px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-light), rgba(5,150,105,.12));
}
.staff-role {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.staff-card h3 {
  font-family: "Tajawal", sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 10px;
}
.staff-card p {
  color: var(--muted);
  line-height: 1.9;
}


/* =====================================================
   DARK MODE — BASE VARIABLES
   ===================================================== */
body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0c1627;
  --card: #0f1b2d;
  --text: #f1f5f9;
  --text-light: #d6deea;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.12);
  --primary-light: rgba(59, 130, 246, 0.12);
  --accent-light: rgba(16, 185, 129, 0.12);
  --gold-light: rgba(245, 158, 11, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.26);
  --shadow-hover: 0 30px 70px rgba(0, 0, 0, 0.45);
}
body[data-theme="dark"] .section-soft {
  background: linear-gradient(180deg, #081221 0%, #0c1829 100%);
}
body[data-theme="dark"] .top-strip {
  background: linear-gradient(90deg, #091a32 0%, #143b8f 50%, #0b5f54 100%);
}
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .menu-toggle {
  background: rgba(10, 18, 31, 0.85);
}

/* Dark mode cards — فقط على العناصر نفسها مش الـ children */
body[data-theme="dark"] .dropdown-panel,
body[data-theme="dark"] .menu,
body[data-theme="dark"] .quick-links-card,
body[data-theme="dark"] .news-featured,
body[data-theme="dark"] .news-mini,
body[data-theme="dark"] .contact-item,
body[data-theme="dark"] .staff-card,
body[data-theme="dark"] .results-lookup-card,
body[data-theme="dark"] .result-display,
body[data-theme="dark"] .news-card-full,
body[data-theme="dark"] .article-full-card,
body[data-theme="dark"] .grade-card,
body[data-theme="dark"] .contact-card,
body[data-theme="dark"] .about-card,
body[data-theme="dark"] .about-image,
body[data-theme="dark"] .announcement-card,
body[data-theme="dark"] .gallery-item,
body[data-theme="dark"] .filter-btn,
body[data-theme="dark"] .page-hero,
body[data-theme="dark"] .content-card,
body[data-theme="dark"] .article-card {
  background-color: var(--card);
  border-color: var(--border);
}

/* الـ stat-card له خلفية خاصة — لا نعيد تعريفها من var(--card) */
body[data-theme="dark"] .stat-card {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.07);
}

body[data-theme="dark"] .menu > a:hover,
body[data-theme="dark"] .menu > a.active,
body[data-theme="dark"] .menu-parent:hover,
body[data-theme="dark"] .menu-parent.active,
body[data-theme="dark"] .dropdown-panel a:hover,
body[data-theme="dark"] .filter-btn:hover,
body[data-theme="dark"] .filter-btn.active,
body[data-theme="dark"] .contact-item:hover,
body[data-theme="dark"] .about-feature-item,
body[data-theme="dark"] .subject-bar-wrap {
  background: rgba(255,255,255,0.06);
}

/* =====================================================
   DARK MODE — QUICK LINKS (الإصلاح الجوهري)
   كل ql-item له لون خاص به ولا يتأثر بالـ override العام
   ===================================================== */
body[data-theme="dark"] .ql-item {
  color: var(--text-light);
}

body[data-theme="dark"] .ql-results {
  background: rgba(59, 130, 246, 0.14) !important;
  border-color: rgba(96, 165, 250, 0.22) !important;
}
body[data-theme="dark"] .ql-results:hover {
  background: rgba(59, 130, 246, 0.24) !important;
  color: #93c5fd;
}

body[data-theme="dark"] .ql-news {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(251, 191, 36, 0.22) !important;
}
body[data-theme="dark"] .ql-news:hover {
  background: rgba(245, 158, 11, 0.24) !important;
  color: #fcd34d;
}

body[data-theme="dark"] .ql-articles {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(52, 211, 153, 0.22) !important;
}
body[data-theme="dark"] .ql-articles:hover {
  background: rgba(16, 185, 129, 0.24) !important;
  color: #6ee7b7;
}

body[data-theme="dark"] .ql-announce {
  background: rgba(244, 63, 94, 0.14) !important;
  border-color: rgba(251, 113, 133, 0.22) !important;
}
body[data-theme="dark"] .ql-announce:hover {
  background: rgba(244, 63, 94, 0.24) !important;
  color: #fda4af;
}

body[data-theme="dark"] .ql-activities {
  background: rgba(139, 92, 246, 0.14) !important;
  border-color: rgba(167, 139, 250, 0.22) !important;
}
body[data-theme="dark"] .ql-activities:hover {
  background: rgba(139, 92, 246, 0.24) !important;
  color: #c4b5fd;
}

body[data-theme="dark"] .ql-gallery {
  background: rgba(236, 72, 153, 0.14) !important;
  border-color: rgba(244, 114, 182, 0.22) !important;
}
body[data-theme="dark"] .ql-gallery:hover {
  background: rgba(236, 72, 153, 0.24) !important;
  color: #f9a8d4;
}

/* =====================================================
   DARK MODE — STATS SECTION
   ===================================================== */
body[data-theme="dark"] .stats-section {
  background: #030d1c;
}

body[data-theme="dark"] .stat-card strong {
  background: linear-gradient(90deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =====================================================
   DARK MODE — MISC
   ===================================================== */
body[data-theme="dark"] .alert-card {
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.05));
  border-color: rgba(245,158,11,.24);
}
body[data-theme="dark"] .footer {
  background: #050d18;
}
body[data-theme="dark"] .footer-desc,
body[data-theme="dark"] .footer-links a,
body[data-theme="dark"] .footer-contact-item,
body[data-theme="dark"] .footer-bottom {
  color: rgba(255,255,255,.68);
}
body[data-theme="dark"] .form-group input,
body[data-theme="dark"] .form-group select,
body[data-theme="dark"] .form-group textarea {
  background: #0b1627;
  border-color: var(--border);
}
body[data-theme="dark"] .subject-bar-wrap { background: rgba(255,255,255,.08); }
body[data-theme="dark"] .result-total-badge,
body[data-theme="dark"] .result-avatar { background: rgba(59,130,246,.12); }
body[data-theme="dark"] .page-hero {
  background: linear-gradient(135deg, #050d18 0%, #0f2550 55%, #0a5247 100%);
}
body[data-theme="dark"] .hero {
  background:
    linear-gradient(125deg, rgba(2,8,23,0.94) 0%, rgba(10,33,85,0.78) 60%, rgba(5,92,78,0.46) 100%),
    url('../images/school-main.png') center center / cover no-repeat;
}
body[data-theme="dark"] .ticker-bar {
  background: #060f1d;
}

@media (max-width: 960px) {
  .nav {
    grid-template-columns: auto auto auto;
  }
}
@media (max-width: 820px) {
  .staff-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .back-to-top {
    left: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }
}




/* ===== Premium Formal Upgrade ===== */
:root{
  --premium-navy: #071225;
  --premium-deep: #0b1730;
  --premium-cyan: #4fd1ff;
  --premium-aqua: #49e3c8;
  --premium-gold: #f4c66b;
  --surface-glass: rgba(255,255,255,0.72);
  --surface-glass-dark: rgba(9,16,32,0.72);
  --ring-soft: 0 0 0 1px rgba(255,255,255,0.08) inset;
}

body.premium-ui{
  background:
    radial-gradient(circle at top left, rgba(26,86,219,0.08), transparent 25%),
    radial-gradient(circle at top right, rgba(5,150,105,0.07), transparent 24%),
    var(--bg);
}

body[data-theme="dark"].premium-ui{
  --bg: #04101f;
  --bg-soft: #081426;
  --card: #09182c;
  --text: #edf4ff;
  --text-light: #d6e5ff;
  --muted: #90a6c6;
  --border: rgba(143, 177, 222, 0.12);
  --shadow: 0 24px 80px rgba(0,0,0,0.42);
  --shadow-soft: 0 14px 46px rgba(0,0,0,0.30);
  --shadow-hover: 0 28px 90px rgba(0,0,0,0.5);
  background:
    radial-gradient(circle at 10% 10%, rgba(34,211,238,0.12), transparent 20%),
    radial-gradient(circle at 90% 0%, rgba(59,130,246,0.18), transparent 18%),
    radial-gradient(circle at 50% -10%, rgba(5,150,105,0.12), transparent 25%),
    linear-gradient(180deg, #020817 0%, #071223 48%, #09182c 100%);
}

.top-strip{
  background: linear-gradient(90deg, #0f2f6b 0%, #1148a4 40%, #0e8a7b 100%);
  box-shadow: 0 8px 30px rgba(6, 24, 58, 0.18);
}

.topbar{
  background: color-mix(in srgb, var(--card) 90%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  box-shadow: 0 8px 30px rgba(8,20,44,0.08);
}
body[data-theme="dark"] .topbar{
  background: rgba(4,16,31,0.82);
  box-shadow: 0 10px 40px rgba(0,0,0,0.28);
}

.menu > a, .menu-parent{
  transition: all .35s cubic-bezier(.22,1,.36,1);
}
.menu > a:hover, .menu > a.active, .menu-parent:hover, .menu-parent.active{
  transform: translateY(-1px);
}

.hero{
  min-height: calc(100vh - 102px);
  isolation: isolate;
}
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(112deg, rgba(2,8,23,0.92) 12%, rgba(5,15,40,0.84) 34%, rgba(18,64,168,0.48) 64%, rgba(20,184,166,0.14) 100%);
  z-index:0;
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mix-blend-mode: soft-light;
  opacity:.38;
  z-index:0;
}
.hero-layout, .hero-content, .hero-card-panel, .scroll-hint{ position:relative; z-index:1; }
.hero-layout{
  align-items: center;
  gap: clamp(24px, 4vw, 52px);
}
.hero-content{
  max-width: 720px;
}
.hero-badge{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.hero h1{
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.hero .highlight{
  background: linear-gradient(90deg, #76e4ff 0%, #51d8cf 35%, #a5f3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(79,209,255,0.12);
}
.hero-p{
  max-width: 60ch;
  color: rgba(255,255,255,0.88);
  font-size: 1.08rem;
}
.hero-actions{
  gap: 14px;
  margin-bottom: 22px;
}
.hero-actions .btn{
  min-width: 180px;
  justify-content: center;
}
.hero-trust-strip{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.trust-item{
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--ring-soft);
  backdrop-filter: blur(14px);
}
.trust-item strong{
  display:block;
  color:#fff;
  font-size:.95rem;
  font-weight:800;
  margin-bottom: 4px;
}
.trust-item span{
  display:block;
  color: rgba(255,255,255,0.72);
  font-size: .82rem;
  line-height: 1.7;
}
.hero-stats{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}
.hero-stats .hstat strong{
  text-shadow: 0 0 20px rgba(77,225,255,0.12);
}

.hero-card-panel{
  animation: floatPremium 7s ease-in-out infinite;
}
@keyframes floatPremium{
  0%,100%{ transform: translateY(0);}
  50%{ transform: translateY(-8px);}
}

.quick-links-card{
  background: color-mix(in srgb, var(--card) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 70%, rgba(255,255,255,0.06));
  box-shadow: 0 26px 60px rgba(0,0,0,0.20), var(--ring-soft);
  backdrop-filter: blur(22px) saturate(120%);
}
body[data-theme="dark"] .quick-links-card{
  background: rgba(10, 21, 39, 0.88);
  border-color: rgba(143, 177, 222, 0.14);
}
.quick-links-card h3{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.quick-links-card h3::after{
  content:"";
  display:block;
  width:72px;
  height:2px;
  border-radius:999px;
  background: linear-gradient(90deg, var(--premium-cyan), transparent);
}
.ql-item{
  min-height: 108px;
  justify-content:center;
  border-width: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
  transition: all .42s cubic-bezier(.22,1,.36,1);
}
.ql-item:hover{
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(2,8,23,0.18);
}

.alert-card{
  background: linear-gradient(135deg, rgba(245,158,11,0.16), rgba(220,38,38,0.08));
  border: 1px solid rgba(245,158,11,0.26);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(20,20,20,0.12);
}
body[data-theme="dark"] .alert-card{
  background: linear-gradient(135deg, rgba(245,158,11,0.16), rgba(220,38,38,0.10));
}

.ticker-bar{
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  backdrop-filter: blur(16px);
}
body[data-theme="dark"] .ticker-bar{
  background: rgba(7,19,36,0.84);
}

.section-head{
  max-width: 760px;
  margin-inline:auto;
  text-align:center;
}
.section-head .section-kicker{
  padding: 7px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-light) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.04);
}
body[data-theme="dark"] .section-head .section-kicker{
  background: rgba(12,30,56,0.88);
}
.section-head h2{
  position:relative;
  display:inline-block;
  padding-bottom:14px;
}
.section-head h2::after{
  content:"";
  position:absolute;
  right:50%;
  transform: translateX(50%);
  bottom:0;
  width:88px;
  height:4px;
  border-radius:999px;
  background: linear-gradient(90deg, var(--primary), var(--premium-cyan));
  box-shadow: 0 8px 24px rgba(26,86,219,0.16);
}

.news-featured,
.news-card-side,
.news-card-full,
.article-card,
.gallery-card,
.activity-card,
.stat-card,
.about-card,
.contact-card,
.staff-card,
.results-form,
.result-card,
.announcement-card{
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s cubic-bezier(.22,1,.36,1), border-color .35s ease;
}

.news-featured:hover,
.news-card-side:hover,
.news-card-full:hover,
.article-card:hover,
.gallery-card:hover,
.activity-card:hover,
.stat-card:hover,
.about-card:hover,
.contact-card:hover,
.staff-card:hover,
.result-card:hover,
.announcement-card:hover{
  transform: translateY(-8px);
}

.news-featured,
.news-card-side,
.news-card-full,
.article-card,
.gallery-card,
.activity-card,
.stat-card,
.about-card,
.contact-card,
.staff-card,
.results-form,
.result-card,
.announcement-card{
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
}

.news-featured-img img,
.news-card-img img,
.article-card img,
.gallery-card img,
.activity-card img{
  transition: transform .75s cubic-bezier(.22,1,.36,1), filter .45s ease;
}
.news-featured:hover img,
.news-card-side:hover img,
.news-card-full:hover img,
.article-card:hover img,
.gallery-card:hover img,
.activity-card:hover img{
  transform: scale(1.06);
  filter: saturate(1.05);
}


.stat-card{
  position:relative;
  overflow:hidden;
}
.stat-card::before{
  content:"";
  position:absolute;
  inset:auto -20% 100% auto;
  width:180px;
  height:180px;
  border-radius:50%;
  background: radial-gradient(circle, rgba(79,209,255,0.16), transparent 68%);
  transition: transform .45s ease;
}
.stat-card:hover::before{
  transform: translateY(145px);
}
.stat-card strong{
  background: linear-gradient(90deg, var(--primary), var(--premium-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-card,
.contact-card,
.results-form{
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card) 98%, #fff) 0%, color-mix(in srgb, var(--card) 94%, transparent) 100%);
}
body[data-theme="dark"] .about-card,
body[data-theme="dark"] .contact-card,
body[data-theme="dark"] .results-form{
  background: linear-gradient(180deg, rgba(10,24,43,0.98), rgba(8,20,36,0.98));
}

.page-hero{
  position: relative;
  overflow:hidden;
  isolation:isolate;
}
.page-hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 12% 30%, rgba(255,255,255,0.12), transparent 18%),
    radial-gradient(circle at 88% 12%, rgba(79,209,255,0.12), transparent 16%);
  z-index:0;
}
.page-hero > .container{ position:relative; z-index:1; }
.page-hero h1{
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}
.page-hero p{
  max-width: 62ch;
}

.footer{
  position: relative;
  overflow:hidden;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}
.footer::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--premium-cyan), transparent);
  opacity:.85;
}

.back-to-top{
  width: 52px;
  height: 52px;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(13,27,46,.22);
}

.menu > a:focus-visible,
.menu-parent:focus-visible,
.btn:focus-visible,
.back-to-top:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(79,209,255,0.24);
}

@media (max-width: 980px){
  .hero-trust-strip{
    grid-template-columns: 1fr;
  }
  .hero{
    min-height: auto;
  }
}

@media (max-width: 640px){
  .hero h1{
    font-size: clamp(2.15rem, 10vw, 3rem);
  }
  .hero-actions{
    flex-direction: column;
  }
  .hero-actions .btn{
    width: 100%;
  }
}


.page-inline-note{margin-top:14px;padding:12px 16px;border:1px solid rgba(26,86,219,.14);background:rgba(26,86,219,.06);border-radius:14px;color:var(--muted);font-size:.96rem;line-height:1.8}.dynamic-news-body{margin-top:14px;padding-top:14px;border-top:1px dashed rgba(15,23,42,.15)}.dynamic-news-body-inner{line-height:1.95;color:var(--text);white-space:pre-line}.dynamic-listing + .news-full-grid.static-fallback{margin-top:28px;padding-top:12px;border-top:1px dashed rgba(15,23,42,.14)}


/* ===== Hero refinement ===== */
.hero-layout-refined{
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.hero-badge-refined{
  width: fit-content;
  margin-bottom: 22px;
}

.school-title-block{
  margin-bottom: 24px;
}

.school-kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  color: rgba(255,255,255,0.88);
  font-size: 0.92rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
}

.school-hero-title{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 18px;
  line-height: 1;
}

.school-hero-title .line-primary{
  display: block;
  font-size: clamp(2.7rem, 5vw, 5rem);
  color: #fff;
  letter-spacing: -0.035em;
}

.school-hero-title .line-secondary{
  display: block;
  font-size: clamp(2.35rem, 4.2vw, 4.35rem);
  background: linear-gradient(90deg, #86e9ff 0%, #59dbc8 48%, #b8f8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.03em;
}

.school-hero-subtitle{
  max-width: 62ch;
  font-size: 1.08rem;
  line-height: 1.95;
  color: rgba(255,255,255,0.88);
  margin: 0;
}

.hero-actions-refined{
  margin-bottom: 26px;
}

.hero-trust-strip-refined{
  margin-bottom: 24px;
}

.hero-trust-strip-refined .trust-item{
  min-height: 92px;
}

@media (max-width: 1100px){
  .hero-layout-refined{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px){
  .school-kicker{
    font-size: 0.84rem;
    padding: 7px 12px;
  }

  .school-hero-title .line-primary{
    font-size: clamp(2.2rem, 8vw, 3.35rem);
  }

  .school-hero-title .line-secondary{
    font-size: clamp(1.95rem, 7vw, 2.85rem);
  }

  .school-hero-subtitle{
    font-size: 1rem;
    line-height: 1.85;
  }
}


/* Final hero refinement */
.hero-layout-refined{
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 42px;
}

.hero-content{
  max-width: 760px;
  margin-inline-start: auto;
}

.hero-badge-refined{
  margin-bottom: 16px;
}

.hero-badge-refined,
.school-kicker{
  box-shadow: 0 10px 30px rgba(7,18,44,0.16);
}

.school-title-block{
  margin-bottom: 20px;
}

.school-kicker{
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 7px 14px;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.84);
}

.school-hero-title{
  gap: 10px;
  margin: 0 0 16px;
  line-height: 1.06;
}

.school-hero-title .line-primary{
  font-size: clamp(2.45rem, 4.4vw, 4.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.school-hero-title .line-secondary{
  font-size: clamp(2.05rem, 3.7vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.school-hero-subtitle{
  max-width: 54ch;
  font-size: 1.02rem;
  line-height: 1.9;
  color: rgba(255,255,255,0.82);
}

.hero-actions-refined{
  margin-bottom: 22px;
  gap: 12px;
}

.hero-actions-refined .btn{
  min-width: 176px;
}

.hero-trust-strip-refined{
  margin-bottom: 20px;
  gap: 12px;
}

.hero-trust-strip-refined .trust-item{
  min-height: 84px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
}

.hero-trust-strip-refined .trust-item strong{
  font-size: 1rem;
  font-weight: 800;
}

.hero-trust-strip-refined .trust-item span{
  font-size: 0.92rem;
  line-height: 1.7;
}

.hero-stats{
  margin-top: 10px;
}

.hero-card-panel{
  align-self: center;
}

.quick-links-card{
  padding: 24px 24px 20px;
  border-radius: 24px;
}

.quick-links-card h3{
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.ql-grid{
  gap: 9px;
}

.ql-item{
  min-height: 86px;
  border-radius: 14px;
}

.alert-card{
  margin-top: 12px;
  min-height: auto;
  padding: 16px 18px;
}

.alert-card strong{
  font-size: 0.92rem;
}

.alert-card p{
  font-size: 0.83rem;
  line-height: 1.65;
}

@media (max-width: 1100px){
  .hero-layout-refined{
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-content{
    max-width: 100%;
    margin-inline-start: 0;
  }
}

@media (max-width: 768px){
  .hero-badge-refined,
  .school-kicker{
    font-size: 0.78rem;
  }
  .school-hero-title{
    gap: 8px;
  }
  .school-hero-title .line-primary{
    font-size: clamp(2.15rem, 8vw, 3.2rem);
  }
  .school-hero-title .line-secondary{
    font-size: clamp(1.82rem, 7vw, 2.7rem);
  }
  .school-hero-subtitle{
    font-size: 0.96rem;
    line-height: 1.8;
  }
  .hero-actions-refined .btn{
    min-width: 0;
  }
}


/* ===== Hero final professional refinement ===== */
.school-hero-title{
  gap: 10px;
  margin: 0 0 16px;
  line-height: 0.96;
}

.school-hero-title .line-primary,
.school-hero-title .line-secondary{
  font-family: "Tajawal", "Cairo", sans-serif;
  text-wrap: balance;
}

.school-hero-title .line-primary{
  font-size: clamp(2.55rem, 4.7vw, 4.45rem);
  font-weight: 800;
  letter-spacing: -0.028em;
}

.school-hero-title .line-secondary{
  font-size: clamp(2.15rem, 4vw, 3.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.school-hero-subtitle{
  max-width: 58ch;
  font-size: 1.03rem;
  line-height: 1.95;
  color: rgba(255,255,255,0.84);
}

.hero-trust-strip-refined{
  gap: 14px;
  margin-bottom: 22px;
}

.hero-trust-strip-refined .trust-item{
  min-height: auto;
}

.trust-item-info{
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.07));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 30px rgba(8,18,42,0.16);
}

.trust-item-info strong{
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.trust-item-info span{
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.82);
  margin-top: 2px;
}

@media (max-width: 900px){
  .hero-trust-strip-refined{
    grid-template-columns: 1fr;
  }

  .school-hero-title .line-primary{
    font-size: clamp(2.15rem, 8vw, 3.35rem);
  }

  .school-hero-title .line-secondary{
    font-size: clamp(1.85rem, 7vw, 2.95rem);
  }
}


/* ===== Final hero polish with entry urgent ===== */
.hero-layout-refined{
  grid-template-columns:minmax(320px,0.96fr) minmax(0,1.04fr);
  gap:36px;
}
.hero-content{max-width:700px;}
.hero-meta-stack{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  margin-bottom:18px;
}
.hero-kicker-card{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 18px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.14);
  color:rgba(255,255,255,0.92);
  font-size:0.92rem;
  font-weight:700;
  backdrop-filter:blur(10px);
}
.hero-badge-refined{margin-bottom:0;}
.hero-urgent-banner{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:start;
  padding:16px 18px;
  margin-bottom:22px;
  border-radius:22px;
  background:linear-gradient(135deg, rgba(17,94,89,0.22), rgba(30,64,175,0.18));
  border:1px solid rgba(103,232,249,0.22);
  box-shadow:0 18px 40px rgba(6,18,45,0.24);
  backdrop-filter:blur(14px);
}
.hero-urgent-label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:72px;
  padding:10px 12px;
  border-radius:999px;
  background:rgba(13,148,136,0.18);
  color:#b9fff8;
  font-size:0.9rem;
  font-weight:800;
}
.hero-urgent-body strong{
  display:block;
  margin-bottom:6px;
  color:#fff;
  font-size:1rem;
  font-weight:800;
}
.hero-urgent-body p{
  margin:0;
  color:rgba(255,255,255,0.84);
  line-height:1.8;
  font-size:0.95rem;
}
.school-title-block{margin-bottom:20px;}
.school-hero-title{
  gap:2px;
  line-height:1.08;
  margin-bottom:14px;
}
.school-hero-title .line-primary{
  font-size:clamp(2.55rem,4.35vw,4.6rem);
  font-weight:800;
  letter-spacing:-0.028em;
}
.school-hero-title .line-secondary{
  font-size:clamp(2.12rem,3.8vw,3.78rem);
  font-weight:700;
  letter-spacing:-0.022em;
}
.school-hero-subtitle{
  max-width:58ch;
  font-size:1rem;
  line-height:1.95;
  color:rgba(255,255,255,0.86);
}
.hero-actions-refined{margin-bottom:18px;gap:14px;}
.hero-actions-refined .btn{
  min-width:180px;
}
.quick-links-card{
  padding:22px 22px 18px;
  background:rgba(255,255,255,0.97);
  border:1px solid rgba(255,255,255,0.7);
  backdrop-filter:blur(24px);
}
.quick-links-card h3{font-size:1rem;font-weight:900;margin-bottom:14px;color:var(--text);}
.ql-grid{gap:9px;}
.ql-item{
  min-height:82px;
  border-radius:13px;
  font-size:0.80rem;
  color:var(--text);
}
.ql-icon{font-size:1.4rem;}
.alert-card-refined{
  padding:15px 17px;
  border-radius:16px;
  background:linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.05));
  border:1.5px solid rgba(245,158,11,0.30);
  border-right:4px solid #f59e0b;
}
.alert-card-refined strong{font-size:0.91rem;color:#92400e;}
.alert-card-refined p{font-size:0.82rem;line-height:1.65;color:#78350f;opacity:0.85;}
.hero-trust-strip-refined{
  gap:10px;
  margin-bottom:16px;
}
.trust-item-info{
  padding:14px 15px 12px;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.06));
  border:1px solid rgba(255,255,255,0.14);
}
.trust-item-info strong{font-size:0.92rem;margin-bottom:6px;font-weight:800;}
.trust-item-info span{font-size:0.81rem;line-height:1.6;color:rgba(255,255,255,0.8);}
.hero-stats{
  padding:14px 18px;
  border-radius:20px;
  background:linear-gradient(90deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
}
@media (max-width: 1100px){
  .hero-layout-refined{grid-template-columns:1fr;}
  .hero-content{max-width:none;}
  .hero-meta-stack{justify-content:flex-start;}
}
@media (max-width: 768px){
  .hero-urgent-banner{grid-template-columns:1fr;gap:10px;padding:14px 14px;}
  .hero-urgent-label{width:fit-content;}
  .school-hero-title .line-primary{font-size:clamp(2rem,8vw,3rem);}
  .school-hero-title .line-secondary{font-size:clamp(1.7rem,7vw,2.5rem);}
  .hero-actions-refined .btn{min-width:unset;width:100%;}
  .hero-meta-stack{gap:10px;}
}


/* refined single-line school title */
.school-title-block{display:flex;flex-direction:column;align-items:flex-end;gap:16px;}
.school-hero-title-inline{font-family:"Tajawal",sans-serif;font-size:clamp(2rem,3.6vw,3.25rem);font-weight:700;line-height:1.25;letter-spacing:0;white-space:nowrap;text-wrap:nowrap;margin:0;text-shadow:0 4px 18px rgba(0,0,0,0.22);max-width:100%;}
.school-hero-subtitle{max-width:680px;}
@media (max-width: 1200px){.school-hero-title-inline{font-size:clamp(1.9rem,3.2vw,2.8rem);}}
@media (max-width: 992px){.school-title-block{align-items:center;}.school-hero-title-inline{white-space:normal;text-wrap:balance;font-size:clamp(1.8rem,5.8vw,2.7rem);text-align:center;}.school-hero-subtitle{text-align:center;}}
@media (max-width: 640px){.school-hero-title-inline{font-size:clamp(1.55rem,8vw,2.15rem);line-height:1.35;}}

.top-strip-right a,
.contact-item a,
.footer-contact-item a { color: inherit; text-decoration: none; }
.top-strip-right a:hover,
.contact-item a:hover,
.footer-contact-item a:hover { text-decoration: underline; }


/* ===== 2026 light mode strengthening + important news badges ===== */
.brand-sub{
  display:block;
  font-size:.9rem;
  font-weight:800;
  color:#5673a5;
  opacity:1;
}
.top-strip{
  color:#f8fbff;
  font-weight:700;
}
.top-strip-right,
.top-strip-left{
  font-weight:700;
}
.top-strip-right a,
.top-strip-right span,
.top-strip-left a,
.top-strip-left span{
  color:rgba(255,255,255,.96);
}
.topbar{
  background:rgba(255,255,255,.99);
  border-bottom:1px solid rgba(15,23,42,.08);
}
.menu > a,
.menu-parent{
  color:#20324d;
  font-weight:800;
}
.menu > a:hover,
.menu > a.active,
.menu-parent:hover,
.menu-parent.active{
  color:#1447b5;
  background:linear-gradient(180deg,#edf4ff 0%,#e7efff 100%);
  box-shadow:inset 0 0 0 1px rgba(26,86,219,.08);
}
.dropdown-panel a{ color:#223552; }
.dropdown-panel a:hover{ background:#ecf3ff; color:#1447b5; }
.top-strip a[href^="mailto:"],
.top-strip a[href^="tel:"]{ display:inline-flex; align-items:center; gap:6px; }
#site-email,#contact-email,#footer-email,#site-phone,#contact-phone,#footer-phone{ direction:ltr; unicode-bidi:plaintext; }
.news-important-mark,.news-break-mark{
  display:inline-flex; align-items:center; justify-content:center; min-width:34px; height:34px; padding:0 10px; border-radius:999px; font-size:.95rem; font-weight:900; backdrop-filter:blur(10px);
}
.news-important-mark{ background:rgba(245,158,11,.96); color:#fff7db; box-shadow:0 10px 22px rgba(245,158,11,.24); }
.news-break-mark{ background:rgba(220,38,38,.95); color:#fff; box-shadow:0 10px 22px rgba(220,38,38,.24); }
.featured-tag.featured-tag-icon{ min-width:auto; padding:10px 12px; font-size:1rem; }
.featured-tag.featured-tag-important{ background:linear-gradient(135deg,#f59e0b,#f97316); }
.tag.tag-important{ background:rgba(245,158,11,.12); color:#b45309; border:1px solid rgba(245,158,11,.24); }
.tag.tag-breaking{ background:rgba(220,38,38,.1); color:#b91c1c; border:1px solid rgba(220,38,38,.18); }
.news-priority-chip{
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; font-size:.8rem; font-weight:900; background:rgba(245,158,11,.12); color:#b45309; border:1px solid rgba(245,158,11,.22);
}

.ticker-entry{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:.92rem;
  font-weight:800;
  color:rgba(255,255,255,0.92);
  white-space:nowrap;
}
.ticker-entry .ticker-dot{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:999px;
  background:rgba(239,68,68,.22);
  color:#fecaca;
  font-size:.88rem;
  font-weight:900;
  flex:0 0 24px;
}
.ticker-entry .ticker-pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(245,158,11,.2);
  border:1px solid rgba(245,158,11,.32);
  color:#ffdca8;
  font-size:.75rem;
  font-weight:900;
}
.ticker-entry.is-important{
  color:#fff3d8;
}
.ticker-entry.is-important .ticker-dot{
  background:linear-gradient(135deg,#f59e0b,#f97316);
  color:#fff7db;
  box-shadow:0 10px 22px rgba(245,158,11,.22);
}
body[data-theme="dark"] .ticker-entry{color:#edf5ff;}
body[data-theme="dark"] .ticker-entry .ticker-dot{background:rgba(239,68,68,.16);color:#fecaca;}
body[data-theme="dark"] .ticker-entry .ticker-pill{background:rgba(245,158,11,.18);border-color:rgba(245,158,11,.28);color:#ffdca8;}
body[data-theme="dark"] .ticker-entry.is-important{color:#fff3d8;}
.ticker-bar.is-hidden{display:none}
.page-empty-state{ max-width:880px; margin:0 auto; padding:36px 24px; border-radius:24px; border:1px dashed rgba(26,86,219,.18); background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%); color:var(--muted); text-align:center; }
.page-empty-state .icon{font-size:3rem;margin-bottom:12px}
.page-empty-state h3{font-size:1.25rem;font-weight:900;color:var(--text);margin-bottom:8px}
.page-empty-state p{max-width:40ch;margin:0 auto}
body[data-theme="dark"] .brand-sub{color:#bcd5ff}
body[data-theme="dark"] .menu > a,
body[data-theme="dark"] .menu-parent{color:#e8f1ff}
body[data-theme="dark"] .menu > a:hover,
body[data-theme="dark"] .menu > a.active,
body[data-theme="dark"] .menu-parent:hover,
body[data-theme="dark"] .menu-parent.active{ background:rgba(96,165,250,.12); color:#8cc6ff; }
body[data-theme="dark"] .dropdown-panel a{color:#e4ecff}
body[data-theme="dark"] .dropdown-panel a:hover{background:rgba(96,165,250,.12);color:#8cc6ff}
body[data-theme="dark"] .top-strip-right a,
body[data-theme="dark"] .top-strip-right span,
body[data-theme="dark"] .top-strip-left a,
body[data-theme="dark"] .top-strip-left span{color:rgba(255,255,255,.96)}
body[data-theme="dark"] .news-priority-chip{ background:rgba(245,158,11,.14); color:#ffdca8; border-color:rgba(245,158,11,.3); }
body[data-theme="dark"] .tag.tag-important{ background:rgba(245,158,11,.18); color:#ffdca8; border-color:rgba(245,158,11,.28); }
body[data-theme="dark"] .tag.tag-breaking{ background:rgba(239,68,68,.16); color:#fecaca; border-color:rgba(239,68,68,.24); }
body[data-theme="dark"] .page-empty-state{ background:linear-gradient(180deg,#0b1728 0%,#0c1c33 100%); border-color:rgba(96,165,250,.18); }


/* Global search */
.nav-search-inline{display:inline-flex;align-items:center;gap:8px;min-width:220px;max-width:300px;background:rgba(255,255,255,.88);border:1px solid var(--border);border-radius:999px;padding:4px 6px;box-shadow:var(--shadow-soft);backdrop-filter:blur(18px)}
.nav-search-inline input{border:none;background:transparent;outline:none;font-family:inherit;color:var(--text);width:100%;padding:8px 10px;font-size:.9rem}
.nav-search-inline input::placeholder{color:var(--muted)}
.nav-search-inline button{border:none;background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;border-radius:999px;padding:8px 14px;font-family:inherit;font-weight:800;cursor:pointer;white-space:nowrap}
.site-search-modal{position:fixed;inset:0;background:rgba(5,10,20,.72);backdrop-filter:blur(8px);z-index:3000;display:none;align-items:flex-start;justify-content:center;padding:70px 20px 20px}
.site-search-modal.open{display:flex}
.site-search-panel{width:min(920px,100%);max-height:calc(100vh - 110px);overflow:auto;background:var(--card);border:1px solid var(--border);border-radius:28px;box-shadow:var(--shadow);padding:24px}
.site-search-head{display:flex;align-items:center;gap:12px;margin-bottom:18px;flex-wrap:wrap}
.site-search-head input{flex:1;min-width:220px;border:1px solid var(--border);background:var(--bg-soft);color:var(--text);border-radius:16px;padding:14px 16px;font-family:inherit;font-size:1rem;outline:none}
.site-search-head input:focus{border-color:var(--primary)}
.site-search-close{border:none;background:var(--bg-soft);color:var(--text);border-radius:14px;padding:12px 16px;font-family:inherit;font-weight:800;cursor:pointer}
.site-search-meta{font-size:.9rem;color:var(--muted);margin-bottom:14px}
.site-search-results{display:grid;gap:12px}
.site-search-item{display:block;padding:16px 18px;border:1px solid var(--border);border-radius:18px;background:var(--bg-soft);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.site-search-item:hover{transform:translateY(-2px);border-color:rgba(26,86,219,.35);box-shadow:var(--shadow-soft)}
.site-search-type{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:800;color:var(--primary);background:rgba(79,124,255,.12);border-radius:999px;padding:5px 10px;margin-bottom:8px}
.site-search-item h3{font-size:1.05rem;margin-bottom:8px;color:var(--text)}
.site-search-item p{font-size:.92rem;line-height:1.9;color:var(--muted)}
.site-search-empty{text-align:center;padding:32px 16px;color:var(--muted)}
.ticker-item-important{color:#fff3b0;font-weight:900}
.ticker-item-important::before{content:'⭐';margin-inline:6px}
@media (max-width: 1180px){.nav-search-inline{min-width:180px;max-width:220px}}
@media (max-width: 960px){.nav-search-inline{display:none}}
body[data-theme="dark"] .nav-search-inline{background:rgba(10,22,38,.9);border-color:rgba(255,255,255,.08)}
body[data-theme="dark"] .nav-search-inline input{color:#e8f1ff}
body[data-theme="dark"] .nav-search-inline input::placeholder{color:#8aa0c7}
body[data-theme="dark"] .site-search-panel{background:#081528;border-color:rgba(255,255,255,.08)}
body[data-theme="dark"] .site-search-head input,
body[data-theme="dark"] .site-search-close,
body[data-theme="dark"] .site-search-item{background:#0d1d33;border-color:rgba(255,255,255,.08);color:#e8f1ff}
body[data-theme="dark"] .site-search-item h3{color:#f4f8ff}
body[data-theme="dark"] .site-search-item p,
body[data-theme="dark"] .site-search-meta,
body[data-theme="dark"] .site-search-empty{color:#b9c7de}

.search-open-mobile{display:none;align-items:center;justify-content:center;width:42px;height:42px;border-radius:999px;border:1px solid var(--border);background:rgba(255,255,255,.88);box-shadow:var(--shadow-soft);cursor:pointer;font-size:1rem;color:var(--text)}
@media (max-width:960px){.search-open-mobile{display:inline-flex}}
body[data-theme="dark"] .search-open-mobile{background:rgba(10,22,38,.9);color:#e8f1ff;border-color:rgba(255,255,255,.08)}


/* ===== Narrow news card text + size stabilization ===== */
body[data-firebase-page="home"] #news .news-featured,
body[data-firebase-page="home"] #news .news-mini,
body[data-firebase-page="news"] .news-card-full{
  min-width:0;
}

body[data-firebase-page="home"] #news .news-featured-body,
body[data-firebase-page="home"] #news .news-mini-body,
body[data-firebase-page="news"] .news-card-full .news-card-body{
  min-width:0;
}

body[data-firebase-page="home"] #news .news-featured-body h3,
body[data-firebase-page="home"] #news .news-mini-body h4,
body[data-firebase-page="news"] .news-card-full .news-card-body h3{
  overflow:hidden;
  overflow-wrap:anywhere;
  word-break:break-word;
  display:-webkit-box;
  -webkit-box-orient:vertical;
}

body[data-firebase-page="home"] #news .news-featured-body h3{
  -webkit-line-clamp:2;
  min-height:calc(1.5em * 2);
}

body[data-firebase-page="home"] #news .news-mini-body h4{
  -webkit-line-clamp:2;
  min-height:calc(1.45em * 2);
}

body[data-firebase-page="news"] .news-card-full .news-card-body h3{
  -webkit-line-clamp:2;
  min-height:calc(1.42em * 2);
}

body[data-firebase-page="home"] #news .news-featured-body p:not(.news-card-note),
body[data-firebase-page="home"] #news .news-mini-body p:not(.news-card-note),
body[data-firebase-page="news"] .news-card-full .news-card-body p:not(.news-card-note){
  overflow:hidden;
  overflow-wrap:anywhere;
  word-break:break-word;
  display:-webkit-box;
  -webkit-box-orient:vertical;
}

body[data-firebase-page="home"] #news .news-featured-body p:not(.news-card-note){
  -webkit-line-clamp:3;
  min-height:calc(1.8em * 3);
}

body[data-firebase-page="home"] #news .news-mini-body p:not(.news-card-note){
  -webkit-line-clamp:2;
  min-height:calc(1.75em * 2);
}

body[data-firebase-page="news"] .news-card-full .news-card-body p:not(.news-card-note){
  -webkit-line-clamp:2;
  min-height:calc(1.85em * 2);
}

body[data-firebase-page="home"] #news .news-featured-body .news-card-note,
body[data-firebase-page="home"] #news .news-mini-body .news-card-note,
body[data-firebase-page="news"] .news-card-full .news-card-body .news-card-note{
  overflow-wrap:anywhere;
  word-break:break-word;
}

body[data-firebase-page="news"] .news-card-full{
  align-items:stretch;
}

body[data-firebase-page="news"] .news-card-full .read-more-btn,
body[data-firebase-page="home"] #news .read-more-btn,
body[data-firebase-page="home"] #news .mini-link{
  margin-top:auto;
}

@media (max-width: 768px){
  body[data-firebase-page="home"] #news .news-featured-body h3,
  body[data-firebase-page="home"] #news .news-mini-body h4,
  body[data-firebase-page="news"] .news-card-full .news-card-body h3{
    min-height:unset;
  }

  body[data-firebase-page="home"] #news .news-featured-body p:not(.news-card-note),
  body[data-firebase-page="home"] #news .news-mini-body p:not(.news-card-note),
  body[data-firebase-page="news"] .news-card-full .news-card-body p:not(.news-card-note){
    min-height:unset;
  }
}

/* ===== Narrow card text refinement: articles + announcements only ===== */
body[data-firebase-page="home"] #articles .article-card,
body[data-firebase-page="announcements"] .announcement-card,
body[data-firebase-page="home"] #announcements-home .home-ann-card{
  min-width: 0;
}

body[data-firebase-page="home"] #articles .article-body,
body[data-firebase-page="announcements"] .announcement-card .announcement-body,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body{
  min-width: 0;
}

/* Home articles: stable fallback header when there is no image */
body[data-firebase-page="home"] #articles .article-card{
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

body[data-firebase-page="home"] #articles .article-icon-wrap{
  min-height: 146px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(59,130,246,0.08), rgba(59,130,246,0.03));
  border-bottom: 1px solid rgba(15,23,42,0.07);
}

body[data-firebase-page="home"] #articles .article-icon-wrap img,
body[data-firebase-page="home"] #articles .article-icon-wrap svg{
  max-width: 72px;
  max-height: 72px;
  width: auto;
  height: auto;
}

body[data-firebase-page="home"] #articles .article-body{
  padding: 18px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

body[data-firebase-page="home"] #articles .article-body h3,
body[data-firebase-page="announcements"] .announcement-card h3,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body h3{
  margin: 0;
  line-height: 1.55;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-firebase-page="home"] #articles .article-body h3{
  min-height: calc(1.55em * 2);
}

body[data-firebase-page="announcements"] .announcement-card h3,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body h3{
  min-height: calc(1.55em * 2);
}

body[data-firebase-page="home"] #articles .article-body p,
body[data-firebase-page="announcements"] .announcement-card p,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body p{
  margin: 0;
  line-height: 1.85;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-firebase-page="home"] #articles .article-body p{
  min-height: calc(1.85em * 3);
}

body[data-firebase-page="announcements"] .announcement-card p,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body p{
  min-height: calc(1.85em * 3);
}

body[data-firebase-page="home"] #articles .article-meta,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body .meta-row,
body[data-firebase-page="announcements"] .announcement-card .meta-row{
  margin-top: auto;
  min-width: 0;
}

body[data-firebase-page="home"] #articles .article-meta,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body .meta-row,
body[data-firebase-page="announcements"] .announcement-card .meta-row,
body[data-firebase-page="announcements"] .announcement-card .meta-date,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body .meta-date{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Keep announcement cards calm when content is extremely long */
body[data-firebase-page="announcements"] .announcement-card,
body[data-firebase-page="home"] #announcements-home .home-ann-card{
  overflow: hidden;
}

/* Dark mode readability for article cards with no image */
body[data-theme="dark"][data-firebase-page="home"] #articles .article-card{
  background: linear-gradient(180deg, rgba(10,24,43,0.98), rgba(8,20,36,0.98));
  border-color: rgba(143,177,222,0.14);
}

body[data-theme="dark"][data-firebase-page="home"] #articles .article-icon-wrap{
  background: linear-gradient(180deg, rgba(148,163,184,0.10), rgba(148,163,184,0.04));
  border-bottom-color: rgba(143,177,222,0.12);
}

body[data-theme="dark"][data-firebase-page="home"] #articles .article-body h3{
  color: #edf4ff;
}

body[data-theme="dark"][data-firebase-page="home"] #articles .article-body p,
body[data-theme="dark"][data-firebase-page="home"] #articles .article-meta{
  color: #b9c7de;
}

@media (max-width: 768px){
  body[data-firebase-page="home"] #articles .article-body h3,
  body[data-firebase-page="home"] #articles .article-body p,
  body[data-firebase-page="announcements"] .announcement-card h3,
  body[data-firebase-page="announcements"] .announcement-card p,
  body[data-firebase-page="home"] #announcements-home .home-ann-card-body h3,
  body[data-firebase-page="home"] #announcements-home .home-ann-card-body p{
    min-height: unset;
  }

  body[data-firebase-page="home"] #articles .article-icon-wrap{
    min-height: 128px;
  }
}


/* ===== Focused refinement: articles page + announcements page ===== */
body[data-theme="dark"][data-firebase-page="articles"] .article-card{
  background: linear-gradient(180deg, rgba(10,24,43,0.98), rgba(8,20,36,0.98));
  border-color: rgba(143,177,222,0.14);
}

body[data-theme="dark"][data-firebase-page="articles"] .article-card-header:not(.with-image){
  background: linear-gradient(180deg, rgba(148,163,184,0.10), rgba(148,163,184,0.04)) !important;
  border-bottom: 1px solid rgba(143,177,222,0.12);
}

body[data-theme="dark"][data-firebase-page="articles"] .article-card-title,
body[data-theme="dark"][data-firebase-page="articles"] .article-card-body h2,
body[data-theme="dark"][data-firebase-page="articles"] .article-card-body h3{
  color: #edf4ff !important;
}

body[data-theme="dark"][data-firebase-page="articles"] .article-card-excerpt,
body[data-theme="dark"][data-firebase-page="articles"] .article-card-body p,
body[data-theme="dark"][data-firebase-page="articles"] .article-card-meta,
body[data-theme="dark"][data-firebase-page="articles"] .article-card-meta .meta-date,
body[data-theme="dark"][data-firebase-page="articles"] .article-card-meta .meta-author{
  color: #b9c7de !important;
}

body[data-firebase-page="articles"] .article-card-title,
body[data-firebase-page="articles"] .article-card-excerpt,
body[data-firebase-page="articles"] .article-card-meta,
body[data-firebase-page="articles"] .article-card-meta .meta-date,
body[data-firebase-page="articles"] .article-card-meta .meta-author{
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-firebase-page="announcements"] .announcement-card .ann-body > p,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body > p{
  margin: 0;
  line-height: 1.85;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-firebase-page="announcements"] .announcement-card .dynamic-news-body,
body[data-firebase-page="announcements"] .announcement-card .dynamic-news-body *,
body[data-firebase-page="home"] #announcements-home .dynamic-news-body,
body[data-firebase-page="home"] #announcements-home .dynamic-news-body *{
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-firebase-page="announcements"] .announcement-card .dynamic-news-body p,
body[data-firebase-page="announcements"] .announcement-card .dynamic-news-body li,
body[data-firebase-page="announcements"] .announcement-card .dynamic-news-body blockquote,
body[data-firebase-page="home"] #announcements-home .dynamic-news-body p,
body[data-firebase-page="home"] #announcements-home .dynamic-news-body li,
body[data-firebase-page="home"] #announcements-home .dynamic-news-body blockquote{
  white-space: normal;
}

body[data-firebase-page="announcements"] .announcement-card .ann-body > h3,
body[data-firebase-page="announcements"] .announcement-card .ann-meta,
body[data-firebase-page="announcements"] .announcement-card .ann-date,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body > h3,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body .meta-row,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body .meta-date{
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-firebase-page="announcements"] .mini-link-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a56db, #3b82f6);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(26,86,219,.22);
  transition: opacity .2s ease, transform .2s ease;
  text-decoration: none;
}

body[data-firebase-page="announcements"] .mini-link-btn:hover{
  opacity: .9;
  text-decoration: none;
  transform: translateY(-1px);
}

body[data-firebase-page="announcements"] .mini-link-btn:focus-visible{
  outline: 3px solid rgba(26,86,219,.18);
  outline-offset: 2px;
}


/* ===== Safe card refinement 2026 — scoped only to current content sections ===== */
body[data-firebase-page="home"] #news .news-featured,
body[data-firebase-page="home"] #news .news-mini,
body[data-firebase-page="news"] .news-card-full,
body[data-firebase-page="home"] #articles .article-card,
body[data-firebase-page="home"] #announcements-home .home-ann-card,
body[data-firebase-page="announcements"] .announcement-card,
body[data-firebase-page="home"] #activities .activity-card{
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: 0 10px 25px -5px rgb(11 28 54 / 0.10);
}

body[data-firebase-page="home"] #news .news-featured:hover,
body[data-firebase-page="home"] #news .news-mini:hover,
body[data-firebase-page="news"] .news-card-full:hover,
body[data-firebase-page="home"] #articles .article-card:hover,
body[data-firebase-page="home"] #announcements-home .home-ann-card:hover,
body[data-firebase-page="announcements"] .announcement-card:hover,
body[data-firebase-page="home"] #activities .activity-card:hover{
  box-shadow: 0 20px 35px -10px rgb(11 28 54 / 0.15);
}

body[data-firebase-page="home"] #news .news-featured-body,
body[data-firebase-page="home"] #news .news-mini-body,
body[data-firebase-page="news"] .news-card-full .news-card-body,
body[data-firebase-page="home"] #articles .article-body,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body,
body[data-firebase-page="announcements"] .announcement-card .ann-body,
body[data-firebase-page="home"] #activities .activity-overlay{
  min-width: 0;
}

body[data-firebase-page="home"] #news .news-featured-body h3,
body[data-firebase-page="home"] #news .news-mini-body h4,
body[data-firebase-page="news"] .news-card-full .news-card-body h3,
body[data-firebase-page="home"] #articles .article-body h3,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body > h3,
body[data-firebase-page="announcements"] .announcement-card .ann-body > h3{
  color: var(--text);
  text-wrap: balance;
}

body[data-firebase-page="home"] #news .news-featured-body p:not(.news-card-note),
body[data-firebase-page="home"] #news .news-mini-body p:not(.news-card-note),
body[data-firebase-page="news"] .news-card-full .news-card-body p:not(.news-card-note),
body[data-firebase-page="home"] #articles .article-body p,
body[data-firebase-page="home"] #announcements-home .home-ann-card-body > p,
body[data-firebase-page="announcements"] .announcement-card .ann-body > p{
  color: var(--muted);
}

body[data-firebase-page="home"] #news .read-more-btn,
body[data-firebase-page="home"] #news .mini-link,
body[data-firebase-page="news"] .news-card-full .read-more-btn,
body[data-firebase-page="announcements"] .mini-link-btn{
  font-weight: 800;
}

body[data-firebase-page="home"] #activities .activity-overlay{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-firebase-page="home"] #activities .activity-overlay h3{
  line-height: 1.45;
  text-wrap: balance;
}

body[data-firebase-page="home"] #activities .activity-overlay p{
  color: rgba(255,255,255,0.86);
  line-height: 1.75;
}

@media (max-width: 768px){
  body[data-firebase-page="home"] #activities .activity-card{
    min-height: 340px;
  }
}


/* ===== Shared shell cleanup extracted from page-level CSS ===== */
.topbar-sticky-wrap .topbar{position:relative!important;top:auto!important;z-index:auto!important}
.topbar-sticky-wrap .ticker-bar{position:relative;z-index:auto}
.top-strip-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.top-strip-right a{direction:ltr;unicode-bidi:isolate}
.brand{display:flex;align-items:center;gap:14px;min-width:0}
.brand-badge{flex:0 0 auto}
.brand-badge svg{display:block}
.brand-text-wrap{display:flex;flex-direction:column;min-width:0;line-height:1.15}
.brand-title,.brand-sub{display:block;white-space:normal}
.brand-title{font-weight:800}
.brand-sub{opacity:.95}
[data-section]{transition:opacity .3s ease}
[data-results-gated]{transition:opacity .25s ease}
@media (max-width:768px){
  .top-strip-inner{gap:8px}
  .top-strip-right{justify-content:center;font-size:.92rem;gap:8px}
  .brand{gap:10px;align-items:center}
  .brand-badge svg{width:44px;height:44px}
  .brand-text-wrap{gap:3px}
  .brand-title{font-size:1rem}
  .brand-sub{font-size:.9rem}
}

/* ===== Home page layout refinements moved out of index.html ===== */
body[data-firebase-page="home"] .hero-trust-strip-refined{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:stretch}
body[data-firebase-page="home"] .hero-trust-strip-refined .trust-item{height:100%}
body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined{display:flex;flex-direction:column;gap:10px;line-height:1;margin:0}
body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined .hero-name-main,
body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined .hero-name-subline{display:block;color:#fff;text-wrap:balance}
body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined .hero-name-main{font-size:clamp(2.25rem,4.4vw,4.3rem);font-weight:800;letter-spacing:-0.02em}
body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined .hero-name-subline{font-size:clamp(2.7rem,5.6vw,5.2rem);font-weight:900;letter-spacing:-0.03em}
body[data-firebase-page="home"] .school-title-block .school-hero-subtitle{margin-top:16px}
body[data-firebase-page="home"] #news .news-layout.news-layout-empty{display:block!important;min-height:0!important}
body[data-firebase-page="home"] #news .news-layout{align-items:start}
body[data-firebase-page="home"] #news .news-layout>.news-featured:only-child{grid-column:1/-1}
body[data-firebase-page="home"] #news .news-layout.news-layout-empty .empty-section{padding:20px 0 8px}
body[data-firebase-page="home"] #news .section-cta{margin-top:20px}
body[data-firebase-page="home"] #news.news-section-empty{padding-bottom:28px!important}
body[data-firebase-page="home"] #news.news-section-empty .section-cta{margin-top:12px}
body[data-firebase-page="home"] #news .news-featured.no-image,
body[data-firebase-page="home"] #news .news-mini.no-image{background:rgba(11,28,54,.72);border:1px solid rgba(96,165,250,.14);box-shadow:0 14px 30px rgba(2,12,27,.18)}
body[data-firebase-page="home"] #news .news-featured.no-image{display:block}
body[data-firebase-page="home"] #news .news-featured.no-image .news-featured-body{padding:28px}
body[data-firebase-page="home"] #news .news-textual-mark{width:52px;height:52px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;background:rgba(59,130,246,.12);color:#fff;font-size:1.35rem;margin-bottom:16px}
body[data-firebase-page="home"] #news .news-mini-body{display:flex;flex-direction:column;gap:10px}
body[data-firebase-page="home"] #news .news-mini-excerpt{margin:0;color:var(--muted);line-height:1.8;font-size:.95rem}
body[data-firebase-page="home"] #news .news-mini .meta-date{display:block}
body[data-firebase-page="home"] #news .news-mini.no-image .news-mini-body{padding:20px}
body[data-firebase-page="home"] #news .news-featured.has-image{display:grid;grid-template-columns:minmax(300px,34%) minmax(0,1fr);align-items:stretch}
body[data-firebase-page="home"] #news .news-featured.has-image .news-featured-body{padding:26px 28px;display:flex;flex-direction:column;gap:12px}
body[data-firebase-page="home"] #news .news-featured.has-image .news-featured-body p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body[data-firebase-page="home"] #announcements-home .home-ann-card.has-image{display:flex;flex-direction:column;overflow:hidden}
body[data-firebase-page="home"] #announcements-home .home-ann-card.has-image .home-ann-card-img{min-height:220px;max-height:220px;overflow:hidden;background:linear-gradient(135deg,rgba(29,78,216,.92),rgba(15,23,42,.96))}
body[data-firebase-page="home"] #announcements-home .home-ann-card.has-image .home-ann-card-img img{display:block;width:100%;height:100%;object-fit:cover}
body[data-firebase-page="home"] #announcements-home .home-ann-card-icon{width:60px;height:60px;border-radius:18px;display:inline-flex;align-items:center;justify-content:center;background:rgba(59,130,246,.12);color:#fff;font-size:1.55rem;margin:24px 24px 0}
body[data-firebase-page="home"] #announcements-home .home-ann-card-body{padding:22px 24px 24px;display:flex;flex-direction:column;gap:10px;flex:1}
body[data-firebase-page="home"] #announcements-home .home-ann-card-body .mini-link{margin-top:auto;align-self:flex-start}
body[data-firebase-page="home"] #news .news-mini.has-image{display:grid;grid-template-columns:minmax(136px,150px) minmax(0,1fr);align-items:stretch}
body[data-firebase-page="home"] #news .news-mini.has-image .news-mini-body{padding:16px 18px}
body[data-firebase-page="home"] #news .news-mini.has-image .news-mini-body p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-firebase-page="home"] #news .news-featured.has-image.is-video-only{grid-template-columns:minmax(250px,30%) minmax(0,1fr)}
body[data-firebase-page="home"] #news .news-featured.has-image.is-video-only .news-featured-body{justify-content:center;gap:10px}
body[data-firebase-page="home"] #news .news-featured.has-image.is-video-only .news-featured-body p{-webkit-line-clamp:unset;display:block;overflow:visible}
body[data-firebase-page="home"] #news .news-mini.has-image.is-video-only{grid-template-columns:minmax(126px,138px) minmax(0,1fr)}
body[data-firebase-page="home"] #news .news-mini.has-image.is-video-only .news-mini-body{justify-content:center;gap:8px}
body[data-firebase-page="home"] #news .news-featured.has-image.is-image-only{grid-template-columns:minmax(230px,28%) minmax(0,1fr)}
body[data-firebase-page="home"] #news .news-featured.has-image.is-image-only .news-featured-body{justify-content:center;gap:10px}
body[data-firebase-page="home"] #news .news-featured.has-image.is-image-only .news-featured-body p{-webkit-line-clamp:unset;display:block;overflow:visible}
body[data-firebase-page="home"] #news .news-mini.has-image.is-image-only{grid-template-columns:minmax(122px,132px) minmax(0,1fr)}
body[data-firebase-page="home"] #news .news-mini.has-image.is-image-only .news-mini-body{justify-content:center;gap:8px}
body[data-firebase-page="home"] #news .news-card-note{margin:0;color:#93c5fd;font-size:.92rem;font-weight:700;line-height:1.8}
body[data-firebase-page="home"] #news .news-mini .news-card-note{font-size:.86rem}
body[data-firebase-page="home"] #news .news-mini.has-image .news-mini-img img,
body[data-firebase-page="home"] #news .news-featured.has-image .news-featured-img img{display:block;width:100%;height:100%;object-fit:cover}
body[data-firebase-page="home"] #news .news-media-preview{position:relative;overflow:hidden;background:linear-gradient(135deg,rgba(29,78,216,.92),rgba(15,23,42,.96));color:#fff;isolation:isolate}
body[data-firebase-page="home"] #news .news-media-preview img{display:block;width:100%;height:100%;object-fit:cover}
body[data-firebase-page="home"] #news .news-media-preview-badge{position:absolute;top:12px;left:12px;display:inline-flex;align-items:center;gap:8px;padding:7px 11px;border-radius:999px;background:rgba(15,23,42,.76);backdrop-filter:blur(8px);color:#fff;font-size:.76rem;font-weight:800;box-shadow:0 10px 24px rgba(15,23,42,.24);z-index:2}
body[data-firebase-page="home"] #news .news-media-preview-fallback{min-height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;padding:18px;text-align:center}
body[data-firebase-page="home"] #news .news-media-preview-fallback strong{font-size:1rem;line-height:1.7}
body[data-firebase-page="home"] #news .news-media-preview-fallback span{font-size:.86rem;color:rgba(255,255,255,.84)}
body[data-firebase-page="home"] #news .news-featured-img.news-media-preview{min-height:240px;height:100%}
body[data-firebase-page="home"] #news .news-mini-img.news-media-preview{width:auto;min-height:100%;height:100%}
body[data-firebase-page="home"] #news .news-mini-img.news-media-preview .news-media-preview-fallback{padding:14px 10px}
body[data-firebase-page="home"] #news .news-featured.is-image-only .news-featured-img.news-media-preview{min-height:220px;max-height:220px}
body[data-firebase-page="home"] #news .news-mini.is-image-only .news-mini-img.news-media-preview{min-height:132px;max-height:132px}
@media (max-width:992px){
  body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined{gap:8px}
}
@media (max-width:900px){
  body[data-firebase-page="home"] .hero-trust-strip-refined{grid-template-columns:1fr}
  body[data-firebase-page="home"] #news .news-featured.has-image,
  body[data-firebase-page="home"] #news .news-featured.has-image.is-video-only,
  body[data-firebase-page="home"] #news .news-featured.has-image.is-image-only{grid-template-columns:1fr}
  body[data-firebase-page="home"] #news .news-featured-img.news-media-preview{min-height:220px;max-height:220px}
  body[data-firebase-page="home"] #news .news-featured.is-image-only .news-featured-img.news-media-preview{min-height:200px;max-height:200px}
}
@media (max-width:768px){
  body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined .hero-name-main{font-size:clamp(1.7rem,7vw,2.4rem)}
  body[data-firebase-page="home"] .school-hero-title-inline.school-hero-title-refined .hero-name-subline{font-size:clamp(2rem,8.5vw,3rem)}
  body[data-firebase-page="home"] .school-title-block .school-hero-subtitle{margin-top:12px}
  body[data-firebase-page="home"] #news.news-section-empty{padding-bottom:20px!important}
  body[data-firebase-page="home"] #news .news-layout.news-layout-empty .empty-section{padding:16px 0 4px}
  body[data-firebase-page="home"] #news .news-featured.no-image .news-featured-body,
  body[data-firebase-page="home"] #news .news-mini.no-image .news-mini-body,
  body[data-firebase-page="home"] #news .news-featured.has-image .news-featured-body{padding:20px}
  body[data-firebase-page="home"] #news .news-mini.has-image,
  body[data-firebase-page="home"] #news .news-mini.has-image.is-image-only{grid-template-columns:1fr}
  body[data-firebase-page="home"] #news .news-mini-img.news-media-preview{min-height:180px;max-height:180px}
}

/* ============================================================
   NEW ARCHITECTURE ADDITIONS (Boot Screen, Shell, etc.)
   ============================================================ */

/* Boot Screen */
.boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.boot-screen.hide {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.boot-card {
  text-align: center; padding: 48px 40px;
  background: #fff; border-radius: 28px;
  box-shadow: var(--shadow); max-width: 360px; width: 90%;
}
.boot-card img { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 20px; border-radius: 16px; }
.boot-card h1 { font-size: 1.3rem; margin-bottom: 10px; color: var(--primary); }
.boot-card p { color: var(--muted); font-size: .92rem; line-height: 1.8; }

/* Page Shell */
.page-shell { opacity: 0; transition: opacity 0.2s ease; }
.page-shell.ready { opacity: 1; }

/* Nav Shell */
.nav-shell { display: flex; align-items: center; gap: 16px; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; flex-shrink: 0; }

/* Maintenance Screen */
.maintenance-card { max-width: 600px; margin: 80px auto; padding: 48px; background: #fff; border-radius: 28px; box-shadow: var(--shadow); text-align: center; }
.maintenance-card h1 { font-size: 2rem; color: var(--primary); margin-bottom: 16px; }
.maintenance-card p { color: var(--muted); line-height: 2; margin-bottom: 24px; }
.simple-card { max-width: 500px; margin: 80px auto; padding: 40px; background: #fff; border-radius: 24px; box-shadow: var(--shadow); text-align: center; }

/* Urgent Bar override */
#urgent-bar { display: none; }
#urgent-bar.show { display: block; background: linear-gradient(135deg,#e31b23,#c1121f); }
#urgent-bar .inner { width: min(calc(100% - 32px), var(--container)); margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 13px 0; justify-content: center; flex-wrap: wrap; font-weight: 800; }
#urgent-bar strong { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(255,255,255,.14); border-radius: 999px; }

/* ═══════════════════════════════════════════════════════
   NEW ARCHITECTURE VISUAL ADDITIONS
   ═══════════════════════════════════════════════════════ */

/* data-page alias for data-firebase-page selectors */
body[data-page="home"] #news .news-featured,
body[data-page="home"] #news .news-mini {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); overflow: hidden;
}
body[data-page="home"] #news .news-featured-body,
body[data-page="home"] #news .news-mini-body {
  padding: 22px;
}
body[data-page="home"] #news .news-featured-body h3,
body[data-page="home"] #news .news-mini-body h4 {
  margin: 8px 0; line-height: 1.4;
}
body[data-page="news"] .news-card-full {
  display: grid; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
body[data-page="news"] .news-card-full:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-hover);
}
body[data-page="news"] .news-card-full .news-card-body {
  padding: 24px 26px; display: flex; flex-direction: column; gap: 10px;
}
body[data-page="news"] .news-card-full.has-image {
  grid-template-columns: minmax(220px,248px) 1fr;
}
body[data-page="news"] .news-card-full .news-card-img img {
  width: 100%; height: 100%; object-fit: cover;
}

/* top-strip contact (always visible) */
.top-strip-contact {
  display: block !important;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: rgba(255,255,255,0.9);
  font-size: 0.82rem; font-weight: 600; padding: 8px 0;
}

/* Inner page hero (sub-pages) */
.hero-inner {
  min-height: 260px; padding: 60px 0 50px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #3b82f6 100%);
  color: #fff;
}
.inner-hero-content h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: #fff; margin: 8px 0 14px; line-height: 1.3;
}
.inner-hero-content p { color: rgba(255,255,255,.8); line-height: 2; }
.inner-hero-content .section-kicker {
  background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.28);
}
.inner-hero-content .breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: rgba(255,255,255,.65); margin-top: 16px;
}
.inner-hero-content .breadcrumb a { color: rgba(255,255,255,.75); }
.inner-hero-content .breadcrumb a:hover { color: #fff; }

/* Content list shell */
.content-list-shell { display: grid; gap: 20px; }

/* Article detail view */
.article-detail { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; }
.article-detail-cover { max-height: 420px; overflow: hidden; }
.article-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-detail-meta { display: flex; gap: 12px; padding: 24px 28px 0; flex-wrap: wrap; align-items: center; }
.article-detail h2 { padding: 12px 28px 0; font-size: clamp(1.4rem,3vw,2rem); line-height: 1.4; }
.article-detail-body { padding: 20px 28px 8px; line-height: 2; color: var(--text-light); }
.article-detail-body p { margin-bottom: 16px; }
.article-detail-footer { padding: 20px 28px 28px; }

/* Announcements list */
.announcements-list { display: grid; gap: 18px; }
.home-ann-card { display: flex; gap: 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; padding: 22px; align-items: flex-start; transition: transform .2s, box-shadow .2s; }
.home-ann-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.home-ann-card-icon { font-size: 1.8rem; flex-shrink: 0; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--primary-light); }
.home-ann-card-img { flex-shrink: 0; width: 120px; border-radius: 12px; overflow: hidden; }
.home-ann-card-img img { width: 100%; height: 100%; object-fit: cover; }
.home-ann-card-body { flex: 1; min-width: 0; }
.home-ann-card-body h3 { font-size: 1.05rem; margin: 8px 0 6px; line-height: 1.4; }
.home-ann-card-body p { color: var(--muted); font-size: .93rem; line-height: 1.8; margin: 0 0 10px; }

/* Activities grid */
.activities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 22px; }
.activity-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.activity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.activity-img { height: 180px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.activity-body { padding: 20px; }
.activity-body h3 { font-size: 1.05rem; margin: 8px 0 8px; line-height: 1.4; }
.activity-body p { color: var(--muted); font-size: .9rem; line-height: 1.8; }

/* Simple card fallback */
.simple-card { max-width: 520px; margin: 80px auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 48px 40px; text-align: center; }
.simple-card h1, .simple-card h2 { color: var(--primary); margin-bottom: 14px; }
.simple-card p { color: var(--muted); line-height: 2; }

/* Responsive */
@media (max-width: 640px) {
  .home-ann-card { flex-direction: column; }
  .home-ann-card-img { width: 100%; height: 160px; }
  .article-detail-body, .article-detail h2, .article-detail-meta, .article-detail-footer { padding-left: 18px; padding-right: 18px; }
  .content-list-shell { gap: 14px; }
}

/* ── map data-page to data-firebase-page behaviors ── */
/* repeat key selectors using new attribute */
body[data-page="home"] .news-featured { background:var(--card);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-soft); }
body[data-page="home"] .news-mini { background:var(--card);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-soft); }

/* news page card body */
body[data-page="news"] .news-card-full .news-card-body h3 { line-height:1.42;font-size:1.14rem;margin:0; }
body[data-page="news"] .news-card-full .news-card-body p { line-height:1.85;margin:0; }
body[data-page="news"] .news-card-full .read-more-btn { margin-top:auto;align-self:flex-start; }
body[data-page="news"] .content-list-shell { display:grid;gap:20px; }

/* articles page */
body[data-page="articles"] .content-list-shell,
body[data-page="activities"] .content-list-shell { display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:22px; }
body[data-page="articles"] .news-card-full,
body[data-page="activities"] .news-card-full { display:flex;flex-direction:column; }
body[data-page="articles"] .news-card-full .news-card-img,
body[data-page="activities"] .news-card-full .news-card-img { height:200px;overflow:hidden; }
body[data-page="articles"] .news-card-full .news-card-img img,
body[data-page="activities"] .news-card-full .news-card-img img { height:100%;object-fit:cover; }

/* announcements page */
body[data-page="announcements"] .content-list-shell { display:grid;gap:18px; }
body[data-page="announcements"] .news-card-full { display:grid;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow-soft);overflow:hidden;transition:transform .25s,box-shadow .25s; }
body[data-page="announcements"] .news-card-full:hover { transform:translateY(-4px);box-shadow:var(--shadow-hover); }
body[data-page="announcements"] .news-card-full.has-image { grid-template-columns:minmax(180px,220px) 1fr; }
body[data-page="announcements"] .news-card-full .news-card-body { padding:22px 24px;display:flex;flex-direction:column;gap:10px; }

/* ═══════════════════════════════════════════════════════════
   P3 — وسائط الكروت (media-aware cards)
   ═══════════════════════════════════════════════════════════ */

/* ── غلاف الوسائط مع overlay ────────────────────────────── */
.media-wrap { position: relative; overflow: hidden; }

/* ── زر التشغيل الكبير (featured card) ─────────────────── */
.media-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.18);
  transition: background .25s;
  text-decoration: none;
}
.media-play-overlay:hover { background: rgba(0,0,0,.36); }
.media-play-btn {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(0,0,0,.28);
  transition: transform .2s, box-shadow .2s;
  padding-right: 2px; /* بصرياً لتمركز مثلث التشغيل */
}
.media-play-overlay:hover .media-play-btn {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,.38);
}

/* ── شارة "▶ فيديو" على الكرت الكبير ───────────────────── */
.media-video-badge {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .78rem; font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ── placeholder فيديو بدون صورة مصغّرة (featured) ─────── */
.media-video-placeholder {
  height: 220px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
}
.media-video-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff;
}
.media-video-label {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  text-decoration: underline;
  cursor: pointer;
}
.media-video-label:hover { color: #fff; }

/* ── P8.2 — شارة تشغيل pill محسّنة (mini cards) ──────────── */
/* يحل محل media-mini-video-dot القديم */
.media-mini-play-badge {
  position: absolute; bottom: 8px; right: 8px;
  height: 22px; padding: 0 9px;
  background: rgba(0,0,0,.76);
  color: #fff;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .66rem; font-weight: 700;
  letter-spacing: .3px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* ── P8.1 — Thumbnail fallback عند فشل التحميل ──────────── */
.news-mini-img.thumb-error {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* ── P8.3 — Placeholder فيديو بدون thumbnail ────────────── */
.news-mini-video-placeholder {
  width: 110px; flex-shrink: 0; min-height: 90px;
  background: linear-gradient(160deg, #1e3a5f 0%, #0b1c36 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
}
.news-mini-play-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: #fff;
  padding-right: 2px;
}
.news-mini-video-label {
  font-size: .62rem; font-weight: 700;
  color: rgba(255,255,255,.65);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── P8.3 — Strip بصري لبطاقات بدون وسائط ───────────────── */
.news-mini.no-media { align-items: stretch; }
.news-mini-no-media-strip {
  width: 5px; flex-shrink: 0;
  background: var(--primary-light);
  opacity: .7;
}

/* توافق backward للبطاقات القديمة (media-mini-placeholder / media-mini-icon) */
.media-mini-placeholder {
  width: 110px; flex-shrink: 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
}
.media-mini-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: #fff;
}

/* ── شارة فيديو صغيرة جداً (مقالات / أنشطة) ────────────── */
.media-tiny-badge {
  position: absolute;
  background: rgba(0,0,0,.68);
  color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 3px;
  pointer-events: none;
}
.article-video-badge  { bottom: 8px; left: 8px; }
.activity-video-badge { bottom: 8px; left: 8px; }

/* article-icon-wrap يجب أن يكون relative لعمل الـ badge */
.article-icon-wrap { position: relative; }
.activity-img      { position: relative; }

/* ── dark mode — تعديلات بسيطة ─────────────────────────── */
[data-theme="dark"] .media-play-btn {
  background: rgba(255,255,255,.85);
  color: #0f172a;
}
[data-theme="dark"] .media-video-placeholder {
  background: linear-gradient(135deg, #0f172a 0%, #1e1e2e 100%);
}

/* ── P8 — dark mode للعناصر الجديدة ──────────────────────── */
[data-theme="dark"] .media-mini-play-badge {
  background: rgba(0,0,0,.85);
}
[data-theme="dark"] .news-mini-video-placeholder {
  background: linear-gradient(160deg, #0f1f38 0%, #07111f 100%);
}
[data-theme="dark"] .news-mini-no-media-strip {
  background: var(--primary);
  opacity: .3;
}
[data-theme="dark"] .news-mini-img.thumb-error {
  background: linear-gradient(135deg, #0f1f38 0%, #07111f 100%);
}

/* ── responsive: news-side على شاشات صغيرة ─────────────── */
@media (max-width: 640px) {
  .media-play-btn { width: 52px; height: 52px; font-size: 1.2rem; }
  .media-video-placeholder { height: 170px; }
}
