/* Tajawal (Arabic) + Poppins/Public Sans (English) loaded via Google Fonts in
   inc/head.php. Editorial "boutique clinic" language on purpose: deep ink
   sections, thin hairlines and large quiet type — not a light SaaS
   feature-grid look. Palette: brand blue #6199ad (sampled from the DMB
   mark) with #a6c4cf as its lighter tint — the "--gold-*" variable names
   are historical (an earlier amber accent) but now hold the blue scale. */

:root {
    --brand-500: #6199ad;
    --brand-700: #3f6674;
    --brand-900: #20343b;
    --ink-950: #142229;
    --gold-400: #a6c4cf;
    --gold-500: #6199ad;
    --gold-600: #4f7f91;
    --ink-900: #20211f;
    --ink-700: #484f54;
}

* { scroll-behavior: smooth; }

html, body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink-900);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Dark editorial sections ---------- */

.section-dark {
    position: relative;
    background: radial-gradient(1200px 640px at 50% -20%, rgba(97,153,173,.28), transparent 60%), var(--ink-950);
    color: rgba(255,255,255,.82);
}

/* Thin arcing line-art, standing in for the brand's geometric identity
   graphic — a quiet "smile curve" rather than a literal tooth icon. */
.arc-motif {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.arc-motif svg { position: absolute; opacity: .35; }

.hairline {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(97,153,173,.55), transparent);
}
.hairline-solid { height: 1px; background: rgba(32,52,59,.1); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-600);
}
.eyebrow::before {
    content: '';
    width: 26px; height: 1px;
    background: var(--gold-500);
}
.eyebrow.on-dark { color: var(--gold-400); }

/* Large quiet background numerals for editorial rows / service list */
.num-mark {
    font-weight: 300;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(97,153,173,.55);
}

/* ---------- Buttons ---------- */

.btn-gold {
    background: var(--gold-500);
    color: #fff;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
    box-shadow: 0 10px 26px -10px rgba(97,153,173,.5);
}
.btn-gold:hover { background: var(--gold-600); transform: translateY(-1.5px); }

.btn-outline {
    border: 1.5px solid rgba(32,52,59,.18);
    color: var(--ink-700);
    transition: all .2s ease;
}
.btn-outline:hover { border-color: var(--gold-500); color: var(--gold-600); }

.btn-gold-outline {
    border: 1.5px solid rgba(166,196,207,.55);
    color: var(--gold-400);
    transition: all .2s ease;
}
.btn-gold-outline:hover { background: rgba(166,196,207,.1); border-color: var(--gold-400); color: #fff; }

.btn-blue {
    background: #6199ad;
    color: #fff;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
    box-shadow: 0 10px 24px -10px rgba(97,153,173,.55);
}
.btn-blue:hover { background: #a6c4cf; color: #20343b; transform: translateY(-1.5px); }

/* ---------- Editorial panels (replace boxy SaaS "feature cards") ---------- */

.panel {
    border: 1px solid rgba(32,52,59,.1);
    background: #fff;
    transition: border-color .25s ease;
}
.panel:hover { border-color: rgba(97,153,173,.5); }

.corner-frame {
    position: relative;
}
.corner-frame::before, .corner-frame::after {
    content: '';
    position: absolute;
    width: 22px; height: 22px;
    border: 1.5px solid var(--gold-500);
    opacity: .8;
}
.corner-frame::before { top: -1px; inset-inline-start: -1px; border-inline-end: none; border-bottom: none; }
.corner-frame::after { bottom: -1px; inset-inline-end: -1px; border-inline-start: none; border-top: none; }

.icon-mark {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-700);
}
.icon-mark.on-dark { color: var(--gold-400); }

/* ---------- Scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Nav — quiet text links, no pill/tab styling ---------- */

.nav-link {
    position: relative;
    color: var(--ink-700);
    letter-spacing: .01em;
    transition: color .2s ease;
    padding-bottom: 4px;
}
.nav-link::after {
    content: '';
    position: absolute; right: 0; left: 0; bottom: 0;
    height: 1px; background: var(--gold-500);
    transform: scaleX(0); transform-origin: center;
    transition: transform .25s ease;
}
.nav-link:hover { color: var(--brand-700); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--gold-600); }
.nav-link.is-active::after { transform: scaleX(1); }

