/* El Bab – base: tokens, fonts, type, buttons, forms, header, footer.
   Layout uses logical properties (inline-start/end) so Arabic RTL mirrors automatically. */

@font-face { font-family: "Libre Baskerville"; src: url("../fonts/libre-baskerville-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/libre-baskerville-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/libre-baskerville-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Noto Naskh Arabic"; src: url("../fonts/noto-naskh-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 400 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Noto Naskh Arabic"; src: url("../fonts/noto-naskh-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }

:root {
    --navy: #142a43;
    --navy-deep: #10233a;
    --navy-soft: #24405f;
    --gold: #b89960;
    --gold-deep: #7d6236;   /* gold for small text on cream (AA contrast) */
    --gold-soft: #e6d8bb;
    --cream: #f5e9d7;   /* soft beige */
    --paper: #faf2e6;
    --white: #faf2e6;   /* card colour, same as --paper (no bright white) */
    --line: #e0cdb0;
    --line-dark: rgba(243, 239, 230, .16);
    --ink: #142a43;
    --muted: #5d6a78;
    --muted-light: #b9c2cc;
    --danger: #a3372b;
    --success: #2f6b4f;

    --serif: "Libre Baskerville", Baskerville, "Times New Roman", serif;
    --sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
    --arabic-serif: "Noto Naskh Arabic", "Geeza Pro", serif;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 18px 50px -24px rgba(16, 35, 58, .35);
    --container: 1240px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --section: clamp(4rem, 9vw, 7.5rem);
    --header-h: 76px;
}

[dir="rtl"] {
    --serif: "Noto Naskh Arabic", "Geeza Pro", serif;
    --sans: "IBM Plex Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.65; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--gold-deep); }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0 0 1rem; font-weight: 400; line-height: 1.12; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100; background: var(--navy); color: var(--cream); padding: .6rem 1rem; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; }
.center { text-align: center; }
.gold { color: var(--gold); }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* Type */
.display-1, .display-2, .display-3, .hero-title { font-family: var(--serif); color: var(--navy); letter-spacing: -.01em; }
.display-1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.display-2 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
.display-3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
[dir="rtl"] .display-1, [dir="rtl"] .display-2, [dir="rtl"] .display-3, [dir="rtl"] .hero-title { letter-spacing: 0; line-height: 1.35; }
.eyebrow { font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; color: var(--navy); margin-bottom: 1.25rem; font-weight: 500; }
.eyebrow-gold { color: var(--gold); }
.eyebrow-sm { font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
[dir="rtl"] .eyebrow, [dir="rtl"] .eyebrow-sm { letter-spacing: 0; font-size: .9rem; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 36rem; }
.fine { font-size: .8rem; color: var(--muted); margin: .75rem 0 0; }
.text-link { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: .15rem; }
.text-link .icon { width: 18px; }

/* Icons */
.icon { width: 22px; height: 22px; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: 54px; padding: .85rem 1.6rem; border-radius: 6px; border: 1px solid transparent; font-size: 1rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.btn .icon { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #c7aa72; color: var(--navy); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--cream); }
.btn-outline-light { border-color: rgba(243, 239, 230, .6); color: var(--cream); }
.btn-outline-light:hover { background: var(--cream); color: var(--navy); }
.btn-ghost { background: var(--cream); color: var(--navy); }
.btn-sm { min-height: 42px; padding: .5rem 1.1rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 1.25rem; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; background: var(--cream); font-size: .8rem; color: var(--navy); white-space: nowrap; }
.chip .icon { width: 16px; height: 16px; }
.chip-gold { background: var(--gold-soft); }

/* Forms */
.form { display: grid; gap: 1.1rem; }
.form-title { font-family: var(--serif); font-size: 1.5rem; margin-bottom: .25rem; }
.field { display: grid; gap: .4rem; }
.field-row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; }
.field label { font-size: .9rem; font-weight: 500; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--white); transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 153, 96, .2); }
.field [aria-invalid="true"] { border-color: var(--danger); }
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.hint { font-size: .8rem; color: var(--muted); }
.field-error, .form-error { color: var(--danger); font-size: .85rem; }
.form-error { padding: .75rem 1rem; border: 1px solid rgba(163, 55, 43, .3); border-radius: 6px; background: rgba(163, 55, 43, .06); margin: 0; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--navy); flex: none; }
.segmented { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.segmented legend { font-size: .9rem; font-weight: 500; margin-bottom: .5rem; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; text-align: center; padding: .8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--white); transition: all .2s; }
.segmented input:checked + span { border-color: var(--navy); background: var(--navy); color: var(--cream); }
.segmented input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.input-affix { display: flex; align-items: stretch; }
.input-affix .affix { display: grid; place-items: center; padding-inline: .9rem; border: 1px solid var(--line); border-inline-end: 0; border-start-start-radius: 6px; border-end-start-radius: 6px; background: var(--cream); font-size: .85rem; color: var(--muted); }
.input-affix input { border-start-start-radius: 0; border-end-start-radius: 0; }
.hp-field { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: .8rem; color: var(--muted); margin: 0; }
.form-note .icon { width: 16px; color: var(--gold); }
.form-success { text-align: center; padding: 2rem 1rem; }
.form-success h3 { font-family: var(--serif); font-size: 1.6rem; }
.success-icon { width: 48px; height: 48px; margin: 0 auto 1rem; color: var(--success); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(245, 233, 215, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: .8rem; color: var(--navy); text-decoration: none; }
.wordmark:hover { color: var(--navy); }
.logo-mark { object-fit: contain; display: block; }
.wordmark .logo-mark { width: 38px; height: 48px; }
.logo-handle { fill: var(--cream); }
.wordmark-text { display: grid; line-height: 1; text-align: center; }
.wordmark-latin { font-family: "Libre Baskerville", Baskerville, serif; font-size: 1.35rem; letter-spacing: .12em; }
.wordmark-arabic { font-family: var(--arabic-serif); font-size: 1.05rem; margin-top: .25rem; }
.main-nav { margin-inline-start: auto; }
.main-nav ul { display: flex; gap: clamp(1rem, 2vw, 2rem); }
.main-nav a { text-decoration: none; font-size: .95rem; padding-block: .4rem; border-bottom: 1px solid transparent; }
.main-nav a[aria-current="page"], .main-nav a:hover { border-color: var(--gold); color: var(--navy); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.lang-switch { position: relative; }
.lang-switch summary { display: flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none; font-size: .9rem; padding: .5rem; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch .icon { width: 20px; }
.lang-menu { position: absolute; inset-inline-end: 0; top: 100%; min-width: 10rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem; }
.lang-menu a { display: block; padding: .55rem .8rem; border-radius: 6px; text-decoration: none; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--cream); }
.header-login { font-size: .95rem; text-decoration: none; white-space: nowrap; }
.header-login:hover { color: var(--gold-deep); }
.nav-toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--navy); }
.nav-toggle-close { display: none; }

@media (max-width: 1080px) {
    .nav-toggle { display: inline-flex; }
    .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--cream); border-bottom: 1px solid var(--line); padding: 1rem var(--gutter) 1.5rem; display: none; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav a { display: block; padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
    .nav-open .main-nav { display: block; }
    .nav-open .nav-toggle-open { display: none; }
    .nav-open .nav-toggle-close { display: inline; }
    .header-actions { margin-inline-start: auto; }
}
@media (max-width: 560px) {
    :root { --header-h: 66px; }
    .header-cta { display: none; }
    .wordmark .logo-mark { width: 30px; height: 38px; }
    .wordmark-latin { font-size: 1.15rem; }
}

/* Footer */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding-top: 4rem; font-size: .95rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; padding-bottom: 3rem; }
.footer-brand p { color: var(--muted); max-width: 20rem; margin-top: 1.25rem; }
.site-footer h2 { font-family: var(--sans); font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; font-weight: 500; }
[dir="rtl"] .site-footer h2 { letter-spacing: 0; font-size: .9rem; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { text-decoration: none; }
.social { display: flex; gap: .6rem; }
.social a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; }
.social a:hover { border-color: var(--gold); }
.social .icon { width: 19px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer-bottom p { margin: 0; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-bottom a, .footer-bottom .link-button { color: var(--muted); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

.app-badges { display: flex; flex-wrap: wrap; gap: .6rem; }
.app-badge { display: inline-flex; align-items: center; gap: .6rem; min-width: 10.5rem; padding: .55rem 1rem; border-radius: 8px; background: var(--navy); color: var(--cream); text-decoration: none; line-height: 1.15; font-weight: 500; }
.app-badge:hover { color: var(--cream); background: var(--navy-soft); }
.app-badge small { display: block; font-size: .68rem; font-weight: 400; opacity: .75; }
.app-badge .icon { width: 24px; height: 24px; }
.app-badge.is-soon { opacity: .75; cursor: default; }

/* Cookie banner */
.cookie-banner { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 80; display: flex; justify-content: center; }
.cookie-inner { max-width: 54rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding: 1.1rem 1.4rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); font-size: .9rem; }
.cookie-inner p { margin: 0; flex: 1 1 22rem; }
.cookie-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
