/* =========================================================================
   Al-Aqeed Engineering Group — site stylesheet (Arabic, RTL)
   -------------------------------------------------------------------------
   1. Design tokens          7. Services cards
   2. Base & accessibility   8. About
   3. Buttons                9. Portfolio
   4. Header: top bar       10. CNC banner
   5. Header: main nav      11. Features bar
   6. Hero                  12. Footer, floating WhatsApp
                            13. Lightbox, reveal animations, inner pages
   ========================================================================= */

/* 1. Design tokens ------------------------------------------------------- */
:root {
    --c-dark: #28170F;
    --c-brown: #3B2418;
    --c-wood: #704321;
    --c-gold: #C58A45;
    --c-gold-light: #E9B878;
    --c-cream: #F6E9D9;
    --c-ivory: #FDF5EC;
    --c-text: #24170F;
    --c-white: #FFFFFF;
    --c-whatsapp: #25D366;

    --grad-gold: linear-gradient(135deg, #F3CF95 0%, #C58A45 55%, #9A6430 100%);
    --grad-gold-text: linear-gradient(180deg, #F6D7A2 0%, #E0A962 45%, #B27536 100%);

    --font-head: "Cairo", "Tajawal", system-ui, sans-serif;
    --font-body: "Tajawal", "Cairo", system-ui, sans-serif;

    --radius: 10px;
    --header-h: 84px;
    --header-h-scrolled: 70px;
    --topbar-h: 38px;
    --shadow-soft: 0 10px 30px rgba(40, 23, 15, .14);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* 2. Base & accessibility ------------------------------------------------ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h-scrolled) + 12px);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--c-text);
    background: var(--c-ivory);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--font-head); }

img { max-width: 100%; }

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

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

:focus-visible {
    outline: 2px solid var(--c-gold-light);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    top: -60px;
    z-index: 3000;
    padding: .6rem 1rem;
    background: var(--c-gold);
    color: var(--c-dark);
    border-radius: 6px;
    font-weight: 700;
    transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.text-gold {
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-eyebrow {
    margin: 0 0 .25rem;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--c-gold);
}

/* 3. Buttons ------------------------------------------------------------- */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .7rem 1.6rem;
    border: 1px solid rgba(255, 228, 185, .55);
    border-radius: 999px;
    background: var(--grad-gold);
    color: var(--c-dark);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(197, 138, 69, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s;
}
.btn-gold:hover,
.btn-gold:focus-visible {
    color: var(--c-dark);
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 12px 28px rgba(197, 138, 69, .45), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn-gold i { transition: transform .25s var(--ease); }
.btn-gold:hover i.fa-arrow-left { transform: translateX(-4px); }

.btn-gold--lg {
    padding: .95rem 2.2rem;
    font-size: 1.15rem;
}

/* 4. Header: top bar ----------------------------------------------------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    color: var(--c-cream);
}
/* Background on a pseudo-element: a backdrop-filter on the header itself
   would break the fixed-position mobile menu inside it. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(20, 11, 6, .82) 0%, rgba(20, 11, 6, .45) 65%, rgba(20, 11, 6, 0) 100%);
    transition: background-color .35s, box-shadow .35s;
}
.site-header.is-scrolled::before {
    background: rgba(40, 23, 15, .96) url("../images/textures/dark-wood-lite.jpg") center / cover;
    background-blend-mode: multiply;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
    border-bottom: 1px solid rgba(233, 184, 120, .18);
}

.topbar {
    max-height: var(--topbar-h);
    overflow: hidden;
    font-size: .85rem;
    border-bottom: 1px solid rgba(233, 184, 120, .16);
    transition: max-height .35s var(--ease), opacity .3s;
}
.site-header.is-scrolled .topbar {
    max-height: 0;
    opacity: 0;
    border-bottom-color: transparent;
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--topbar-h);
}

.topbar__slogan {
    margin: 0;
    color: var(--c-gold-light);
    font-weight: 500;
}

.topbar__contact {
    display: flex;
    gap: 1.5rem;
    margin-inline-start: auto;
}
.topbar__contact li { display: flex; align-items: center; gap: .45rem; }
.topbar__contact i { color: var(--c-gold); font-size: .8rem; }
.topbar__contact a:hover { color: var(--c-gold-light); }

.social-links { display: flex; gap: .6rem; }
.social-links a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--grad-gold);
    color: var(--c-dark);
    font-size: .95rem;
    transition: transform .25s var(--ease), filter .25s;
}
.social-links a:hover { transform: translateY(-2px); filter: brightness(1.1); color: var(--c-dark); }
.social-links--sm a { width: 24px; height: 24px; font-size: .72rem; }

/* 5. Header: main nav ---------------------------------------------------- */
.navbar-main__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--header-h);
    transition: height .35s var(--ease);
}
.site-header.is-scrolled .navbar-main__inner { height: var(--header-h-scrolled); }

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-shrink: 0;
}
/* Fixed height, natural width: the main logo (5:4) stays 60×48, a wider logo (e.g. the CNC
   logo) gets the width its shape needs instead of being squeezed. */
.brand__logo {
    width: auto;
    height: 48px;
    max-width: 110px;
    object-fit: contain;
    transition: height .35s var(--ease);
}
.site-header.is-scrolled .brand__logo { height: 40px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.2rem;
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand__name-en {
    font-family: var(--font-head);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--c-cream);
    opacity: .85;
}

.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav__list { display: flex; align-items: center; gap: .25rem; }
.main-nav__list > li { position: relative; }

.main-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem .9rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .98rem;
    color: var(--c-cream);
    white-space: nowrap;
    transition: color .25s;
}
.main-nav__link::after {
    content: "";
    position: absolute;
    inset-inline: .9rem;
    bottom: .15rem;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-gold);
    transform: scaleX(0);
    transition: transform .3s var(--ease);
}
.main-nav__link:hover,
.main-nav__link.is-active { color: var(--c-gold-light); }
.main-nav__link:hover::after,
.main-nav__link.is-active::after { transform: scaleX(1); }
.main-nav__caret { font-size: .65rem; transition: transform .25s; }

.main-nav__dropdown {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 210px;
    padding: .5rem;
    border: 1px solid rgba(233, 184, 120, .25);
    border-radius: var(--radius);
    background: rgba(40, 23, 15, .97);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
}
.main-nav__dropdown a {
    display: block;
    padding: .55rem .8rem;
    border-radius: 6px;
    font-size: .95rem;
    color: var(--c-cream);
    transition: background .2s, color .2s, padding .2s;
}
.main-nav__dropdown a:hover {
    background: rgba(197, 138, 69, .16);
    color: var(--c-gold-light);
    padding-inline-start: 1.1rem;
}
@media (min-width: 992px) {
    .main-nav__item--dropdown:hover .main-nav__dropdown,
    .main-nav__item--dropdown:focus-within .main-nav__dropdown {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .main-nav__item--dropdown:hover .main-nav__caret { transform: rotate(180deg); }
}

.header-cta { padding: .55rem 1.3rem; font-size: .9rem; }
.main-nav__mobile-cta { display: none; }
@keyframes navDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* Parts of the phone menu that do not exist on computers. */
.main-nav__head, .main-nav__foot, .main-nav__icon, .main-nav__sub-toggle { display: none; }
.main-nav__row { display: contents; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    margin-inline-start: auto;
    padding: 0 11px;
    border: 1px solid rgba(233, 184, 120, .45);
    border-radius: 10px;
    background: rgba(40, 23, 15, .5);
    cursor: pointer;
}
.nav-toggle__bar {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--c-gold-light);
    transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(10, 5, 2, .6);
}