header.is-scrolled { box-shadow: 0 16px 40px -22px rgba(32,52,59,.3); }

/* Language switcher dropdown */
.lang-trigger {
    display: flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border: 1px solid rgba(32,52,59,.15);
    font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
    color: var(--ink-700);
    transition: border-color .2s ease, color .2s ease;
}
.lang-trigger:hover { border-color: var(--gold-500); color: var(--gold-600); }
.lang-trigger svg.chev { transition: transform .2s ease; }
[data-lang-dropdown].is-open .lang-trigger svg.chev { transform: rotate(180deg); }

.lang-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    min-width: 160px;
    background: #fff;
    border: 1px solid rgba(32,52,59,.1);
    box-shadow: 0 20px 44px -16px rgba(32,52,59,.28);
    padding: 6px;
    z-index: 60;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
[data-lang-dropdown].is-open .lang-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity .2s ease, transform .22s ease;
}
.lang-menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    font-size: 13.5px; font-weight: 600;
    color: var(--ink-700);
    transition: background-color .14s ease, color .14s ease;
}
.lang-menu-item:hover { background: rgba(97,153,173,.1); color: var(--brand-700); }
.lang-menu-item.is-active { color: var(--gold-600); }

/* ---------- Departments dropdown (desktop nav) ---------- */

.nav-dropdown { position: relative; }
.nav-dropdown .chev { transition: transform .2s ease; }
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 480px;
    margin-top: 18px;
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(32,52,59,.1);
    box-shadow: 0 24px 50px -18px rgba(32,52,59,.3);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity .18s ease, transform .2s ease, visibility 0s linear .2s;
}
/* Invisible bridge over the gap so the menu stays open while the
   pointer travels from the link down into it */
.nav-dropdown-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -20px; height: 20px; }
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: opacity .18s ease, transform .2s ease;
}
.nav-dropdown:hover .chev,
.nav-dropdown:focus-within .chev { transform: rotate(180deg); }

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ink-700);
    transition: background-color .14s ease, color .14s ease;
}
.nav-dropdown-icon {
    width: 38px; height: 38px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: rgba(97,153,173,.12);
    color: var(--brand-700);
    transition: background-color .14s ease, color .14s ease;
}
.nav-dropdown-item:hover, .nav-dropdown-item.is-active { background: rgba(97,153,173,.08); color: var(--brand-700); }
.nav-dropdown-item:hover .nav-dropdown-icon, .nav-dropdown-item.is-active .nav-dropdown-icon { background: var(--brand-500); color: #fff; }
.nav-dropdown-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    padding: 12px;
    border-top: 1px solid rgba(32,52,59,.08);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gold-600);
    transition: color .14s ease;
}
.nav-dropdown-all:hover { color: var(--brand-900); }

/* Mobile departments sub-list — same grid-rows collapse as the menu itself */
.mobile-sub { display: grid; grid-template-rows: minmax(0, 0fr); transition: grid-template-rows .32s cubic-bezier(.4,0,.2,1); }
.mobile-sub > div { overflow: hidden; min-height: 0; padding-inline-start: 6px; }
[data-mobile-sub].is-open .mobile-sub { grid-template-rows: minmax(0, 1fr); }
.mobile-sub-toggle .chev { transition: transform .2s ease; }
[data-mobile-sub].is-open .mobile-sub-toggle .chev { transform: rotate(180deg); }

/* ---------- Mobile menu ---------- */
/* Scoped under the same "lg" breakpoint as the Tailwind `lg:hidden` utility
   on #mobileMenu itself. Without this media guard, the unconditional
   `#mobileMenu { display: grid }` below (an ID selector) outranks Tailwind's
   `.lg\:hidden { display: none }` (a class selector) on specificity alone,
   so the collapsed menu never actually hides on desktop — it sits there at
   its collapsed-but-nonzero height, inflating the header. */
