/* ============================================================
   NUBA EDUCATION — Main Stylesheet
   Aesthetic: Warm luxury · Brown & cream · Editorial serif
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Jost:wght@300;400;500;600&display=swap');

:root {
    /* Browns */
    --brown-deep:    #2c1810;
    --brown-dark:    #3d2314;
    --brown-mid:     #6b3d2a;
    --brown-warm:    #8b5e3c;
    --brown-light:   #c4956a;
    --brown-pale:    #d4a574;

    /* Creams */
    --cream-deep:    #f5ede0;
    --cream-light:   #fdf8f2;
    --cream-white:   #fffcf8;

    /* Accents */
    --gold:          #c9a05a;
    --gold-light:    #e8c98a;
    --text-dark:     #1a0e08;
    --text-body:     #4a3728;
    --text-muted:    #8a7060;
    --text-light:    #b8a090;
    --white:         #ffffff;

    /* UI */
    --border:        rgba(107,61,42,0.12);
    --border-warm:   rgba(201,160,90,0.25);
    --shadow-sm:     0 2px 12px rgba(44,24,16,0.08);
    --shadow-md:     0 8px 32px rgba(44,24,16,0.12);
    --shadow-lg:     0 20px 60px rgba(44,24,16,0.18);
    --radius:        14px;
    --radius-sm:     8px;
    --nav-h:         80px;
    --transition:    all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   GLOBAL OVERFLOW LOCK — must be first, never overridden
   ============================================================ */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Clipping context: child transforms cannot expand scroll width */
    contain: paint;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
    position: relative;
    width: 100%;
}

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

body {
    font-family: 'Jost', sans-serif;
    background: var(--cream-white);
    color: var(--text-body);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--brown-deep);
    line-height: 1.2;
}
h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 600; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 500; }
h4 { font-size: 1.2rem; font-weight: 600; }
p  { line-height: 1.8; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    /* Prevent any child from expanding beyond this width */
    overflow-x: hidden;
}
.section { padding: 100px 0; }
.section-sm { padding: 60px 0; }

/* Every section is a hard clipping boundary */
section {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ---- NAVBAR ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: rgba(253,248,242,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    /* Navbar must never cause horizontal scroll */
    overflow: hidden;
    max-width: 100vw;
}
.navbar.scrolled {
    background: rgba(253,248,242,0.98);
    box-shadow: var(--shadow-sm);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px; font-weight: 700;
    color: var(--cream-light);
    letter-spacing: -1px;
    flex-shrink: 0;
}
.logo-name { display: block; font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 700; color: var(--brown-deep); letter-spacing: 0.08em; line-height: 1; }
.logo-sub  { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.15em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
.nav-link {
    padding: 8px 16px;
    color: var(--text-body);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: 6px;
    transition: var(--transition);
    position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--brown-warm); }
.nav-link.active::after {
    content: ''; position: absolute; bottom: 4px; left: 16px; right: 16px;
    height: 2px; background: var(--brown-light); border-radius: 1px;
}
.btn-nav {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: var(--cream-light);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-nav:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(61,35,20,0.3); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--brown-deep); border-radius: 2px; transition: var(--transition); }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px;
    font-family: 'Jost', sans-serif;
    font-size: 14px; font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: none; cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: var(--cream-light);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(61,35,20,0.35); }
.btn-outline {
    background: transparent;
    color: var(--brown-warm);
    border: 2px solid var(--brown-warm);
}
.btn-outline:hover { background: var(--brown-warm); color: white; }
.btn-ghost {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.25); }
.btn-lg { padding: 18px 44px; font-size: 15px; }
.btn-sm { padding: 9px 20px; font-size: 13px; }

