:root {
    --font-latin: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --font-arabic-body: "Noto Sans Arabic", Tahoma, Arial, sans-serif;
    --font-arabic-heading: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
    --ink: #13231d;
    --muted: #5b6c65;
    --line: #d9e2dc;
    --paper: #f7f4ec;
    --panel: #ffffff;
    --accent: #087c66;
    --accent-dark: #064d40;
    --sun: #d79b32;
    --clay: #9f5131;
    --sky: #dfeef0;
    --shadow: 0 18px 50px rgba(19, 35, 29, .12);
}

* { box-sizing: border-box; }
html { text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-latin);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(215, 155, 50, .14), transparent 30%),
        linear-gradient(180deg, #fbfaf5 0%, var(--paper) 56%, #eef3ef 100%);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body {
    font-family: var(--font-arabic-body);
    font-size: 17px;
    line-height: 1.85;
    text-align: right;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(19,35,29,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(19,35,29,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, .brand, nav, .button, button, .facts strong {
    font-family: var(--font-latin);
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .brand,
html[lang="ar"] nav,
html[lang="ar"] .button,
html[lang="ar"] button,
html[lang="ar"] .facts strong {
    font-family: var(--font-arabic-heading);
}

.site-header, .admin-header {
    position: fixed;
    z-index: 10;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 72px;
    padding: 16px clamp(20px, 5vw, 72px);
    color: #fff;
    backdrop-filter: blur(14px);
}
.site-header { background: linear-gradient(180deg, rgba(19, 35, 29, .72), rgba(19, 35, 29, .08)); }
.site-header.compact, .admin-header {
    position: sticky;
    background: var(--ink);
}
.brand {
    font-size: 21px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0;
}
nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.3;
}
nav a { opacity: .9; }
nav a:hover { opacity: 1; color: var(--sun); }
.locale-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    background: rgba(255,255,255,.1);
}
.locale-switch a {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 28px;
    border-radius: 999px;
    font-family: var(--font-latin);
    font-size: 12px;
    font-weight: 800;
}
.locale-switch a:hover { background: rgba(255,255,255,.18); color: #fff; }

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 120px clamp(20px, 7vw, 96px) 80px;
    background-size: cover;
    background-position: center;
    color: #fff;
    position: relative;
    isolation: isolate;
}
.hero::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 28%;
    background: linear-gradient(180deg, transparent, var(--paper));
    z-index: -1;
}
.hero-content { width: min(760px, 100%); }
.eyebrow {
    margin: 0 0 10px;
    color: var(--sun);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.hero h1 {
    margin: 0;
    font-size: clamp(42px, 6.2vw, 78px);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: 0;
    text-wrap: balance;
    text-shadow: 0 18px 45px rgba(0,0,0,.24);
}
.hero p:not(.eyebrow) {
    max-width: 640px;
    margin: 24px 0 0;
    font-size: clamp(17px, 1.45vw, 20px);
    font-weight: 500;
    line-height: 1.75;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}
.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(8,124,102,.26);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover, button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(8,124,102,.32);
    background: var(--accent-dark);
}
.button.secondary {
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.35);
}
.button.small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin: -38px clamp(20px, 6vw, 84px) 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 2;
}
.facts div { background: var(--panel); padding: 24px clamp(18px, 4vw, 40px); }
.facts strong { display: block; font-size: 22px; line-height: 1.2; }
.facts span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.section { padding: 86px clamp(20px, 6vw, 84px); position: relative; }
.section-heading { max-width: 760px; margin-bottom: 28px; }
.section h1, .section h2, .article-body h1 {
    margin: 0;
    font-size: clamp(30px, 3.7vw, 50px);
    font-weight: 900;
    line-height: 1.12;
    text-wrap: balance;
}
.page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.content-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(19, 35, 29, .07);
    transition: transform .18s ease, box-shadow .18s ease;
}
.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.content-card img { width: 100%; height: 220px; object-fit: cover; }
.content-card div { padding: 20px; }
.content-card h3, .event-list h3 {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 850;
    line-height: 1.25;
}
.content-card p, .split p, .rich-text {
    color: var(--muted);
    line-height: 1.75;
}
.content-card a, .gallery-grid a {
    color: var(--accent-dark);
    font-weight: 800;
}

