/* ===================================================================
   hub.css — shared styles for every Intracoastal Hub page.
   Page-specific rules stay in the page's own <style> block.
   =================================================================== */

:root{
  --ink:#0E2338; --ink-2:#1B3B57; --tide:#1B5A78;
  --marker-red:#A63328; --marker-green:#2A6B4F; --grass:#8A9A5B;
  --paper:#EDF1F3; --shell:#FFFFFF; --rule:#D3DCE1; --muted:#5B6C79;
  --brand-plate:#FFFFFF;
  --font-body:'Archivo',system-ui,-apple-system,sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,monospace;
  --gut:clamp(16px,3vw,40px); --maxw:1240px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font-body);
     font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2.5px solid var(--tide);outline-offset:3px;border-radius:2px}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 var(--gut)}
[hidden]{display:none !important}

/* ---------- sign-in gate ---------- */
.gate{min-height:100vh;display:grid;place-items:center;padding:24px}
.gate-card{background:var(--shell);border:1px solid var(--rule);border-radius:8px;
           max-width:420px;width:100%;padding:36px 34px;text-align:center}
.gate-mark{width:48px;height:48px;border-radius:5px;background:var(--ink);
           display:grid;place-items:center;margin:0 auto 20px}
.gate-mark svg{width:30px;height:30px}
.gate h1{margin:0 0 8px;font-size:24px;font-weight:800;letter-spacing:-.035em}
.gate p{margin:0 0 24px;font-size:14.5px;color:var(--muted);line-height:1.5}
.msbtn{display:flex;align-items:center;justify-content:center;gap:11px;width:100%;
       background:var(--ink);color:#fff;border:none;border-radius:5px;padding:14px 18px;
       font-family:var(--font-body);font-size:15px;font-weight:600;cursor:pointer;
       transition:background .15s}