/* ---- LABELS / BADGES ---- */
.label {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.label-brown { background: rgba(107,61,42,0.1); color: var(--brown-warm); }
.label-gold  { background: rgba(201,160,90,0.15); color: #8a6020; }
.label-cream { background: var(--cream-deep); color: var(--text-muted); }

/* ---- SECTION HEADERS ---- */
.section-header { text-align: center; margin-bottom: 64px; }
.section-overline {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 16px;
    position: relative;
    padding: 0 24px;
}
.section-overline::before, .section-overline::after {
    content: ''; position: absolute; top: 50%;
    width: 16px; height: 1px;
    background: var(--brown-light);
}
.section-overline::before { right: 0; }
.section-overline::after  { left: 0; }
.section-title { margin-bottom: 16px; }
.section-desc { color: var(--text-muted); font-size: 17px; max-width: 600px; margin: 0 auto; }

/* ---- DIVIDER ---- */
.ornament { text-align: center; color: var(--brown-pale); font-size: 24px; letter-spacing: 8px; margin: 8px 0; opacity: 0.6; }

/* ============================================================
   ANIMATIONS — defined once, used everywhere
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-fade-up {
    animation: fadeUp 0.7s ease both;
    /* Self-contained stacking context: transform won't affect scroll width */
    isolation: isolate;
    max-width: 100%;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Hero */
.hero {
    min-height: 100vh;
    display: flex; align-items: center;
    position: relative;
    background: linear-gradient(160deg, var(--brown-deep) 0%, var(--brown-dark) 40%, var(--brown-mid) 100%);
    overflow: hidden;
    padding-top: var(--nav-h);
}
.hero-texture {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(201,160,90,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212,165,116,0.08) 0%, transparent 50%);
    pointer-events: none;
}
.hero-pattern {
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 60px,
        rgba(255,255,255,0.015) 60px,
        rgba(255,255,255,0.015) 61px
    );
    pointer-events: none;
}
.hero-content {
    position: relative; z-index: 2;
    max-width: 1200px; margin: 0 auto;
    padding: 80px 24px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
    /* Prevent grid columns from overflowing */
    width: 100%;
    overflow: hidden;
}
.hero-text {
    /* Clipping context for the fade-up child */
    overflow: hidden;
    min-width: 0; /* allows grid child to shrink */
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(201,160,90,0.15);
    border: 1px solid rgba(201,160,90,0.3);
    border-radius: 30px;
    padding: 8px 20px 8px 12px;
    margin-bottom: 32px;
    font-size: 12px; font-weight: 600;
    color: var(--gold-light); letter-spacing: 0.06em;
}
.hero-badge-icon {
    background: var(--gold); color: var(--brown-deep);
    border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
}
.hero-title { color: white; margin-bottom: 12px; }
.hero-title em { color: var(--gold-light); font-style: italic; }
.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--brown-pale);
    margin-bottom: 24px;
    font-style: italic;
}
.hero-desc {
    color: rgba(245,237,224,0.75);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 44px;
    max-width: 500px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat-item { text-align: left; }
.hero-stat-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem; font-weight: 700;
    color: var(--gold-light); line-height: 1;
    margin-bottom: 4px;
}
.hero-stat-label { font-size: 12px; color: rgba(245,237,224,0.6); font-weight: 500; letter-spacing: 0.06em; }
.hero-stat-divider { width: 1px; background: rgba(255,255,255,0.1); align-self: stretch; }

.hero-visual {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    /* Clip the rotated card stack so it never bleeds right */
    overflow: hidden;
    min-width: 0;
}
.hero-card-stack {
    position: relative;
    width: 380px; height: 460px;
    /* Isolate so rotated children don't affect scroll width */
    isolation: isolate;
}
.hero-card {
    position: absolute;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 28px;
    transition: var(--transition);
}
.hero-card-main {
    bottom: 0; left: 0; right: 0;
    background: rgba(253,248,242,0.95);
    border-color: rgba(201,160,90,0.3);
    z-index: 3;
}
.hero-card-back1 { top: 0; left: 20px; right: 20px; z-index: 2; transform: rotate(-2deg); }
.hero-card-back2 { top: 20px; left: 40px; right: 0; z-index: 1; transform: rotate(3deg); }
.hero-card-uni-logo {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 14px;
}
.hero-card-uni-name { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 600; color: var(--brown-deep); margin-bottom: 4px; }
.hero-card-location { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.hero-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-card-tag {
    padding: 4px 10px; border-radius: 20px;
    background: var(--cream-deep);
    font-size: 11px; color: var(--text-body); font-weight: 500;
}
.hero-card-cta {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 16px; border-top: 1px solid var(--border);
}
.hero-card-rating { font-size: 13px; color: var(--brown-warm); font-weight: 600; }
.hero-card-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: white; border-radius: 8px; font-size: 12px; font-weight: 600;
    text-decoration: none;
}

/* Award Banner */
.award-banner {
    background: var(--cream-deep);
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.award-inner {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-muted);
    font-weight: 500; letter-spacing: 0.04em;
}
.award-trophy { font-size: 20px; }
.award-divider { color: var(--border); }

/* Why Section */
.why-section { background: var(--cream-white); overflow: hidden; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.why-card {
    background: var(--cream-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: var(--transition);
    position: relative; overflow: hidden;
    /* min-width 0 allows grid children to shrink below content size */
    min-width: 0;
}
.why-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brown-light), var(--gold));
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.4s ease;
}
.why-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--border-warm); }
.why-card:hover::before { transform: scaleX(1); }
.why-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--cream-deep), var(--cream-light));
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 20px;
}
.why-title { font-size: 1rem; font-weight: 600; color: var(--brown-deep); margin-bottom: 10px; font-family: 'Jost',sans-serif; }
.why-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ============================================================
   STATS SECTION — FIX
   The 5-column grid at full width overflows on mid-size screens.
   Lock it to max-width: 100% and use min-width: 0 on cells.
   ============================================================ */
.stats-section {
    background: linear-gradient(135deg, var(--brown-deep), var(--brown-dark));
    position: relative;
    overflow: hidden; /* hard clip */
    max-width: 100vw;
}
.stats-section::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(ellipse at 30% 50%, rgba(201,160,90,0.1) 0%, transparent 60%);
    pointer-events: none;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    position: relative;
    /* Prevent the 5 equal columns from ever exceeding 100% */
    width: 100%;
    max-width: 100%;
}
.stat-item {
    text-align: center;
    padding: 50px 24px;
    border-right: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
    /* Critical: allow grid children to shrink */
    min-width: 0;
    overflow: hidden;
}
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: rgba(255,255,255,0.03); }
.stat-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.2rem; font-weight: 700;
    color: var(--gold-light); line-height: 1;
    margin-bottom: 8px;
    /* Don't let large numbers push the cell wider */
    word-break: break-word;
}
.stat-label { font-size: 13px; color: rgba(245,237,224,0.6); font-weight: 500; letter-spacing: 0.06em; line-height: 1.5; }
.stat-sub { font-size: 12px; color: rgba(201,160,90,0.6); margin-top: 4px; }

