/* Al Mihrab — public site. Logical properties are used throughout so RTL/LTR need no overrides. */
:root {
    --navy: #182440;
    --navy-deep: #0f1830;
    --navy-2: #243562;
    --gold: #d8ac28;
    --gold-deep: #8f6b00;
    --gold-soft: #faf3db;
    --mist: #f4f5f9;
    --line: #e2e5ee;
    --muted: #5a6479;
    --font-ar: 'Cairo', system-ui, sans-serif;
    --font-en: 'Montserrat', 'Cairo', system-ui, sans-serif;
    --header-h: 84px;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-ar);
    font-size: 1.0625rem;
    line-height: 1.9;
    color: var(--navy);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}
html[lang='en'] body { font-family: var(--font-en); line-height: 1.7; font-size: 1rem; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.35; color: var(--navy); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--gold); color: var(--navy); padding: .5rem 1rem; z-index: 2000; border-radius: 4px; }
.skip-link:focus { top: 1rem; }
section[id] { scroll-margin-top: calc(var(--header-h) - 8px); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 4px; padding: .6rem 1.4rem; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-gold:hover, .btn-gold:focus { background: #e6bb3a; border-color: #e6bb3a; color: var(--navy); }
.btn-outline-light:hover { color: var(--navy); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid var(--line); }
.site-header .navbar { min-height: var(--header-h); padding-block: .25rem; }
.navbar-brand img { height: 64px; width: auto; display: block; }
.navbar-toggler { border: 0; font-size: 2rem; color: var(--navy); line-height: 1; padding: .25rem .5rem; }
.navbar-toggler:focus { box-shadow: none; }
.nav-link { color: var(--navy); font-weight: 600; font-size: .95rem; padding: .5rem .8rem !important; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--gold-deep); }
.nav-link.active { color: var(--navy); border-bottom-color: var(--gold); }
.nav-no { font-family: var(--font-en); font-weight: 500; font-size: .7rem; color: var(--gold-deep); margin-inline-end: .4rem; }
.nav-tools { display: flex; align-items: center; gap: 1rem; }
.lang-switch { text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--navy); white-space: nowrap; }
.lang-switch:hover { color: var(--gold-deep); }