@media (max-width: 1199.98px) {
    .main-nav__link { padding-inline: .6rem; font-size: .92rem; }
    .main-nav__link::after { inset-inline: .6rem; }
    .header-cta { display: none; }
}

@media (max-width: 991.98px) {
    .nav-toggle { display: flex; position: relative; z-index: 1002; }

    /* The phone menu: a floating panel of dark wood framed in gold, sliding in from the right. */
    .main-nav {
        position: fixed;
        top: .6rem;
        bottom: .6rem;
        inset-inline-start: .6rem;
        z-index: 1001;
        width: min(310px, calc(100vw - 5.5rem));   /* leaves room for the close button beside it */
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        padding: 0;
        overflow: hidden auto;
        overscroll-behavior: contain;
        scrollbar-width: none;                     /* the panel still scrolls by touch, without a gray bar */
        border: 1.5px solid rgba(233, 184, 120, .75);
        border-radius: 18px;
        background:
            radial-gradient(120% 60% at 100% 0%, rgba(197, 138, 69, .22), transparent 60%),
            radial-gradient(90% 50% at 0% 100%, rgba(197, 138, 69, .16), transparent 65%),
            linear-gradient(170deg, rgba(58, 33, 19, .93) 0%, rgba(30, 17, 10, .96) 55%, rgba(22, 12, 7, .98) 100%),
            url("../images/textures/dark-wood-lite.jpg") center / cover;
        box-shadow:
            0 0 0 4px rgba(40, 23, 15, .55),
            inset 0 0 0 1px rgba(255, 220, 160, .08),
            0 24px 60px rgba(0, 0, 0, .65);
        transform: translateX(calc(100% + 1.5rem));
        visibility: hidden;
        transition: transform .45s var(--ease), visibility .45s;
    }
    .main-nav.is-open { transform: none; visibility: visible; }

    /* Logo + gold wave */
    .main-nav__head {
        display: block;
        position: relative;
        flex: none;
        padding: 1.35rem 1.25rem 0;
        background: linear-gradient(180deg, rgba(197, 138, 69, .14), transparent);
    }
    .main-nav__brand { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; }
    .main-nav__brand img { width: auto; height: 44px; max-width: 90px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
    .main-nav__brand-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
    .main-nav__brand-text strong {
        font-family: var(--font-head);
        font-size: clamp(.95rem, 4.4vw, 1.12rem);
        font-weight: 800;
        white-space: nowrap;
        background: var(--grad-gold-text);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
    .main-nav__brand-text span { font-size: .68rem; font-weight: 600; color: var(--c-cream); opacity: .85; letter-spacing: .02em; }
    .main-nav__wave { display: block; width: calc(100% + 2.5rem); height: 34px; margin: .6rem -1.25rem 0; }

    /* Links */
    .main-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: .9rem 0 .4rem; }
    .main-nav__list > li { position: relative; margin-inline-end: 1rem; }
    .main-nav__list > li + li::before {
        content: "";
        position: absolute;
        top: 0;
        inset-inline: 1.1rem 0;
        height: 1px;
        background: linear-gradient(to left, rgba(233, 184, 120, .32), rgba(233, 184, 120, .04));
    }
    .main-nav__link {
        display: flex;
        align-items: center;
        gap: .85rem;
        min-height: 48px;
        padding: .6rem 1.1rem;
        border-radius: 12px 0 0 12px;
        color: var(--c-ivory);
        font-size: 1.05rem;
        font-weight: 700;
    }
    .main-nav__link::after { display: none; }
    .main-nav__caret { display: none; }
    .main-nav__icon {
        display: inline-grid;
        place-items: center;
        flex: none;
        width: 1.6rem;
        font-size: 1.15rem;
        color: var(--c-gold-light);
        transition: color .2s;
    }
    .main-nav__link:hover { color: var(--c-gold-light); background: rgba(233, 184, 120, .06); }
    /* The section in view: a gold bar that runs to the panel's edge. */
    .main-nav__link.is-active {
        color: var(--c-dark);
        background: linear-gradient(100deg, #F6D7A2 0%, #E0A962 45%, #B27536 100%);
        box-shadow: 0 8px 20px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
    }
    .main-nav__link.is-active .main-nav__icon { color: var(--c-dark); }
    .main-nav__list > li:has(.main-nav__link.is-active) + li::before,
    .main-nav__list > li:has(.main-nav__link.is-active)::before { opacity: 0; }

    /* Services: a row with an open/close arrow, and the list in a framed box */
    .main-nav__row { display: flex; align-items: center; }
    .main-nav__row .main-nav__link { flex: 1; }
    .main-nav__sub-toggle {
        display: grid;
        place-items: center;
        flex: none;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 10px;
        background: none;
        color: var(--c-gold-light);
        cursor: pointer;
    }
    .main-nav__sub-toggle i { transition: transform .3s var(--ease); }
    .main-nav__item--dropdown.is-expanded .main-nav__sub-toggle i { transform: rotate(180deg); }
    .main-nav__sub-toggle:hover { background: rgba(233, 184, 120, .08); }

    .main-nav__dropdown {
        position: static;
        display: none;
        min-width: 0;
        margin: 0 1.1rem .7rem 0;
        padding: .45rem .5rem;
        border: 1px solid rgba(233, 184, 120, .25);
        border-radius: 12px;
        background: rgba(15, 8, 4, .35);
        box-shadow: inset 0 1px 0 rgba(255, 220, 160, .05);
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .main-nav__item--dropdown.is-expanded .main-nav__dropdown { display: block; animation: navDrop .3s var(--ease); }
    .main-nav__dropdown a {
        display: flex;
        align-items: center;
        gap: .7rem;
        padding: .45rem .7rem;
        border-radius: 8px;
        font-size: .93rem;
        font-weight: 500;
        color: var(--c-cream);
        opacity: 1;
    }
    .main-nav__dropdown a::before {
        content: "";
        flex: none;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--grad-gold);
        box-shadow: 0 0 6px rgba(233, 184, 120, .6);
    }
    .main-nav__dropdown a:hover { background: rgba(233, 184, 120, .1); color: var(--c-gold-light); }

    /* Consultation button */
    .main-nav__mobile-cta {
        display: inline-flex;
        justify-content: center;
        flex: none;
        margin: .8rem 1.25rem 0;
        padding: .85rem 1rem;
        border-radius: 999px;
        border: 1.5px solid rgba(255, 230, 190, .55);
        box-shadow: 0 0 0 4px rgba(197, 138, 69, .18), 0 10px 26px rgba(0, 0, 0, .45);
        font-size: 1rem;
    }

    /* Gold curls + motto at the bottom */
    .main-nav__foot {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1 0 auto;
        justify-content: flex-end;
        gap: .2rem;
        min-height: 120px;
        padding: 1rem 1rem .9rem;
        background: radial-gradient(70% 70% at 50% 100%, rgba(197, 138, 69, .22), transparent 70%);
    }
    .main-nav__curls { width: 150px; height: 66px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
    .main-nav__motto {
        display: flex;
        align-items: center;
        gap: .6rem;
        width: 100%;
        margin: 0;
        font-size: .82rem;
        font-weight: 600;
        color: var(--c-gold-light);
        white-space: nowrap;
    }
    .main-nav__motto::before, .main-nav__motto::after {
        content: "";
        flex: 1;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(233, 184, 120, .6), transparent);
    }

    /* The menu button becomes a framed gold "×" next to the open panel. */
    body.nav-open .nav-toggle {
        border-color: rgba(233, 184, 120, .85);
        background: rgba(40, 23, 15, .85);
        box-shadow: 0 0 0 3px rgba(197, 138, 69, .18), 0 8px 20px rgba(0, 0, 0, .5);
    }

    .brand__logo { height: 40px; }
    .brand__name { font-size: 1.05rem; }
}

@media (max-width: 767.98px) {
    .topbar__slogan { display: none; }
    .topbar__contact { margin-inline-start: 0; gap: 1rem; }
    .topbar__inner { justify-content: space-between; gap: .75rem; }
}

@media (max-width: 479.98px) {
    .topbar__contact li:nth-child(2) { display: none; }
    .brand__name-en { font-size: .66rem; }
}

/* 6. Hero ---------------------------------------------------------------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    /* Exactly the photos' 16:9 shape, so the whole photo fills the hero edge to edge on laptops and
       large screens: no side bars and nothing cut off. (Capping it by the screen height made the
       hero wider than 16:9 on wide laptops, which left blurred bars on the left and right.) */
    min-height: clamp(560px, 56.25vw, 1200px);
    padding: calc(var(--topbar-h) + var(--header-h) + 2rem) 0 5rem;
    overflow: hidden;
    background: var(--c-dark);
    color: var(--c-white);
}

/* Each slide shows the WHOLE photo (never cropped) on every screen size:
   the photo is scaled to fit, and a blurred, darker copy of it fills the free space
   around it. The active slide cross-fades in while the backdrop slowly drifts. */
.hero__slide {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.4s ease-in-out;
}
.hero__slide.is-active { opacity: 1; }
.hero picture { display: contents; }   /* the wrapper adds no box; its img is positioned by the slide */

.hero__backdrop {
    position: absolute;
    inset: -40px;                          /* hides the soft edges the blur creates */
    width: calc(100% + 80px);
    height: calc(100% + 80px);
    object-fit: cover;
    filter: blur(28px) saturate(1.15) brightness(.55);
    transform: scale(1.08);
    transition: transform 6.5s ease-out;
}
.hero__slide.is-active .hero__backdrop { transform: scale(1); }

.hero__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* The hero has the photo's own shape, so the photo fills it completely: no empty bars.
       (Only a photo of a different shape, e.g. an uploaded non-16:9 one, loses a thin edge.) */
    object-fit: cover;
    object-position: 50% 50%;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to left, rgba(28, 16, 10, .9) 0%, rgba(28, 16, 10, .7) 32%, rgba(28, 16, 10, .25) 62%, rgba(28, 16, 10, .1) 100%),
        linear-gradient(to top, rgba(28, 16, 10, .75) 0%, rgba(28, 16, 10, 0) 30%);
}