/* ============================================================
   PROCESS SECTION — FIX
   The ::before connector line uses calc() values that can bleed
   on certain viewport widths. Replace with a safer approach
   and clip the entire section.
   ============================================================ */
.process-section {
    background: var(--cream-deep);
    overflow: hidden; /* hard clip */
}
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
    /* Contain everything including the pseudo-element line */
    width: 100%;
    overflow: hidden;
}
.process-grid::before {
    content: ''; position: absolute;
    top: 48px;
    /* Use percentage-based inset so it never exceeds the container */
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: var(--border-warm);
    /* Prevent this pseudo from contributing to scroll width */
    pointer-events: none;
}
.process-step {
    text-align: center;
    padding: 0 20px;
    position: relative;
    /* Allow step to shrink in grid */
    min-width: 0;
    overflow: hidden;
}
.process-num {
    width: 96px; height: 96px;
    background: white;
    border: 2px solid var(--border-warm);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 28px;
    position: relative; z-index: 1;
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem; font-weight: 700;
    color: var(--brown-warm);
    transition: var(--transition);
    /* Shrink font if needed on small containers */
    flex-shrink: 0;
}
.process-step:hover .process-num {
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: white; border-color: transparent;
    transform: scale(1.08);
}
.process-title { font-size: 1.1rem; font-weight: 600; color: var(--brown-deep); margin-bottom: 10px; font-family: 'Jost',sans-serif; }
.process-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* Hub Section */
.hub-section { background: var(--cream-white); overflow: hidden; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; width: 100%; }
.hub-features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hub-feature {
    background: var(--cream-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: var(--transition);
    min-width: 0;
}
.hub-feature:hover { border-color: var(--border-warm); background: var(--cream-deep); }
.hub-feature-icon { font-size: 22px; margin-bottom: 10px; }
.hub-feature-title { font-size: 13px; font-weight: 600; color: var(--brown-deep); margin-bottom: 4px; }
.hub-feature-desc { font-size: 12px; color: var(--text-muted); }
.hub-visual {
    background: linear-gradient(160deg, var(--brown-deep), var(--brown-mid));
    border-radius: 24px;
    padding: 48px 40px;
    position: relative; overflow: hidden;
    min-width: 0;
}
.hub-visual::before {
    content: ''; position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 30%, rgba(201,160,90,0.15) 0%, transparent 60%);
}
.hub-visual-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem; font-weight: 600;
    color: var(--cream-light); margin-bottom: 32px;
    position: relative;
}
.hub-steps { display: flex; flex-direction: column; gap: 0; position: relative; }
.hub-step {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 16px 0; position: relative;
}
.hub-step:not(:last-child)::after {
    content: ''; position: absolute;
    left: 15px; top: 44px; bottom: 0;
    width: 1px; background: rgba(255,255,255,0.15);
}
.hub-step-dot {
    width: 32px; height: 32px; flex-shrink: 0;
    background: rgba(201,160,90,0.2);
    border: 1px solid rgba(201,160,90,0.4);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.hub-step-text { color: rgba(245,237,224,0.85); font-size: 14px; padding-top: 6px; min-width: 0; }
.hub-step-label { font-weight: 600; color: var(--gold-light); font-size: 13px; margin-bottom: 2px; }

/* Universities preview */
.unis-preview { background: var(--cream-deep); overflow: hidden; }
.unis-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 28px; 
}
@media (max-width: 350px) {
    .unis-grid { grid-template-columns: 1fr; }
}

/* Contact section */
.contact-section {
    background: linear-gradient(160deg, var(--brown-deep), var(--brown-dark));
    position: relative;
    overflow: hidden; /* hard clip */
}
.contact-section::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(201,160,90,0.1) 0%, transparent 60%);
    pointer-events: none;
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    width: 100%;
}
.contact-info h2 { color: white; margin-bottom: 20px; }
.contact-info p { color: rgba(245,237,224,0.7); margin-bottom: 36px; font-size: 16px; }
.contact-points { display: flex; flex-direction: column !important; gap: 20px; }
.contact-point { display: flex; gap: 16px; align-items: flex-start; }
.contact-point-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    background: rgba(201,160,90,0.15);
    border: 1px solid rgba(201,160,90,0.25);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.contact-point-title { font-size: 13px; font-weight: 600; color: var(--gold-light); margin-bottom: 3px; }
