/* =========================================================================
   UIIC SETU — SHARED SITE NAVIGATION (nav-shared.css)
   One stylesheet, used on every page. Edit this file only — never re-type
   the nav's CSS into a page again. It is fully self-contained (its own
   colors, fonts and spacing, all under --hdr-* / --nav-* names) so it
   renders identically no matter what CSS variables the host page defines.
   ========================================================================= */

@keyframes logoFloat{0%{transform:translateY(0)}50%{transform:translateY(-6px)}100%{transform:translateY(0)}}
@keyframes glowPulse{0%{filter:drop-shadow(0 0 6px rgba(200,151,42,.25)) drop-shadow(0 0 12px rgba(200,151,42,.1));}50%{filter:drop-shadow(0 0 14px rgba(200,151,42,.55)) drop-shadow(0 0 26px rgba(200,151,42,.3));}100%{filter:drop-shadow(0 0 6px rgba(200,151,42,.25)) drop-shadow(0 0 12px rgba(200,151,42,.1));}}

#siteHeader{
  --hdr-page-max:1500px;--hdr-page-w:94%;
  --hdr-nav-bg:#ffffff;--hdr-border:#e5e7eb;--hdr-ink:#0f2460;--hdr-ink-soft:#2a2f38;
  --hdr-muted:#64748b;--hdr-emblem:#0f2460;--hdr-gold:#c8972a;--hdr-gold-soft:#f5e9cb;
  --hdr-pill-soon-bg:#eceef2;--hdr-pill-soon-text:#8a90a0;
  --hdr-glass-bg:rgba(255,248,235,0.94);--hdr-glass-border:rgba(200,151,42,0.32);--hdr-glass-sheen:rgba(255,255,255,0.55);
  --hdr-font-heading:'EB Garamond',serif;--hdr-font-body:'DM Sans',Arial,Helvetica,sans-serif;
  background:var(--hdr-nav-bg);border-bottom:1px solid var(--hdr-border);position:sticky;top:0;z-index:40;
  font-family:var(--hdr-font-body);
}
#siteHeader[data-theme="dark"]{--hdr-nav-bg:#101a30;--hdr-border:#22304d;--hdr-ink:#e9ecf5;--hdr-ink-soft:#c9cee0;
  --hdr-muted:#8b93ab;--hdr-emblem:#1b2f57;--hdr-gold:#e0b559;--hdr-gold-soft:#2a2413;
  --hdr-pill-soon-bg:#1a2440;--hdr-pill-soon-text:#6d7690;
  --hdr-glass-bg:rgba(36,28,14,0.94);--hdr-glass-border:rgba(224,181,89,0.3);--hdr-glass-sheen:rgba(255,244,214,0.08);
  background:var(--hdr-nav-bg);border-bottom-color:var(--hdr-border);}

#siteHeader .navwrap{width:var(--hdr-page-w);max-width:var(--hdr-page-max);margin:0 auto;padding:0 20px;
  height:60px;display:flex;align-items:center;justify-content:space-between;}
#siteHeader .logo-small{height:42px;animation:logoFloat 4s ease-in-out infinite, glowPulse 2.8s ease-in-out infinite;display:block;}
#siteHeader .brandwrap{display:flex;flex-direction:column;line-height:1.15;}
#siteHeader .brandwrap .word{font-weight:700;font-size:16px;}
/* Tagline removed permanently from the nav bar (was wrapping onto a second
   line and colliding with the nav links at in-between widths) — kept as a
   rule (display:none) rather than deleted, so it stays easy to bring back. */
#siteHeader .brandwrap .tag{display:none;}

.navwrap-right{display:flex;align-items:center;gap:20px;}
.navlinks{display:flex;gap:2px;align-items:center;}
.navlinks .navlink{position:relative;font-family:var(--hdr-font-body);font-weight:500;font-size:14px;
  color:var(--hdr-muted);text-decoration:none;padding:10px 11px;background:none;border:none;
  border-radius:8px;cursor:pointer;display:flex;align-items:center;gap:5px;white-space:nowrap;
  transition:background .15s ease,color .15s ease;}