.hero__content { position: relative; z-index: 2; }

.hero__title {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    max-width: 780px;
    margin: 0;
    font-weight: 900;
    font-size: clamp(2rem, 4.4vw, 3.5rem);
    line-height: 1.35;
}
.hero__title-main { text-shadow: 0 4px 24px rgba(0, 0, 0, .45); }
.hero__title-accent {
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .4));
}

.hero__lead {
    max-width: 560px;
    margin: 1.25rem 0 2rem;
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 500;
    color: var(--c-cream);
}

/* Phones and tablets held upright (same media query as PhoneMedia in _Hero.cshtml). */
@media (max-width: 767.98px), (max-width: 1199.98px) and (orientation: portrait) {
    .hero { --hero-top: calc(var(--topbar-h) + var(--header-h)); }

    /* A) The usual case: some slides have a phone version. Only those rotate on phones,
          so every slide looks the same: a portrait photo (2:3 area, whole photo, never
          stretched) filling the screen under the header, the title and button over its
          lower part on a dark gradient. */
    /* The photo area has the average shape of the phone versions (about 7:10), and each photo
       fills it completely, so no slide shows an empty band under or beside its photo; the phone
       versions differ only slightly in shape, so at most a thin edge is trimmed. */
    .hero--phone-set {
        --hero-photo-h: min(143vw, calc(100vh - var(--hero-top) - 1rem));
        --hero-photo-h: min(143vw, calc(100svh - var(--hero-top) - 1rem));
        min-height: calc(var(--hero-top) + var(--hero-photo-h));
        align-items: flex-end;
        padding-top: var(--hero-top);
        padding-bottom: 2.25rem;
    }
    .hero--phone-set .hero__slide:not(.has-mobile) { display: none; }
    .hero--phone-set .hero__slide.is-phone-start { opacity: 1; }   /* before site.js takes over */
    .hero--phone-set .hero__photo {
        /* From under the header down to the very bottom of the hero (an explicit height: an
           absolutely positioned image would otherwise follow its own proportions). */
        inset: var(--hero-top) 0 auto;
        height: calc(100% - var(--hero-top));
        object-fit: cover;
        object-position: 50% 35%;
    }
    .hero--phone-set .hero__overlay {
        background: linear-gradient(to top, rgba(28, 16, 10, .96) 0%, rgba(28, 16, 10, .8) 28%, rgba(28, 16, 10, .25) 52%, rgba(28, 16, 10, 0) 64%);
    }

    /* B) No slide has a phone version yet: the wide photo, whole, at full width under the
          header, with the text below it. */
    .hero:not(.hero--phone-set) {
        --hero-photo-h: min(56.25vw, 52vh);
        min-height: 0;
        align-items: flex-start;
        padding-top: calc(var(--hero-top) + var(--hero-photo-h) + 1.75rem);
        padding-bottom: 2.75rem;
    }
    .hero:not(.hero--phone-set) .hero__photo {
        inset: var(--hero-top) 0 auto;
        height: var(--hero-photo-h);
        object-fit: contain;
        box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    }
    .hero:not(.hero--phone-set) .hero__overlay {
        top: calc(var(--hero-top) + var(--hero-photo-h));
        background: linear-gradient(to bottom, rgba(28, 16, 10, .2) 0%, rgba(28, 16, 10, .55) 100%);
    }
}