.contact-point-text { font-size: 14px; color: rgba(245,237,224,0.65); }
.contact-form {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px;
    min-width: 0;
}
.contact-form h3 { font-family: 'Cormorant Garamond',serif; color: white; font-size: 1.6rem; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: rgba(245,237,224,0.6); text-transform: uppercase; margin-bottom: 8px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: white;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.3); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: rgba(201,160,90,0.5); background: rgba(255,255,255,0.1); }
.form-group select option { background: var(--brown-dark); color: white; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-submit { width: 100%; margin-top: 8px; }

/* ============================================================
   UNIVERSITIES LIST PAGE
   ============================================================ */
.page-hero {
    background: linear-gradient(160deg, var(--brown-deep), var(--brown-dark));
    padding: calc(var(--nav-h) + 60px) 0 80px;
    position: relative; overflow: hidden;
}
.page-hero::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 60px;
    background: var(--cream-white);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.page-hero-content { text-align: center; position: relative; z-index: 1; }
.page-hero h1 { color: white; margin-bottom: 16px; }
.page-hero p { color: rgba(245,237,224,0.7); font-size: 17px; max-width: 560px; margin: 0 auto; }

/* Filters */
.filters-bar {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 40px;
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.filter-search { flex: 1; min-width: 200px; position: relative; }
.filter-search input {
    width: 100%;
    background: var(--cream-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 16px 11px 42px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    color: var(--text-body);
    outline: none;
    transition: var(--transition);
}
.filter-search input:focus { border-color: var(--brown-light); }
.filter-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; }
.filter-select {
    background: var(--cream-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    color: var(--text-body);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}
.filter-select:focus { border-color: var(--brown-light); }
.filter-btn {
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Jost', sans-serif;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover { filter: brightness(1.1); }

/* University Cards */
.uni-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.uni-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--border-warm); }
.uni-card-image {
    height: 200px;
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--cream-deep), var(--cream-light));
}
.uni-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.uni-card:hover .uni-card-image img { transform: scale(1.05); }
.uni-card-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 60px; opacity: 0.3;
}
.uni-card-type {
    position: absolute; top: 12px; right: 12px;
}
.uni-card-logo-overlay {
    position: absolute; bottom: -22px; left: 20px;
    width: 52px; height: 52px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}
.uni-card-logo-overlay img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.uni-card-body { padding: 32px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.uni-card-name { font-family: 'Cormorant Garamond',serif; font-size: 1.25rem; font-weight: 600; color: var(--brown-deep); margin-bottom: 4px; }
.uni-card-location { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.uni-card-stats { display: flex; gap: 16px; margin-bottom: 16px; }
.uni-card-stat { text-align: center; }
.uni-card-stat-num { font-family: 'Cormorant Garamond',serif; font-size: 1.2rem; font-weight: 600; color: var(--brown-warm); }
.uni-card-stat-label { font-size: 11px; color: var(--text-muted); }
.uni-card-stars { color: var(--gold); font-size: 14px; margin-bottom: 16px; }
.uni-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border); margin-top: auto; }
.uni-card-ranking { font-size: 13px; color: var(--text-muted); }
.uni-card-ranking strong { color: var(--brown-warm); font-family: 'Cormorant Garamond',serif; font-size: 1.1rem; }
.uni-card-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: white;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.uni-card-link:hover { box-shadow: 0 4px 14px rgba(61,35,20,0.3); }

/* ============================================================
   UNIVERSITY DETAIL PAGE
   ============================================================ */
.uni-hero {
    background: linear-gradient(160deg, var(--brown-deep), var(--brown-dark));
    padding: calc(var(--nav-h) + 40px) 0 0;
    position: relative;
    overflow: hidden;
}
.uni-hero-content { position: relative; z-index: 1; padding-bottom: 0; }
.uni-hero-top { display: flex; gap: 32px; align-items: flex-start; margin-bottom: 40px; }
.uni-logo-big {
    width: 96px; height: 96px; flex-shrink: 0;
    background: white; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(255,255,255,0.2);
    overflow: hidden;
}
.uni-logo-big img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.uni-hero-info { flex: 1; min-width: 0; }
.uni-hero-name { color: white; margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 3rem); }
.uni-hero-heading { color: var(--gold-light); font-style: italic; font-family: 'Cormorant Garamond',serif; font-size: 1.1rem; margin-bottom: 16px; }
.uni-hero-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.uni-meta-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: rgba(245,237,224,0.7); }
.uni-hero-img-bar {
    height: 280px; position: relative; overflow: hidden;
    border-radius: 16px 16px 0 0; margin-top: 32px;
}
.uni-hero-img-bar img { width: 100%; height: 100%; object-fit: cover; }
.uni-hero-img-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--brown-mid), var(--brown-warm));
    display: flex; align-items: center; justify-content: center;
    font-size: 80px; opacity: 0.4;
}

/* Stats ribbon */
.uni-stats-ribbon {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: -30px; position: relative; z-index: 2;
    width: 100%;
}
.uni-stat-cell {
    padding: 24px 16px; text-align: center;
    border-right: 1px solid var(--border);
    transition: var(--transition);
    min-width: 0;
}
.uni-stat-cell:last-child { border-right: none; }
.uni-stat-cell:hover { background: var(--cream-light); }
.uni-stat-cell-num { font-family: 'Cormorant Garamond',serif; font-size: 1.8rem; font-weight: 700; color: var(--brown-warm); word-break: break-word; }
.uni-stat-cell-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* Uni Detail Content */
.uni-detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: flex-start; }
.uni-section-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; overflow: hidden; }
.uni-section-title {
    font-family: 'Cormorant Garamond',serif;
    font-size: 1.5rem; color: var(--brown-deep);
    margin-bottom: 20px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.uni-overview-text { color: var(--text-body); line-height: 1.9; font-size: 15px; }
.uni-sidebar-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    margin-bottom: 20px; position: sticky; top: 100px;
}
.uni-sidebar-apply {
    background: linear-gradient(160deg, var(--brown-dark), var(--brown-warm));
    padding: 28px; text-align: center;
}
.uni-sidebar-apply h3 { color: white; font-family: 'Cormorant Garamond',serif; font-size: 1.4rem; margin-bottom: 8px; }
.uni-sidebar-apply p { color: rgba(245,237,224,0.75); font-size: 14px; margin-bottom: 20px; }
.uni-sidebar-apply .btn { width: 100%; justify-content: center; }
.uni-sidebar-info { padding: 20px; }
.uni-info-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.uni-info-item:last-child { border-bottom: none; }
.uni-info-label { color: var(--text-muted); }
.uni-info-value { color: var(--text-dark); font-weight: 500; text-align: center; }
.uni-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.uni-gallery-item { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; }
.uni-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.uni-gallery-item:hover img { transform: scale(1.08); }
.uni-stars { color: var(--gold); font-size: 18px; }
.stars-empty { color: var(--border); }

