/* =========================================================
   AL ANDALUS PRIVATE ACADEMY — Design System
   Palette derived from the school crest: olive-green Moorish
   arch + terracotta brickwork, on a warm parchment ground.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,500;1,600&family=Nunito+Sans:ital,wght@0,400;0,600;0,700;0,800;1,600&family=Almarai:wght@400;700;800&display=swap');

:root{
  /* --- Brand colors, pulled from the crest, warmed for a softer feel --- */
  --olive:        #6B7F4F;   /* arch line */
  --olive-dark:   #3D4A33;   /* deep green, header/footer */
  --olive-soft:   #9CAE84;   /* tints, hovers */
  --terracotta:   #D97D4A;   /* brick, warm clay */
  --terracotta-dp:#B35C2E;   /* brick, shaded */
  --sand:         #F0C27B;   /* highlight / honey gold */
  --parchment:    #FBF3E7;   /* page background, warm cream */
  --parchment-dp: #F3E8D3;   /* card / section background */
  --ink:          #3A3226;   /* primary text, warm brown-black */
  --ink-soft:     #7A6F5C;   /* secondary text */
  --white:        #FFFFFF;

  /* Humanist type pairing: a warm, calligraphic serif for headings,
     a rounded, friendly sans for reading, and a soft Arabic companion. */
  --font-display: "Lora", Georgia, serif;
  --font-body:    "Nunito Sans", "Segoe UI", sans-serif;
  --font-ar:      "Almarai", "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius-md: 20px;
  --shadow-card: 0 12px 32px -14px rgba(58,50,38,.28);
  --container: 1180px;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Arabic mode ---------- */
html[lang="ar"] body{ font-family: var(--font-ar); direction: rtl; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .display{
  font-family: var(--font-ar);
}
[dir="rtl"] .site-header .nav-list{ direction: rtl; }

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family: inherit; cursor:pointer; }

.container{ max-width: var(--container); margin:0 auto; padding: 0 24px; }

