/* =========================================================================
   IKU International Office - Global styles
   Design tokens, reset, typography, layout, navbar, footer, buttons.
   ========================================================================= */

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

:root {
    /* Brand palette */
    --red: #e30613;
    --red-600: #c1050f;
    --red-300: #ff4d57;
    /* Accent tuned for readable red text on light backgrounds */
    --accent: #c1050f;

    /* Light theme surfaces */
    --bg: #f5f7fb;
    --bg-2: #eceff5;
    --surface: #ffffff;
    --surface-2: #eef1f7;
    --border: rgba(18, 24, 38, 0.10);
    --border-strong: rgba(18, 24, 38, 0.16);

    /* Text */
    --text: #121722;
    --text-muted: #566074;
    --text-dim: #8b93a3;

    /* Dark surfaces (footer, logo pill) reused on the light theme */
    --dark-surface: #0e1420;

    /* Effects */
    --glass: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(18, 24, 38, 0.12);
    --shadow-lg: 0 30px 70px -25px rgba(24, 34, 60, 0.28);
    --shadow-md: 0 14px 40px -16px rgba(24, 34, 60, 0.16);

    /* Metrics */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 26px;
    --container: 1200px;
    --header-h: 76px;

    --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-head: 'Sora', var(--font-body);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img,
video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; padding: 0; }

button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.1; font-weight: 700; }

:focus-visible {
    outline: 2px solid var(--red-300);
    outline-offset: 3px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 200;
    background: var(--red);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
}
.skip-link:focus { left: 12px; }

/* ---------- Layout helpers ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

.section { padding: clamp(56px, 8vw, 120px) 0; }

.section__head {
    max-width: 680px;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}
.eyebrow::before {
    content: '';
    width: 26px;
    height: 2px;
    background: var(--red);
}

.section__title {
    font-size: clamp(1.9rem, 4vw, 3rem);
    letter-spacing: -0.02em;
}

.section__lead {
    color: var(--text-muted);
    font-size: 1.08rem;
    margin-top: 16px;
}

.text-gradient {
    background: linear-gradient(100deg, var(--text) 0%, var(--red) 55%, var(--red-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--text);
    font-weight: 600;
    font-size: 0.98rem;
    transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { padding: 10px 20px; font-size: 0.9rem; }
.btn--lg { padding: 17px 34px; font-size: 1.05rem; }
.btn--block { width: 100%; }

.btn--primary {
    --btn-bg: linear-gradient(135deg, var(--red) 0%, var(--red-600) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 30px -10px rgba(227, 6, 19, 0.6);
}
.btn--primary:hover { box-shadow: 0 18px 42px -10px rgba(227, 6, 19, 0.75); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(18, 24, 38, 0.05); border-color: var(--border-strong); }

/* ---------- Header / Navbar ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid rgba(18, 24, 38, 0.08);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.site-header.is-scrolled {
    background: #fff;
    box-shadow: 0 10px 30px -24px rgba(15, 23, 42, 0.45);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 46px; width: auto; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-shell {
    display: flex;
    align-items: center;
    gap: 14px;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.nav-menu__link {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-menu__link:hover {
    color: var(--text);
    background: rgba(18, 24, 38, 0.05);
}
.nav-menu__link.is-active {
    color: #c53a42;
    background: rgba(227, 6, 19, 0.1);
    box-shadow: none;
}
.nav-menu__link.is-active::after { display: none; }

.nav-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-tools__cta {
    --btn-bg: linear-gradient(135deg, #ef4a54 0%, #e30613 100%);
    box-shadow: 0 8px 20px -12px rgba(227, 6, 19, 0.55);
}

.lang-switch { position: relative; }
.lang-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lang-switch__btn:hover,
.lang-switch__btn[aria-expanded="true"] {
    border-color: rgba(227, 6, 19, 0.35);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}
.lang-switch__btn svg { width: 14px; height: 14px; color: var(--text-muted); }
.lang-switch__code {
    color: #c53a42;
}
.lang-switch__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 120;
}
.lang-switch__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}
.lang-switch__option:hover { background: rgba(18, 24, 38, 0.05); }
.lang-switch__option.is-active {
    background: rgba(227, 6, 19, 0.08);
    color: var(--red-600);
    font-weight: 700;
}
.lang-switch__option-code {
    width: 28px;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.nav-toggle__bar {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-main { min-height: 60vh; }

/* ---------- Footer (light) ---------- */
.site-footer {
    background: var(--bg-2);
    color: var(--text);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    padding-block: clamp(48px, 6vw, 72px);
}
.site-footer__logo { height: 52px; width: auto; margin-bottom: 20px; }
.site-footer__tagline { color: var(--text-muted); max-width: 340px; font-size: 0.96rem; }
.site-footer__official {
    display: inline-block;
    margin-top: 22px;
    max-width: min(100%, 240px);
}
.site-footer__official img {
    display: block;
    width: 100%;
    height: auto;
}
.site-footer__official:hover {
    opacity: 0.88;
}
.site-footer__title {
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 18px;
}
.site-footer__links li,
.site-footer__social li { margin-bottom: 12px; }
.site-footer__links a,
.site-footer__social a,
.site-footer__links span {
    color: var(--text-muted);
    transition: color 0.2s ease;
    font-size: 0.96rem;
}
.site-footer__links a:hover,
.site-footer__social a:hover { color: var(--accent); }

