/* Shifaia Health — shared site chrome (header nav + footer) for every page.

   Loaded by the marketing pages AND the legal/support pages so both families
   carry the identical header and footer. It is deliberately loaded LAST on
   every page: where it overlaps index.html's inline <style> or legal.css, this
   file is the one that should win.

   Tokens (--blue, --ink, --line, …) are defined by whichever stylesheet the
   page already loads; the var() fallbacks below cover the few tokens that
   exist in legal.css but not in index.html's inline block. */

:root{ --head-h:68px }

/* Anchor targets must clear the sticky header. index.html had smooth scrolling
   but no scroll padding, so every in-page jump landed under the header. */
html{ scroll-padding-top:calc(var(--head-h) + 16px) }

/* ---------- Header ---------- */

.site-head{
  position:sticky;top:0;z-index:60;
  background:rgba(247,250,255,.85);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.head-row{display:flex;align-items:center;justify-content:space-between;
  gap:20px;height:var(--head-h)}

.nav-links{display:flex;align-items:center;gap:22px}
.nav-links > a:not(.langswitch):not(.navcta){
  font-size:15px;font-weight:500;color:var(--slate);
  text-decoration:none;transition:color .16s ease}
.nav-links > a:not(.langswitch):not(.navcta):hover{color:var(--ink)}

/* "You are here" — set by nav.js on the marketing page as you scroll, and
   authored as aria-current="page" on the legal pages. */
.nav-links > a[aria-current]{color:var(--blue-900);font-weight:600}

/* Header call-to-action. Deliberately its own class rather than the .btn /
   .btn-primary pair from index.html's inline styles, so the header renders
   identically on the legal pages, which never load those rules. */
.navcta{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 20px;border-radius:999px;
  background:var(--blue-900);color:#fff;
  font-size:14.5px;font-weight:700;line-height:1.2;text-decoration:none;
  white-space:nowrap;box-shadow:0 4px 14px rgba(11,60,145,.3);
  transition:background .18s ease,transform .18s ease}
.navcta:hover{background:var(--blue);transform:translateY(-1px)}

/* ---------- Legal dropdown ---------- */

.navdrop{position:relative}
.navdrop-btn{
  display:inline-flex;align-items:center;gap:6px;
  font:inherit;font-size:15px;font-weight:500;color:var(--slate);
  background:none;border:0;padding:0;cursor:pointer;transition:color .16s ease}
.navdrop-btn:hover,.navdrop-btn[aria-expanded="true"]{color:var(--ink)}
.navdrop-btn .chev{
  display:inline-block;font-size:10px;line-height:1;color:var(--muted);
  transition:transform .18s ease}
.navdrop-btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
/* current-page state when you are standing inside the legal area */
.navdrop-btn[data-current="true"]{color:var(--blue-900);font-weight:600}

.navdrop-menu{
  position:absolute;top:calc(100% + 14px);left:50%;transform:translateX(-50%) translateY(-6px);
  min-width:318px;padding:8px;
  background:var(--card,#fff);border:1px solid var(--line);border-radius:14px;
  box-shadow:var(--shadow,0 10px 30px rgba(15,23,42,.08));
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .16s ease,transform .16s ease,visibility .16s;
}
.navdrop-menu[data-open="true"]{
  opacity:1;visibility:visible;pointer-events:auto;transform:translateX(-50%) translateY(0)}
/* little pointer up to the button */
.navdrop-menu::before{
  content:"";position:absolute;top:-5px;left:50%;margin-left:-5px;
  width:9px;height:9px;background:var(--card,#fff);
  border-left:1px solid var(--line);border-top:1px solid var(--line);
  transform:rotate(45deg)}

.navdrop-menu a{
  display:block;padding:9px 12px;border-radius:9px;
  font-size:14.5px;font-weight:600;color:var(--ink);
  text-decoration:none;transition:background .14s ease}
.navdrop-menu a small{
  display:block;margin-top:2px;font-size:12.5px;font-weight:400;
  color:var(--muted);line-height:1.45}
.navdrop-menu a:hover,.navdrop-menu a:focus-visible{background:var(--blue-50)}
.navdrop-menu a[aria-current="page"]{background:var(--blue-50);color:var(--blue-900)}

/* ---------- Footer ---------- */

.site-foot{border-top:1px solid var(--line);background:#fff;padding:56px 0 40px}
.foot-top{
  display:grid;grid-template-columns:minmax(240px,1fr) 2.2fr;
  gap:44px;align-items:start}

.foot-brand .brand{margin-bottom:14px}
.foot-blurb{font-size:14px;color:var(--muted);line-height:1.7;max-width:34ch;margin:0 0 16px}

.foot-cols{display:grid;grid-template-columns:repeat(3,1fr);gap:32px}
.foot-col{display:flex;flex-direction:column;gap:9px;align-items:flex-start}
.foot-col h3{
  font-size:12px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  color:var(--faint,#94A3B8);margin:0 0 3px}
.foot-col a{font-size:14.5px;color:var(--slate);text-decoration:none;
  font-weight:500;transition:color .16s ease}
.foot-col a:hover{color:var(--blue)}
.foot-col a[aria-current="page"]{color:var(--blue-900);font-weight:600}
.foot-note{font-size:14px;color:var(--muted);line-height:1.6}

/* ---------- Mobile ---------- */

.menu-btn{display:none;background:none;border:0;cursor:pointer;color:var(--ink);padding:4px}
.menu-btn svg{display:block;width:26px;height:26px;stroke:currentColor;fill:none;
  stroke-width:2;stroke-linecap:round}

@media (max-width:880px){
  .menu-btn{display:block}
  .nav-links{
    display:none;position:absolute;top:var(--head-h);left:0;right:0;
    flex-direction:column;align-items:stretch;gap:0;
    background:#fff;border-bottom:1px solid var(--line);
    padding:6px 24px 18px;
    max-height:calc(100vh - var(--head-h));overflow-y:auto;
    box-shadow:var(--shadow,0 10px 30px rgba(15,23,42,.08))}
  .nav-links.open{display:flex}
  .nav-links.open > a:not(.langswitch):not(.navcta){padding:13px 0;border-bottom:1px solid var(--line)}
  .nav-links.open .langswitch{margin:14px 0 0;justify-content:center;padding:11px 0}
  .nav-links.open .navcta{margin-top:10px}

  /* the dropdown flattens into an in-flow accordion */
  .navdrop{border-bottom:1px solid var(--line)}
  .navdrop-btn{width:100%;justify-content:space-between;padding:13px 0;font-size:15px}
  .navdrop-menu{
    position:static;transform:none;min-width:0;width:100%;
    padding:0 0 10px;margin:0;
    background:none;border:0;border-radius:0;box-shadow:none;
    display:none;opacity:1;visibility:visible;pointer-events:auto;transition:none}
  .navdrop-menu[data-open="true"]{display:block;transform:none}
  .navdrop-menu::before{display:none}
  .navdrop-menu a{padding:9px 0 9px 14px;border-left:2px solid var(--line);border-radius:0}
  .navdrop-menu a small{display:none}
  .navdrop-menu a:hover,.navdrop-menu a[aria-current="page"]{
    background:none;border-left-color:var(--blue)}

  .foot-top{grid-template-columns:1fr;gap:34px}
  .foot-cols{grid-template-columns:repeat(2,1fr);gap:28px}
}

@media (max-width:520px){
  .foot-cols{grid-template-columns:1fr;gap:26px}
}

@media (prefers-reduced-motion:reduce){
  .navdrop-menu,.navdrop-btn .chev{transition:none}
  .navcta:hover{transform:none}
}

@media print{
  .site-head,.menu-btn{display:none!important}
  .foot-cols{grid-template-columns:repeat(3,1fr)}
}

/* ---------- RTL ----------
   The Arabic pages set dir="rtl" on <html>; flexbox/grid already mirror
   themselves, so only the hand-placed left/right values need flipping. */

[dir="rtl"] .navdrop-btn .chev{margin-right:2px}

@media (max-width:880px){
  [dir="rtl"] .navdrop-menu a{
    padding:9px 14px 9px 0;
    border-left:0;border-right:2px solid var(--line)}
  [dir="rtl"] .navdrop-menu a:hover,
  [dir="rtl"] .navdrop-menu a[aria-current="page"]{border-right-color:var(--blue)}
}
