:root {
    --navy: #182B3A;
    --navy-dark: #101f2b;
    --eu-blue: #003399;
    --gold: #c49f2e;
    --gold-dark: #a48424;
    --text: #334155;
    --muted: #576671;
    --bg: #f7f4ee;
    --white: #ffffff;
    --line: #e4ddd0;
    --header-h: 84px;
    --radius: 14px;
    --shadow: 0 12px 32px rgba(24, 43, 58, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body.site-body {
    margin: 0;
    padding: 0;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

img,
svg,
video,
iframe {
    max-width: 100%;
    height: auto;
}

.site-main {
    min-height: 50vh;
}

.site-body h1,
.site-body h2,
.site-body h3,
.site-body h4,
.site-body h5,
.site-body h6 {
    color: var(--navy);
    font-weight: 700;
    line-height: 1.35;
}

.site-body a {
    color: var(--navy);
    text-decoration: none;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.site-body a:hover,
.site-body a:focus {
    color: var(--gold-dark);
}

.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;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 2px 12px rgba(24, 43, 58, 0.08);
}

.site-header__bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 78px;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.site-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.lang-en .site-menu > li > a,
.lang-ar .site-menu > li > a {
    padding: 8px 10px;
    font-size: 14.5px;
}

.site-logo img {
    height: 52px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--navy);
    position: absolute;
    left: 12px;
    transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle__bars {
    top: 21px;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: "";
}

.nav-toggle__bars::before {
    top: -6px;
}

.nav-toggle__bars::after {
    top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
    transform: translateY(-6px) rotate(-45deg);
}

.site-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-menu > li {
    position: relative;
}

.site-menu > li > a {
    display: block;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--navy);
    border-radius: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    line-height: 1.3;
}

.site-menu > li > a:hover,
.site-menu > li > a:focus {
    background: transparent;
    color: var(--navy);
    border-bottom-color: var(--gold);
}

.sub-toggle {
    display: none;
}

.has-sub .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    z-index: 20;
}

[dir="rtl"] .has-sub .sub-menu {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.has-sub:hover > .sub-menu,
.has-sub:focus-within > .sub-menu,
.has-sub.open > .sub-menu {
    display: block;
}

.sub-menu a {
    display: block;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
}

.sub-menu a:hover {
    background: #f3efe6;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    background: var(--navy);
    color: var(--white) !important;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

.lang-switch:hover,
.lang-switch:focus {
    background: var(--gold);
    color: var(--navy) !important;
}

/* Hero */
.home-hero {
    width: 100%;
    padding: 0;
    margin: 0;
    background: linear-gradient(180deg, #101f2b 0%, var(--navy) 100%);
    border-bottom: 4px solid var(--gold);
}

.home-hero__banner {
    width: 100%;
    line-height: 0;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(24, 43, 58, 0.18);
}

.home-hero__banner img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.page-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #234258 100%);
    padding: 36px 0 28px;
    border-bottom: 4px solid var(--gold);
}

.page-hero__crumb {
    margin: 0 0 8px;
    color: #d5c39a;
    font-size: 14px;
}

.page-hero__crumb a {
    color: var(--gold);
}

.page-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

/* Sections */
.section {
    padding: 72px 0;
}

.section--alt {
    background: var(--white);
}

.section-head {
    text-align: center;
    margin-bottom: 36px;
}

.section-head h2 {
    margin: 0 0 8px;
    font-size: 1.85rem;
}

.section-head h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    background: var(--gold);
    margin: 12px auto 0;
}

.prose {
    max-width: 860px;
    margin: 0 auto;
    color: var(--text);
}

.prose h2,
.prose h3 {
    margin-top: 0;
}

.prose ul,
.prose ol {
    padding-inline-start: 1.4rem;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.prose table td,
.prose table th {
    border: 1px solid var(--line);
    padding: 8px 10px;
    color: var(--text);
}

.about-block {
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--gold);
}

.about-block h2 {
    text-align: center;
    margin-bottom: 16px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card,
.news-card,
.media-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card {
    padding: 28px 24px;
    text-align: center;
    border-top: 4px solid var(--gold);
}

.feature-card .icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #f3efe6;
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin: 0;
}

.news-card {
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(24, 43, 58, 0.06);
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 34px rgba(24, 43, 58, 0.14);
}

.news-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0b0b0b;
}

.news-card img,
.media-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.news-card:hover img {
    transform: scale(1.05);
}

.news-card img.is-default,
.media-card img.is-default {
    object-fit: contain;
    background: #0b0b0b;
    padding: 28px 22px;
}

.news-card__date {
    position: absolute;
    inset-inline-start: 12px;
    bottom: 12px;
    background: rgba(24, 43, 58, 0.88);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(196, 159, 46, 0.55);
    backdrop-filter: blur(4px);
}

.news-card__body,
.media-card__body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.news-card h3,
.media-card h3 {
    font-size: 1.02rem;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}

.news-card h3 a:hover,
.media-card h3 a:hover {
    color: var(--gold-dark);
}

.news-card__excerpt {
    margin: 0;
    color: #5b6770;
    font-size: 0.92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: auto;
    background: var(--navy);
    color: var(--white) !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
}

.btn-more:hover {
    background: var(--gold);
    color: var(--navy) !important;
}

.btn-more .bx {
    font-size: 18px;
    line-height: 1;
}

.section-cta {
    margin-top: 28px;
    text-align: center;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 10px;
    border: 2px solid var(--navy);
    color: var(--navy) !important;
    font-weight: 700;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-outline:hover {
    background: var(--navy);
    color: var(--white) !important;
    border-color: var(--navy);
}

.partners-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    align-items: center;
}

.partners-strip a,
.partners-strip span {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}

.partners-strip img {
    max-height: 72px;
    width: auto;
    max-width: 100%;
}

.article-section {
    padding: 40px 0 72px;
}

.article-wrap {
    background: var(--white);
    border-radius: var(--radius);
    border-top: 4px solid var(--gold);
    padding: 40px 36px 48px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.article-wrap,
.article-wrap p,
.article-wrap li,
.article-wrap td,
.article-wrap span,
.article-wrap div {
    color: var(--text);
}

.article-wrap h1,
.article-wrap h2,
.article-wrap h3,
.article-wrap h4,
.article-wrap h5,
.article-wrap h6 {
    color: var(--navy) !important;
    margin-top: 1.2em;
    margin-bottom: .5em;
}

.article-wrap h2:first-child,
.article-wrap h3:first-child {
    margin-top: 0;
}

.article-wrap a {
    color: var(--eu-blue) !important;
    font-weight: 700;
}

.article-wrap a:hover {
    color: var(--gold-dark) !important;
}

.article-wrap table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 28px;
    background: #fff;
}

.article-wrap th,
.article-wrap td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    vertical-align: top;
    text-align: start;
}