/* A photo that has not arrived yet (or failed) never shows the browser's broken-image mark or its alt text. */
.hero__photo:not([src]), .hero__backdrop:not([src]) { visibility: hidden; }
.hero__photo { color: transparent; }
.hero__slide.is-broken { display: none; }
@media (max-width: 767.98px) {
    .hero__title { font-size: clamp(1.75rem, 8vw, 2.3rem); }
}

/* 7. Services cards ------------------------------------------------------ */
.services {
    padding: 1.5rem 0;
    background: linear-gradient(180deg, #F3E3CF 0%, var(--c-ivory) 100%);
}

/* One row of cards: --per cards fill the width; more cards than that scroll sideways
   (never a half-empty second row). Fewer cards stay centered at the same size. */
.services__row { position: relative; display: flex; align-items: center; --per: 6; --gap: .9rem; }
.services__grid {
    display: flex;
    flex: 1;
    gap: var(--gap);
    min-width: 0;
    margin: -.6rem 0 -1.4rem;
    padding: .6rem 0 1.4rem;               /* room for the hover lift and shadow inside the scroller */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.services__grid::-webkit-scrollbar { display: none; }
.services__grid > li {
    flex: none;
    width: calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
    scroll-snap-align: start;
}
.services__grid > li:first-child { margin-inline-start: auto; }
.services__grid > li:last-child { margin-inline-end: auto; }

.service-card {
    position: relative;
    display: block;
    aspect-ratio: 5 / 6;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(197, 138, 69, .35);
    background: var(--c-brown);
    box-shadow: var(--shadow-soft);
    isolation: isolate;
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.service-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(to top, rgba(28, 16, 10, .96) 0%, rgba(28, 16, 10, .6) 26%, rgba(28, 16, 10, 0) 55%);
}
.service-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s var(--ease);
}
/* Lift and zoom only with a mouse: on touch screens a finger resting on a card while scrolling
   would trigger them and make the card jump under the finger. */
@media (hover: hover) and (pointer: fine) {
    .service-card:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(40, 23, 15, .3); }
    .service-card:hover .service-card__img { transform: scale(1.08); }
}

.service-card__body {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 1;
    display: flex;
    /* Everything sits on the bottom line: the arrow is always at the same place in the corner, and a
       name on two lines grows upwards (it used to push the arrow up to the middle of the two lines). */
    --arrow: 28px;
    align-items: flex-end;
    gap: .55rem;
    padding: .85rem .9rem;
    color: var(--c-white);
}
.service-card__icon {
    flex: none;
    line-height: var(--arrow);
    font-size: 1.35rem;
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.service-card__title {
    flex: 1;
    min-width: 0;                          /* lets a long name shrink instead of pushing the arrow out */
    margin-bottom: calc((var(--arrow) - 1.3em) / 2);   /* last line centred on the arrow (a margin: the clipped 3rd line never peeks out) */
    overflow: hidden;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    /* A long name («الكارمات واللافتات») wraps to a second line instead of ending with "…". */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.service-card__arrow {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: var(--arrow);
    height: var(--arrow);
    border: 1.5px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    font-size: .7rem;
    transition: background .3s, border-color .3s, color .3s;
}
@media (hover: hover) and (pointer: fine) {
    .service-card:hover .service-card__arrow {
        background: var(--c-gold);
        border-color: var(--c-gold);
        color: var(--c-dark);
    }
}

@media (min-width: 1200px) {
    .service-card__body { gap: .45rem; padding: .8rem .75rem; }
    .service-card__title { font-size: .92rem; }
    .service-card__icon { font-size: 1.2rem; }
}
/* Wide screens: the row uses the space on the right and left instead of the 1320px container.
   Every card keeps exactly its usual width (the width it has as one of 6 in that container, 204px);
   as many cards as fit are shown, up to 8. On a narrower wide screen the arrow shows the rest. */
@media (min-width: 1400px) {
    .services__row { --card: calc((1296px - 5 * var(--gap)) / 6); }
    .services__grid > li { width: var(--card); }
    .services > .container { max-width: calc(8 * ((1296px - 5 * .9rem) / 6) + 7 * .9rem + 1.5rem); }
}
@media (max-width: 1199.98px) {
    .services__row { --per: 3; }
    .service-card { aspect-ratio: 4 / 3; }
}
@media (max-width: 575.98px) {
    /* Phones: a fixed two-column grid instead of a sideways strip. A strip under the finger
       catches slightly slanted swipes as sideways ones and stops the page scrolling; a grid
       never does, and every service is visible at once. */
    .services__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
        margin: 0;
        padding: 0;
        overflow: visible;
        scroll-snap-type: none;
    }
    .services__grid > li { width: auto; margin: 0 !important; }
    .services__grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd last card fills the row */
    .services__grid > li:last-child:nth-child(odd) .service-card { aspect-ratio: 2 / 1; }
    .services__row .scroll-arrow { display: none !important; }
    .service-card { aspect-ratio: 4 / 3; }
    .service-card__body { padding: .7rem; gap: .4rem; }
    /* Half-width cards: a long name wraps to a second line instead of ending with "…". */
    .service-card__title {
        font-size: .9rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    .service-card__icon { font-size: 1.1rem; }
    .service-card__body { --arrow: 24px; }
}

/* 8. About --------------------------------------------------------------- */
.about {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(246, 233, 217, .9), rgba(253, 245, 236, .95)),
        url("../images/textures/light-oak-lite.jpg") center / cover;
    border-block: 1px solid rgba(197, 138, 69, .25);
}

.about__grid {
    /* The right-hand gutter that lines the section up with the site container
       is its own column, so the highlights column always keeps its full width
       (padding inside a fixed-width column overflowed it on wide screens). */
    --about-gutter: max(1rem, calc((100% - 1296px) / 2));
    display: grid;
    /* The highlights column is as wide as its longest phrase, so each one stays on one line. */
    grid-template-columns: var(--about-gutter) minmax(210px, max-content) minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-areas: ". highlights content media";
    min-height: 460px;
}

.about__highlights {
    grid-area: highlights;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.25rem;
    padding-block: 3rem;
    padding-inline: 0 1.75rem;
}
.about__highlight {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.5;
    white-space: nowrap;
}
.about__highlight-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(197, 138, 69, .45);
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    font-size: 1.4rem;
    color: var(--c-wood);
    transition: background .3s, color .3s, transform .3s var(--ease);
}
.about__highlight:hover .about__highlight-icon {
    background: var(--c-gold);
    color: var(--c-white);
    transform: rotate(-8deg) scale(1.05);
}

.about__content {
    grid-area: content;
    align-self: center;
    padding: 3.5rem 2.5rem;
    border-inline-start: 1px solid rgba(112, 67, 33, .22);
}
.about__title {
    margin: 0 0 1.1rem;
    font-weight: 900;
    font-size: clamp(1.6rem, 2.4vw, 2.3rem);
    color: var(--c-dark);
}
.about__text {
    max-width: 620px;
    margin: 0 0 1.75rem;
    font-size: 1.07rem;
    line-height: 2;
    color: #4A3527;
}

.about__media {
    grid-area: media;
    position: relative;
    margin: 0;
    min-height: 320px;
}
.about__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    /* Slanted edge toward the text, as in the reference design. */
    clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%);
}
.about__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(246, 233, 217, .35), transparent 30%);
    clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%);
    pointer-events: none;
}