/* Courses mini-list */
.course-mini-card {
    display: flex; gap: 16px; align-items: flex-start;
    padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 12px; transition: var(--transition);
    text-decoration: none;
    background: var(--cream-light);
}
.course-mini-card:hover { border-color: var(--border-warm); background: var(--cream-deep); }
.course-mini-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    background: var(--cream-deep);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.course-mini-title { font-size: 14px; font-weight: 600; color: var(--brown-deep); margin-bottom: 4px; }
.course-mini-meta { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   COURSES PAGE
   ============================================================ */
.courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.course-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
    min-width: 0;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-warm); }
.course-card-image { height: 160px; overflow: hidden; background: var(--cream-deep); }
.course-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.course-card:hover .course-card-image img { transform: scale(1.06); }
.course-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; opacity: 0.3; }
.course-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.course-card-level { margin-bottom: 12px; }
.course-card-title { font-family: 'Cormorant Garamond',serif; font-size: 1.2rem; color: var(--brown-deep); margin-bottom: 8px; }
.course-card-uni { font-size: 13px; color: var(--brown-light); font-weight: 500; margin-bottom: 12px; }
.course-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; flex: 1; }
.course-card-footer { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.course-card-fee { font-family: 'Cormorant Garamond',serif; font-size: 1.2rem; font-weight: 600; color: var(--brown-warm); }
.course-card-duration { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   NEWS PAGE
   ============================================================ */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.news-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
    min-width: 0;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.news-card-image { height: 200px; overflow: hidden; background: var(--cream-deep); }
.news-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.news-card:hover .news-card-image img { transform: scale(1.06); }
.news-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 60px; opacity: 0.3; }
.news-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.news-card-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.news-card-cat { font-size: 11px; font-weight: 600; color: var(--brown-light); letter-spacing: 0.08em; text-transform: uppercase; }
.news-card-date { font-size: 12px; color: var(--text-muted); }
.news-card-title { font-family: 'Cormorant Garamond',serif; font-size: 1.2rem; color: var(--brown-deep); margin-bottom: 10px; line-height: 1.4; }
.news-card-summary { font-size: 13px; color: var(--text-muted); line-height: 1.7; flex: 1; margin-bottom: 16px; }
.news-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border); margin-top: auto; }
.news-card-author { font-size: 12px; color: var(--text-muted); }
.news-read-link {
    font-size: 13px; font-weight: 600; color: var(--brown-warm);
    text-decoration: none; display: flex; align-items: center; gap: 4px;
}
.news-read-link:hover { color: var(--brown-dark); }

/* ============================================================
   FOOTER — FIX
   The 4-column grid (2fr 1fr 1fr 1.5fr) can cause the last
   column to bleed on mid-range viewports. Lock every column
   with min-width: 0 and clip the footer element.
   ============================================================ */
.footer {
    background: var(--brown-deep);
    overflow: hidden; /* hard clip */
    max-width: 100vw;
}
.footer-top { padding: 80px 0 60px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
    width: 100%;
    /* Ensures each column can shrink */
    min-width: 0;
}
/* Every direct child of footer-grid must be allowed to shrink */
.footer-grid > * {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.footer-logo .logo-mark { background: linear-gradient(135deg, var(--brown-mid), var(--brown-light)); }
.footer-logo .logo-name { color: var(--cream-light); }
.footer-logo .logo-sub { color: rgba(245,237,224,0.4); }
.footer-desc { font-size: 14px; color: rgba(245,237,224,0.55); line-height: 1.8; margin-bottom: 28px; }
.footer-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.social-link {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(245,237,224,0.5);
    text-decoration: none; font-size: 12px; font-weight: 700;
    transition: var(--transition);
    flex-shrink: 0;
}
.social-link:hover { background: var(--brown-warm); border-color: var(--brown-warm); color: white; }
.footer-heading { font-family: 'Cormorant Garamond',serif; font-size: 1.1rem; color: var(--cream-light); margin-bottom: 20px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links li a, .footer-links li { font-size: 14px; color: rgba(245,237,224,0.5); text-decoration: none; transition: var(--transition); }
.footer-links li a:hover { color: var(--gold-light); padding-left: 4px; }
.footer-contact li { display: flex; align-items: flex-start; gap: 8px; }
.btn-footer-cta {
    display: inline-block; margin-top: 20px;
    padding: 10px 20px;
    background: rgba(201,160,90,0.15);
    border: 1px solid rgba(201,160,90,0.3);
    border-radius: var(--radius-sm);
    color: var(--gold-light);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.btn-footer-cta:hover { background: var(--gold); color: var(--brown-deep); }
.footer-bottom {
    padding: 24px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
    overflow: hidden;
}
.footer-bottom p { font-size: 13px; color: rgba(245,237,224,0.35); text-align: center; }
.footer-bottom .container { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-family: 'Cormorant Garamond',serif; font-size: 1.5rem; color: var(--brown-deep); margin-bottom: 8px; }
.result-count { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; flex-wrap: wrap; padding: 0 10px; }
.page-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-body); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--brown-warm); border-color: var(--brown-warm); color: white; }