h1,h2,h3,h4{ font-family: var(--font-display); font-weight:600; color: var(--olive-dark); margin:0 0 .5em; line-height:1.15; }
h1{ font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight:700; }
h2{ font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3{ font-size: 1.25rem; }
p{ margin:0 0 1em; }
.eyebrow{
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight:700;
  color: var(--terracotta-dp);
}
html[lang="ar"] .eyebrow{ font-family: var(--font-ar); letter-spacing:0; }

.section{ padding: 84px 0; }
.section-tight{ padding: 56px 0; }
.section-alt{ background: var(--parchment-dp); }
.section-olive{ background: var(--olive-dark); color: #EDE8D8; }
.section-olive h2, .section-olive h3{ color:#fff; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight:600; font-size:.95rem;
  border: 2px solid transparent;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover{ transform: translateY(-2px); }
.btn-primary{ background: var(--terracotta); color:#fff; }
.btn-primary:hover{ background: var(--terracotta-dp); }
.btn-outline{ border-color: rgba(255,255,255,.6); color:#fff; }
.btn-outline:hover{ background: rgba(255,255,255,.12); }
.btn-olive{ background: var(--olive); color:#fff; }
.btn-olive:hover{ background: var(--olive-dark); }
.btn-ghost{ border-color: var(--olive); color: var(--olive-dark); }
.btn-ghost:hover{ background: var(--olive); color:#fff; }

/* ---------- Arch motif (signature element) ----------
   A repeating horseshoe-arch silhouette, echoing the crest,
   used as dividers, card tops, and image frames. */
.arch-divider{
  width:100%; height:34px;
  background-repeat: repeat-x;
  background-size: 68px 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='68' height='34'><path d='M0 34 V16 A17 17 0 0 1 34 16 A17 17 0 0 1 68 16 V34 Z' fill='%236B7F4F'/></svg>");
}
.arch-divider.terra{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='68' height='34'><path d='M0 34 V16 A17 17 0 0 1 34 16 A17 17 0 0 1 68 16 V34 Z' fill='%23D97D4A'/></svg>");
}
.arch-frame{
  position:relative;
  border-radius: 140px 140px 14px 14px;
  overflow:hidden;
  border: 6px solid var(--parchment);
  box-shadow: var(--shadow-card);
  background: var(--olive);
}
.arch-frame img{ width:100%; height:100%; object-fit:cover; }

/* ---------- Header ---------- */
.topbar{
  background: var(--olive-dark);
  color: #D9D2BC;
  font-size:.82rem;
}
.topbar .container{ display:flex; align-items:center; justify-content:space-between; padding-top:7px; padding-bottom:7px; flex-wrap:wrap; gap:6px; }
.topbar a{ color:#D9D2BC; }
.topbar-links{ display:flex; gap:18px; }
.topbar-links span, .topbar-links a{ display:inline-flex; align-items:center; gap:6px; }

.site-header{
  background: var(--parchment);
  border-bottom: 1px solid rgba(46,61,38,.12);
  position: sticky; top:0; z-index: 50;
}
.site-header .container{ display:flex; align-items:center; justify-content:space-between; padding-top:12px; padding-bottom:12px; gap: 20px; }
.brand{ display:flex; align-items:center; gap:12px; }
.brand img{ height:56px; width:auto; }
.brand-name{ font-family: var(--font-display); font-weight:700; color: var(--olive-dark); line-height:1.1; font-size:1.05rem; }
.brand-name small{ display:block; font-family: var(--font-body); font-weight:500; font-size:.68rem; letter-spacing:.08em; color: var(--terracotta-dp); text-transform:uppercase; }

.nav-list{ display:flex; align-items:center; justify-content:flex-end; gap: 6px; flex-wrap: wrap; }
.nav-list > li{ flex: 0 0 auto; }
.nav-list > li > a{
  display: inline-block;
  font-weight:600; font-size:.85rem; color: var(--ink);
  padding: 9px 14px;
  border-radius: 999px;                      /* oval / pill shape */
  background: var(--parchment-dp);           /* visible pill */
  white-space: nowrap;                       /* keep each label on one line */
  line-height: 1.1;
  transition: background .2s ease, color .2s ease, transform .12s ease, box-shadow .2s ease;
}
.nav-list > li > a:hover{ background: var(--olive); color:#fff; box-shadow: 0 4px 12px -4px rgba(61,74,51,.5); }
.nav-list > li > a:active{ transform: scale(.94); background: var(--terracotta); color:#fff; }
.nav-list > li > a.active{ background: var(--terracotta); color:#fff; }
/* hamburger menu on phones / small tablets only */
@media (max-width: 860px){
  .nav-list{
    position: fixed; inset: 68px 0 0 0; background: var(--parchment);
    flex-direction: column; align-items: flex-start; padding: 26px 22px; gap: 12px;
    transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
  }
  html[lang="ar"] .nav-list{ transform: translateX(-100%); }
  .nav-list.open{ transform: translateX(0); }
  .nav-list > li{ width: 100%; }
  .nav-list > li > a{ display: block; font-size: .95rem; }
  .nav-toggle{ display: block; font-size: 1.6rem; color: var(--olive-dark); }
}

/* ---- Academy Policies dropdown ---- */
.has-dropdown{ position: relative; }
/* invisible bridge over the gap so moving the mouse down keeps the menu open */
.has-dropdown:hover::after{
  content: "";
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  width: 100%;
  height: 22px;
}
.dropdown{
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--parchment-dp);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: 8px;
  margin: 6px 0 0;
  list-style: none;
  z-index: 300;
  max-height: 86vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  transition-delay: .6s; /* stay open ~0.6s after the mouse leaves */
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s; /* open instantly on hover */
}
.dropdown li{ margin: 3px 0; }
.dropdown a{
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.dropdown a::after{ display: none; }
.dropdown a:hover{ background: var(--parchment); color: var(--olive-dark); }

.header-actions{ display:flex; align-items:center; gap:12px; }
.lang-switch{
  border:1px solid var(--olive); background:transparent; color:var(--olive-dark);
  border-radius:999px; padding:8px 14px; font-weight:700; font-size:.8rem; letter-spacing:.03em;
}
.lang-switch:hover{ background: var(--olive); color:#fff; }
.nav-toggle{ display:none; background:none; border:none; }

/* ---------- Hero ---------- */
.hero{ position:relative; padding: 64px 0 0; overflow:hidden; }
.hero-grid{ display:grid; grid-template-columns: 1.05fr .95fr; gap:48px; align-items:center; }
.hero-eyebrow{ margin-bottom:14px; }
.hero p.lead{ font-size:1.12rem; color: var(--ink-soft); max-width:46ch; }
.hero-cta{ display:flex; gap:14px; margin-top:28px; flex-wrap:wrap; }
.hero-art{ position:relative; }
.hero-stats{
  margin-top:-1px;
  background: var(--olive-dark); color:#fff;
}
.stat-grid{ display:grid; grid-template-columns: repeat(4,1fr); }
.stat-grid div{ text-align:center; padding: 30px 10px; border-inline-start: 1px solid rgba(255,255,255,.15); }
.stat-grid div:first-child{ border-inline-start:none; }
.stat-num{ font-family: var(--font-display); font-weight:700; font-size:2rem; color: var(--sand); }
.stat-label{ font-size:.78rem; text-transform:uppercase; letter-spacing:.09em; color:#cfd6c6; }

/* ---------- Cards / grids ---------- */
.grid{ display:grid; gap:28px; }
.grid-3{ grid-template-columns: repeat(3,1fr); }
.grid-2{ grid-template-columns: repeat(2,1fr); }
.grid-4{ grid-template-columns: repeat(4,1fr); }

.card{
  background:#fff; border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow:hidden;
  display:flex; flex-direction:column;
}
.card-body{ padding: 22px 24px 26px; }
.card-top{ height:6px; background: var(--terracotta); }
.card .date{ font-size:.78rem; color: var(--terracotta-dp); font-weight:700; text-transform:uppercase; letter-spacing:.06em; }

.program-card{ text-align:center; padding: 30px 20px; background:#fff; border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.program-card .icon{
  width:58px; height:58px; margin:0 auto 16px; border-radius:50%;
  background: var(--parchment-dp); display:flex; align-items:center; justify-content:center;
  color: var(--olive); font-size:1.5rem;
}

/* ---------- Two-column content blocks ---------- */
.split{ display:grid; grid-template-columns: 1fr 1fr; gap:56px; align-items:center; }
.split.reverse .split-text{ order:2; }
.split.reverse .split-art{ order:1; }

/* ---------- Tables (fees etc.) ---------- */
table{ width:100%; border-collapse:collapse; background:#fff; border-radius:var(--radius-md); overflow:hidden; box-shadow: var(--shadow-card);}
th,td{ padding:14px 18px; text-align:start; border-bottom:1px solid var(--parchment-dp); font-size:.95rem; }
thead th{ background: var(--olive-dark); color:#fff; font-family:var(--font-display); font-weight:600; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:nth-child(even){ background: var(--parchment); }

/* ---------- Timeline / org chart ---------- */
.org-level{ display:flex; justify-content:center; gap:20px; flex-wrap:wrap; margin-bottom: 34px; position:relative; }
.org-card{
  background:#fff; border-top:4px solid var(--olive); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card); padding: 16px 22px; text-align:center; min-width:190px;
}
.org-card h4{ margin:0 0 4px; font-size:1rem; color:var(--olive-dark); }
.org-card span{ font-size:.8rem; color: var(--ink-soft); }
.org-card.lead{ border-top-color: var(--terracotta); }

/* ---------- Forms ---------- */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.form-grid .full{ grid-column: 1 / -1; }
label{ display:block; font-weight:600; font-size:.86rem; margin-bottom:6px; color: var(--olive-dark); }
input, select, textarea{
  width:100%; padding:12px 14px; border-radius: 10px; border:1.5px solid #DCD3B8;
  background:#fff; font-family:inherit; font-size:.95rem; color: var(--ink);
}
input:focus, select:focus, textarea:focus{ outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(75,97,66,.15); }
textarea{ resize:vertical; min-height:120px; }

/* ---------- Page header (inner pages) ---------- */
.page-hero{ background: var(--olive-dark); color:#fff; padding: 60px 0 44px; text-align:center; }
.page-hero h1{ color:#fff; }
.page-hero p{ color:#cfd6c6; max-width:62ch; margin:0 auto; }
.breadcrumb{ font-size:.82rem; color:#a9b39a; margin-bottom:14px; }
.breadcrumb a{ color: var(--sand); }

/* ---------- Footer ---------- */
.site-footer{ background: var(--olive-dark); color:#C9D0BB; padding-top: 56px; }
.footer-grid{ display:grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap:36px; padding-bottom: 40px; }
.footer-grid h4{ color:#fff; font-size:1rem; margin-bottom:16px; }
.footer-grid a{ display:block; padding: 5px 0; color:#C9D0BB; }
.footer-grid a:hover{ color: var(--sand); }
.footer-brand img{ height:52px; margin-bottom:14px; }
.footer-brand p{ font-size:.88rem; color:#a9b39a; max-width: 32ch; }
.social-row{ display:flex; gap:10px; margin-top:14px; }
.social-row a{ width:36px; height:36px; border-radius:50%; border:1px solid rgba(255,255,255,.25); display:flex; align-items:center; justify-content:center; padding:0; }
.social-row a:hover{ background: var(--terracotta); border-color: var(--terracotta); }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.12); padding: 16px 0; text-align:center; font-size:.8rem; color:#a9b39a; }

/* ---------- Photo placeholders (swap for real <img> tags later) ---------- */
.photo-slot{
  width:100%; height:100%; min-height:180px;
  background: var(--parchment-dp);
  border: 2px dashed var(--olive-soft);
  border-radius: inherit;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px; color: var(--ink-soft); text-align:center; padding:16px;
}
.photo-slot svg{ width:32px; height:32px; opacity:.55; }
.photo-slot span{ font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; opacity:.75; }

.avatar-slot{
  width:76px; height:76px; border-radius:50%;
  background: var(--parchment-dp);
  border: 2px dashed var(--olive-soft);
  display:flex; align-items:center; justify-content:center;
  margin: 0 auto 12px; color: var(--ink-soft);
}
.avatar-slot svg{ width:30px; height:30px; opacity:.6; }

.card-thumb{
  height:170px; border-radius: var(--radius-md) var(--radius-md) 0 0; overflow:hidden;
}
.card-thumb img{ width:100%; height:100%; object-fit:cover; }
.card-thumb .photo-slot{ border-radius: var(--radius-md) var(--radius-md) 0 0; min-height:170px; }

/* ---------- Profile modal (click a person/card to see details) ---------- */
.profile-trigger{ cursor:pointer; transition: transform .18s ease, box-shadow .18s ease; }
.profile-trigger:hover{ transform: translateY(-4px); box-shadow: 0 16px 34px -14px rgba(58,50,38,.35); }
.profile-trigger .avatar-slot{ pointer-events:none; }
.profile-hint{
  display:inline-flex; align-items:center; gap:6px; margin-top:10px;
  font-size:.74rem; font-weight:700; color: var(--terracotta-dp); text-transform:uppercase; letter-spacing:.05em;
}

.modal-overlay{
  position:fixed; inset:0; background: rgba(38,32,25,.55);
  display:flex; align-items:center; justify-content:center; z-index:200; padding:20px;
  opacity:0; visibility:hidden; pointer-events:none;
  transition: opacity .32s cubic-bezier(.22,1,.36,1), visibility .32s;
  backdrop-filter: blur(3px);
}
.modal-overlay.open{ opacity:1; visibility:visible; pointer-events:auto; }
.modal-box{
  background:#fff; border-radius: var(--radius-md); max-width:480px; width:100%;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); position:relative; overflow:hidden;
  max-height:88vh; overflow-y:auto;
  transform: translateY(28px) scale(.95); opacity:0;
  transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .32s ease;
}
.modal-overlay.open .modal-box{ transform: translateY(0) scale(1); opacity:1; }
.modal-close{
  position:absolute; top:14px; inset-inline-end:14px; width:34px; height:34px; border-radius:50%;
  background: var(--parchment-dp); border:none; font-size:1.1rem; color: var(--ink); z-index:2;
  display:flex; align-items:center; justify-content:center;
}
.modal-close:hover{ background: var(--terracotta); color:#fff; }
.modal-photo{ height:200px; }
.modal-body{ padding:26px 28px 30px; }
.modal-body h3{ margin-bottom:2px; }
.modal-role{ color: var(--terracotta-dp); font-weight:700; font-size:.85rem; text-transform:uppercase; letter-spacing:.05em; margin-bottom:14px; display:block; }
.modal-body p.bio{ color: var(--ink-soft); }
.modal-section{ margin-top:18px; padding-top:16px; border-top:1px solid var(--parchment-dp); }
.modal-section h4{ font-size:.92rem; margin-bottom:10px; color: var(--olive-dark); text-transform:uppercase; letter-spacing:.04em; }
.modal-section ul{ list-style:none; padding:0; margin:0; }
.modal-section ul li{
  font-size:.87rem; color: var(--ink-soft); padding: 6px 0 6px 16px; position:relative; border-bottom:1px dashed var(--parchment-dp);
}
.modal-section ul li:last-child{ border-bottom:none; }
.modal-section ul li::before{ content:"—"; position:absolute; left:0; color: var(--terracotta); }
[dir="rtl"] .modal-section ul li{ padding: 6px 16px 6px 0; }
[dir="rtl"] .modal-section ul li::before{ left:auto; right:0; }
.modal-contact a{ display:flex; align-items:center; gap:8px; color: var(--olive-dark); font-weight:600; margin-bottom:8px; font-size:.9rem; }
.modal-contact a:hover{ color: var(--terracotta-dp); }

/* group card (e.g. "Section & Department Heads") */
.org-card.profile-trigger-group{ border-top-color: var(--sand); }
.group-member{ display:none; }

.modal-group-view{ display:none; }
.modal-group-view.show{ display:block; }
.modal-profile-view.hide{ display:none; }

@keyframes modalContentIn{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
.modal-anim{ animation: modalContentIn .38s cubic-bezier(.22,1,.36,1); }

.modal-group-title{ margin-bottom:14px; }
.modal-group-list{ display:flex; flex-direction:column; gap:4px; }
.modal-group-item{
  display:flex; align-items:center; gap:14px; padding:12px 10px; border-radius:12px;
  cursor:pointer; text-align:start; border:1px solid transparent; background:none; width:100%;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.modal-group-item:hover{ background: var(--parchment-dp); border-color: var(--parchment-dp); transform: translateX(4px); }
[dir="rtl"] .modal-group-item:hover{ transform: translateX(-4px); }
.modal-group-item .mini-avatar{
  width:46px; height:46px; border-radius:50%; background: var(--parchment-dp);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; color: var(--ink-soft);
  transition: background .2s ease, color .2s ease;
}
.modal-group-item:hover .mini-avatar{ background: var(--olive); color:#fff; }
.modal-group-item .mini-avatar svg{ width:20px; height:20px; }
.modal-group-item .mini-info strong{ display:block; font-size:.92rem; color: var(--olive-dark); }
.modal-group-item .mini-info span{ font-size:.78rem; color: var(--ink-soft); }

.modal-back-btn{
  display:none; align-items:center; gap:6px; background:none; border:none;
  color: var(--olive-dark); font-weight:700; font-size:.85rem; margin-bottom:14px; cursor:pointer; padding:4px 0;
  transition: transform .2s ease, color .2s ease;
}
.modal-back-btn.show{ display:inline-flex; }
.modal-back-btn:hover{ color: var(--terracotta-dp); transform: translateX(-3px); }
[dir="rtl"] .modal-back-btn:hover{ transform: translateX(3px); }

/* ---------- News grid page ---------- */
.filter-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:34px; }
.filter-chip{ padding:8px 18px; border-radius:999px; border:1.5px solid var(--olive); font-weight:600; font-size:.85rem; color:var(--olive-dark); background:#fff; }
.filter-chip.active{ background:var(--olive); color:#fff; }

/* ---------- Utilities ---------- */
.text-center{ text-align:center; }
.mt-0{ margin-top:0 !important; }
.muted{ color: var(--ink-soft); }
.max-w{ max-width: 720px; margin-inline:auto; }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .hero-grid, .split{ grid-template-columns:1fr; }
  .split .split-art{ order:1 !important; }
  .split .split-text{ order:2 !important; }
  .grid-3, .grid-4{ grid-template-columns: repeat(2,1fr); }
  .footer-grid{ grid-template-columns: 1fr 1fr; }
  .stat-grid{ grid-template-columns: repeat(2,1fr); }
  .stat-grid div:nth-child(3){ border-inline-start:none; }
}
@media (max-width: 720px){
  .nav-list{
    position:fixed; inset: 68px 0 0 0; background: var(--parchment);
    flex-direction:column; align-items:flex-start; padding: 28px 24px; gap:18px;
    transform: translateX(100%); transition: transform .25s ease; overflow-y:auto;
  }
  html[lang="ar"] .nav-list{ transform: translateX(-100%); }
  .nav-list.open{ transform: translateX(0); }
  .nav-toggle{ display:block; font-size:1.6rem; color:var(--olive-dark); }
  /* dropdown becomes an inline indented list inside the mobile menu */
  .dropdown{
    position: static; display: block; box-shadow: none; border: none;
    background: transparent; padding: 6px 0 6px 14px; margin: 6px 0 0;
    max-height: none; overflow: visible; min-width: 0;
    opacity: 1; visibility: visible; transform: none; transition: none;
  }
  html[lang="ar"] .dropdown{ padding: 6px 14px 6px 0; }
  .dropdown a{ padding: 7px 4px; font-size: .85rem; white-space: normal; }
  .grid-3,.grid-4,.grid-2{ grid-template-columns:1fr; }
  .form-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; }
  .org-level{ flex-direction:column; align-items:center; }
}

/* language visibility helper (JS toggles html[lang]) */
.lang-ar{ display:none; }
html[lang="ar"] .lang-en{ display:none; }
html[lang="ar"] .lang-ar{ display:block; }
html[lang="ar"] span.lang-ar{ display:inline; }

/* =========================================================
   HOMEPAGE CAROUSEL — "Academy Moments"
   ========================================================= */
.carousel{
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--olive-dark);
  box-shadow: var(--shadow-card);
  direction: ltr;   /* keep slide order + arrows correct even in Arabic (RTL) mode */
}
.carousel-track{
  display: flex;
  transition: transform .6s cubic-bezier(.4,.0,.2,1);
  will-change: transform;
}
.carousel-slide{
  min-width: 100%;
  flex: 0 0 100%;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-slide img{
  width: 100%;
  height: 100%;
  object-fit: contain;   /* never crop the photos */
}
/* prev / next buttons */
.carousel-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(251,243,231,.85);
  color: var(--olive-dark);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.4);
  transition: background .2s ease, transform .2s ease;
  z-index: 2;
}
.carousel-btn:hover{ background: var(--sand); transform: translateY(-50%) scale(1.07); }
.carousel-btn.prev{ left: 16px; }
.carousel-btn.next{ right: 16px; }
/* dots */
.carousel-dots{
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.carousel-dots button{
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(251,243,231,.5);
  transition: background .2s ease, transform .2s ease;
}
.carousel-dots button.active{ background: var(--sand); transform: scale(1.25); }

/* ---- Full-width photo banner at the top of the homepage ---- */
.photo-banner{ width: 100%; background: var(--olive-dark); }
.carousel-banner{
  max-width: none;
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.carousel-banner .carousel-slide{
  height: clamp(240px, 40vw, 480px);
  position: relative;
  overflow: hidden;
  padding: 0 66px;   /* keep the photo clear of the prev/next arrows */
}
/* blurred, zoomed copy of the same photo fills the sides — no empty gaps */
.carousel-banner .carousel-slide::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--slide-bg);
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(.6);
  transform: scale(1.2);
}
/* the actual photo — fills the banner edge-to-edge */
.carousel-banner .carousel-slide img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* posters/portraits: show the whole image, no cropping (blurred bg fills the sides) */
.carousel-banner .carousel-slide.slide-fit img{
  object-fit: contain;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}
/* caption bar overlaid on the photo */
.slide-caption{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  direction: rtl;
  font-family: var(--font-ar);
  font-weight: 700;
  color: #fff;
  text-align: center;
  font-size: clamp(.82rem, 2vw, 1.12rem);
  line-height: 1.55;
  padding: 44px 22px 30px;
  background: linear-gradient(to top, rgba(61,74,51,.95), rgba(61,74,51,.6) 55%, rgba(61,74,51,0));
}
.carousel-banner .carousel-dots{ z-index: 3; }

/* ---- Academy Pulse video button + popup ---- */
.btn-video{ display: inline-flex; align-items: center; gap: 9px; }
.video-play-icon{
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; color: var(--terracotta); font-size: 9px; padding-left: 2px;
}
.video-modal{
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.82); padding: 24px;
}
.video-modal.open{ display: flex; }
.video-box{ position: relative; width: min(900px, 96vw); }
.video-box video{ width: 100%; max-height: 82vh; border-radius: 12px; display: block; background: #000; }
.video-close{
  position: absolute; top: -48px; right: 0;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: #fff; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer;
}

/* ---- Leadership message boxes (Director / Chairman) ---- */
.message-block{
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 44px;
  align-items: start;
}
.message-portrait{ text-align: center; }
.message-title{
  font-family: var(--font-display);
  color: var(--olive-dark);
  font-size: 1.4rem;
  margin: 0 0 14px;
}
.portrait-frame{
  border-radius: 14px;
  overflow: hidden;
  border: 5px solid var(--parchment);
  box-shadow: var(--shadow-card);
  background: var(--parchment-dp);
  aspect-ratio: 4/5;
}
.portrait-frame img{ width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.message-name{ margin-top: 16px; display: flex; flex-direction: column; gap: 3px; }
.message-name strong{ color: var(--ink); font-size: 1.05rem; }
.message-name .muted{ font-size: .85rem; }
.message-body{ line-height: 2; color: var(--ink); }
.message-body p{ margin: 0 0 16px; }
.message-signoff{ font-weight: 800; color: var(--olive-dark); line-height: 1.7; }
@media(max-width: 820px){
  .message-block{ grid-template-columns: 1fr; }
  .message-portrait{ max-width: 300px; margin: 0 auto; }
}

/* ---- Homepage leadership boxes (Director + Chairman) ---- */
.leader-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.leader-frame{
  background: var(--white);
  border: 1px solid var(--parchment-dp);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 32px;
  text-align: center;
}
.leader-heading{ font-family: var(--font-display); color: var(--olive-dark); font-size: 1.4rem; margin: 0 0 20px; }
.leader-photo-plain{ width: 100%; max-width: 220px; margin: 0 auto 16px; border-radius: 12px; display: block; }
.leader-name{ display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.leader-role{ color: var(--terracotta-dp); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.leader-fullname{ color: var(--ink); font-size: 1.12rem; }
.leader-words{ text-align: right; line-height: 2; color: var(--ink); border-top: 1px solid var(--parchment-dp); padding-top: 20px; }
.leader-words p{ margin: 0 0 14px; }
@media(max-width: 820px){ .leader-grid{ grid-template-columns: 1fr; gap: 32px; } }

/* ---- About: school category + executive summary ---- */
.info-grid{ display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: start; }
/* ---- About: school category / evaluation / calendar (restored) ---- */
.info-card{ background: var(--white); border: 1px solid var(--parchment-dp); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 32px; direction: rtl; text-align: right; }
.info-icon{ font-size: 1.8rem; margin-bottom: 10px; }
.info-card h3{ color: var(--olive-dark); margin: 0 0 18px; font-size: 1.3rem; }
.cat-list{ list-style: none; padding: 0; margin: 0; }
.cat-list li{ padding: 12px 0; border-bottom: 1px solid var(--parchment-dp); color: var(--ink); line-height: 1.7; }
.cat-list li:last-child{ border-bottom: none; }
.cat-list li strong{ color: var(--olive-dark); }
.info-card p{ line-height: 2; color: var(--ink); margin: 0 0 14px; }
.info-badge{ display: inline-block; margin-top: 6px; background: var(--olive); color: #fff; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: .85rem; }
.eval-row{ display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; direction: rtl; }
.info-badge-glow{ font-size: 1rem; padding: 8px 22px; background: var(--olive); animation: badgeGlow 1.8s ease-in-out infinite; }
@keyframes badgeGlow{ 0%,100%{ box-shadow: 0 0 8px 1px rgba(240,194,123,.55); } 50%{ box-shadow: 0 0 24px 7px rgba(240,194,123,1); } }
.eval-link{ color: var(--terracotta-dp); font-weight: 700; font-size: .9rem; text-decoration: underline; }
.eval-link:hover{ color: var(--olive-dark); }
.calendar-card{ margin-top: 30px; background: var(--olive-dark); color: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 26px 32px; display: flex; align-items: center; gap: 20px; direction: rtl; text-align: right; }
.calendar-card .info-icon{ margin: 0; font-size: 2rem; }
.calendar-text{ flex: 1; }
.calendar-card h3{ color: #fff; margin: 0 0 4px; }
.calendar-card p{ margin: 0; color: #cfd6c6; }
.calendar-card .btn{ flex-shrink: 0; }
@media(max-width: 640px){ .calendar-card{ flex-direction: column; text-align: center; } }


/* ---- Announcements / activities image grid ---- */
.adv-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  direction: ltr;                 /* keep images in the exact given order */
}
.adv-img{
  background: var(--parchment-dp);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.adv-img img{ width: 100%; height: 100%; object-fit: contain; }  /* full image, clear, not cropped */
@media(max-width: 640px){ .adv-grid{ grid-template-columns: repeat(2, 1fr); } }

/* ---- Announcements / activities video cards ---- */
.vid-stack{ display: flex; flex-direction: column; gap: 26px; }
.vid-card{ background: var(--white); border: 1px solid var(--parchment-dp); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 18px; direction: rtl; text-align: right; }
.vid-card video{ width: 100%; border-radius: 12px; background: #000; display: block; margin-bottom: 14px; }
.vid-card p{ margin: 0; line-height: 1.9; color: var(--ink); }

/* ---- Alumni club: smaller slideshow + autoplaying video grid ---- */
.carousel-sm{ max-width: 780px; }
.carousel-sm .carousel-slide{ height: 420px; }
.auto-vid-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.auto-vid-grid video{ width: 100%; height: 320px; object-fit: contain; background: #000; border-radius: 12px; box-shadow: var(--shadow-card); display: block; }
@media(max-width: 640px){ .carousel-sm .carousel-slide{ height: 300px; } .auto-vid-grid video{ height: 260px; } }

/* ---- Org chart groups (Administrative / Teaching / Kindergarten) ---- */
.org-group{ margin-bottom: 54px; }
.org-group:last-child{ margin-bottom: 0; }
.org-group-title{
  text-align: center;
  color: var(--terracotta-dp);
  font-size: 1.35rem;
  width: fit-content;
  margin: 0 auto 30px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--parchment-dp);
}

/* ---- Graduates gallery ---- */
.grad-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 22px; direction: rtl; }
.grad-card{ text-align: center; }
.grad-photo{ width: 100%; aspect-ratio: 1/1; border-radius: 50%; overflow: hidden; background: var(--parchment-dp); box-shadow: var(--shadow-card); border: 3px solid var(--white); }
.grad-photo img{ width: 100%; height: 100%; object-fit: cover; }
.grad-name{ margin-top: 10px; font-size: .82rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
@media(max-width: 640px){ .grad-grid{ grid-template-columns: repeat(3, 1fr); gap: 14px; } }

/* ---- Graduate slide grid (portraits) ---- */
.slide-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.slide-card{ border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); background: var(--parchment-dp); }
.slide-card img{ width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
@media(max-width: 640px){ .slide-grid{ grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ---- Graduates: photo + name cards ---- */
.grads-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; direction: rtl; }
.grad-item{ background: var(--white); border: 2px solid var(--olive-soft); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); text-align: center; }
.grad-item img{ width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.grad-item .nm{ padding: 10px 8px; font-weight: 700; font-size: .85rem; color: var(--olive-dark); border-top: 2px solid var(--olive-soft); line-height: 1.4; }
@media(max-width: 640px){ .grads-grid{ grid-template-columns: repeat(2, 1fr); gap: 14px; } }

/* ---- Animated graduate-faces background behind the nav bar ---- */
.site-header{ position: relative; }
.site-header .container{ position: relative; z-index: 2; }
/* slowly panning strip of graduate faces (scrolls via background-position, so
   the header needs no overflow:hidden and the dropdowns stay visible) */
.site-header::before{
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  background-image: url("../images/brand/grad-faces-strip.jpg");
  background-repeat: repeat-x;
  background-size: 2240px 80px;
  background-position: 0 center;
  opacity: .65;
  animation: facesPan 55s linear infinite;
}
@keyframes facesPan{
  from{ background-position-x: 0; }
  to  { background-position-x: -2240px; }
}
/* readability veil so the menu pills stay crisp */
.site-header::after{
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(251,243,231,.74), rgba(251,243,231,.86));
}
/* pills get a touch more contrast over the photos */
.site-header .nav-list > li > a{ background: rgba(255,255,255,.82); backdrop-filter: blur(2px); }
.site-header .nav-list > li > a:hover{ background: var(--olive); }
.site-header .nav-list > li > a.active{ background: var(--terracotta); }
@media (max-width: 1024px){ .site-header .nav-list > li > a{ background: var(--parchment-dp); backdrop-filter: none; } }

/* ---- Academy name moved into the top bar, logo alone in the header ---- */
.topbar .container{ padding-top: 12px; padding-bottom: 12px; }
.topbar-brand{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  flex: 1 1 auto;
}
html[lang="ar"] .topbar-brand{ font-family: var(--font-ar); }
.brand img{ height: 68px; }
@media (max-width: 720px){
  .topbar .container{ justify-content: center; }
  .topbar-brand{ font-size: 1.05rem; width: 100%; order: -1; margin-bottom: 4px; }
  .brand img{ height: 54px; }
}

/* ---- Header layout: logo + menu + language all on one row ---- */
@media (min-width: 861px){
  .site-header .container{ flex-wrap: nowrap; gap: 14px; }
  .site-header .nav-list{
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
  }
  .site-header .nav-list > li > a{ font-size: .78rem; padding: 7px 11px; }
  .site-header .brand{ flex: 0 0 auto; }
  .site-header .header-actions{ flex: 0 0 auto; }
  .brand img{ height: 58px; }
}
/* keep the faces a little more subtle behind a single-row header */
.site-header::after{ background: linear-gradient(to bottom, rgba(251,243,231,.82), rgba(251,243,231,.90)); }

/* ---- Staff photos inside org avatars ---- */
.avatar-slot{ overflow: hidden; }
.avatar-slot:has(img){ border: 2px solid var(--olive-soft); background: none; }
.avatar-slot img{ border-radius: 50%; }
/* subject / department icons — show the whole badge, no cropping */
.avatar-slot.avatar-icon{
  width: 92px; height: 92px;
  border: none; background: none; overflow: visible;
}
.avatar-slot.avatar-icon img{
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.modal-photo{ overflow: hidden; }
.modal-photo-img{ border-radius: 0; }
.modal-group-item .mini-avatar{ overflow: hidden; }

/* ---------- Floating AI assistant button ---------- */
.ai-fab{
  position: fixed;
  inset-block-end: 26px;
  inset-inline-end: 26px;
  z-index: 120;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-dp));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px -6px rgba(179,92,46,.65);
  text-decoration: none;
  animation: aiFloat 3.4s ease-in-out infinite;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ai-fab::before{                       /* pulsing halo */
  content:""; position:absolute; inset:0; border-radius:50%;
  background: var(--terracotta);
  animation: aiPulse 2.4s ease-out infinite;
  z-index:-1;
}
.ai-fab svg{ width:30px; height:30px; }
.ai-fab:hover{ transform: scale(1.1) rotate(-6deg); box-shadow: 0 14px 32px -6px rgba(179,92,46,.8); }
.ai-fab .ai-tip{
  position:absolute; inset-inline-end:74px; white-space:nowrap;
  background: var(--olive-dark); color:#fff;
  font-size:.8rem; font-weight:700; font-family: var(--font-ar);
  padding:8px 14px; border-radius:999px;
  opacity:0; pointer-events:none; transform: translateX(8px);
  transition: opacity .25s ease, transform .25s ease;
}
html[lang="ar"] .ai-fab .ai-tip{ transform: translateX(-8px); }
.ai-fab:hover .ai-tip{ opacity:1; transform: translateX(0); }
@keyframes aiFloat{ 0%,100%{ translate:0 0 } 50%{ translate:0 -8px } }
@keyframes aiPulse{ 0%{ transform:scale(1); opacity:.55 } 70%{ transform:scale(1.75); opacity:0 } 100%{ opacity:0 } }
@media (max-width: 640px){
  .ai-fab{ width:56px; height:56px; inset-block-end:18px; inset-inline-end:18px; }
  .ai-fab .ai-tip{ display:none; }
}
@media (prefers-reduced-motion: reduce){
  .ai-fab, .ai-fab::before{ animation: none; }
}