@media (max-width: 991.98px) {
    .about__grid {
        grid-template-columns: 1fr;
        grid-template-areas: "content" "highlights" "media";
    }
    .about__content { padding: 3rem 1.25rem 1.5rem; border: 0; }
    .about__highlights {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 1rem 2rem;
        padding: 0 1.25rem 2.5rem;
    }
    .about__media { min-height: 0; aspect-ratio: 16 / 10; }
    .about__media img,
    .about__media::after { clip-path: none; }
    .about__media::after { display: none; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
    .about__content, .about__highlights {
        padding-inline: max(1.25rem, calc((100vw - 720px) / 2 + .75rem));
    }
}

/* 9. Portfolio ----------------------------------------------------------- */
.portfolio {
    padding: 3.5rem 0 3rem;
    background:
        radial-gradient(ellipse at top, rgba(233, 184, 120, .18), transparent 60%),
        var(--c-ivory);
}

.section-heading { text-align: center; }
.section-heading__title {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0;
    font-weight: 900;
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    color: var(--c-dark);
}
.section-heading__title::before,
.section-heading__title::after {
    content: "";
    width: clamp(40px, 10vw, 120px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-wood));
}
.section-heading__title::after { transform: scaleX(-1); }
.section-heading__subtitle {
    margin: .35rem 0 0;
    font-weight: 500;
    font-size: 1.08rem;
    color: var(--c-wood);
}

/* The categories always stay in ONE row (as on phones): centered when they fit, otherwise the
   row scrolls sideways, with round arrows on computers. */
.portfolio__filterbar {
    position: relative;
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1.75rem;
}
.portfolio__filters {
    display: flex;
    flex: 1;
    flex-wrap: nowrap;
    gap: .6rem;
    min-width: 0;
    padding: .35rem .25rem .6rem;
    scroll-padding-inline: .25rem;      /* snapping keeps the same side space as the padding */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.portfolio__filters::-webkit-scrollbar { display: none; }
/* Auto margins center the row while it fits, and still let it scroll from the first button when it does not. */
.portfolio__filters > .filter-btn:first-child { margin-inline-start: auto; }
.portfolio__filters > .filter-btn:last-child { margin-inline-end: auto; }
.filter-btn { flex: none; white-space: nowrap; scroll-snap-align: start; }
/* Sideways rows (categories bar, service cards) have clean edges: the item cut at the screen
   edge already shows there is more to swipe; desktop also gets arrows. */
.scroll-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: -.1rem;
    border: 1px solid rgba(197, 138, 69, .55);
    border-radius: 50%;
    background: var(--c-ivory);
    color: var(--c-wood);
    box-shadow: 0 6px 16px rgba(40, 23, 15, .16);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s, color .2s, transform .2s;
}
.scroll-arrow[hidden] { display: none; }
.scroll-arrow--start { inset-inline-start: -.35rem; }
.scroll-arrow--end { inset-inline-end: -.35rem; }
.scroll-arrow:hover { background: var(--grad-gold); color: var(--c-dark); border-color: transparent; }
.filter-btn {
    min-width: 84px;
    padding: .4rem 1.25rem;
    border: 1px solid rgba(112, 67, 33, .22);
    border-radius: 999px;
    background: #F4E6D3;
    color: var(--c-text);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .25s;
}
.filter-btn:hover { border-color: var(--c-gold); transform: translateY(-1px); }
.filter-btn.is-active {
    background: var(--grad-gold);
    border-color: transparent;
    color: var(--c-dark);
    box-shadow: 0 6px 16px rgba(197, 138, 69, .35);
}

/* Filter buttons carry an optional category cover and the number of projects. */
.filter-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.filter-btn__cover {
    width: 26px; height: 26px; margin-inline-start: -.6rem;
    border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .9);
    box-shadow: 0 2px 6px rgba(40, 23, 15, .2);
}
/* «الكل» has no category photo: a round icon in the same place and size instead. */
.filter-btn__cover--all {
    display: grid; place-items: center; flex: none;
    background: var(--c-dark);
    color: var(--c-gold-light, #E9B878);
    font-size: .7rem;
}
.filter-btn.is-active .filter-btn__cover--all { background: rgba(40, 23, 15, .9); }
.portfolio__intro {
    max-width: 720px;
    margin: -.5rem auto 1.75rem;
    color: var(--c-wood);
    font-size: 1.02rem;
    text-align: center;
    animation: fade-in .4s ease both;
}

/* Large, consistent project cards: 3 per row on desktop, 2 on tablets, 1 on phones. */
.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.75rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Wide screens: the projects use the space on the right and left: 4 per row where the screen
   has room, each card exactly its usual width (one of 3 in the 1320px container); a narrower wide
   screen keeps 3. */
@media (min-width: 1400px) {
    .portfolio > .container { max-width: calc(4 * ((1296px - 2 * 1.75rem) / 3) + 3 * 1.75rem + 1.5rem); }
    .portfolio__grid {
        grid-template-columns: repeat(auto-fill, calc((1296px - 2 * 1.75rem) / 3));
        gap: 1.75rem;
        justify-content: center;
    }
}

.project-card { animation: card-in .5s var(--ease) both; }
.project-card[hidden] { display: none; }

@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.project-card__btn {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(197, 138, 69, .25);
    border-radius: 14px;
    background: var(--c-white);
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: zoom-in;
    box-shadow: 0 10px 28px rgba(40, 23, 15, .1);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.project-card__btn:hover,
.project-card__btn:focus-visible {
    transform: translateY(-5px);
    border-color: var(--c-gold);
    box-shadow: 0 22px 44px rgba(40, 23, 15, .2);
}

.project-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--c-cream);
}
.project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .9s var(--ease);
}
.project-card__btn:hover .project-card__media img,
.project-card__btn:focus-visible .project-card__media img { transform: scale(1.06); }
.project-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28, 16, 10, .45), transparent 45%);
    pointer-events: none;
}

.project-card__tag {
    position: absolute;
    top: .8rem;
    inset-inline-start: .8rem;
    z-index: 1;
    padding: .2rem .75rem;
    border-radius: 999px;
    background: var(--grad-gold);
    color: var(--c-dark);
    font-family: var(--font-head);
    font-size: .78rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
.project-card__count {
    position: absolute;
    bottom: .8rem;
    inset-inline-start: .8rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    background: rgba(28, 16, 10, .72);
    color: var(--c-white);
    font-size: .8rem;
    font-weight: 700;
}
.project-card__zoom {
    position: absolute;
    top: .8rem;
    inset-inline-end: .8rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--c-wood);
    opacity: 0;
    transform: scale(.8);
    transition: opacity .3s, transform .3s;
}
.project-card__btn:hover .project-card__zoom,
.project-card__btn:focus-visible .project-card__zoom { opacity: 1; transform: none; }

/* Video card: a frosted-glass play button in the middle of the cover picture, always visible:
   a rounded white triangle, a thin light frame and a soft gold ring that slowly pulses outward. */