.gallery-band { background: linear-gradient(135deg, #e8f2ec, var(--sky)); }
.social-band { background: #f7f4ec; }
.gallery-strip, .gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
figure { margin: 0; }
.gallery-strip img, .gallery-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(19, 35, 29, .12);
}
figcaption {
    padding-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}
figcaption strong, figcaption span, figcaption a { display: block; }

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.social-card {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(19, 35, 29, .07);
    transition: transform .18s ease, box-shadow .18s ease;
}
.social-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.social-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.social-card div { padding: 18px; }
.social-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}
.social-card h3 {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.28;
}
.social-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.team-band {
    background: linear-gradient(180deg, #fbfaf5, #eef3ef);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.team-card {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(19, 35, 29, .07);
    transition: transform .18s ease, box-shadow .18s ease;
}

a.team-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.team-photo {
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 100%;
    max-height: 230px;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
}

.team-photo img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.team-photo span {
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 900;
    line-height: 1;
}

.team-card-body {
    display: grid;
    gap: 7px;
    padding: 16px 18px 18px;
}

.team-card-body > span {
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.team-card h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.2;
}

.team-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.team-card strong {
    margin-top: 4px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 850;
}

.split {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 40px;
    align-items: start;
}
.event-list { display: grid; gap: 12px; }
.event-list article {
    border-left: 4px solid var(--clay);
    border-radius: 0 8px 8px 0;
    background: var(--panel);
    padding: 18px;
    box-shadow: 0 8px 22px rgba(19, 35, 29, .06);
}
.event-list span {
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
}
.sources, footer {
    padding: 28px clamp(20px, 6vw, 84px);
    background: var(--ink);
    color: #dce5de;
}
.sources h2 { margin: 0 0 8px; }
.sources p { max-width: 980px; color: #c9d6cf; }
footer {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 28px;
    border-top: 1px solid rgba(255,255,255,.12);
}
footer strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}
footer p {
    max-width: 560px;
    margin: 0;
    color: #c9d6cf;
}
.footer-brand {
    max-width: 360px;
}
.footer-links {
    justify-content: flex-end;
    max-width: 520px;
    color: #e6eee9;
}

.article-page { padding-bottom: 72px; }
.article-hero { width: 100%; max-height: 520px; object-fit: cover; }
.article-body { max-width: 850px; margin: 48px auto 0; padding: 0 20px; }
.lead {
    font-size: clamp(19px, 2vw, 23px);
    line-height: 1.65;
    color: var(--accent-dark);
}

.admin-surface { background: #f2f4f1; }
.admin-layout { max-width: 1120px; margin: 0 auto; padding: 34px 20px 70px; }
.admin-layout.narrow { max-width: 780px; }
.admin-section, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 18px;
}
.admin-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
table { width: 100%; border-collapse: collapse; }
td { padding: 13px 8px; border-top: 1px solid var(--line); vertical-align: top; }
td:last-child { text-align: right; font-weight: 800; color: var(--accent-dark); }
.admin-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    padding: 0;
    overflow: hidden;
}
.admin-kpis div {
    padding: 22px;
    background: #fff;
}
.admin-kpis strong {
    display: block;
    color: var(--accent-dark);
    font-size: 34px;
    line-height: 1;
}
.admin-kpis span,
.admin-subline {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.admin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.admin-actions form { display: inline; }
.link-danger {
    min-height: auto;
    padding: 0;
    background: transparent;
    color: #a12b2b;
    box-shadow: none;
    font: inherit;
    font-weight: 800;
}
.link-danger:hover {
    background: transparent;
    box-shadow: none;
    color: #6f1717;
    transform: none;
}
form { display: grid; gap: 14px; }
label { font-weight: 800; }
input, textarea {
    width: 100%;
    border: 1px solid #cbd5cd;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}
input[type="checkbox"] { width: auto; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.panel { width: min(430px, 100%); }
.alert { color: #9b1c1c; font-weight: 800; }
.success { background: #dff4e9; border: 1px solid #b4dfca; padding: 12px 14px; border-radius: 8px; }
.muted { color: var(--muted); font-size: 14px; }

html[dir="rtl"] .site-header {
    flex-direction: row;
}
html[dir="rtl"] nav { justify-content: flex-end; }
html[dir="rtl"] .hero-content {
    max-width: 730px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    text-align: right;
}
html[dir="rtl"] .hero h1 {
    font-size: clamp(39px, 5.2vw, 66px);
    line-height: 1.28;
    font-weight: 800;
}
html[dir="rtl"] .hero p:not(.eyebrow) {
    max-width: 660px;
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.95;
}
html[dir="rtl"] .hero-actions { justify-content: flex-start; }
html[dir="rtl"] .section-heading {
    margin-inline-start: auto;
    margin-inline-end: 0;
}
html[dir="rtl"] .section h1,
html[dir="rtl"] .section h2,
html[dir="rtl"] .article-body h1 {
    line-height: 1.35;
    font-weight: 800;
}
html[dir="rtl"] .content-card h3,
html[dir="rtl"] .event-list h3,
html[dir="rtl"] .social-card h3 {
    line-height: 1.5;
    font-weight: 750;
}
html[dir="rtl"] .content-card p,
html[dir="rtl"] .split p,
html[dir="rtl"] .rich-text,
html[dir="rtl"] .social-card p {
    line-height: 1.95;
}
html[dir="rtl"] .event-list article {
    border-left: 0;
    border-right: 4px solid var(--clay);
    border-radius: 8px 0 0 8px;
}
html[dir="rtl"] td:last-child { text-align: left; }
html[dir="rtl"] .eyebrow {
    font-family: var(--font-arabic-heading);
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0;
}
html[dir="rtl"] .facts span,
html[dir="rtl"] figcaption {
    line-height: 1.75;
}

@media (max-width: 900px) {
    .site-header, .admin-header { position: sticky; background: var(--ink); min-height: auto; }
    .site-header, .admin-header { align-items: flex-start; flex-direction: column; }
    nav { width: 100%; }
    .hero { min-height: 78vh; padding-top: 82px; }
    .facts, .page-grid, .gallery-strip, .gallery-grid, .split, .social-grid, .team-grid { grid-template-columns: 1fr 1fr; }
    .admin-kpis { grid-template-columns: 1fr 1fr; }
    footer { flex-direction: column; }
    .footer-links { justify-content: flex-start; }
    html[dir="rtl"] .hero-content { margin-inline-end: 0; }
}
@media (max-width: 640px) {
    .site-header, .admin-header, footer { align-items: flex-start; flex-direction: column; }
    .site-header, .admin-header { padding: 14px 18px; }
    nav { gap: 10px 12px; font-size: 13px; }
    .locale-switch { order: 10; }
    .section { padding: 58px 18px; }
    .hero {
        min-height: auto;
        padding: 70px 18px 84px;
    }
    .facts {
        margin: -28px 18px 0;
        border-radius: 8px;
    }
    .facts, .page-grid, .gallery-strip, .gallery-grid, .split, .social-grid, .team-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 40px; }
    html[dir="rtl"] .hero h1 { font-size: 34px; line-height: 1.35; }
    html[dir="rtl"] nav { justify-content: flex-start; }
    .admin-layout { padding: 20px 12px 50px; }
    .admin-section { padding: 16px; }
    .admin-kpis { grid-template-columns: 1fr 1fr; padding: 0; }
    .admin-actions {
        align-items: flex-start;
        justify-content: flex-start;
    }
    td { display: block; padding: 8px 0; }
    td:last-child { text-align: left; }
}

/* Final public UI polish: RTL alignment, softer navigation, and calmer responsive rhythm. */
::selection { background: rgba(8, 124, 102, .22); }

.site-header {
    min-height: 76px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(19, 35, 29, .82), rgba(19, 35, 29, .14));
}

.site-header nav,
.admin-header nav,
.footer-links {
    gap: 8px;
}

.site-header nav a,
.admin-header nav a,
.footer-links a {
    border-radius: 999px;
    padding: 8px 11px;
    transition: background .18s ease, color .18s ease, opacity .18s ease;
}

.site-header nav a:hover,
.admin-header nav a:hover,
.footer-links a:hover,
.footer-links a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    opacity: 1;
}

.locale-switch {
    margin-inline-start: 6px;
}

.locale-switch a {
    padding: 0;
}

.locale-switch a.active {
    background: rgba(255,255,255,.24);
    color: #fff;
    opacity: 1;
}

.hero {
    padding-block: 132px 92px;
}

.section {
    padding-block: 92px;
}

.section-heading {
    margin-bottom: 34px;
}

.section-heading p:not(.eyebrow) {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.facts {
    margin-top: -42px;
}

.facts div,
.content-card,
.social-card,
.event-list article {
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.facts div:hover {
    background: #fbfdfb;
}

.content-card,
.social-card {
    box-shadow: 0 10px 28px rgba(19, 35, 29, .08);
}

.content-card a,
.gallery-grid a {
    display: inline-flex;
    align-items: center;
    margin-top: 4px;
}

.content-card a::after,
.gallery-grid a::after {
    content: "";
    width: 18px;
    height: 1px;
    margin-inline-start: 8px;
    background: currentColor;
    transition: width .18s ease;
}

.content-card a:hover::after,
.gallery-grid a:hover::after {
    width: 28px;
}

.gallery-band {
    background:
        linear-gradient(135deg, rgba(232,242,236,.96), rgba(223,238,240,.96)),
        radial-gradient(circle at 85% 10%, rgba(215,155,50,.18), transparent 28%);
}

.social-band {
    background: linear-gradient(180deg, #fffaf0, #f7f4ec);
}

.gallery-strip img,
.gallery-grid img {
    transition: transform .18s ease, box-shadow .18s ease;
}

.gallery-strip figure:hover img,
.gallery-grid figure:hover img {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.gallery-page {
    overflow-x: clip;
    background:
        linear-gradient(180deg, #fbfaf5 0%, #f3f7f2 44%, #fbfaf5 100%);
}

.gallery-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    align-items: end;
    gap: 28px;
    padding-bottom: 34px;
}

.gallery-intro-copy {
    max-width: 860px;
}

.gallery-intro h1 {
    margin: 0;
    font-size: clamp(34px, 4.6vw, 64px);
    line-height: 1.06;
}

.gallery-intro-copy p:not(.eyebrow) {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.gallery-stat {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(19,35,29,.08);
}

.gallery-stat strong {
    color: var(--accent-dark);
    font-size: 46px;
    line-height: 1;
}

.gallery-stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}

.gallery-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(280px, .84fr);
    gap: 0;
    padding-top: 0;
    padding-bottom: 54px;
}

.gallery-feature-image {
    min-height: 420px;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
    background: #eef2ef;
}

.gallery-feature-image img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
}

.gallery-feature-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 52px);
    border: 1px solid var(--line);
    border-inline-start: 0;
    border-radius: 0 8px 8px 0;
    background: #fff;
}

.gallery-feature-content h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 42px);
    line-height: 1.12;
}

.gallery-feature-content p:not(.eyebrow) {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.75;
}

.gallery-source-button {
    align-self: flex-start;
    margin-top: 22px;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gallery-collection {
    padding-top: 34px;
}

.gallery-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.gallery-section-head h2 {
    margin: 0;
    font-size: clamp(28px, 3.3vw, 48px);
    line-height: 1.12;
}

.gallery-section-head > span {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--accent-dark);
    background: #fff;
    font-size: 13px;
    font-weight: 850;
}

.gallery-pro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gallery-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(19,35,29,.08);
    transition: transform .18s ease, box-shadow .18s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.gallery-card-media {
    display: block;
    overflow: hidden;
    background: #eef2ef;
}

.gallery-card-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .24s ease;
}