@media (max-width: 1399.98px) {
    .offcanvas { background: var(--navy); color: #fff; width: min(88vw, 340px); }
    .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.12); }
    .offcanvas .nav-link { color: #fff; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.1); padding: .85rem .25rem !important; }
    .offcanvas .nav-link.active { border-bottom-color: var(--gold); color: var(--gold); }
    .offcanvas .nav-no { color: var(--gold); }
    .offcanvas .lang-switch { color: #fff; }
    .nav-tools { margin-top: 1.5rem; flex-wrap: wrap; }
}
@media (min-width: 1400px) {
    .nav-no { display: none; }
    .nav-link { white-space: normal; text-align: center; line-height: 1.35; font-size: .88rem; max-width: 8.5rem; padding: .35rem .5rem !important; }
    .navbar-nav { gap: .1rem; align-items: center; }
    .offcanvas { position: static; visibility: visible !important; transform: none !important; background: transparent; border: 0; flex-grow: 1; width: auto; }
    .offcanvas-header { display: none; }
    .offcanvas-body { display: flex; align-items: center; padding: 0; overflow: visible; }
}

/* ---------- Hero: the mihrab arch is the one big gesture ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(120% 90% at 85% 0%, var(--navy-2) 0%, var(--navy) 55%, var(--navy-deep) 100%);
    padding-top: clamp(3rem, 7vw, 5.5rem);
}
.hero::before {
    content: ''; position: absolute; inset: 0; opacity: .9; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23D8AC28' stroke-opacity='.13' stroke-width='1'%3E%3Crect x='16' y='16' width='48' height='48'/%3E%3Cpath d='M40 3l37 37-37 37L3 40z'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
            mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero .container { position: relative; }
.hero-copy { padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 700; line-height: 1.3; max-width: 16ch; letter-spacing: 0; }
html[lang='en'] .hero h1 { line-height: 1.2; max-width: 18ch; }
.hero-lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: rgba(255,255,255,.82); max-width: 52ch; margin: 1.25rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-arch { position: relative; width: min(380px, 78vw); aspect-ratio: 400 / 560; margin-top: 1rem; }
.arch-fill {
    position: absolute; inset: 0; clip-path: url(#mihrab-arch); display: grid; place-items: center;
    background: radial-gradient(60% 45% at 50% 55%, rgba(216,172,40,.22), rgba(216,172,40,0) 70%), rgba(255,255,255,.05);
}
.arch-emblem { width: 46%; height: auto; margin-top: 18%; }
.arch-photo { width: 100%; height: 100%; object-fit: cover; }
.arch-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.arch-outer { stroke: var(--gold); stroke-width: 3; stroke-linejoin: round; }
.arch-inner { stroke: var(--gold); stroke-opacity: .45; stroke-width: 1.5; }
@media (prefers-reduced-motion: no-preference) {
    .arch-outer, .arch-inner { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s .15s cubic-bezier(.5,0,.2,1) forwards; }
    .arch-inner { animation-delay: .5s; }
    .arch-fill { animation: fadein 1.4s .6s both; }
    @keyframes draw { to { stroke-dashoffset: 0; } }
    @keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--mist { background: var(--mist); }
.section--soft { background: var(--gold-soft); }
.section--dark { background: var(--navy); color: rgba(255,255,255,.85); }
.section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }

.sec-head { margin-bottom: 1.75rem; }
.sec-no { display: flex; align-items: center; gap: .75rem; font-family: var(--font-en); font-weight: 500; font-size: .95rem; color: var(--gold-deep); letter-spacing: .08em; margin-bottom: .5rem; }
.sec-no::after { content: ''; width: 3.5rem; height: 1px; background: currentColor; }
.section--dark .sec-no { color: var(--gold); }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0; }
.sec-sub { margin: .75rem 0 0; font-size: 1.1rem; color: var(--muted); }
.section--dark .sec-sub { color: rgba(255,255,255,.7); }
.prose p { margin-bottom: 1.1rem; max-width: 62ch; }
.prose--lead p { font-size: 1.08rem; color: var(--muted); margin: 0; }
.section--dark .prose--lead p { color: rgba(255,255,255,.75); }
.intro-sticky { top: calc(var(--header-h) + 1.5rem); }
.intro-img, .generic-img { width: 100%; border-radius: 6px; margin-top: 1.5rem; }

/* About: arch picture frame */
.arch-frame { width: min(360px, 80vw); aspect-ratio: 400 / 560; clip-path: url(#mihrab-arch); background: var(--gold-soft); display: grid; place-items: center; }
.arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.arch-frame img.emblem { width: 52%; height: auto; margin-top: 18%; }

/* Small arch icon holder, repeated across cards */
.arch-icon { flex: none; width: 54px; height: 64px; clip-path: url(#mihrab-arch); background: var(--navy); color: var(--gold); display: grid; place-items: end center; padding-bottom: 12px; font-size: 1.35rem; }

/* Vision / mission */
.panel { height: 100%; padding: clamp(1.75rem, 4vw, 2.75rem); border-radius: 6px; }
.panel h3 { font-size: 1.6rem; margin: 1.1rem 0 .6rem; }
.panel p { margin: 0; font-size: 1.1rem; max-width: 52ch; }
.panel--navy { background: var(--navy); color: rgba(255,255,255,.88); }
.panel--navy h3 { color: #fff; }
.panel--gold { background: var(--gold); color: var(--navy); }
.panel--gold .arch-icon { background: var(--navy); }
.values-title { font-size: 1.25rem; margin-bottom: 1.25rem; }
.value { height: 100%; padding: 1.25rem 1.1rem; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 4px; }
.value i { font-size: 1.5rem; color: var(--gold-deep); }
.value h4 { font-size: 1.05rem; margin: .5rem 0 .25rem; }
.value p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.7; }

/* Fields: ruled rows, like a table of contents */
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li { display: flex; gap: 1.25rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.row-list li:first-child { border-top: 1px solid var(--line); }
.row-icon { font-size: 1.8rem; color: var(--gold-deep); flex: none; width: 2.5rem; }
.row-list h3 { font-size: 1.2rem; margin: 0 0 .15rem; }
.row-list p { margin: 0; color: var(--muted); }

/* Service cards */
.card-item { height: 100%; display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; transition: border-color .2s, transform .2s; }
.card-item:hover { border-color: var(--gold); transform: translateY(-2px); }
.card-item h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
.card-item p { margin: 0; color: var(--muted); font-size: .98rem; line-height: 1.75; }
.card-item--grid { flex-direction: column; }
.card-photo { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 4px; }
.card-item--dark { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); }
.card-item--dark .arch-icon { background: var(--gold); color: var(--navy); }
.card-item--dark p { color: rgba(255,255,255,.72); }
.section--dark .card-item { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); }
.section--dark .card-item .arch-icon { background: var(--gold); color: var(--navy); }
.section--dark .card-item p { color: rgba(255,255,255,.72); }
.card-item--tiles .arch-icon { background: var(--gold-soft); color: var(--navy); }

/* Projects & HR: stacked items with an inline-start accent */
.stack { display: grid; gap: 1rem; }
.stack-item { display: flex; gap: 1.1rem; padding: 1.25rem 1.5rem; background: var(--mist); border-inline-start: 4px solid var(--gold); border-radius: 4px; }
.stack-item i { font-size: 1.6rem; color: var(--navy); }
.stack-item h3 { font-size: 1.1rem; margin: 0 0 .2rem; }
.stack-item p { margin: 0; color: var(--muted); }

/* Sectors: arch tiles */
.sector { text-align: center; }
.sector-arch { width: min(150px, 100%); aspect-ratio: 5 / 6; margin: 0 auto 1rem; clip-path: url(#mihrab-arch); background: var(--navy); color: var(--gold); display: grid; place-items: end center; padding-bottom: 20%; font-size: 2.2rem; transition: background .2s; }
.sector:hover .sector-arch { background: var(--navy-2); }
.sector-arch img { width: 100%; height: 100%; object-fit: cover; align-self: stretch; }
.sector h3 { font-size: 1.1rem; margin: 0 0 .25rem; }
.sector p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.7; }

/* Why: open columns separated by hairlines */
.reasons .col-md-6, .reasons .col-xl-4 { border-bottom: 1px solid rgba(24,36,64,.14); }
.reason { padding: 2rem 1.75rem; height: 100%; }
.reason i { font-size: 1.9rem; color: var(--gold-deep); }
.reason h3 { font-size: 1.2rem; margin: .6rem 0 .35rem; }
.reason p { margin: 0; color: #3f4a63; }
@media (min-width: 1200px) { .reasons .col-xl-4:not(:nth-child(3n)) { border-inline-end: 1px solid rgba(24,36,64,.14); } .reasons .col-xl-4:nth-last-child(-n+3) { border-bottom: 0; } }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .85rem; }
.contact-list li { display: flex; gap: .75rem; align-items: flex-start; }
.contact-list i { color: var(--gold); margin-top: .2rem; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--gold); }
.contact-form { background: #fff; color: var(--navy); border-radius: 6px; padding: clamp(1.25rem, 3vw, 2.25rem); }
.contact-form label { font-weight: 600; font-size: .95rem; margin-bottom: .25rem; }
.contact-form .form-control { border-color: #cfd4e1; border-radius: 4px; padding: .6rem .8rem; }
.contact-form .form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 .2rem rgba(216,172,40,.35); }
.contact-form .form-control.is-invalid { border-color: #c0392b; }
.field-error { color: #b02a1f; font-size: .85rem; min-height: 0; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,.75); padding-top: clamp(3rem, 6vw, 4.5rem); }
.footer-logo { height: 96px; width: auto; margin-bottom: 1rem; }
.footer-about { max-width: 38ch; }
.footer-title { font-size: 1rem; color: var(--gold); margin-bottom: 1.1rem; font-weight: 600; }
.social { display: flex; gap: .6rem; margin-top: 1rem; }
.social a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; text-decoration: none; color: #fff; }
.social a:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; text-decoration: none; color: rgba(255,255,255,.85); }
.toc a:hover { color: var(--gold); }
.toc-rule { flex: 1; border-bottom: 1px dashed rgba(255,255,255,.2); transform: translateY(2px); }
.toc-no { font-family: var(--font-en); font-weight: 500; font-size: .9rem; color: var(--gold); }
.site-footer .contact-list { margin-top: 0; }
.footer-bottom { margin-top: 3rem; padding-block: 1.25rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; }
.wa-float { position: fixed; inset-inline-end: 1.1rem; bottom: 1.1rem; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; font-size: 1.7rem; z-index: 1020; box-shadow: 0 4px 14px rgba(0,0,0,.25); text-decoration: none; }

@media (max-width: 575.98px) {
    .navbar-brand img { height: 54px; }
    .card-item { padding: 1.15rem; }
    .row-list li { gap: .9rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card-item { transition: none; } }

.panel--navy .arch-icon { background: var(--gold); color: var(--navy); }
.nav-tools .btn { white-space: nowrap; }

/* Wide gutters only where the container has room for them (avoids horizontal scroll on phones) */
@media (max-width: 991.98px) { .row.g-5 { --bs-gutter-x: 1.5rem; } }
html, body { overflow-x: clip; }