/* ====== ENGLISH PROVIDERS SECTION — index.php ====== */
.english-preview { background: var(--cream-white); overflow: hidden; }
.ep-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 28px; 
}
@media (max-width: 350px) {
    .ep-grid { grid-template-columns: 1fr; }
}
.ep-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
    min-width: 0;
}
.ep-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--border-warm); }
.ep-card-image {
    height: 200px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--cream-deep), var(--cream-light));
}
.ep-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.ep-card:hover .ep-card-image img { transform: scale(1.05); }
.ep-card-image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 60px; opacity: 0.3; }
.ep-featured-badge {
    position: absolute; top: 12px; right: 12px;
    background: rgba(201,160,90,0.15); color: #8a6020;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 4px 14px; border-radius: 20px; z-index: 3;
    border: 1px solid rgba(201,160,90,0.3);
}
.ep-logo-overlay {
    position: absolute; bottom: -22px; left: 20px;
    width: 52px; height: 52px; background: white;
    border: 2px solid var(--border); border-radius: 12px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: var(--shadow-sm); z-index: 4;
}
.ep-logo-overlay img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ep-card-body { padding: 32px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.ep-card-name { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 600; color: var(--brown-deep); margin-bottom: 4px; }
.ep-card-tagline { font-family: 'Cormorant Garamond', serif; font-size: 0.95rem; font-style: italic; color: var(--text-muted); margin-bottom: 4px; line-height: 1.5; }
.ep-card-location { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.ep-card-stars { color: var(--gold); font-size: 14px; margin-bottom: 12px; }
.ep-courses { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ep-course-tag { padding: 4px 10px; background: var(--cream-deep); color: var(--text-body); border-radius: 20px; font-size: 11px; font-weight: 500; border: 1px solid var(--border); }
.ep-card-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ep-stat { text-align: center; flex: 1; min-width: 60px; }
.ep-stat-num { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 600; color: var(--brown-warm); }
.ep-stat-label { font-size: 11px; color: var(--text-muted); }
.ep-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border); margin-top: auto; }
.rich-text ul, .rich-text ol { padding-left: 24px; margin: 8px 0 16px; }
.rich-text li { margin-bottom: 6px; line-height: 1.6; }
.rich-text p { margin-bottom: 10px; line-height: 1.7; }
.rich-text strong { font-weight: 600; }
.rich-text h3, .rich-text h4 { font-family: 'Cormorant Garamond', serif; color: var(--brown-deep); margin: 16px 0 8px; }
.ep-card-fee { font-size: 13px; color: var(--text-muted); }
.ep-card-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--brown-dark), var(--brown-warm));
    color: white; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: var(--transition);
}
.ep-card-link:hover { box-shadow: 0 4px 14px rgba(61,35,20,0.3); }

/* ============================================================
   RTL (Arabic) SUPPORT
   ============================================================ */
html[dir="rtl"],
body.lang-ar {
    overflow-x: hidden;
}

body.lang-ar .hero-texture,
body.lang-ar .hero-pattern {
    left: 0; right: 0; overflow: hidden;
}

body.lang-ar .hero-content,
body.lang-ar .contact-grid,
body.lang-ar .hub-grid,
body.lang-ar .why-grid,
body.lang-ar .unis-grid,
body.lang-ar .courses-grid,
body.lang-ar .news-grid,
body.lang-ar .stats-grid,
body.lang-ar .process-grid,
body.lang-ar .hub-features,
body.lang-ar .footer-grid,
body.lang-ar .uni-detail-grid,
body.lang-ar .form-row {
    direction: rtl;
}

body.lang-ar .container,
body.lang-ar .nav-container,
body.lang-ar section {
    max-width: 100%;
    overflow-x: hidden;
}

body.lang-ar .hero-actions,
body.lang-ar .hero-stats,
body.lang-ar .contact-points {
    width: 100%;
    max-width: 100%;
}

body.lang-ar #toast { right: auto; left: 30px; }

/* ============================================================
   RTL CONTENT TEXT ALIGNMENT
   Body text, descriptions, specs: right-aligned for Arabic
   ============================================================ */

/* Cards: logo overlay moves to right side in RTL */
body.lang-ar .uni-card-logo-overlay { left: auto; right: 20px; }
body.lang-ar .uni-card-footer { flex-direction: row-reverse; }
body.lang-ar .uni-card-stat  { text-align: right; }

/* Course cards RTL */
body.lang-ar .course-card-body,
body.lang-ar .news-card-body,
body.lang-ar .ep-card-body    { text-align: right; direction: rtl; }

/* Stats ribbon */
body.lang-ar .uni-stat-cell-label { text-align: center; }