.project-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border: 2px solid rgba(233, 184, 120, .95);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .26), rgba(20, 12, 8, .42) 68%);
    color: #fff;
    transform: translate(-50%, -50%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: transform .35s var(--ease), background .3s, color .3s, border-color .3s;
}
/* The triangle's centre of weight sits exactly in the middle of the circle (see the path in
   _Portfolio.cshtml); no shifting, no animation. */
.project-card__play svg {
    display: block;
    width: 30px;
    height: 30px;
    fill: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
.project-card__btn:focus-visible .project-card__play,
.project-card__btn:active .project-card__play {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(255, 255, 255, .95);
    border-color: transparent;
    color: var(--c-wood);
}
/* Pointer over the card (computers only: a phone would keep this look stuck after a tap). */
@media (hover: hover) and (pointer: fine) {
    .project-card__btn:hover .project-card__play {
        transform: translate(-50%, -50%) scale(1.08);
        background: rgba(255, 255, 255, .95);
        border-color: transparent;
        color: var(--c-wood);
    }
}
@media (max-width: 639.98px) {
    .project-card__play { width: 60px; height: 60px; }
    .project-card__play svg { width: 27px; height: 27px; }
}

.project-card__info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 1.15rem 1.1rem;
    border-top: 3px solid transparent;
    border-image: var(--grad-gold) 1;
}
.project-card__title {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.08rem;
    line-height: 1.45;
    color: var(--c-dark);
    /* At most two lines on the card, so a very long name never makes one card taller than the
       others; the full name shows when the project is opened. */
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.project-card__desc {
    display: -webkit-box;
    overflow: hidden;
    color: #6b5546;
    font-size: .92rem;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
.project-card__more {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: auto;
    padding-top: .35rem;
    color: var(--c-wood);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .88rem;
}
.project-card__btn:hover .project-card__more { color: var(--c-gold); }

/* Share link: the corner opposite «عرض المشروع», on the same line. It sits on top of the card
   (a button cannot hold another button), so it follows the card's hover lift. */
.project-card { position: relative; }
.project-card__share {
    position: absolute;
    bottom: .7rem;
    inset-inline-end: .9rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(197, 138, 69, .45);
    border-radius: 50%;
    background: var(--c-white);
    color: var(--c-wood);
    font-size: .95rem;
    cursor: pointer;
    transition: transform .35s var(--ease), background .25s, color .25s, border-color .25s;
}
.project-card__share:focus-visible { background: var(--grad-gold); border-color: transparent; color: var(--c-dark); }
/* Touch screens: a short gold flash while pressed (a "hover" would stay stuck after the tap). */
.project-card__share:active { background: var(--grad-gold); border-color: transparent; color: var(--c-dark); }
/* Whenever the card is raised (pointer over it, keyboard focus, or a phone keeping the tapped card
   raised), the share button rises with it, so it keeps exactly the same corner spacing on every card. */
.project-card:has(> .project-card__btn:hover) .project-card__share,
.project-card:has(> .project-card__btn:focus-visible) .project-card__share { transform: translateY(-5px); }
@media (hover: hover) and (pointer: fine) {
    .project-card__share:hover { background: var(--grad-gold); border-color: transparent; color: var(--c-dark); }
    .project-card:hover .project-card__share { transform: translateY(-5px); }
    .project-card:has(.project-card__share:hover) .project-card__btn {
        transform: translateY(-5px);
        border-color: var(--c-gold);
        box-shadow: 0 22px 44px rgba(40, 23, 15, .2);
    }
}
@media (max-width: 639.98px) {
    .project-card__share { bottom: .6rem; inset-inline-end: .8rem; }
}

/* "تم نسخ الرابط" confirmation (also above the photo viewer). */
.share-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    z-index: 3100;
    max-width: min(92vw, 460px);
    padding: .75rem 1.25rem;
    border: 1px solid rgba(233, 184, 120, .5);
    border-radius: 12px;
    background: rgba(28, 16, 10, .95);
    color: var(--c-cream);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .95rem;
    text-align: center;
    overflow-wrap: anywhere;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .25s, transform .25s;
}
.share-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Touch screens have no hover: keep the zoom hint visible. */
@media (hover: none) {
    .project-card__zoom { opacity: 1; transform: none; width: 34px; height: 34px; }
}

.portfolio__empty { margin: 1rem 0 0; color: var(--c-wood); text-align: center; }
.portfolio__more { display: flex; justify-content: center; margin-top: 2rem; }
.portfolio__more [hidden] { display: none; }

@media (max-width: 1199.98px) {
    .portfolio__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639.98px) {
    .portfolio__grid { grid-template-columns: minmax(0, 1fr); }
    /* Phones: the row bleeds to the screen edges (exactly the container padding) and is swiped;
       no arrows, the button cut at the edge shows there is more. */
    .portfolio__filterbar { margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5); }
    .portfolio__filters {
        padding: .3rem calc(var(--bs-gutter-x, 1.5rem) * .5) .6rem;
        scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * .5);
    }
    .scroll-arrow { display: none !important; }
    .filter-btn { min-width: 0; padding: .4rem 1rem; font-size: .88rem; }
    .project-card__info { padding: .9rem 1rem 1rem; }
}

/* 10. CNC banner --------------------------------------------------------- */
.cnc-banner {
    position: relative;
    overflow: hidden;
    color: var(--c-white);
    background: var(--c-dark) url("../images/textures/dark-wood-lite.jpg") center / cover;
    border-block: 1px solid rgba(233, 184, 120, .25);
}
.cnc-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 55% 50%, rgba(197, 138, 69, .18), transparent 60%),
        linear-gradient(rgba(28, 16, 10, .78), rgba(28, 16, 10, .88));
}

.cnc-banner__grid {
    /* Same approach as the About section: the gutter that aligns the hexagons
       with the site container is its own column, and the hexagon column is
       sized to fit its three hexagons, so they never spill into the text. */
    --cnc-gutter: max(1rem, calc((100% - 1296px) / 2));
    position: relative;
    display: grid;
    grid-template-columns: var(--cnc-gutter) auto minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    min-height: 270px;
}