.navlinks .navlink::after{content:"";position:absolute;left:50%;right:50%;bottom:4px;height:2.5px;
  background:var(--hdr-gold);transition:left .18s ease,right .18s ease;}
.navlinks .navlink:hover,.navlinks .navlink.active{background:rgba(15,36,96,0.08);color:var(--hdr-ink);}
#siteHeader[data-theme="dark"] .navlinks .navlink:hover,
#siteHeader[data-theme="dark"] .navlinks .navlink.active{background:rgba(255,255,255,0.08);}
.navlinks .navlink:hover::after,.navlinks .navlink.active::after{left:11px;right:11px;}
.nav-chev{width:8px;height:8px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
  transform:rotate(45deg);transition:transform .18s ease;margin-top:-3px;}
.dd-wrap{position:relative;}
.dd-wrap.open .nav-chev{transform:rotate(225deg);margin-top:3px;}
.glass-panel{position:absolute;top:100%;left:50%;transform:translateX(-50%);
  background:var(--hdr-glass-bg);border:1px solid var(--hdr-glass-border);border-radius:16px;
  box-shadow:inset 0 1px 0 var(--hdr-glass-sheen);
  backdrop-filter:blur(16px) saturate(140%);-webkit-backdrop-filter:blur(16px) saturate(140%);
  padding:8px;display:flex;flex-direction:column;gap:2px;white-space:nowrap;min-width:250px;z-index:60;
  opacity:0;visibility:hidden;translate:0 -6px;
  transition:opacity .16s ease,translate .16s ease,visibility .16s;}
.dd-wrap.open .glass-panel{opacity:1;visibility:visible;translate:0 4px;}
.shelf-item{border-radius:8px;padding:7px 10px;}
.shelf-item:not(.disabled):hover{background:var(--hdr-gold-soft);}
.shelf-head{display:flex;align-items:center;gap:10px;font-family:var(--hdr-font-body);
  font-weight:600;font-size:13.5px;color:var(--hdr-ink-soft);text-decoration:none;}
.shelf-icon{width:18px;height:18px;flex-shrink:0;}
.shelf-sub{display:flex;align-items:center;gap:5px;margin:4px 0 0 28px;
  font-size:11.5px;color:var(--hdr-muted);text-decoration:none;}
.shelf-sub:hover{color:var(--hdr-ink);}
.shelf-sub svg{width:13px;height:13px;flex-shrink:0;}
.badge-soon{margin-left:auto;font-size:9.5px;font-weight:600;color:var(--hdr-pill-soon-text);
  background:var(--hdr-pill-soon-bg);padding:2px 8px;border-radius:999px;}
.shelf-item.disabled .shelf-head{color:var(--hdr-pill-soon-text);cursor:default;}
.shelf-item.disabled .shelf-icon{opacity:.5;}
.shelf-item.disabled .shelf-sub{color:var(--hdr-pill-soon-text);pointer-events:none;}
.knowledge-panel{min-width:190px;}
.k-row{display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:9px 10px;border-radius:8px;cursor:default;}
.k-name{font-family:var(--hdr-font-body);font-weight:600;font-size:13.5px;color:var(--hdr-pill-soon-text);}
.theme-toggle{display:flex;align-items:center;gap:7px;background:none;border:none;cursor:pointer;padding:0;}
.tg-icon{width:14px;height:14px;color:var(--hdr-muted);flex-shrink:0;}
.tg-track{width:40px;height:22px;border-radius:999px;background:var(--hdr-border);
  position:relative;transition:background .2s ease;display:block;}
.tg-thumb{position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;
  background:var(--hdr-gold);transition:translate .2s ease;}
#siteHeader[data-theme="dark"] .tg-track{background:var(--hdr-emblem);}
#siteHeader[data-theme="dark"] .tg-thumb{translate:18px 0;}
.identity{display:flex;align-items:center;gap:9px;background:none;border:none;cursor:pointer;
  padding:4px;font-family:var(--hdr-font-body);}
