/* ============================================
   SAHAB ACADEMY - Modern Academic Portal
   ============================================ */

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

:root {
    --primary: #0a1628;
    --primary-light: #142240;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --surface: #ffffff;
    --surface-dim: #f8fafc;
    --surface-glass: rgba(255,255,255,0.08);
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #e2e8f0;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 60px rgba(0,0,0,0.2);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', Tahoma, sans-serif;
    background: var(--surface-dim);
    color: var(--text);
    direction: rtl;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.95);
    padding: 6px;
    box-shadow: 0 4px 20px rgba(37,99,235,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.header-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(37,99,235,0.4);
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.header-title {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.header-subtitle {
    color: var(--gold-light);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Navigation */
.main-nav { display: flex; align-items: center; }

.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: var(--text-light);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-link.active {
    background: var(--accent);
    color: #fff;
}

.nav-item .submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--primary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 100;
}

.nav-item:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
}

.submenu a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.hamburger:hover { background: rgba(255,255,255,0.1); }

.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1a365d 50%, #1e3a5f 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(245,158,11,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text {
    animation: fadeInUp 0.8s ease;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius-full);
    color: var(--gold-light);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 560px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 8px 30px rgba(37,99,235,0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(37,99,235,0.45);
}

.btn-outline {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--primary);
    box-shadow: 0 8px 30px rgba(245,158,11,0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(245,158,11,0.4);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/10;
    box-shadow: var(--shadow-xl);
    animation: fadeInLeft 0.8s ease 0.2s both;
}

.hero-slider .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-slider .slide.active {
    opacity: 1;
}

.hero-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider .slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dots .dot.active {
    background: var(--gold);
    width: 28px;
    border-radius: 5px;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.stats-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.5rem 2rem;
    border-left: 1px solid var(--border);
    transition: var(--transition);
    margin: 20px;
}

.stat-item:last-child { border-left: none; }

.stat-item:hover {
    background: var(--surface-dim);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; color: var(--accent); }
.stat-icon.gold { background: #fffbeb; color: var(--gold); }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.purple { background: #f5f3ff; color: #8b5cf6; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ============================================
   SECTION COMMON
   ============================================ */
.section {
    padding: 5rem 2rem;
}

.section-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    border-radius: 2px;
    margin: 1rem auto 0;
}

/* ============================================
   FACULTIES GRID
   ============================================ */
.faculty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.faculty-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.faculty-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--accent), var(--gold));
    border-radius: 0 0 0 4px;
    transition: height 0.4s ease;
}

.faculty-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.faculty-card:hover::before {
    height: 100%;
}

.faculty-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--accent);
}

.faculty-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.faculty-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   NEWS SECTION
   ============================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-card-img {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-img img {
    transform: scale(1.05);
}

.news-card-category {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 14px;
    background: var(--accent);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.news-card-body {
    padding: 1.5rem;
}

.news-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
}

.news-card-link:hover {
    gap: 10px;
}

/* ============================================
   ABOUT PAGE
   ============================================ */
.page-hero {
    background: linear-gradient(135deg, var(--primary), #1a365d);
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.page-hero h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.75rem;
}

.page-hero p {
    color: rgba(255,255,255,0.7);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

.school-pages-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    margin-top: auto;
    padding-top: 2rem;
}

.school-pages-menu .school-page-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    /* border-radius: 999px; */
    /* background: rgba(255, 255, 255, 0.12); */
    /* border: 1px solid rgba(255, 255, 255, 0.35); */
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.school-pages-submenu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-right: 24px;
    padding-right: 16px;
    border-right: 2px solid rgba(255, 255, 255, 0.35);
}

.school-pages-submenu .school-page-link {
    font-size: .82rem;
    padding: 7px 14px;
    font-weight: 500;
    opacity: .92;
}

.school-pages-submenu.button-variant {
    border-right-color: #d5dfe9;
}

.school-pages-submenu .btn {
    width: auto !important;
}

.school-page-group {
    opacity: .85;
    cursor: default;
}

:is(.school-pages-submenu) .btn {
    font-size: .82rem !important;
    padding: 7px 14px !important;
}

/* School pages nested items as dropdowns */
.school-dropdown {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.school-dropdown .school-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.school-dropdown .school-dropdown-caret {
    font-size: .7rem;
    opacity: .75;
    transition: transform .18s ease;
}

.school-dropdown:hover .school-dropdown-caret,
.school-dropdown.submenu-open .school-dropdown-caret {
    transform: rotate(180deg);
}

.school-dropdown > .school-pages-submenu.school-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: auto;
    min-width: 240px;
    margin: 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    background: var(--primary);
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.school-dropdown:hover > .school-pages-submenu.school-dropdown-menu,
.school-dropdown.submenu-open > .school-pages-submenu.school-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.school-dropdown > .school-pages-submenu.school-dropdown-menu .school-page-link {
    display: block;
    width: 100%;
    font-size: .85rem;
    padding: 9px 14px;
    border-radius: 8px;
    white-space: nowrap;
    text-align: right;
}

.school-dropdown > .school-pages-submenu.school-dropdown-menu .school-page-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.school-dropdown > .school-pages-submenu.button-variant.school-dropdown-menu {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.school-dropdown > .school-pages-submenu.school-dropdown-menu .btn {
    display: block;
    width: 100% !important;
    text-align: right;
}

@media (max-width: 768px) {
    .school-dropdown {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .school-dropdown > .school-pages-submenu.school-dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-right: 24px;
        padding-right: 16px;
        border-right: 2px solid rgba(255, 255, 255, 0.35);
        box-shadow: none;
        opacity: 0;
        visibility: hidden;
        transform: none;
    }

    .school-dropdown.submenu-open > .school-pages-submenu.school-dropdown-menu {
        opacity: 1;
        visibility: visible;
    }

    .school-dropdown > .school-pages-submenu.button-variant.school-dropdown-menu {
        border-right-color: #d5dfe9;
    }
}

.content-section {
    padding: 4rem 2rem;
}

.content-inner {
    max-width: 900px;
    margin: 0 auto;
}

.content-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.content-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

.content-card p {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 1rem;
}

.content-card ul {
    padding-right: 1.5rem;
    margin-bottom: 1rem;
}

.content-card li {
    position: relative;
    padding-right: 1rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--text);
    list-style: disc;
}

.content-card li::marker {
    color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--primary);
    color: var(--text-light);
    padding: 4rem 2rem 0;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.2rem;
}

.footer-col a {
    display: block;
    padding: 6px 0;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--gold-light);
    padding-right: 6px;
}