.site-footer__bottom { border-top: 1px solid var(--border); }
.site-footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-block: 22px;
    color: var(--text-dim);
    font-size: 0.86rem;
    flex-wrap: wrap;
}

/* ---------- Shared page components (used across modules) ---------- */
.page-hero {
    padding-top: calc(var(--header-h) + 70px);
    padding-bottom: 40px;
    background:
        radial-gradient(90% 120% at 80% -10%, rgba(227, 6, 19, 0.18), transparent 55%),
        var(--bg);
    border-bottom: 1px solid var(--border);
}
.page-hero--compact { padding-bottom: 30px; }
.page-hero__inner { max-width: 720px; }
.page-hero__title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    letter-spacing: -0.02em;
    margin: 12px 0 16px;
}
.page-hero__lead { color: var(--text-muted); font-size: 1.08rem; }
.page-hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

.cta-band__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.12), rgba(227, 6, 19, 0.03));
    border: 1px solid rgba(227, 6, 19, 0.20);
    border-radius: var(--radius-lg);
    padding: clamp(32px, 5vw, 56px);
}
.cta-band__title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.cta-band__text { color: var(--text-muted); margin-top: 10px; }

@media (max-width: 640px) {
    .cta-band__inner { flex-direction: column; align-items: flex-start; }
    .cta-band__inner .btn { width: 100%; }
}

/* ---------- Reveal-on-scroll animation ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

/* Keep the full nav on one line between the tablet and desktop breakpoints. */
@media (min-width: 981px) and (max-width: 1280px) {
    .nav-menu__link { padding: 8px 8px; font-size: 0.82rem; }
    .site-header__inner { gap: 10px; }
    .nav-tools { gap: 8px; }
    .brand__logo { height: 42px; }
}

@media (max-width: 980px) {
    .nav-toggle { display: flex; }
    .nav-shell {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 18px 24px 26px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        transform: translateY(-140%);
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }
    .nav-shell.is-open { transform: translateY(0); }
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        border-radius: 0;
        padding: 0;
        gap: 2px;
        background: transparent;
        border: 0;
    }
    .nav-menu__link { padding: 13px 16px; font-size: 1.02rem; justify-content: flex-start; }
    .nav-tools {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-tools__cta { width: 100%; }
    .lang-switch__btn { width: 100%; justify-content: center; }
    .lang-switch__menu {
        position: static;
        margin-top: 8px;
        box-shadow: none;
    }
}

@media (max-width: 560px) {
    .container { padding-inline: 18px; }
    .site-footer__grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto; }
    [data-reveal] { opacity: 1; transform: none; }
}

/* RTL (Arabic, Persian) */
html[dir="rtl"] body.is-rtl {
    direction: rtl;
    text-align: start;
    font-family: 'Vazirmatn', 'Noto Sans Arabic', var(--font-body);
}
html[dir="rtl"] body.is-rtl .page-hero__title,
html[dir="rtl"] body.is-rtl .section__title,
html[dir="rtl"] body.is-rtl .hero__title,
html[dir="rtl"] body.is-rtl h1,
html[dir="rtl"] body.is-rtl h2,
html[dir="rtl"] body.is-rtl h3 {
    font-family: 'Vazirmatn', 'Noto Sans Arabic', var(--font-head);
}
/* Neutral punctuation (., ،) stays with the Arabic sentence */
html[dir="rtl"] body.is-rtl p,
html[dir="rtl"] body.is-rtl li,
html[dir="rtl"] body.is-rtl td,
html[dir="rtl"] body.is-rtl .page-hero__lead,
html[dir="rtl"] body.is-rtl .hero__lead,
html[dir="rtl"] body.is-rtl .section__lead,
html[dir="rtl"] body.is-rtl .card__text,
html[dir="rtl"] body.is-rtl .accordion__body {
    unicode-bidi: plaintext;
}
html[dir="rtl"] .site-header__inner,
html[dir="rtl"] .nav-menu,
html[dir="rtl"] .nav-tools,
html[dir="rtl"] .infobar__item,
html[dir="rtl"] .coop-stats__item,
html[dir="rtl"] .guide-sim,
html[dir="rtl"] .admission-grid,
html[dir="rtl"] .admission-contact,
html[dir="rtl"] .feature-band__grid,
html[dir="rtl"] .contact-grid,
html[dir="rtl"] .apply-page__grid {
    direction: rtl;
}
html[dir="rtl"] .nav-menu__link,
html[dir="rtl"] .guide-steps__btn,
html[dir="rtl"] .admission-docs__item,
html[dir="rtl"] .admin-table th,
html[dir="rtl"] .admin-table td {
    text-align: right;
}
html[dir="rtl"] .guide-device__zoom-hint,
html[dir="rtl"] .photo-gallery__zoom,
html[dir="rtl"] .coop-stats__item {
    flex-direction: row-reverse;
}
html[dir="rtl"] .home-lightbox__nav--prev { left: auto; right: -8px; transform: translateY(-50%) scaleX(-1); }
html[dir="rtl"] .home-lightbox__nav--next { right: auto; left: -8px; transform: translateY(-50%) scaleX(-1); }
html[dir="rtl"] .guide-lightbox__close,
html[dir="rtl"] .home-lightbox__close { right: auto; left: -10px; }