.identity-seal{width:30px;height:30px;border-radius:50%;flex-shrink:0;background:var(--hdr-emblem);
  border:1.5px solid var(--hdr-gold);display:flex;align-items:center;justify-content:center;
  font-family:var(--hdr-font-heading);font-weight:600;font-size:12px;color:var(--hdr-gold);}
/* Identity now renders as one line — "NAME (Type)" — to match the reference
   layout, with the branch kept only as a title-attribute tooltip. id-branch
   stays in the markup (for pages/scripts that still read it) but collapses
   to nothing when empty so it never reserves a blank second line. */
.id-text{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;line-height:1.2;}
.id-name{font-size:13px;font-weight:600;color:var(--hdr-ink);white-space:nowrap;}
.id-branch{font-size:11px;color:var(--hdr-muted);}
.id-branch:empty{display:none;margin:0;}
.identity .nav-chev{color:var(--hdr-muted);}
.navburger{display:none;flex-direction:column;justify-content:center;gap:5px;
  width:34px;height:34px;padding:6px;background:none;border:none;cursor:pointer;flex-shrink:0;}
.navburger span{display:block;height:2px;width:100%;background:var(--hdr-ink);border-radius:2px;
  transition:transform .2s ease,opacity .2s ease;}
#siteHeader.nav-open .navburger span:nth-child(1){transform:translateY(7px) rotate(45deg);}
#siteHeader.nav-open .navburger span:nth-child(2){opacity:0;}
#siteHeader.nav-open .navburger span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

@media(max-width:900px){
  #siteHeader .navwrap{height:56px;padding:0 14px;}
  /* Small screens: drop the emblem too, so only the "UIIC Setu" wordmark
     is left — keeps the header on one line next to the hamburger button. */
  #siteHeader .logo-small{display:none;}
  .navwrap-right{gap:8px;}
  .navburger{display:flex;order:-1;}
  .textsize-toggle{display:none;}

  /* The link row becomes a full-width dropdown panel under the header,
     shown only while #siteHeader carries "nav-open" (see nav-shared.js). */
  .navlinks{display:none;position:absolute;top:56px;left:0;right:0;
    flex-direction:column;align-items:stretch;gap:2px;
    background:var(--hdr-nav-bg);border-bottom:1px solid var(--hdr-border);
    padding:10px 14px 16px;box-shadow:0 16px 28px rgba(15,23,42,.12);z-index:55;
    max-height:calc(100vh - 56px);overflow-y:auto;}
  #siteHeader.nav-open .navlinks{display:flex;}
  .navlinks .navlink{width:100%;justify-content:space-between;padding:13px 10px;}
  .navlinks .navlink::after{display:none;}
  .dd-wrap{width:100%;}

  /* Dropdown sub-panels (Calculator / Policy knowledge) sit inline,
     indented, instead of floating over the page. */
  .glass-panel{position:static;transform:none;width:100%;min-width:0;
    opacity:1;visibility:visible;translate:none;display:none;
    background:transparent;border:none;box-shadow:none;
    backdrop-filter:none;-webkit-backdrop-filter:none;
    padding:0 0 6px 14px;}
  .dd-wrap.open .glass-panel{display:flex;}
}

/* ---------------------------------------------------------------------
   TEXT SIZE CONTROL (A- / 100% / A+)
   Adjusts the whole page's root font-size (see nav-shared.js:initTextSize).
   Only works on pages whose CSS is written in rem units — the nav itself
   uses px throughout on purpose, so this control never resizes the header.
   --------------------------------------------------------------------- */
.textsize-toggle{display:flex;align-items:center;gap:2px;font-family:var(--hdr-font-body);
  border:1px solid var(--hdr-border);border-radius:999px;padding:3px;background:transparent;}