.gallery-card:hover .gallery-card-media img {
    transform: scale(1.035);
}

.gallery-card-body {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.gallery-index {
    color: var(--sun);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
}

.gallery-card-body strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.28;
}

.gallery-card-body small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.gallery-card-body a {
    width: fit-content;
    margin-top: 2px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 850;
}

.gallery-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    align-items: end;
    gap: clamp(24px, 5vw, 70px);
    min-height: 72vh;
    padding: 140px clamp(20px, 6vw, 84px) 54px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(19,35,29,.9), rgba(19,35,29,.32)),
        url("/assets/bazma-hero.webp");
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.gallery-hero::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: -1;
    height: 26%;
    background: linear-gradient(180deg, transparent, #fbfaf5);
}

.gallery-hero-content {
    max-width: 760px;
    min-width: 0;
}

.gallery-hero h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(38px, 5.8vw, 78px);
    font-weight: 900;
    line-height: 1.03;
    text-wrap: balance;
    overflow-wrap: anywhere;
    text-shadow: 0 18px 44px rgba(0,0,0,.28);
}

.gallery-hero-content p:not(.eyebrow) {
    max-width: 660px;
    margin: 22px 0 0;
    font-size: clamp(16px, 1.4vw, 20px);
    font-weight: 560;
    line-height: 1.8;
}

.gallery-hero-panel {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    box-shadow: 0 18px 48px rgba(0,0,0,.16);
    backdrop-filter: blur(16px);
}

.gallery-hero-panel span {
    color: rgba(255,255,255,.78);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-hero-panel strong {
    font-size: 22px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.gallery-hero-panel p {
    margin: 0;
    color: rgba(255,255,255,.82);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.gallery-showcase {
    padding-top: 58px;
}

.gallery-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.gallery-toolbar h2 {
    margin: 0;
    font-size: clamp(28px, 3.4vw, 48px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.gallery-toolbar > span {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--accent-dark);
    background: #fff;
    font-size: 13px;
    font-weight: 850;
}

.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 16px;
}

.gallery-photo {
    position: relative;
    grid-column: span 4;
    display: grid;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(217,226,220,.92);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(19,35,29,.08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.gallery-photo:nth-child(5n + 2),
.gallery-photo:nth-child(5n + 4) {
    grid-column: span 3;
}

.gallery-photo:nth-child(7n + 3) {
    grid-column: span 5;
}

.gallery-photo.is-featured {
    grid-column: span 8;
    grid-row: span 2;
}

.gallery-photo:hover {
    transform: translateY(-3px);
    border-color: rgba(8,124,102,.28);
    box-shadow: var(--shadow);
}

.gallery-photo button {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    cursor: zoom-in;
    overflow: hidden;
}

.gallery-photo button:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}

.gallery-photo button:focus-visible {
    outline: 3px solid rgba(215,155,50,.72);
    outline-offset: -3px;
}

.gallery-photo img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 270px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .26s ease, filter .26s ease;
}

.gallery-photo.is-featured img {
    min-height: 560px;
    aspect-ratio: 16 / 10;
}

.gallery-photo:hover img {
    transform: scale(1.035);
    filter: saturate(1.04) contrast(1.03);
}

.gallery-photo figcaption {
    display: grid;
    gap: 5px;
    padding: 16px;
    background: #fff;
}

.gallery-photo figcaption span {
    color: var(--sun);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
}

.gallery-photo figcaption strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.26;
}

.gallery-photo figcaption small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.gallery-photo figcaption a {
    width: fit-content;
    margin-top: 2px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 850;
}

.gallery-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
}

.gallery-lightbox[hidden] {
    display: none;
}

.is-lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(9,18,15,.86);
    backdrop-filter: blur(10px);
}

.gallery-lightbox-frame {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: min(1180px, 100%);
    max-height: calc(100vh - 44px);
}

.gallery-lightbox-frame img {
    grid-column: 2;
    width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
    border-radius: 8px;
    background: #0e1714;
    box-shadow: 0 24px 70px rgba(0,0,0,.34);
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.12);
    color: #fff;
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.gallery-lightbox-close {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    z-index: 2;
    width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 28px;
    line-height: 1;
}

.gallery-lightbox-arrow {
    width: 48px;
    min-height: 64px;
    padding: 0;
    font-size: 42px;
}

.gallery-lightbox-arrow:hover,
.gallery-lightbox-close:hover {
    background: rgba(255,255,255,.2);
    box-shadow: none;
}

.gallery-lightbox-caption {
    grid-column: 2;
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    color: #fff;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(14px);
}

.gallery-lightbox-caption span {
    color: rgba(255,255,255,.62);
    font-size: 12px;
    font-weight: 850;
}

.gallery-lightbox-caption strong {
    font-size: 20px;
    line-height: 1.25;
}

.gallery-lightbox-caption p {
    margin: 0;
    color: rgba(255,255,255,.76);
}

.gallery-lightbox-caption p[hidden] {
    display: none;
}

.gallery-lightbox-caption a {
    width: fit-content;
    color: var(--sun);
    font-weight: 850;
}

.event-list article:hover {
    transform: translateX(2px);
    box-shadow: 0 10px 28px rgba(19, 35, 29, .08);
}

.sources,
footer {
    background:
        linear-gradient(135deg, rgba(19,35,29,.98), rgba(6,77,64,.95)),
        var(--ink);
}

footer {
    gap: 36px;
}

/* Arabic layout should feel native: brand on the right, nav flowing from the right, headings right-aligned. */
html[dir="rtl"] .site-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .site-header .brand {
    text-align: right;
}

html[dir="rtl"] .site-header nav {
    justify-content: flex-start;
}

html[dir="rtl"] .locale-switch {
    margin-inline-start: 0;
    margin-inline-end: 6px;
}

html[dir="rtl"] .hero-content {
    margin-inline-start: 0;
    margin-inline-end: auto;
    text-align: right;
}

html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero p,
html[dir="rtl"] .hero .eyebrow {
    text-align: right;
}

html[dir="rtl"] .section-heading {
    margin-inline-start: 0;
    margin-inline-end: auto;
    text-align: right;
}

html[dir="rtl"] .content-card a::after,
html[dir="rtl"] .gallery-grid a::after {
    margin-inline-start: 0;
    margin-inline-end: 8px;
}

html[dir="rtl"] .gallery-feature {
    grid-template-columns: minmax(280px, .84fr) minmax(0, 1.16fr);
}

html[dir="rtl"] .gallery-feature-image {
    grid-column: 2;
    border-radius: 0 8px 8px 0;
}

html[dir="rtl"] .gallery-feature-content {
    grid-column: 1;
    grid-row: 1;
    border-inline-start: 1px solid var(--line);
    border-inline-end: 0;
    border-radius: 8px 0 0 8px;
}

html[dir="rtl"] .gallery-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    direction: rtl;
}

html[dir="rtl"] .gallery-hero-content {
    grid-column: 1;
    justify-self: start;
    margin-inline-start: auto;
    margin-inline-end: 0;
    text-align: right;
}

html[dir="rtl"] .gallery-hero-panel {
    grid-column: 2;
    justify-self: stretch;
    text-align: right;
}