.article-wrap th {
    background: var(--navy) !important;
    color: #fff !important;
    font-weight: 700;
}

.article-wrap tr:nth-child(even) td {
    background: #f7f4ee;
}

.article-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 12px 0;
}

.article-wrap ul,
.article-wrap ol {
    padding-inline-start: 1.4rem;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 40px 16px;
    grid-column: 1 / -1;
}

/* Layout with sidebar */
.with-sidebar {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

.side-nav {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 0;
    overflow: hidden;
}

.side-nav a {
    display: block;
    padding: 10px 18px;
    border-inline-start: 3px solid transparent;
    font-weight: 600;
}

.side-nav a.active,
.side-nav a:hover {
    background: #f3efe6;
    border-inline-start-color: var(--gold);
    color: var(--navy);
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-gallery a img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.moodle-legacy {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 12px 40px;
    overflow-x: auto;
}

.moodle-legacy table {
    width: 100% !important;
    max-width: 960px;
    margin: 0 auto;
}

.moodle-legacy h3,
.moodle-legacy h4 {
    color: var(--navy) !important;
}

.moodle-legacy img {
    max-width: 100%;
    height: auto;
}

/* Footer */
.site-footer {
    background: var(--navy-dark);
    color: #d7dee4;
    padding: 56px 0 0;
    margin-top: 0;
}

.site-footer h2 {
    color: var(--white);
    font-size: 1.2rem;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--gold);
    display: inline-block;
}

.footer-col p {
    margin: 0 0 14px;
    line-height: 1.85;
}

.site-footer a {
    color: var(--gold);
}

.site-footer a:hover {
    color: #e8cf7a;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
}

.footer-col--eu {
    text-align: center;
}

.eu-badge {
    display: inline-block;
    background: var(--white);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    margin-bottom: 14px;
}

.eu-badge img {
    display: block;
    width: 280px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.footer-disclaimer {
    font-size: 13px;
    line-height: 1.7;
    color: #b7c2cb;
}

.footer-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 16px 0 20px;
    font-size: 14px;
    text-align: center;
}

.footer-copy p {
    margin: 0;
    color: #c5ced6;
}

.go-top {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy);
    font-size: 22px;
    cursor: pointer;
    display: none;
    z-index: 50;
    box-shadow: var(--shadow);
}