.cnc-banner__hexes {
    grid-column: 2;
    display: flex;
    justify-content: center;
    gap: .5rem;
    padding: 1.5rem 0;
    padding-inline-end: 1rem;
}
.cnc-banner__content { grid-column: 3; }
.cnc-banner__art { grid-column: 4; }
.hex {
    --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    display: block;
    width: clamp(110px, 11vw, 170px);
    aspect-ratio: 1 / 1.1547;
    padding: 3px;
    border: 0;
    background: var(--grad-gold);
    clip-path: var(--hex);
    transition: transform .4s var(--ease), filter .4s;
}
.hex img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: var(--hex);
    transition: transform .7s var(--ease);
}
.hex:hover { transform: translateY(-4px); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.hex:hover img { transform: scale(1.1); }
.cnc-banner__hexes li:nth-child(2) .hex { margin-top: 2.5rem; }

.cnc-banner__content { padding: 2rem 1.5rem; }
.cnc-banner__title {
    margin: 0 0 .6rem;
    font-weight: 900;
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.cnc-banner__text {
    max-width: 380px;
    margin: 0 0 1.4rem;
    font-size: 1.02rem;
    line-height: 1.9;
    color: var(--c-cream);
}

.cnc-banner__art {
    position: relative;
    align-self: stretch;
    min-height: 270px;
}
.cnc-banner__art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 45%);
    mask-image: linear-gradient(to left, transparent 0%, #000 45%);
}

@media (max-width: 991.98px) {
    .cnc-banner__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cnc-banner__hexes,
    .cnc-banner__content,
    .cnc-banner__art { grid-column: 1; }
    .cnc-banner__content { order: -1; padding: 3rem 1.25rem 0; }
    .cnc-banner__text { margin-inline: auto; }
    .cnc-banner__hexes { padding: 1.5rem 1rem 3rem; }
    .cnc-banner__art {
        position: absolute;
        inset: 0;
        z-index: 0;
        min-height: 0;
        opacity: .22;
    }
    .cnc-banner__content,
    .cnc-banner__hexes { position: relative; z-index: 1; }
    .cnc-banner__art img { -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 479.98px) {
    .cnc-banner__hexes { gap: .35rem; padding-inline: .5rem; }
    .hex { width: 28vw; }
    .cnc-banner__hexes li:nth-child(2) .hex { margin-top: 1.5rem; }
}

/* 11. Features bar ------------------------------------------------------- */
.features {
    padding: 1.4rem 0;
    background: var(--c-cream);
    border-bottom: 1px solid rgba(197, 138, 69, .3);
}
.features__list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.features__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .85rem;
    padding: .5rem 1rem;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    color: var(--c-dark);
}
.features__item + .features__item { border-inline-start: 1px solid rgba(112, 67, 33, .28); }
.features__icon {
    font-size: 1.75rem;
    color: var(--c-wood);
    transition: transform .35s var(--ease), color .35s;
}
.features__item:hover .features__icon { transform: translateY(-3px); color: var(--c-gold); }

@media (max-width: 991.98px) {
    .features__list { grid-template-columns: repeat(2, 1fr); row-gap: .75rem; }
    .features__item:nth-child(3) { border-inline-start: 0; }
}
@media (max-width: 479.98px) {
    .features__list { grid-template-columns: 1fr; }
    .features__item { justify-content: flex-start; border-inline-start: 0 !important; }
    .features__item + .features__item { border-top: 1px solid rgba(112, 67, 33, .15); padding-top: .9rem; }
}

/* 12. Footer ------------------------------------------------------------- */
.site-footer {
    position: relative;
    color: var(--c-cream);
    background: var(--c-dark) url("../images/textures/dark-wood-lite.jpg") center / cover;
}
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 20%, rgba(197, 138, 69, .16), transparent 55%),
        linear-gradient(rgba(28, 16, 10, .84), rgba(24, 13, 8, .93));
}

.site-footer__grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    gap: 2rem;
    padding-block: 3.5rem 3rem;
}

.footer-brand { text-align: center; }
.footer-brand__logo { width: auto; height: 88px; max-width: 190px; object-fit: contain; }
.footer-brand__name {
    margin: .6rem 0 .1rem;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.55rem;
    background: var(--grad-gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.footer-brand__name-en {
    margin: 0 0 .6rem;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--c-gold-light);
}
.footer-brand__slogan {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    font-size: .88rem;
    opacity: .9;
}
.footer-brand__slogan::before,
.footer-brand__slogan::after {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--c-gold);
}

.footer-cta { text-align: center; }
.footer-cta__title {
    margin: 0 0 .35rem;
    font-weight: 900;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    color: var(--c-gold-light);
}
.footer-cta__text { margin: 0 0 1.4rem; font-size: 1.1rem; }

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2EDB72 0%, #1FB956 100%);
    color: var(--c-white);
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.12rem;
    box-shadow: 0 10px 26px rgba(37, 211, 102, .35);
    transition: transform .25s var(--ease), box-shadow .25s, filter .25s;
}
.btn-whatsapp i { font-size: 1.8rem; }
.btn-whatsapp:hover {
    color: var(--c-white);
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 14px 32px rgba(37, 211, 102, .45);
}

.footer-contact { margin: 0; font-style: normal; }
.footer-contact__list {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    margin-bottom: 1.2rem;
}
.footer-contact__list li { display: flex; align-items: center; gap: .75rem; }
.footer-contact__list i {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(233, 184, 120, .45);
    border-radius: 50%;
    color: var(--c-gold-light);
    font-size: .85rem;
}
.footer-contact__list a:hover { color: var(--c-gold-light); }

.site-footer__bottom {
    position: relative;
    padding: .9rem 0;
    border-top: 1px solid rgba(233, 184, 120, .2);
    background: rgba(0, 0, 0, .35);
    text-align: center;
    font-size: .9rem;
}
.site-footer__bottom p { margin: 0; opacity: .9; }
/* The copyright line, centred on every screen. */
.site-footer__copy { text-align: center; margin-inline: auto; }

@media (max-width: 991.98px) {
    .site-footer__grid { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
    .footer-contact__list { align-items: center; }
    .footer-contact .social-links { justify-content: center; }
}

.whatsapp-float {
    position: fixed;
    bottom: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 900;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-whatsapp);
    color: var(--c-white);
    font-size: 1.9rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
    transition: transform .25s var(--ease);
}
.whatsapp-float:hover { color: var(--c-white); transform: scale(1.08); }

/* 13. Lightbox ----------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    /* The top padding always clears the close button (1rem + 50px), so a tall photo or video
       never slides under it. */
    padding: 4.75rem 1rem 4rem;
    background: rgba(15, 8, 4, .94);
    animation: fade-in .3s ease both;
}
.lightbox[hidden] { display: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Height of the photo / video frame (smaller screens set their own below). */
.lightbox {
    --lb-media-h: min(78vh, var(--lb-fit, calc(100vh - 15rem)));
    --lb-media-w: min(1200px, 88vw, calc(100vw - 9.5rem));
}
/* A fixed width too: the caption wraps the same way under every photo, so nothing shifts. */
.lightbox__figure { margin: 0; text-align: center; width: var(--lb-media-w); max-width: 100%; }
.lightbox__img {
    display: block;
    /* Never under the side arrows: each takes 1rem + 50px, plus a small gap. */
    max-width: var(--lb-media-w);
    /* --lb-fit is the exact free height measured by site.js (screen minus buttons, caption and
       thumbnails), so the photo or video always fits between the close button and the arrows. */
    max-height: var(--lb-media-h);
    margin: 0 auto;
    object-fit: contain;
    border: 3px solid rgba(233, 184, 120, .45);
    border-radius: 8px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .6);
}
/* The photo animations (opening zoom, cross-fade to the next photo) are played by site.js once:
   classes switched on and off here restarted them, which looked like a flash. */