.footer-bottom {
    padding: 1.5rem 0;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

/* ============================================
   STRUCTURE PAGE
   ============================================ */
.structure-img {
    text-align: center;
    margin: 2rem 0;
}

.structure-img img {
    max-width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero p { margin: 0 auto 2rem; }
    .hero-actions { justify-content: center; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-list {
        position: fixed;
        top: 72px;
        right: -100%;
        width: min(85vw, 340px);
        height: calc(100vh - 72px);
        background: var(--primary);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 4px;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -10px 0 40px rgba(0,0,0,0.3);
        z-index: 999;
    }

    .nav-list.open { right: 0; }

    .nav-link {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .nav-item .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255,255,255,0.05);
        border: none;
        box-shadow: none;
        padding: 0 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-item.submenu-open > .submenu {
        max-height: 500px;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-item { padding: 1rem; }

    .hero { min-height: auto; }
    .hero-content { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.8rem; }

    .faculty-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; }
    .section { padding: 3rem 1rem; }

    .contact-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-item { border-left: none; border-bottom: 1px solid var(--border); }
    .stat-item:last-child { border-bottom: none; }
}

/* ====== مكونات قوالب الأكاديمية (تحييد مميزات المحرر) ====== */
.tpl-fill { background: transparent; padding: 0; border: none; box-shadow: none; }
.tpl-slot { display: none; }
.tpl-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 150px;
    margin: 14px 0;
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #94a3b8;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
}
.tpl-img i { font-size: 2rem; color: #cbd5e1; }
.tpl-img small { font-size: .8rem; font-weight: 400; }

/* ============================================
   RESPONSIVE ENHANCEMENTS — جوال/آيباد/آيفون
   ============================================ */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1024px) {
    .page-hero { padding: 3rem 1.5rem; }
    .content-section { padding: 3rem 1.25rem; }
    .content-card { padding: 2rem 1.5rem; }
    .header-inner { gap: 1rem; }
    .hero { min-height: 52vh; }
}

@media (max-width: 768px) {
    .site-header { padding: 0.65rem 0; }
    .header-brand { gap: 10px; }
    .header-logo { width: 46px; height: 46px; }
    .header-title { font-size: 12px; }
    .header-subtitle { font-size: 0.7rem; }
    .hamburger { min-height: 44px; min-width: 44px; }

    .nav-list { top: 60px; height: calc(100vh - 60px); }
    .nav-link, .submenu a { min-height: 44px; }

    .btn { width: 100%; justify-content: center; padding: 12px 20px; }
    .hero-actions { flex-wrap: wrap; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }

    .page-hero { padding: 2.5rem 1rem 3rem; }
    .page-hero h1 { font-size: 1.7rem; }
    .school-pages-menu { justify-content: center; }
    .school-pages-menu .school-page-link {
        flex: 1 1 100%;
        justify-content: center;
        min-height: 44px;
    }

    .section { padding: 2.5rem 1rem; }
    .section-title { font-size: 1.5rem; }
    .content-inner { max-width: 100%; }
    .content-card { padding: 1.5rem 1rem; }
    .faculty-card, .news-card { padding: 1.5rem; }

    table:not(.calendar-table) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    input, select, textarea, button {
        font-size: 16px;
    }
    .form-group input, .form-group select, .form-group textarea {
        width: 100%;
        box-sizing: border-box;
    }

    .footer-grid { gap: 2rem; }
    .footer-section { text-align: center; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.45rem; }
    .hero p { font-size: 0.95rem; }
    .page-hero p { font-size: 0.95rem; }
    .stat-number { font-size: 1.6rem; }
    .section-title { font-size: 1.35rem; }
}

/* ===== هيدر البوابة القديم (Legacy Portal Header) ===== */
#header nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    #header nav ul li a {
        white-space: nowrap;
        display: inline-block;
        padding: 12px 14px;
        min-height: 44px;
        line-height: 44px;
    }
}