html[dir="rtl"] .gallery-toolbar {
    flex-direction: row;
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .gallery-showcase,
html[dir="rtl"] .gallery-masonry {
    direction: rtl;
}

html[dir="rtl"] .gallery-intro-copy,
html[dir="rtl"] .gallery-feature-content,
html[dir="rtl"] .gallery-section-head,
html[dir="rtl"] .gallery-card-body,
html[dir="rtl"] .gallery-photo figcaption,
html[dir="rtl"] .gallery-empty,
html[dir="rtl"] .gallery-lightbox-caption {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .gallery-card-body,
html[dir="rtl"] .gallery-photo figcaption,
html[dir="rtl"] .gallery-lightbox-caption {
    justify-items: start;
}

html[dir="rtl"] .gallery-hero h1,
html[dir="rtl"] .gallery-hero-content p,
html[dir="rtl"] .gallery-hero-panel span,
html[dir="rtl"] .gallery-hero-panel strong,
html[dir="rtl"] .gallery-hero-panel p,
html[dir="rtl"] .gallery-toolbar h2,
html[dir="rtl"] .gallery-toolbar .eyebrow,
html[dir="rtl"] .gallery-toolbar > span {
    text-align: right;
}

html[dir="rtl"] .gallery-source-button,
html[dir="rtl"] .gallery-card-body a,
html[dir="rtl"] .gallery-photo figcaption a {
    margin-inline-start: 0;
    margin-inline-end: auto;
}

html[dir="rtl"] .gallery-source-button {
    align-self: flex-start;
}

html[dir="rtl"] .gallery-card-body a,
html[dir="rtl"] .gallery-photo figcaption a {
    justify-self: start;
}

html[dir="rtl"] .event-list article:hover {
    transform: translateX(-2px);
}

@media (max-width: 900px) {
    .site-header,
    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    html[dir="rtl"] .site-header {
        align-items: flex-end;
        flex-direction: column;
    }

    html[dir="rtl"] .site-header nav {
        justify-content: flex-end;
    }

    html[dir="rtl"] .hero-content {
        margin-inline-start: 0;
        margin-inline-end: auto;
    }
}

@media (max-width: 640px) {
    .site-header,
    .admin-header {
        padding: 14px 18px;
    }

    .site-header nav,
    .admin-header nav,
    .footer-links {
        gap: 8px;
        font-size: 13px;
    }

    .site-header nav a,
    .admin-header nav a,
    .footer-links a {
        padding: 7px 9px;
    }

    .hero {
        padding: 76px 18px 88px;
    }

    .section {
        padding: 60px 18px;
    }

    .section-heading {
        margin-bottom: 24px;
    }

    .facts {
        margin: -28px 18px 0;
    }

    footer {
        padding: 28px 18px;
    }

    html[dir="rtl"] nav {
        justify-content: flex-end;
    }
}

/* Associations and upgraded news board. */
.organizations-band {
    background: linear-gradient(180deg, #f7f4ec, #eef3ef);
}

.organization-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.organization-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 28px rgba(19, 35, 29, .08);
}

.organization-card img {
    width: 100%;
    height: 100%;
    min-height: 210px;
    object-fit: cover;
}

.organization-card div {
    padding: 20px 20px 20px 0;
}

.organization-card span,
.news-category {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(8,124,102,.1);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
}

.news-board article > .news-category:first-child {
    margin-top: 20px;
}

.news-board article:first-child > .news-category:first-child {
    margin-top: 26px;
}

.organization-card h3 {
    margin: 12px 0 8px;
    font-size: 21px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.organization-card p {
    margin: 0 0 10px;
    color: var(--muted);
    line-height: 1.72;
}

.organization-card a,
.news-board a {
    color: var(--accent-dark);
    font-weight: 850;
}

.news-band {
    background:
        linear-gradient(180deg, rgba(255,255,255,.55), rgba(247,244,236,.9)),
        radial-gradient(circle at 10% 10%, rgba(215,155,50,.13), transparent 30%);
}

.news-board {
    display: grid;
    grid-template-columns: 1.25fr repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.news-board article {
    overflow: hidden;
    border-left: 4px solid var(--clay);
    border-radius: 0 8px 8px 0;
    background: var(--panel);
    padding: 0 20px 20px;
    box-shadow: 0 8px 22px rgba(19, 35, 29, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.news-board article:first-child {
    grid-row: span 2;
    padding: 0 26px 26px;
    background: linear-gradient(135deg, #fff, #f1f7f3);
}

.news-board img {
    width: calc(100% + 40px);
    max-width: none;
    aspect-ratio: 16 / 9;
    margin: 0 -20px 18px;
    object-fit: cover;
    background: #eef2ef;
}

.news-board article:first-child img {
    width: calc(100% + 52px);
    margin: 0 -26px 22px;
}

.news-board article:hover {
    transform: translateX(2px);
    box-shadow: 0 10px 28px rgba(19, 35, 29, .08);
}

.news-board time {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.news-board h3 {
    margin: 12px 0 8px;
    font-size: 22px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.news-board article:first-child h3 {
    font-size: clamp(26px, 3vw, 38px);
}

.news-board p {
    margin: 0 0 12px;
    color: var(--muted);
}

.news-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.news-heading > div {
    min-width: 0;
}

.news-heading .button {
    flex: 0 0 auto;
}

.news-slider {
    display: flex;
    grid-template-columns: none;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 4px 18px;
    scroll-padding-inline: 4px;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
}

.news-slider article,
.news-slider article:first-child {
    display: flex;
    flex: 0 0 min(430px, 82vw);
    flex-direction: column;
    grid-row: auto;
    min-height: 520px;
    padding: 0 22px 22px;
    border: 1px solid rgba(8,124,102,.14);
    border-left: 5px solid var(--clay);
    border-radius: 8px;
    background: linear-gradient(145deg, #fff, #f5faf7);
    scroll-snap-align: start;
}

.news-slider article:first-child {
    flex-basis: min(560px, 88vw);
    background: linear-gradient(145deg, #fffdf7, #eef7f2);
}

.news-slider img,
.news-slider article:first-child img {
    width: calc(100% + 44px);
    max-width: none;
    aspect-ratio: 16 / 10;
    margin: 0 -22px 20px;
}

.news-slider h3 {
    font-size: clamp(23px, 2.4vw, 32px);
}

.news-slider article:first-child h3 {
    font-size: clamp(27px, 3.4vw, 42px);
}

.news-slider p {
    flex: 1;
}

.news-carousel {
    display: grid;
    gap: 16px;
    outline: none;
}

.news-carousel-viewport {
    overflow: hidden;
    border-radius: 8px;
}

.news-carousel:not(.is-ready) .news-carousel-viewport {
    overflow-x: auto;
}

.news-carousel:not(.is-ready) .news-carousel-controls {
    display: none;
}

.news-carousel.is-ready .news-slider {
    overflow: visible;
    padding: 0;
    transition: transform .42s ease;
    will-change: transform;
}

.news-carousel .news-slider {
    direction: ltr;
    gap: 0;
    scroll-snap-type: none;
}

.news-carousel .news-slide,
.news-carousel .news-slide:first-child {
    display: grid;
    flex: 0 0 100%;
    grid-template-columns: minmax(280px, .95fr) minmax(0, 1fr);
    gap: 0;
    min-height: 440px;
    padding: 0;
    border: 1px solid rgba(8,124,102,.14);
    border-left: 5px solid var(--clay);
    border-radius: 8px;
    background: linear-gradient(145deg, #fffdf8, #eef7f2);
    box-shadow: 0 18px 44px rgba(19,35,29,.09);
    scroll-snap-align: start;
}

.news-carousel.is-ready .news-slide:not(.is-active) {
    pointer-events: none;
}

.news-carousel .news-slide:hover {
    transform: none;
}

.news-carousel .news-slide img,
.news-carousel .news-slide:first-child img {
    width: 100%;
    height: 100%;
    min-height: 440px;
    margin: 0;
    aspect-ratio: auto;
    object-fit: cover;
}

.news-slide-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(24px, 4vw, 48px);
}

.news-slide-content time {
    margin-top: 12px;
}

.news-slide-content h3,
.news-carousel .news-slide:first-child h3 {
    margin: 14px 0 12px;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.04;
}

.news-slide-content p {
    max-width: 620px;
    margin: 0 0 18px;
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.75;
}

.news-slide-content a {
    width: fit-content;
}

.news-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.news-carousel-arrow {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid rgba(8,124,102,.18);
    border-radius: 999px;
    background: #fff;
    color: var(--accent-dark);
    font-size: 30px;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(19,35,29,.08);
}

.news-carousel-arrow:hover {
    transform: translateY(-1px);
    background: #eef7f2;
    box-shadow: 0 14px 28px rgba(19,35,29,.11);
}

.news-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.news-carousel-dots button {
    width: 10px;
    height: 10px;
    min-height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(8,124,102,.25);
    box-shadow: none;
}

.news-carousel-dots button.is-active {
    width: 28px;
    background: var(--accent-dark);
}

html[dir="rtl"] .news-carousel .news-slide,
html[dir="rtl"] .news-carousel .news-slide:first-child {
    border-right: 5px solid var(--clay);
    border-left: 1px solid rgba(8,124,102,.14);
}

html[dir="rtl"] .news-slider article,
html[dir="rtl"] .news-slider article:first-child {
    border-right: 5px solid var(--clay);
    border-left: 1px solid rgba(8,124,102,.14);
}

.article-media {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.article-media h2 {
    margin: 0 0 18px;
    font-size: 28px;
    line-height: 1.2;
}

.news-detail-page .article-body {
    margin-top: 42px;
}

html[dir="rtl"] .organization-card {
    grid-template-columns: 1fr 160px;
}

html[dir="rtl"] .organization-card div {
    padding: 20px 0 20px 20px;
}

html[dir="rtl"] .news-board article {
    border-left: 0;
    border-right: 4px solid var(--clay);
    border-radius: 8px 0 0 8px;
}

html[dir="rtl"] .news-board article:hover {
    transform: translateX(-2px);
}

@media (max-width: 900px) {
    .organization-grid,
    .news-board:not(.news-slider) {
        grid-template-columns: 1fr 1fr;
    }

    .news-board article:first-child {
        grid-row: auto;
    }
}

@media (max-width: 640px) {
    .organization-grid,
    .news-board:not(.news-slider) {
        grid-template-columns: 1fr;
    }

    .news-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .news-heading .button {
        width: 100%;
        justify-content: center;
    }

    .news-carousel .news-slide,
    .news-carousel .news-slide:first-child {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .news-carousel .news-slide img,
    .news-carousel .news-slide:first-child img {
        min-height: 240px;
        aspect-ratio: 16 / 10;
    }

    .news-slide-content h3,
    .news-carousel .news-slide:first-child h3 {
        font-size: clamp(27px, 9vw, 38px);
    }

    .news-carousel-controls {
        justify-content: space-between;
    }

    .organization-card,
    html[dir="rtl"] .organization-card {
        grid-template-columns: 1fr;
    }

    .organization-card div,
    html[dir="rtl"] .organization-card div {
        padding: 18px;
    }

    .organization-card img {
        min-height: 190px;
        aspect-ratio: 16 / 9;
    }
}

/* Professional CMS experience. */
.admin-surface {
    background:
        linear-gradient(180deg, #f7faf8 0%, #edf2ef 100%);
}

.admin-header-pro {
    border-bottom: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 10px 28px rgba(19,35,29,.16);
}

.admin-workspace {
    max-width: 1240px;
    padding-top: 28px;
}

.admin-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    padding: 28px;
    margin-bottom: 18px;
    border: 1px solid rgba(8,124,102,.16);
    border-radius: 8px;
    background:
        linear-gradient(135deg, #ffffff, #edf7f2);
    box-shadow: 0 16px 40px rgba(19,35,29,.08);
}

.admin-hero-panel h1,
.admin-editor-aside h1 {
    margin: 0;
    font-size: clamp(30px, 3.4vw, 48px);
    line-height: 1.08;
    font-weight: 900;
    text-wrap: balance;
}

.admin-hero-panel p:not(.admin-eyebrow),
.admin-editor-aside p {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--muted);
}

.admin-eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.35;
    text-transform: uppercase;
}

.admin-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.secondary-admin {
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid rgba(8,124,102,.18);
    box-shadow: none;
}

.secondary-admin:hover {
    background: #eef8f3;
    color: var(--accent-dark);
}

.admin-kpis-pro {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(19,35,29,.06);
}

.admin-content-section {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 10px 30px rgba(19,35,29,.05);
}

.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.admin-section-head h2 {
    margin: 0;
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.15;
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.admin-item:hover {
    border-color: rgba(8,124,102,.28);
    box-shadow: 0 10px 26px rgba(19,35,29,.07);
    transform: translateY(-1px);
}

.admin-item-main h3,
.admin-media-card h3 {
    margin: 8px 0 3px;
    font-size: 18px;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.admin-item-main p,
.admin-media-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2ef;
    color: #44554e;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.status-pill.is-live {
    background: rgba(8,124,102,.12);
    color: var(--accent-dark);
}

.status-pill.is-draft {
    background: rgba(159,81,49,.12);
    color: #7e3f27;
}

.status-pill.is-archived {
    background: #eef2ef;
    color: #5b6761;
}

.admin-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--accent-dark);
    font-weight: 850;
}

.admin-item-actions form {
    display: inline-flex;
}

.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.admin-media-card {
    overflow: hidden;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(19,35,29,.05);
}

.admin-media-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #eef2ef;
}

.admin-image-placeholder {
    display: grid;
    place-items: center;
    min-height: 180px;
    aspect-ratio: 16 / 10;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    background: repeating-linear-gradient(45deg, #eef2ef, #eef2ef 10px, #f7faf8 10px, #f7faf8 20px);
}

.admin-media-card div {
    padding: 14px;
}

.admin-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed #cbd8d0;
    border-radius: 8px;
    color: var(--muted);
    background: #fbfcfb;
}

.settings-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-hints span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef7f2;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.permission-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.admin-user-profile-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.admin-user-profile-line img,
.admin-user-profile-line > span {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.admin-user-profile-line img {
    object-fit: cover;
}

.admin-user-profile-line > span {
    display: grid;
    place-items: center;
    background: #eef7f2;
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 900;
}

.admin-user-profile-line strong,
.admin-user-profile-line small {
    display: block;
}

.admin-user-profile-line small {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.permission-pills span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 8px;
    background: #eef7f2;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 850;
}

.page-media-manager {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.admin-editor-tips {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.admin-editor-tips li {
    padding: 10px 12px;
    border: 1px solid rgba(8,124,102,.14);
    border-radius: 8px;
    background: #fff;
    color: #355047;
    font-size: 13px;
    line-height: 1.45;
}

.admin-editor-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    max-width: 1180px;
    align-items: start;
}

.admin-editor-aside,
.admin-editor-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(19,35,29,.06);
}

.admin-editor-aside {
    position: sticky;
    top: 96px;
    padding: 24px;
}

.admin-editor-aside h1 {
    font-size: clamp(26px, 2.8vw, 36px);
}

.admin-editor-aside a,
.admin-submit-bar a {
    display: inline-flex;
    margin-top: 18px;
    color: var(--accent-dark);
    font-weight: 850;
}

.admin-editor-panel {
    padding: 24px;
}

.admin-form {
    display: grid;
    gap: 18px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-field {
    display: grid;
    gap: 7px;
}

.admin-field:has(textarea),
.admin-field-check,
.admin-field-wide {
    grid-column: 1 / -1;
}

.admin-field label {
    color: #20362d;
    font-size: 13px;
    line-height: 1.35;
}

.admin-choice-grid > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.admin-choice-grid fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border: 1px solid #dbe5df;
    border-radius: 8px;
    background: #fbfcfb;
}

.admin-choice-grid legend {
    padding: 0 6px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 850;
}

.admin-choice-grid fieldset > div,
.admin-choice-grid > div > div {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #edf2ef;
    border-radius: 8px;
    background: #fff;
}

.admin-choice-grid input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
}

.admin-choice-grid label {
    font-weight: 750;
}

.admin-permissions-field > label {
    font-weight: 850;
}

.admin-permission-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.admin-permission-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #edf2ef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.admin-permission-option input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.admin-permission-option span {
    min-width: 0;
    color: #20362d;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
}

.admin-permissions-field .form-help,
.admin-permissions-field .help-text {
    color: var(--muted);
    font-size: 12px;
}

.admin-field input,
.admin-field textarea {
    min-height: 44px;
    border-color: #cdd8d1;
    background: #fbfcfb;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.wysiwyg-hidden {
    display: none;
}

.wysiwyg-media-input {
    display: none;
}

.wysiwyg {
    overflow: hidden;
    border: 1px solid #cdd8d1;
    border-radius: 8px;
    background: #fff;
}

.wysiwyg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e4ebe6;
    background: #fdfefd;
}

.wysiwyg-header strong,
.wysiwyg-header span {
    display: block;
}

.wysiwyg-header strong {
    color: #20362d;
    font-size: 14px;
}

.wysiwyg-header span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.wysiwyg-header button {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    box-shadow: none;
}

.wysiwyg-header button.active {
    background: var(--accent-dark);
    color: #fff;
}

.wysiwyg-media-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e4ebe6;
    background: #fbfcfb;
}

.wysiwyg-media-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #20362d;
    font-size: 12px;
    font-weight: 850;
}

.wysiwyg-media-options input {
    width: 86px;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #cdd8d1;
    border-radius: 6px;
    background: #fff;
}

.wysiwyg-media-options span {
    color: var(--muted);
    font-size: 12px;
}

.wysiwyg-resize-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #e4ebe6;
    background: #eef7f2;
}

.wysiwyg-resize-bar[hidden] {
    display: none;
}

.wysiwyg-resize-bar strong {
    margin-right: 4px;
    color: #20362d;
    font-size: 12px;
}

.wysiwyg-resize-bar button {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    box-shadow: none;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid #e4ebe6;
    background: #f7faf8;
}

.wysiwyg-toolbar button {
    min-width: 34px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #d8e2dc;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    box-shadow: none;
    font-size: 12px;
    font-weight: 850;
}

.wysiwyg-toolbar button:hover {
    transform: none;
    background: #eef7f2;
    color: var(--accent-dark);
    box-shadow: none;
}

.wysiwyg-separator {
    width: 1px;
    min-height: 28px;
    margin: 2px 4px;
    background: #dce6e0;
}

.wysiwyg-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 320px;
    overflow: auto;
    padding: 12px;
    border-bottom: 1px solid #e4ebe6;
    background: #fbfcfb;
}

.wysiwyg-library[hidden] {
    display: none;
}

.wysiwyg-library button {
    display: grid;
    grid-template-rows: 92px auto auto;
    gap: 6px;
    min-height: 0;
    padding: 8px;
    border: 1px solid #dbe5df;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    box-shadow: none;
}

.wysiwyg-library button:hover {
    transform: none;
    border-color: rgba(8,124,102,.42);
    box-shadow: 0 10px 22px rgba(19,35,29,.08);
}

.wysiwyg-library img {
    width: 100%;
    height: 92px;
    border-radius: 6px;
    object-fit: cover;
}

.wysiwyg-library span {
    overflow: hidden;
    color: #20362d;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wysiwyg-library small {
    color: var(--muted);
    font-size: 11px;
}

.wysiwyg-editor {
    min-height: 260px;
    padding: 18px;
    color: var(--ink);
    font: inherit;
    line-height: 1.75;
    outline: none;
}

.wysiwyg-source-editor {
    width: 100%;
    min-height: 320px;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: #121915;
    color: #e8f2ec;
    font: 13px/1.65 Consolas, Monaco, monospace;
    outline: none;
    resize: vertical;
}

.wysiwyg-source-editor[hidden] {
    display: none;
}

.wysiwyg-editor:focus {
    box-shadow: inset 0 0 0 3px rgba(8,124,102,.1);
}

.wysiwyg-editor h2,
.wysiwyg-editor h3,
.rich-text h2,
.rich-text h3 {
    margin: 1.2em 0 .45em;
    line-height: 1.25;
}

.wysiwyg-editor p,
.rich-text p {
    margin: 0 0 1em;
}

.wysiwyg-editor blockquote,
.rich-text blockquote {
    margin: 1.2em 0;
    padding: 12px 16px;
    border-left: 4px solid var(--accent);
    background: #eef7f2;
    border-radius: 0 8px 8px 0;
}

.wysiwyg-editor ul,
.wysiwyg-editor ol,
.rich-text ul,
.rich-text ol {
    margin: 0 0 1em;
    padding-inline-start: 1.35em;
}

.wysiwyg-editor figure,
.rich-text figure {
    margin: 1.4em 0;
}

.wysiwyg-editor figure[data-size="25"],
.rich-text figure[data-size="25"] {
    max-width: 25%;
}

.wysiwyg-editor figure[data-size="50"],
.rich-text figure[data-size="50"] {
    max-width: 50%;
}

.wysiwyg-editor figure[data-size="75"],
.rich-text figure[data-size="75"] {
    max-width: 75%;
}

.wysiwyg-editor figure[data-size="100"],
.rich-text figure[data-size="100"] {
    max-width: 100%;
}

.wysiwyg-editor figure.is-selected {
    outline: 3px solid rgba(8,124,102,.26);
    outline-offset: 4px;
}

.wysiwyg-editor figure[data-align="center"],
.rich-text figure[data-align="center"],
.wysiwyg-editor figure[data-size]:not([data-align]),
.rich-text figure[data-size]:not([data-align]) {
    margin-inline: auto;
}

.wysiwyg-editor figure[data-align="left"],
.rich-text figure[data-align="left"] {
    margin-right: auto;
    margin-left: 0;
}

.wysiwyg-editor figure[data-align="right"],
.rich-text figure[data-align="right"] {
    margin-right: 0;
    margin-left: auto;
}

.wysiwyg-editor figure[data-align="wrap-left"],
.rich-text figure[data-align="wrap-left"] {
    float: left;
    clear: left;
    margin: .35em 1.35em 1em 0;
}

.wysiwyg-editor figure[data-align="wrap-right"],
.rich-text figure[data-align="wrap-right"] {
    float: right;
    clear: right;
    margin: .35em 0 1em 1.35em;
}

.wysiwyg-editor::after,
.rich-text::after {
    display: table;
    clear: both;
    content: "";
}

.wysiwyg-editor img,
.rich-text img,
.wysiwyg-editor video,
.rich-text video {
    width: 100%;
    max-height: 560px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(19,35,29,.1);
}

.wysiwyg-editor video,
.rich-text video {
    display: block;
    background: #111;
}

.wysiwyg-editor figcaption,
.rich-text figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.rich-text a {
    color: var(--accent-dark);
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 700px) {
    .wysiwyg-editor figure[data-size],
    .rich-text figure[data-size] {
        float: none;
        max-width: 100%;
        margin-inline: 0;
    }
}

.admin-field input:focus,
.admin-field textarea:focus {
    outline: none;
    border-color: rgba(8,124,102,.64);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8,124,102,.1);
}

.admin-field-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fbfcfb;
}

.admin-field-check label {
    order: 2;
}

.admin-field-check input {
    order: 1;
    width: 18px;
    height: 18px;
    min-height: auto;
    accent-color: var(--accent);
}

.admin-field .help-text,
.admin-field .form-text,
.admin-field > div[id$="_help"],
.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.homepage-preview {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fbfcfb;
}

.entity-image-preview {
    margin-bottom: 18px;
}

.upload-field input[type="file"] {
    display: block;
    padding: 10px;
    cursor: pointer;
}

.homepage-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
    background: #eef2ef;
}

.homepage-preview span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.homepage-preview strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.locale-editor {
    display: grid;
    grid-column: 1 / -1;
    gap: 14px;
    margin: 0;
    padding: 16px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fff;
}

.locale-editor legend {
    padding: 0 8px;
    color: var(--accent-dark);
    font-weight: 900;
}

.locale-editor.is-rtl {
    text-align: right;
}

.admin-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.82), #fff 42%);
}