.lightbox__video { background: #000; }
.lightbox__video[hidden], .lightbox__img[hidden] { display: none; }
.lightbox__thumb--video { position: relative; }
.lightbox__thumb--video::after {
    content: "\f04b";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: var(--fa-font-solid);
    font-size: .7rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.lightbox__caption {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--c-cream);
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(233, 184, 120, .5);
    border-radius: 50%;
    background: rgba(40, 23, 15, .8);
    color: var(--c-gold-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background .25s, color .25s;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: var(--c-gold); color: var(--c-dark); }
.lightbox__close { top: 1rem; left: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { right: 1rem; }
.lightbox__nav--next { left: 1rem; }

/* Short screens (a phone held sideways): the arrows sit at the sides, so the photo/video takes
   almost the full height and keeps clear of the close button and arrows by its side margins. */
@media (max-height: 500px) and (min-width: 576px) {
    .lightbox { padding: .6rem 4.6rem; }
    .lightbox__close { top: .5rem; left: .5rem; width: 44px; height: 44px; }
    .lightbox__nav { width: 44px; height: 44px; }
    .lightbox__nav--prev { right: .5rem; }
    .lightbox__nav--next { left: .5rem; }
    .lightbox { --lb-media-h: var(--lb-fit, 80vh); }
    .lightbox__caption { margin-top: .4rem; font-size: .95rem; }
}

@media (max-width: 575.98px) {
    .lightbox__close { top: .75rem; left: .75rem; width: 44px; height: 44px; }
    .lightbox__nav { top: auto; bottom: .75rem; transform: none; width: 44px; height: 44px; }
    /* dvh follows the phone's browser bars as they show and hide (vh does not). */
    .lightbox { --lb-media-h: min(70dvh, var(--lb-fit, 70dvh)); --lb-media-w: 94vw; }
    .lightbox__img { max-width: 94vw; }
}

/* Reveal-on-scroll (only when JS runs; see the inline script in _Layout). */
.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Inner pages (404 / error) sit below the fixed header. */
.page-content {
    min-height: 60vh;
    padding-block: calc(var(--header-h-scrolled) + 4rem) 4rem;
}
.page-content__title { font-weight: 900; color: var(--c-dark); margin-bottom: 1rem; }

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
    .hero__backdrop { transform: none; }
}

/* ---------------------------------------------------------------
   Content managed from the dashboard
   --------------------------------------------------------------- */


/* Lightbox: project description, thumbnail strip and loading spinner. */
/* The frame keeps one height whatever the photo (wide, tall, or still loading): the caption, the
   thumbnails and the arrows never move when going from photo to photo. */
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 120px; height: calc(var(--lb-media-h) + 6px); }
.lightbox__spinner {
    position: absolute;
    width: 42px; height: 42px;
    border: 3px solid rgba(233, 184, 120, .25);
    border-top-color: var(--c-gold);
    border-radius: 50%;
    opacity: 0;
    /* Never catches a tap: it sits exactly over the play / pause button phones show in the
       middle of a video. */
    pointer-events: none;
    animation: lightboxSpin .8s linear infinite;
    transition: opacity .2s;
}
.lightbox__stage.is-loading .lightbox__spinner { opacity: 1; }
.lightbox__stage.is-loading .lightbox__img { opacity: .6; }   /* the card picture, until the full photo arrives */
.lightbox__img:not(.lightbox__ghost) { transition: opacity .3s ease; }   /* 60% → 100% gently when the full photo arrives */
/* Until its first picture arrives the frame is not drawn at all (no empty bordered box for a moment). */
img.lightbox__img:not([src]) { visibility: hidden; }
@keyframes lightboxSpin { to { transform: rotate(360deg); } }

.lightbox__caption { flex-direction: column; align-items: center; justify-content: flex-start; gap: .35rem; }   /* title always at the top of its space */
.lightbox__title-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem 1rem; }
.lightbox__share {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .85rem;
    border: 1px solid rgba(233, 184, 120, .5);
    border-radius: 999px;
    background: rgba(40, 23, 15, .8);
    color: var(--c-gold-light);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: background .25s, color .25s;
}
.lightbox__share:focus-visible,
.lightbox__share:active { background: var(--c-gold); color: var(--c-dark); }
@media (hover: hover) and (pointer: fine) {
    .lightbox__share:hover { background: var(--c-gold); color: var(--c-dark); }
}
.lightbox__share[hidden] { display: none; }
.lightbox__desc {
    max-width: 720px;
    color: rgba(246, 233, 217, .85);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: .95rem;
    line-height: 1.7;
}
.lightbox__thumbs {
    display: flex;
    justify-content: center;
    gap: .5rem;
    max-width: min(1200px, 88vw);
    margin: 1rem auto 0;
    padding: .25rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(233, 184, 120, .4) transparent;
}
.lightbox__thumbs[hidden] { display: none; }
.lightbox__thumb {
    flex: none;
    width: 72px;
    height: 54px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    opacity: .55;
    cursor: pointer;
    transition: opacity .2s, border-color .2s;
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .85; }
.lightbox__thumb.is-active { border-color: var(--c-gold); opacity: 1; }
@media (max-width: 575.98px) {
    /* Top: close button (.75rem + 44px) plus a gap; bottom: the arrows (.75rem + 44px) plus a gap. */
    .lightbox { padding: 3.85rem .5rem 3.85rem; }
    .lightbox__thumbs { justify-content: flex-start; max-width: 94vw; }
    .lightbox__thumb { width: 58px; height: 44px; }
    /* A long description scrolls in its own box instead of pushing the photo away. */
    .lightbox__desc { font-size: .88rem; max-height: 5.2em; overflow-y: auto; padding-inline: .5rem; }
}

/* Phones: keep the last footer line clear of the floating WhatsApp button. */
@media (max-width: 767.98px) {
    .site-footer__bottom { padding-bottom: 5.25rem; }
}

/* Touch screens: small links (topbar and footer icons, phone, email) get a bigger
   invisible touch area (about 44 px, the size of a fingertip) without changing how they look. */
@media (pointer: coarse) {
    .topbar a, .site-footer a:not(.btn-whatsapp) { position: relative; }
    .topbar a::after, .site-footer a:not(.btn-whatsapp)::after {
        content: "";
        position: absolute;
        inset: -10px -6px;
    }
}

/* The menu button never gets squeezed by the logo; very small phones (320 px) get a slightly
   smaller logo and name so the button keeps its full size inside the screen. */
.nav-toggle { flex-shrink: 0; }
@media (max-width: 374.98px) {
    .brand { gap: .45rem; min-width: 0; flex-shrink: 1; }
    .brand__logo { height: 34px; max-width: 80px; }
    .brand__name { font-size: .9rem; }
    .brand__name-en { font-size: .6rem; }
}

/* «من نحن» → «اعرف المزيد»: the rest of the text opens below the paragraph. Scroll anchoring is off
   here, otherwise a phone keeps the button where it was and pushes the new text up out of sight. */
.about__content, .about__content * { overflow-anchor: none; }
.about__text--more:not([hidden]) { animation: about-more-in .35s var(--ease) both; }
@keyframes about-more-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.about__more-icon { font-size: .8em; transition: transform .3s var(--ease); }
.about__more-btn[aria-expanded="true"] .about__more-icon { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .about__text--more:not([hidden]) { animation: none; }
}