.go-top.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1100px) {
    body.nav-open {
        overflow: hidden;
    }

    .site-header__bar {
        gap: 10px;
        min-height: 64px;
        padding: 8px 14px;
    }

    .site-logo {
        margin-inline-end: auto;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 40;
        max-height: calc(100dvh - 72px);
        overflow-y: auto;
        background: var(--white);
        border-top: 3px solid var(--gold);
        box-shadow: 0 18px 36px rgba(24, 43, 58, 0.16);
        padding: 6px 0 10px;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-menu {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
    }

    .site-menu > li {
        border-bottom: 1px solid var(--line);
    }

    .site-menu > li:last-child {
        border-bottom: 0;
    }

    .site-menu > li > a {
        display: flex;
        align-items: center;
        min-height: 48px;
        white-space: normal;
        font-size: 16px;
        padding: 10px 18px;
        border-bottom: 0;
        border-inline-start: 3px solid transparent;
    }

    .site-menu > li > a:hover,
    .site-menu > li > a:focus {
        background: #f7f4ee;
        border-bottom-color: transparent;
        border-inline-start-color: var(--gold);
    }

    .has-sub {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .has-sub > a {
        flex: 1;
    }

    .sub-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border: 0;
        background: transparent;
        cursor: pointer;
        position: relative;
    }

    .sub-toggle::before {
        content: "";
        width: 9px;
        height: 9px;
        border-inline-end: 2px solid var(--navy);
        border-bottom: 2px solid var(--navy);
        transform: rotate(45deg) translateY(-2px);
    }

    [dir="rtl"] .sub-toggle::before {
        transform: rotate(-45deg) translateY(-2px);
    }

    .has-sub .sub-menu,
    .has-sub:hover > .sub-menu,
    .has-sub:focus-within > .sub-menu {
        position: static;
        min-width: 0;
        width: 100%;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        display: none;
        padding: 0 0 6px;
        background: #f7f4ee;
    }

    .has-sub.open > .sub-menu,
    .has-sub.open .sub-menu {
        display: block;
    }

    .sub-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 8px 18px 8px 28px;
        font-size: 15px;
    }

    [dir="rtl"] .sub-menu a {
        padding: 8px 28px 8px 18px;
    }

    .card-grid,
    .with-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }

    .partners-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .section {
        padding: 48px 0;
    }

    .article-section {
        padding: 28px 0 48px;
    }

    .article-wrap,
    .about-block {
        padding: 24px 18px;
    }

    .page-hero {
        padding: 28px 0 22px;
    }
}

@media (max-width: 720px) {
    .card-grid,
    .with-sidebar,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .partners-strip,
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .partners-strip span,
    .partners-strip a {
        min-height: 88px;
        padding: 12px;
    }

    .section {
        padding: 36px 0;
    }

    .section-head {
        margin-bottom: 22px;
    }

    .section-head h2 {
        font-size: 1.45rem;
    }

    .site-footer {
        padding-top: 36px;
    }

    .footer-col--eu {
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .eu-badge img {
        width: 240px;
    }

    .footer-disclaimer {
        text-align: start;
    }

    .news-card img,
    .media-card img,
    .photo-gallery a img {
        height: 180px;
    }

    .article-wrap table {
        width: max-content;
        min-width: 100%;
        font-size: 14px;
    }

    .article-wrap th,
    .article-wrap td {
        padding: 8px 10px;
        min-width: 7.2rem;
        white-space: normal;
    }

    .go-top {
        bottom: 16px;
        inset-inline-end: 16px;
    }
}

@media (max-width: 575px) {
    .site-logo img {
        height: 42px;
    }

    .lang-switch {
        min-height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .page-hero {
        padding: 22px 0 18px;
    }

    .page-hero h1 {
        font-size: 1.35rem;
    }

    .article-wrap,
    .about-block {
        padding: 18px 14px 24px;
        border-radius: 12px;
    }

    .container {
        padding-left: 14px;
        padding-right: 14px;
    }
}