/* University detail — overview text */
body.lang-ar .uni-overview-text,
body.lang-ar .rich-text { text-align: right; direction: rtl; }

/* University section titles flip to right */
body.lang-ar .uni-section-title {
    flex-direction: row-reverse;
    text-align: right;
}

/* Info items: label on right, value on left (RTL order) */
body.lang-ar .uni-info-item { direction: rtl; text-align: right; }
body.lang-ar .uni-info-label { text-align: right; }
body.lang-ar .uni-info-value { text-align: left; }

/* Course mini-cards inside university page */
body.lang-ar .course-mini-card { flex-direction: row-reverse; direction: rtl; }
body.lang-ar .course-mini-title,
body.lang-ar .course-mini-meta  { text-align: right; }

/* Provider & course detail pages */
body.lang-ar .ep-section,
body.lang-ar .ep-section p,
body.lang-ar .ep-section li,
body.lang-ar .ep-overview       { text-align: right; direction: rtl; }

/* News article body */
body.lang-ar .article-body,
body.lang-ar .article-body p,
body.lang-ar .article-body li,
body.lang-ar .article-body h2,
body.lang-ar .article-body h3   { text-align: right; direction: rtl; }

/* General: any paragraph/list inside a content card */
body.lang-ar .uni-section-card p,
body.lang-ar .uni-section-card li,
body.lang-ar .uni-section-card ul { text-align: right; direction: rtl; }

/* Course requirements / description */
body.lang-ar .course-detail-desc,
body.lang-ar .course-requirements { text-align: right; direction: rtl; }

/* Breadcrumb already handled in breadcrumb section */

/* ============================================================
   TABLET — 1024px and below
   ============================================================ */