.msbtn:hover{background:#122b45}
.ms-logo{width:17px;height:17px;flex-shrink:0;display:grid;grid-template-columns:1fr 1fr;gap:1.5px}
.ms-logo i{display:block;font-style:normal}
.err{margin-top:18px;padding:13px 15px;border-radius:5px;text-align:left;
     background:#F5E4E2;border:1px solid #E4C4C0;color:#6E2119;font-size:13.5px;line-height:1.45}
.err code{font-family:var(--font-mono);font-size:12px;background:rgba(0,0,0,.06);
          padding:1px 4px;border-radius:2px}

/* ---------- masthead ---------- */
.masthead{background:var(--ink);color:#fff}
.masthead-in{display:flex;align-items:center;gap:clamp(12px,2vw,28px);padding:14px 0}
.logo{display:flex;align-items:center;gap:10px;flex-shrink:0}
.logo-mark{width:34px;height:34px;background:#fff;border-radius:3px;
           display:grid;place-items:center;flex-shrink:0}
.logo-mark svg{width:22px;height:22px}
.logo-text b{display:block;font-size:17px;font-weight:700;letter-spacing:-.02em;line-height:1.05}
.logo-text span{display:block;font-family:var(--font-mono);font-size:8.5px;
                letter-spacing:.2em;color:#9DB6C7;text-transform:uppercase}
.who{display:flex;align-items:center;gap:9px;margin-left:auto;flex-shrink:0}
.who .out{background:none;border:1px solid rgba(255,255,255,.22);color:#C6D6E0;
          border-radius:4px;padding:6px 11px;font-family:var(--font-body);
          font-size:12px;font-weight:600;cursor:pointer}
.who .out:hover{background:rgba(255,255,255,.1);color:#fff}
.avatar{width:34px;height:34px;border-radius:50%;flex-shrink:0;
        background:linear-gradient(150deg,var(--tide),var(--ink-2));
        display:grid;place-items:center;font-size:12px;font-weight:700;color:#fff;
        border:1.5px solid rgba(255,255,255,.3);overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}

/* ---------- nav ---------- */
.nav{background:var(--ink-2);border-top:1px solid rgba(255,255,255,.09)}
.nav-in{display:flex;gap:2px;overflow-x:auto;scrollbar-width:none}
.nav-in::-webkit-scrollbar{display:none}
.nav a{padding:11px 15px;font-size:13.5px;font-weight:500;color:#C6D6E0;
       white-space:nowrap;border-bottom:2.5px solid transparent}
.nav a:hover{color:#fff;background:rgba(255,255,255,.06)}
.nav a[aria-current]{color:#fff;border-bottom-color:var(--grass)}

/* ---------- nav dropdown ----------
   The trigger matches the plain tabs exactly. The menu itself is rendered
   OUTSIDE .nav-in and positioned with position:fixed by hub-common.js —
   .nav-in scrolls horizontally, which would otherwise clip it. */
.navdrop{display:flex;align-items:center;gap:6px;padding:11px 15px;font-family:var(--font-body);
         font-size:13.5px;font-weight:500;color:#C6D6E0;white-space:nowrap;background:none;
         border:none;border-bottom:2.5px solid transparent;cursor:pointer}
.navdrop:hover{color:#fff;background:rgba(255,255,255,.06)}
.navdrop[aria-expanded="true"]{color:#fff;background:rgba(255,255,255,.09)}
.navdrop .caret{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;
                border-top:4.5px solid currentColor;display:block;margin-top:1px}
.navmenu{position:fixed;z-index:70;min-width:190px;background:var(--shell);
         border:1px solid var(--rule);border-radius:5px;padding:5px;
         box-shadow:0 6px 22px rgba(14,35,56,.16)}
.navmenu a{display:flex;align-items:center;gap:8px;padding:9px 11px;border-radius:4px;
           font-size:14px;font-weight:500;color:var(--ink)}
.navmenu a:hover,.navmenu a:focus-visible{background:var(--paper);color:var(--tide)}
.navmenu .ext{margin-left:auto;font-size:12px;color:var(--muted)}
@media(hover:none),(max-width:860px){ .navdrop{padding-top:14px;padding-bottom:14px} }

/* ---------- nav: stacked (hamburger) mode ----------
   Below 900px the tab strip does not fit, and a horizontally scrolling
   strip with a hidden scrollbar just looks cut off. So the strip is
   hidden behind a menu button in the masthead and, when opened, stacks
   as full-width rows. hub-common.js moves each dropdown's .navmenu
   inline under its tab (class .is-stack) while stacked, then puts it
   back when the window widens. */
.navtoggle{display:none;align-items:center;justify-content:center;width:40px;height:40px;
           padding:0;background:none;border:1px solid rgba(255,255,255,.22);border-radius:4px;
           color:#C6D6E0;cursor:pointer;flex-shrink:0}
.navtoggle:hover{background:rgba(255,255,255,.1);color:#fff}
.navtoggle .bars{position:relative;display:block;width:18px;height:2px;background:currentColor;
                 border-radius:1px;transition:background .15s}
.navtoggle .bars::before,.navtoggle .bars::after{content:"";position:absolute;left:0;width:18px;height:2px;
                 background:currentColor;border-radius:1px;transition:transform .18s}
.navtoggle .bars::before{top:-6px}
.navtoggle .bars::after{top:6px}
.navtoggle[aria-expanded="true"] .bars{background:transparent}
.navtoggle[aria-expanded="true"] .bars::before{transform:translateY(6px) rotate(45deg)}
.navtoggle[aria-expanded="true"] .bars::after{transform:translateY(-6px) rotate(-45deg)}

@media(max-width:900px){
  .navtoggle{display:inline-flex}
  .nav-in{display:none;flex-direction:column;gap:0;overflow:visible;padding-bottom:6px}
  .nav.is-open .nav-in{display:flex}
  .nav a,.navdrop{width:100%;padding:13px 14px;justify-content:space-between;
                  border-bottom:1px solid rgba(255,255,255,.07);border-left:3px solid transparent;
                  text-align:left}
  .nav a[aria-current]{border-bottom-color:rgba(255,255,255,.07);border-left-color:var(--grass)}
  .navdrop[aria-expanded="true"]{background:rgba(255,255,255,.09)}
  .nav-in > .nav-right{margin-left:0}

  .navmenu.is-stack{position:static;min-width:0;width:100%;background:rgba(0,0,0,.2);
                    border:0;border-radius:0;box-shadow:none;padding:4px 0 8px}
  .navmenu.is-stack a{color:#DCE6EC;border-radius:0;padding:11px 14px 11px 30px;font-size:14px}
  .navmenu.is-stack a:hover,.navmenu.is-stack a:focus-visible{background:rgba(255,255,255,.06);color:#fff}
  .navmenu.is-stack .ext{color:#9DB6C7}
  .navmenu.is-stack .navsub-toggle{border-left-color:rgba(255,255,255,.12);color:#DCE6EC}
  .navmenu.is-stack .navsub-toggle:hover,.navmenu.is-stack .navsub.is-open>.navsub-toggle{background:rgba(255,255,255,.08)}
  .navmenu.is-stack .navflyout.is-inline{background:rgba(0,0,0,.18)}
  .navmenu.is-stack .navflyout.is-inline a{padding-left:46px}
}

/* ---------- shared page furniture ---------- */
.sec{padding:clamp(26px,3.6vw,40px) 0 0}
.sec-head{display:flex;align-items:baseline;gap:14px;margin-bottom:16px;flex-wrap:wrap}
.sec-head h2{margin:0;font-size:clamp(19px,2.4vw,23px);font-weight:700;letter-spacing:-.025em}
.sec-head .hint{font-size:13px;color:var(--muted);margin-left:auto;text-align:right}
.empty{padding:20px;color:var(--muted);font-size:14px;text-align:center}
.skel{background:linear-gradient(90deg,#E4EAED 25%,#EDF1F3 50%,#E4EAED 75%);
      background-size:200% 100%;animation:sh 1.3s linear infinite;border-radius:3px;color:transparent}
@keyframes sh{to{background-position:-200% 0}}

.foot{background:var(--shell);border-top:1px solid var(--rule);padding:22px 0 40px;
      margin-top:clamp(30px,4vw,48px)}
.foot-in{display:flex;flex-wrap:wrap;gap:8px 26px;align-items:center}
.foot a{font-size:13px;font-weight:500;color:var(--muted)}
.foot a:hover{color:var(--tide)}
.foot .stamp{margin-left:auto;font-family:var(--font-mono);font-size:11px;color:var(--muted)}

/* ---------- brand mark ----------
   The plate behind the logo. The inline fallback SVG is transparent and
   does need a light backing to read against the navy masthead, so
   .logo-mark keeps background:#fff above.

   The real mark from brand_assets does not. It is a navy tile with a
   white wave and a gold band, and it already carries its own thin white
   border, so a plate underneath it just reads as a thick white margin.
   .has-brand therefore clears both the plate and the padding on the
   masthead. If the logo is ever swapped for a light-on-transparent
   version, put the plate back with background:var(--brand-plate).

   The gate is a separate case: the mark sits on a white card there, so
   it keeps its padded, bordered plate. */
.brand-img{width:100%;height:100%;object-fit:contain;display:block}
.logo-mark.has-brand{background:none;padding:0}
.gate-mark.has-brand{background:var(--brand-plate);padding:3px;border:1px solid var(--rule)}

/* ---------- contact links (tel: / mailto: / maps) ----------
   Rendered by phoneLink(), mailLink() and mapLink() in hub-common.js.
   .lnk-off is a value that exists but is not dialable — shown as text
   with a dotted underline so it never looks like a dead link. */
.lnk{color:var(--tide);font-weight:600;text-decoration:none;
     touch-action:manipulation;-webkit-tap-highlight-color:rgba(27,90,120,.14)}
.lnk:hover{text-decoration:underline;text-underline-offset:2px}
.lnk:active{opacity:.6}
.lnk-off{color:var(--muted);border-bottom:1px dotted var(--rule);cursor:help}

/* ---------- impersonation banner ----------
   Rendered by hub-common.js on EVERY page whenever a read-only
   impersonation session is live. Sticky so it cannot be scrolled past —
   an unlabelled session is how someone edits the wrong person's record
   believing it is their own.

   The name badge is .imp .as, not .imp .who, on purpose: .who is already
   the masthead's right-aligned user block, and its margin-left:auto would
   leak in and shove the badge across the bar. */
.imp{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:11px;flex-wrap:wrap;
     padding:10px var(--gut);background:#3A2A12;color:#F7EFE2;
     border-bottom:2px solid #C98A2B;font-size:13px}
.imp b{font-weight:700}
.imp .as{font-family:var(--font-mono);font-size:12px;background:rgba(255,255,255,.13);
         padding:2px 7px;border-radius:3px}
.imp .exp{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.06em;
          text-transform:uppercase;color:#D9C4A2}
.imp .stop{margin-left:auto;font-family:var(--font-body);font-size:12.5px;font-weight:600;
           padding:8px 15px;border-radius:4px;cursor:pointer;
           background:#F7EFE2;color:#3A2A12;border:1px solid #F7EFE2}
.imp .stop:hover{background:#fff}
.imp .stop[disabled]{opacity:.5;cursor:progress}
@media(max-width:640px){ .imp{gap:8px} .imp .stop{margin-left:0} }

/* ---------- mobile ----------
   Everything below assumes a phone in one hand. The two goals are that
   nothing overflows sideways, and that anything tappable is big enough
   to hit without zooming. */

html{-webkit-text-size-adjust:100%}
body{overflow-wrap:break-word}
img{max-width:100%}
.wrap{padding-left:max(var(--gut),env(safe-area-inset-left));
      padding-right:max(var(--gut),env(safe-area-inset-right))}
.nav-in{-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}

/* iOS zooms the page whenever a focused field is under 16px. */
@media(max-width:860px){
  input,select,textarea{font-size:16px !important}
}

/* Touch devices get real 44px tap targets on contact links and controls. */
@media(hover:none),(max-width:860px){
  .lnk{display:inline-flex;align-items:center;min-height:34px;padding:2px 0}
  .nav a{padding-top:14px;padding-bottom:14px}
  .who .out{padding:10px 14px}
  .reveal{min-height:32px;padding:4px 12px}
}

@media(max-width:640px){
  .masthead-in{flex-wrap:wrap;gap:10px}
  .logo-text b{font-size:15.5px}

  /* Facts rows stack: a right-aligned mono value beside a label is the
     first thing to overflow on a narrow screen. */
  .frow{flex-direction:column;align-items:flex-start;gap:1px;padding:9px 0}
  .frow .k{font-size:12px}
  .frow .v,.frow .v.txt{text-align:left;font-size:15px;max-width:100%;
                        overflow-wrap:anywhere}

  .sec-head{gap:6px}
  .sec-head .hint{margin-left:0;text-align:left;flex-basis:100%}

  .foot-in{gap:10px 18px}
  .foot .stamp{margin-left:0;flex-basis:100%}

  .gate-card{padding:30px 22px}
}

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