@media (max-width: 1023.98px) {
    #mobileMenu {
        display: grid;
        grid-template-rows: minmax(0, 0fr);
        min-height: 0;
        opacity: 0;
        transition: grid-template-rows .42s cubic-bezier(.4,0,.2,1), opacity .24s ease;
    }
    #mobileMenu > * { overflow: hidden; min-height: 0; }
    #mobileMenu.is-open {
        grid-template-rows: minmax(0, 1fr);
        opacity: 1;
        transition: grid-template-rows .42s cubic-bezier(.4,0,.2,1), opacity .3s ease .06s;
    }
}
.mobile-menu-item {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .3s ease, transform .3s ease;
}
#mobileMenu.is-open .mobile-menu-item { opacity: 1; transform: translateY(0); }
#mobileMenu.is-open .mobile-menu-item:nth-child(1) { transition-delay: .07s; }
#mobileMenu.is-open .mobile-menu-item:nth-child(2) { transition-delay: .12s; }
#mobileMenu.is-open .mobile-menu-item:nth-child(3) { transition-delay: .17s; }
#mobileMenu.is-open .mobile-menu-item:nth-child(4) { transition-delay: .22s; }
#mobileMenu.is-open .mobile-menu-item:nth-child(5) { transition-delay: .27s; }

#mobileMenuToggle .bar {
    display: block;
    width: 22px; height: 1.5px;
    background: currentColor;
    transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
#mobileMenuToggle .bar + .bar { margin-top: 6px; }
#mobileMenuToggle.is-active .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
#mobileMenuToggle.is-active .bar:nth-child(2) { opacity: 0; }
#mobileMenuToggle.is-active .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Misc ---------- */

.stat-num { font-variant-numeric: tabular-nums; }

.timeline-track { position: relative; }
.timeline-track .hairline { position: absolute; top: 0; left: 6%; right: 6%; }
.timeline-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--gold-500);
    box-shadow: 0 0 0 5px rgba(97,153,173,.18);
}

/* ---------- Center photography ---------- */

/* Photos sit in a square-cornered frame with a thin brand hairline,
   matching the site's editorial (not rounded-card) language. */
.photo-frame {
    position: relative;
    overflow: hidden;
    background: #e9eef0;
}
.photo-frame img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.photo-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(97,153,173,.25);
    pointer-events: none;
}
a:hover .photo-frame img,
.photo-frame.zoomable:hover img { transform: scale(1.045); }

/* Department card: photo with the title on a dark gradient over its foot */
.dept-card {
    position: relative;
    display: block;
    overflow: hidden;
    color: #fff;
}
.dept-card .dept-card-body {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 24px 24px;
    background: linear-gradient(to top, rgba(20,34,41,.96) 0%, rgba(20,34,41,.82) 55%, rgba(20,34,41,0) 100%);
}

/* Home hero: clinic photo behind a dark overlay that keeps the text legible */
.hero-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 460px at 50% 45%, rgba(20,34,41,.5), rgba(20,34,41,.78) 75%),
        linear-gradient(to bottom, rgba(20,34,41,.55), rgba(20,34,41,.85));
}

/* ---------- Home hero: department icons linking to each department ---------- */

/* One even row of equal tiles (6 on desktop, 3 on tablet, 2 on phones).
   The 1px grid gap over a light background draws even hairlines. */
.dept-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid rgba(166,196,207,.22);
    background: rgba(166,196,207,.22);
    backdrop-filter: blur(6px);
}
@media (min-width: 640px) { .dept-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .dept-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.dept-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 24px 12px 22px;
    color: rgba(255,255,255,.88);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    background: rgba(20,34,41,.62);
    transition: background .25s ease, color .25s ease;
}
.dept-pill-label { min-height: 3em; display: flex; align-items: flex-start; justify-content: center; }
.dept-pill-icon {
    position: relative;
    width: 54px; height: 54px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: var(--brand-500);
    color: #fff;
    transition: background .25s ease, color .25s ease, transform .25s ease;
}
/* Soft pulse ring hints that the icons are clickable */
.dept-pill-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: inherit;
    border: 1.5px solid var(--gold-400);
    opacity: 0;
    animation: dept-pulse 2.8s ease-out infinite;
    animation-delay: inherit;
}
@keyframes dept-pulse {
    0% { opacity: .7; transform: scale(.9); }
    70%, 100% { opacity: 0; transform: scale(1.25); }
}
.dept-pill:hover { background: rgba(43,66,76,.85); color: #fff; }
.dept-pill:hover .dept-pill-icon { background: #fff; color: var(--brand-700); transform: translateY(-3px); }
.dept-pill:focus-visible { outline: 2px solid var(--gold-400); outline-offset: -2px; }