@media (max-width: 1024px) {
    .hero-content    { grid-template-columns: 1fr; gap: 40px; }
    .hero-visual     { display: none; }
    .why-grid        { grid-template-columns: repeat(2, 1fr); }
    /* Stats: collapse 5 cols to 3 so they never overflow */
    .stats-grid      { grid-template-columns: repeat(3, 1fr); }
    .unis-grid,
    .courses-grid,
    .news-grid,
    .ep-grid       { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .uni-detail-grid { grid-template-columns: 1fr; }
    .uni-sidebar-card { position: static; }
    /* Footer: 2 col at tablet */
    .footer-grid     { grid-template-columns: 1fr 1fr; }
    .contact-grid    { grid-template-columns: 1fr; }
    .hub-grid        { grid-template-columns: 1fr; }
    .process-grid    { grid-template-columns: repeat(2, 1fr); gap: 40px; }
    .process-grid::before { display: none; }
    .ep-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   MOBILE — 768px and below
   ============================================================ */
@media (max-width: 768px) {

    /* --- Typography --- */
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .section { padding: 64px 0; }

    /* --- Navbar --- */
    .navbar { height: auto; min-height: var(--nav-h); overflow: hidden; }
    .nav-container {
        flex-wrap: wrap; padding: 0 16px;
        min-height: var(--nav-h); gap: 0;
        align-items: center; justify-content: space-between;
    }
    .nav-logo  { flex-shrink: 0; }
    .nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    #lang-toggle-btn { padding: 6px 12px; font-size: 12px; gap: 5px; }
    #lang-toggle-btn .lang-flag { font-size: 14px; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none; flex-direction: column;
        width: 100%; order: 3;
        background: var(--cream-white);
        border-top: 1px solid var(--border);
        padding: 12px 0 20px; gap: 2px;
    }
    .nav-links.open { display: flex; }
    .nav-link {
        padding: 12px 20px; font-size: 15px;
        border-radius: 0; border-bottom: 1px solid var(--border); width: 100%;
    }
    .nav-link:last-child { border-bottom: none; }
    .nav-link.active::after { display: none; }
    .nav-link.active {
        background: var(--cream-deep); color: var(--brown-warm);
        border-left: 3px solid var(--brown-warm); padding-left: 17px;
    }
    body.lang-ar .nav-link.active {
        border-left: none; border-right: 3px solid var(--brown-warm);
        padding-left: 20px; padding-right: 17px;
    }

    /* --- Hero --- */
    .hero-content { padding: 60px 16px; }
    .hero-desc    { font-size: 15px; }
    .hero-actions { flex-direction: column; gap: 12px; }
    .hero-actions .btn { width: 100%; justify-content: center; text-align: center; }
    .hero-stats   { gap: 20px; justify-content: flex-start; flex-wrap: wrap; }

    /* --- Sections --- */
    .section-header { margin-bottom: 40px; }
    .section-desc   { font-size: 15px; }

    /* --- Why grid --- */
    .why-grid    { grid-template-columns: 1fr; gap: 16px; }
    .why-card    { padding: 24px 20px; }

    /* --- Stats: 2 col on mobile, 1 col on small --- */
    .stats-grid  { grid-template-columns: 1fr 1fr; }
    .stat-item   { padding: 36px 12px; }
    .stat-num    { font-size: 2.4rem; }

    /* --- Process --- */
    .process-grid { grid-template-columns: 1fr; gap: 32px; }
    .process-grid::before { display: none; }
    .process-step { text-align: left; padding: 0; display: flex; gap: 20px; align-items: flex-start; overflow: hidden; }
    .process-num  { width: 64px; height: 64px; flex-shrink: 0; font-size: 1.5rem; margin: 0; }
    body.lang-ar .process-step { text-align: center; flex-direction: row-reverse; }

    /* --- Hub --- */
    .hub-features { grid-template-columns: 1fr 1fr; gap: 10px; }
    .hub-feature  { padding: 14px; }
    .hub-visual   { padding: 32px 24px; }

    /* --- Cards --- */
    .unis-grid, .courses-grid, .news-grid, .ep-grid { grid-template-columns: 1fr; gap: 20px; }
    .uni-stats-ribbon { grid-template-columns: repeat(2, 1fr); }
    .uni-stat-cell    { padding: 18px 10px; }
    .uni-hero-top     { flex-direction: column; gap: 16px; }
    .uni-logo-big     { width: 72px; height: 72px; font-size: 32px; }
    .uni-gallery-grid { grid-template-columns: 1fr 1fr; }
    
    .ep-card-stats { gap: 8px; }
    .ep-stat-num { font-size: 1rem; }

    /* --- Contact --- */
    .contact-form { padding: 28px 20px; }
    .form-row     { grid-template-columns: 1fr; }
    .contact-grid { gap: 40px; }

    /* --- Footer: single column on mobile --- */
    .footer-grid { grid-template-columns: 1fr; gap: 36px; }
    .footer-top  { padding: 56px 0 40px; }
    .footer-bottom .container { text-align: center; }

    /* --- Misc --- */
    .container { padding: 0 16px; }
    .btn-lg    { padding: 15px 28px; font-size: 14px; }
    .filters-bar { flex-direction: column; gap: 10px; }
    .filter-search, .filter-select { width: 100%; }

    /* RTL mobile */
    body.lang-ar .nav-container { flex-direction: row-reverse; width: 100%; padding: 0 16px; }
    /* CRITICAL: restore column direction — the global row-reverse breaks the dropdown */
    body.lang-ar .nav-links { flex-direction: column !important; }
    body.lang-ar .nav-links.open { flex-direction: column !important; }
    body.lang-ar .nav-link { text-align: right; padding-right: 20px; }
    /* Keep nav-actions in natural order on mobile (☰ first in visual flow) */
    body.lang-ar .nav-actions { flex-direction: row; }
    body.lang-ar .nav-link.active { border-left: none; border-right: 3px solid var(--brown-warm); padding-right: 17px; padding-left: 20px; }
    body.lang-ar .hero-text { text-align: center; width: 100%; }
    body.lang-ar .hero-actions { justify-content: flex-start; align-items: flex-end; }
    body.lang-ar .hero-stats { justify-content: flex-start; }
    body.lang-ar .process-step { flex-direction: row-reverse; text-align: center; }
    body.lang-ar .hub-feature { text-align: center; }
    body.lang-ar .contact-form { direction: rtl; }
    body.lang-ar .footer-grid { direction: rtl; text-align: center; }
    body.lang-ar .footer-links li a { padding-left: 0; padding-right: 0; }
    body.lang-ar .footer-links li a:hover { padding-left: 0; padding-right: 4px; }
    body.lang-ar #toast { right: auto; left: 16px; bottom: 16px; }
    body.lang-ar .form-row { direction: rtl; }
    body.lang-ar .hub-features { direction: rtl; }
    /* RTL: disable fade-up transform to prevent any momentary bleed */
    body.lang-ar .animate-fade-up { animation: none; opacity: 1; }
}

/* ============================================================
   SMALL MOBILE — 480px and below
   ============================================================ */
@media (max-width: 480px) {
    h1 { font-size: 1.9rem; }
    /* Stats fully stacked */
    .stats-grid   { grid-template-columns: 1fr; }
    .hub-features { grid-template-columns: 1fr; }
    .hero-stat-num { font-size: 1.8rem; }
    .uni-stats-ribbon { grid-template-columns: 1fr 1fr; }
    .hero-stats { gap: 16px; }
    .why-grid   { grid-template-columns: 1fr; }

    body.lang-ar .hero-stats { flex-wrap: wrap; gap: 12px; }
    body.lang-ar .stat-item { text-align: center; }
}

/* ============================================================
   BREADCRUMB NAV
   ============================================================ */
.breadcrumb-nav {
    background: #f5f0ea;
    border-bottom: 1px solid rgba(61,43,31,0.08);
    padding: 10px 0;
}
.breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    color: #8b7060;
}
.breadcrumb-list li a {
    color: #8b7060;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-list li a:hover { color: #c9922a; }
.breadcrumb-list li[aria-current="page"] span,
.breadcrumb-list li span[aria-current="page"] {
    color: #3d2b1f;
    font-weight: 500;
}
.breadcrumb-sep {
    color: #c4b0a0;
    font-size: 14px;
    line-height: 1;
    user-select: none;
}
body.lang-ar .breadcrumb-list { direction: rtl; }
body.lang-ar .breadcrumb-sep { transform: scaleX(-1); display: inline-block; }

/* ============================================================
   SCROLLBAR STYLING — subtle, non-intrusive
   ============================================================ */
/* Modern browsers (Firefox) */
* { scrollbar-width: thin; scrollbar-color: rgba(139,94,60,0.25) transparent; }

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(139,94,60,0.22);
    border-radius: 10px;
    transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139,94,60,0.50); }