.textsize-toggle button{background:none;border:none;cursor:pointer;color:var(--hdr-muted);
  font-family:var(--hdr-font-body);font-weight:700;font-size:11px;line-height:1;padding:6px 9px;
  border-radius:999px;transition:background .15s ease,color .15s ease;}
.textsize-toggle button:hover{background:rgba(15,36,96,0.08);color:var(--hdr-ink);}
#siteHeader[data-theme="dark"] .textsize-toggle button:hover{background:rgba(255,255,255,0.08);}
.textsize-toggle button:first-child{font-size:10px;}
.textsize-toggle button:last-child{font-size:13px;}
.textsize-toggle button[disabled]{opacity:.35;cursor:default;}
.textsize-toggle button[disabled]:hover{background:none;color:var(--hdr-muted);}
#textSizeLabel{font-size:10.5px;color:var(--hdr-muted);min-width:32px;text-align:center;user-select:none;}
@media(max-width:640px){#textSizeLabel{display:none;}}

/* ---------------------------------------------------------------------
   PHONE / TABLET HEADER (kept LAST so these rules win over the ones above)
   - The bar is exactly the screen width (it used to be 94% + padding).
   - The A-/A+ box is hidden on phones.
   - The SR avatar is only a badge (not clickable); the name lives in the drawer.
   - The menu button opens a drawer from the right, with the links, a
     "My account" section and Log out. Desktop is unchanged.
   --------------------------------------------------------------------- */
.drawer-prof,.drawer-acct{display:none;}
@media(max-width:900px){
  #siteHeader .navwrap{width:100%;box-sizing:border-box;}
  .textsize-toggle{display:none;}

  /* SR = badge only */
  .identity{pointer-events:none;cursor:default;min-width:0;}
  .identity .nav-chev,.id-text{display:none;}
  #idWrap{width:auto;}
  #idWrap .glass-panel{display:none !important;}

  /* The link list becomes a drawer sliding in from the right */
  .navlinks{display:flex;position:fixed;top:56px;right:0;bottom:0;left:auto;
    width:min(300px,86vw);max-height:none;flex-direction:column;align-items:stretch;gap:2px;
    padding:0 8px 12px;background:var(--hdr-nav-bg);border-bottom:none;
    border-left:1px solid var(--hdr-border);box-shadow:-10px 0 28px rgba(15,23,42,.22);
    z-index:55;overflow-y:auto;overscroll-behavior:contain;
    transform:translateX(105%);visibility:hidden;
    transition:transform .22s ease,visibility .22s;}
  #siteHeader.nav-open .navlinks{transform:none;visibility:visible;}
  /* dimmed page behind the drawer (tap it to close) */
  #siteHeader.nav-open::before{content:"";position:fixed;left:0;right:0;top:56px;bottom:0;
    background:rgba(15,23,42,.45);z-index:50;}

  .drawer-prof{display:flex;align-items:center;gap:12px;margin:0 -8px 8px;padding:16px;
    background:var(--hdr-emblem);color:#fff;}
  .drawer-prof:empty{display:none;}
  .drawer-prof .identity-seal{width:40px;height:40px;font-size:15px;}
  .drawer-prof .dp-name{font-size:14px;font-weight:700;line-height:1.25;color:#fff;}
  .drawer-prof .dp-type{font-size:11.5px;color:#c7d5f0;margin-top:2px;}

  /* My account + Log out, kept at the bottom of the drawer */
  .drawer-acct{display:flex;flex-direction:column;margin-top:auto;gap:2px;
    border-top:1px solid var(--hdr-border);padding-top:6px;}
  .navlinks .acct-panel .shelf-sub,.navlinks .drawer-acct .shelf-sub{
    font-size:13.5px;margin:0;padding:10px 4px 10px 14px;color:var(--hdr-ink-soft);}
  .navlinks .navlink{color:var(--hdr-ink-soft);font-size:15px;}
  .navlinks .navlink.active{color:var(--hdr-ink);font-weight:600;}
  .navlinks .drawer-logout{color:#b4421c;}
}