.admin-submit-bar a {
    margin-top: 0;
}

@media (max-width: 980px) {
    .admin-hero-panel,
    .admin-editor-layout {
        grid-template-columns: 1fr;
    }

    .admin-quick-actions {
        justify-content: flex-start;
    }

    .admin-editor-aside {
        position: static;
    }

    .admin-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 640px) {
    .admin-workspace,
    .admin-editor-layout {
        padding-inline: 12px;
    }

    .admin-hero-panel,
    .admin-content-section,
    .admin-editor-aside,
    .admin-editor-panel {
        padding: 16px;
    }

    .admin-item,
    .admin-form-grid,
    .admin-card-grid,
    .homepage-preview {
        grid-template-columns: 1fr;
    }

    .admin-item-actions {
        justify-content: flex-start;
    }

    .admin-submit-bar {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .admin-submit-bar button,
    .admin-submit-bar a {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive hardening for public pages and CMS editorial content. */
.site-header,
.admin-header,
.section,
.article-body,
footer,
.news-board article,
.content-card,
.social-card,
.organization-card,
.admin-item,
.admin-editor-panel,
.admin-content-section {
    min-width: 0;
}

.brand,
.section-heading,
.content-card h3,
.social-card h3,
.organization-card h3,
.news-board h3,
.rich-text,
.rich-text p,
.admin-item h3,
.admin-item p {
    overflow-wrap: anywhere;
}

.site-header nav,
.admin-header nav,
.footer-links {
    min-width: 0;
}

@media (max-width: 1100px) {
    .news-board {
        grid-template-columns: 1fr 1fr;
    }

    .news-board article:first-child {
        grid-row: auto;
    }

    .gallery-strip,
    .gallery-grid,
    .social-grid,
    .team-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gallery-feature,
    html[dir="rtl"] .gallery-feature {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .gallery-feature-image,
    html[dir="rtl"] .gallery-feature-content {
        grid-column: auto;
        grid-row: auto;
    }

    .gallery-feature-image,
    html[dir="rtl"] .gallery-feature-image {
        border-radius: 8px 8px 0 0;
    }

    .gallery-feature-content,
    html[dir="rtl"] .gallery-feature-content {
        border: 1px solid var(--line);
        border-top: 0;
        border-radius: 0 0 8px 8px;
    }

    .gallery-hero,
    html[dir="rtl"] .gallery-hero {
        grid-template-columns: 1fr;
        min-height: 66vh;
    }

    html[dir="rtl"] .gallery-hero-content,
    html[dir="rtl"] .gallery-hero-panel {
        grid-column: auto;
    }

    .gallery-hero-panel {
        max-width: 520px;
    }

    .gallery-photo,
    .gallery-photo:nth-child(5n + 2),
    .gallery-photo:nth-child(5n + 4),
    .gallery-photo:nth-child(7n + 3) {
        grid-column: span 6;
    }

    .gallery-photo.is-featured {
        grid-column: 1 / -1;
    }

    .gallery-pro-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .site-header {
        position: sticky;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 18px;
        background: var(--ink);
    }

    .site-header nav,
    .admin-header nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .site-header nav a,
    .admin-header nav a,
    .footer-links a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .locale-switch {
        flex: 0 0 auto;
        margin-inline-start: 0;
    }

    .hero {
        min-height: 72svh;
        padding: 78px 18px 74px;
        background-position: center;
    }

    .hero-content {
        width: 100%;
    }

    .hero h1 {
        font-size: clamp(34px, 10vw, 52px);
        line-height: 1.08;
    }

    html[dir="rtl"] .hero h1 {
        font-size: clamp(30px, 9vw, 46px);
    }

    .hero p:not(.eyebrow) {
        max-width: 100%;
        margin-top: 18px;
        font-size: 16px;
    }

    .hero-actions,
    html[dir="rtl"] .hero-actions {
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        max-width: 360px;
    }

    .hero-actions .button {
        width: 100%;
    }

    .facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-inline: 18px;
    }

    .section {
        padding: 62px 18px;
    }

    .section-heading {
        max-width: 100%;
    }

    .page-grid,
    .organization-grid,
    .news-board {
        grid-template-columns: 1fr;
    }

    .gallery-strip,
    .gallery-grid,
    .social-grid,
    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-intro {
        grid-template-columns: 1fr;
        padding-top: 54px;
    }

    .gallery-intro-copy p:not(.eyebrow) {
        font-size: 16px;
    }

    .gallery-stat {
        place-items: start;
        min-height: auto;
    }

    .gallery-feature {
        padding-bottom: 34px;
    }

    .gallery-feature-image,
    .gallery-feature-image img {
        min-height: 0;
    }

    .gallery-feature-image img {
        aspect-ratio: 16 / 10;
    }

    .gallery-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery-section-head > span {
        width: fit-content;
    }

    .gallery-hero {
        min-height: auto;
        padding: 78px 18px 46px;
    }

    .gallery-hero h1 {
        font-size: 42px;
    }

    .gallery-hero-content p:not(.eyebrow) {
        font-size: 16px;
    }

    .gallery-showcase {
        padding-top: 42px;
    }

    .gallery-toolbar,
    html[dir="rtl"] .gallery-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery-toolbar > span {
        width: fit-content;
    }

    .gallery-photo,
    .gallery-photo:nth-child(5n + 2),
    .gallery-photo:nth-child(5n + 4),
    .gallery-photo:nth-child(7n + 3),
    .gallery-photo.is-featured {
        grid-column: 1 / -1;
    }

    .gallery-photo img,
    .gallery-photo.is-featured img {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .gallery-lightbox {
        padding: 12px;
    }

    .gallery-lightbox-frame {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        gap: 10px;
        max-height: calc(100vh - 24px);
    }

    .gallery-lightbox-frame img {
        grid-column: 1 / -1;
        grid-row: 2;
        max-height: calc(100vh - 220px);
    }

    .gallery-lightbox-arrow {
        grid-row: 3;
        width: 100%;
        min-height: 46px;
        font-size: 30px;
    }

    .gallery-lightbox-caption {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    .organization-card {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .article-body {
        margin-top: 30px;
        padding-inline: 18px;
    }

    .article-hero {
        max-height: 360px;
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    html[lang="ar"] body {
        font-size: 16px;
    }

    .site-header nav,
    .admin-header nav {
        margin-inline: -4px;
    }

    .site-header nav a,
    .admin-header nav a,
    .footer-links a {
        padding: 7px 9px;
        font-size: 12px;
    }

    .hero {
        min-height: auto;
        padding-block: 58px 72px;
    }

    .hero h1 {
        font-size: clamp(31px, 11vw, 42px);
    }

    .facts,
    .gallery-strip,
    .gallery-grid,
    .social-grid,
    .admin-kpis {
        grid-template-columns: 1fr;
    }

    .gallery-pro-grid {
        grid-template-columns: 1fr;
    }

    .gallery-masonry {
        gap: 14px;
    }

    .gallery-hero-panel {
        padding: 14px;
    }

    .gallery-hero-content,
    .gallery-hero-panel,
    .gallery-toolbar {
        max-width: calc(100vw - 36px);
    }

    .gallery-hero-panel {
        width: 100%;
        box-sizing: border-box;
    }

    .gallery-hero h1 {
        max-width: 18ch;
        font-size: 30px;
        line-height: 1.08;
        text-wrap: auto;
    }

    .gallery-toolbar h2 {
        max-width: 16ch;
        font-size: 27px;
    }

    .gallery-hero-content p:not(.eyebrow) {
        max-width: 31ch;
        font-size: 15px;
    }

    .gallery-photo figcaption {
        padding: 14px;
    }

    .facts div {
        padding: 18px;
    }

    .section h1,
    .section h2,
    .article-body h1 {
        font-size: clamp(27px, 9vw, 36px);
    }

    .gallery-toolbar h2 {
        max-width: 13ch;
        font-size: 27px;
        line-height: 1.12;
        text-wrap: auto;
    }

    .content-card img,
    .social-card img,
    .news-board img {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .organization-card {
        grid-template-columns: 1fr;
    }

    .organization-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .news-board article {
        padding: 14px;
    }

    .rich-text figure[data-size],
    .rich-text figure[data-align],
    .wysiwyg-editor figure[data-size],
    .wysiwyg-editor figure[data-align] {
        float: none;
        max-width: 100%;
        margin: 1.2em 0;
    }

    .rich-text img,
    .rich-text video,
    .wysiwyg-editor img,
    .wysiwyg-editor video {
        max-height: none;
    }

    footer {
        padding: 24px 18px;
    }

    .footer-brand,
    .footer-links {
        width: 100%;
        max-width: none;
    }

    .footer-links {
        justify-content: flex-start;
        width: 100%;
    }

    .wysiwyg-media-options,
    .wysiwyg-resize-bar,
    .wysiwyg-toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
        align-items: center;
    }

    .wysiwyg-media-options label,
    .wysiwyg-media-options span,
    .wysiwyg-resize-bar button,
    .wysiwyg-toolbar button {
        flex: 0 0 auto;
    }

}

/* CMS hardening: stable form layouts, previews, and post-submit states. */
.admin-layout > .success,
.admin-layout > .alert,
.admin-flashes,
.admin-form-errors {
    grid-column: 1 / -1;
}

.admin-flashes {
    display: grid;
    gap: 10px;
    margin: 0;
}

.admin-flash,
.admin-form-errors > ul,
.admin-field ul {
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
}

.admin-flash.alert,
.admin-form-errors > ul,
.admin-field ul {
    border: 1px solid #efcaca;
    background: #fff4f2;
    color: #8f1f1f;
}

.admin-form-errors > ul,
.admin-field ul {
    list-style: none;
    font-size: 13px;
    font-weight: 800;
}

.admin-form-grid,
.admin-field,
.wysiwyg,
.wysiwyg-editor,
.wysiwyg-source-editor,
.image-url-preview,
.admin-submit-bar,
.admin-submit-actions {
    min-width: 0;
}

.admin-field {
    align-content: start;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
    max-width: 100%;
}

.admin-field textarea {
    resize: vertical;
}

.admin-choice-grid > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.admin-permissions-field > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px;
}

.admin-permissions-field fieldset > div:not(:has(> input[type="checkbox"])) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px;
}

.admin-choice-grid > div > div {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fff;
}

.admin-permissions-field > div > div:has(> input[type="checkbox"]),
.admin-permissions-field fieldset > div:has(> input[type="checkbox"]),
.admin-permissions-field fieldset > div > div:has(> input[type="checkbox"]) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100%;
}

.admin-choice-grid > div > label,
.admin-permissions-field label {
    min-width: 0;
}

.admin-choice-grid input[type="checkbox"] {
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.admin-permissions-field input[type="checkbox"] {
    order: -1;
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
}

.admin-field label,
.admin-field .help-text,
.admin-field .form-text,
.admin-field > div[id$="_help"],
.field-help,
.image-url-preview strong {
    overflow-wrap: anywhere;
}

.upload-field {
    padding: 14px;
    border: 1px dashed #cdd8d1;
    border-radius: 8px;
    background: #fbfcfb;
}

.upload-field input[type="file"] {
    border-style: dashed;
    background: #fff;
}

.image-url-preview {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fff;
}

.image-url-preview[hidden] {
    display: none;
}

.image-url-preview img {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    object-fit: cover;
    background: #eef2ef;
}

.image-url-preview span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.image-url-preview strong {
    display: block;
    margin-top: 3px;
    color: #20362d;
    font-size: 13px;
}

.admin-submit-bar {
    flex-wrap: wrap;
}

.admin-submit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.admin-submit-actions .button {
    margin: 0;
}

.admin-submit-actions button,
.admin-submit-actions .button {
    min-height: 44px;
}

.admin-submit-actions button[name="_action"][value="save_stay"] {
    border: 1px solid rgba(8,124,102,.28);
    background: #fff;
    color: var(--accent-dark);
    box-shadow: none;
}

.admin-submit-actions button:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.wysiwyg-toolbar button,
.wysiwyg-resize-bar button,
.wysiwyg-header button {
    white-space: nowrap;
}

.admin-section-head,
.admin-item-actions,
.admin-quick-actions {
    min-width: 0;
}

.admin-section-head {
    flex-wrap: wrap;
}

.admin-item-actions a,
.admin-item-actions button,
.admin-quick-actions .button {
    white-space: nowrap;
}

.admin-media-card > div {
    padding: 14px;
}

.admin-media-card .admin-item-actions {
    justify-content: flex-start;
    padding: 0;
    margin-top: 12px;
}

.admin-gallery-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.admin-gallery-summary div {
    padding: 14px;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fbfcfb;
}

.admin-gallery-summary strong {
    display: block;
    color: var(--accent-dark);
    font-size: 28px;
    line-height: 1;
}

.admin-gallery-summary span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.admin-gallery-card {
    display: grid;
    overflow: hidden;
    border: 1px solid #e4ebe6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(19,35,29,.05);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.admin-gallery-card:hover {
    border-color: rgba(8,124,102,.28);
    box-shadow: 0 12px 30px rgba(19,35,29,.08);
    transform: translateY(-1px);
}

.admin-gallery-card.is-featured {
    border-color: rgba(8,124,102,.3);
}

.admin-gallery-card.needs-local-image {
    border-color: #efcaca;
    box-shadow: 0 8px 24px rgba(143,31,31,.06);
}

.admin-gallery-thumb {
    position: relative;
    overflow: hidden;
    background: #eef2ef;
}

.admin-gallery-thumb img {
    display: block;
    width: 100%;
    min-height: 190px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.admin-gallery-thumb .admin-image-placeholder {
    min-height: 190px;
    aspect-ratio: 4 / 3;
}

.admin-gallery-badges {
    position: absolute;
    inset: 10px 10px auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.admin-gallery-order {
    display: inline-flex;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: #20362d;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.5;
}

.admin-gallery-card-body {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.admin-gallery-locales {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-gallery-locales span {
    display: inline-flex;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef2ef;
    color: #44554e;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-gallery-locales .is-ok {
    background: rgba(8,124,102,.12);
    color: var(--accent-dark);
}

.admin-gallery-locales .is-warning {
    background: #fff4f2;
    color: #8f1f1f;
}

.admin-gallery-card h3 {
    margin: 0;
    color: #20362d;
    font-size: 18px;
    line-height: 1.28;
}

.admin-gallery-path,
.admin-gallery-source,
.admin-gallery-credit {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.admin-gallery-path {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}

.admin-gallery-source {
    padding-top: 7px;
    border-top: 1px solid #eef2ef;
}

.admin-gallery-card .admin-item-actions {
    justify-content: flex-start;
    margin-top: 4px;
    padding: 0;
}

.page-media-manager .admin-card-grid {
    align-items: start;
}

@media (max-width: 640px) {
    .team-grid {
        grid-template-columns: 1fr;
    }

    .admin-gallery-summary {
        grid-template-columns: 1fr;
    }

    .image-url-preview {
        grid-template-columns: 1fr;
    }

    .admin-submit-actions,
    .admin-submit-actions button,
    .admin-submit-actions .button {
        width: 100%;
        justify-content: center;
    }

    .admin-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-section-head .button,
    .admin-item-actions,
    .admin-item-actions a,
    .admin-item-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Front card media safety: large source images must never stretch cards. */
.content-card,
.social-card,
.team-card,
.organization-card,
.gallery-card,
.gallery-photo,
.news-board article {
    min-width: 0;
}

.content-card > img,
.social-card > img,
.organization-card > img,
.gallery-card-media > img,
.gallery-strip figure > img,
.gallery-grid figure > img,
.news-board:not(.news-slider) article > img {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    max-height: 280px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    background: #eef2ef;
}

.content-card > img,
.social-card > img,
.gallery-card-media > img,
.gallery-strip figure > img,
.gallery-grid figure > img,
.news-board:not(.news-slider) article > img {
    height: auto;
}

.organization-card > img {
    height: auto;
}

.team-photo {
    max-height: 280px;
}

.team-photo img {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 640px) {
    .content-card > img,
    .social-card > img,
    .organization-card > img,
    .gallery-card-media > img,
    .gallery-strip figure > img,
    .gallery-grid figure > img,
    .news-board:not(.news-slider) article > img,
    .team-photo {
        max-height: 220px;
    }
}
