/* Shared, site-wide header for every page outside the main atlas (which has
   its own richer masthead wired directly into app.js). One definition here
   keeps nav links, branding and the language toggle consistent across
   news.html, submit.html and seasons.html, and lets a language choice made
   on one of them carry over to the others via the same localStorage key
   app.js itself uses. */
/* position:fixed, not sticky, so this stays pinned to the viewport exactly
   like index.html's own masthead does (that page never scrolls the
   masthead away either -- it's a flex:none row inside a 100dvh column,
   which reads the same as "fixed" to a viewer even though it isn't
   literally that CSS property). Placed OUTSIDE each page's own
   <div class="wrap"> in the HTML so its width is never at the mercy of
   whichever wrap happens to contain it (news.html's is 1360px,
   submit.html's 720px, seasons.html's 1180px) -- sticky took its width
   from that wrap and so visibly resized from page to page; full-bleed
   fixed positioning plus its own inner sizing is what makes it exactly
   one size everywhere. Each page reserves --site-header-h of top padding
   on <body> (below) so fixed positioning doesn't cover its own first
   block.
   .siteHeader-inner below is a pixel-for-pixel copy of index.template.html's
   own .masthead rule (padding, crimson top band, hairline bottom border) --
   a flush letterhead bar, not a floating card -- because matching only the
   brand/text sizes still read as a visibly different, thinner component
   than the real thing. .siteHeader itself carries no visible styling of
   its own; it only positions the actual bar. */
/* This is only a pre-JS fallback (avoids a flash of the page's first block
   sitting under the header before site-header.js has run) -- the real
   value is set per-render by that file's syncBodyPad(), which measures the
   header's actual height instead of guessing a fixed number that would
   undershoot whenever the brand/controls wrap differently at a given
   width or language. */
body{padding-top:120px}
@media (max-width:600px){body{padding-top:152px}}
.siteHeader{position:fixed;top:0;left:0;right:0;z-index:50}
.siteHeader-inner{padding:12px 18px;margin:0;
  border-top:4px solid var(--flag-red);
  background:var(--ink-2);border-bottom:1px solid var(--line)}
.siteHeader-top{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
.siteHeader-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--paper)}
.siteHeader-brand b{font-family:Spectral,Georgia,serif;font-size:22px;font-weight:600}
/* .dev isn't always declared by every page that links this stylesheet
   (submit.html has no copy at all) -- defined once here so the brand's
   secondary name always gets the right typeface regardless. */
.dev{font-family:"Noto Sans Devanagari",Archivo,sans-serif}
.siteHeader-brand .dev{font-size:17px;color:var(--paper-dim);font-weight:400;margin-left:9px}
.siteHeader-brand .verBadge{font-size:11px;color:var(--orpiment);font-weight:700;margin-left:6px;vertical-align:3px}
/* Matches index.template.html's own body.ne .masthead h1 rules: whichever
   name is primary gets the typeface that actually has its script's
   glyphs (Devanagari font for "कालक्रम", Spectral for "Kalakram"), not a
   fixed font tied to the English name always being first. */
body.ne .siteHeader-brand b{font-family:"Noto Sans Devanagari",Spectral,serif}
body.ne .siteHeader-brand .dev{font-family:Spectral,Georgia,serif}
.brandMark{width:38px;height:38px;border-radius:50%;flex:none;
  background:var(--ink-2);border:2px solid var(--orpiment);box-shadow:0 0 0 2px var(--ink-2),0 0 0 3px var(--orpiment);
  display:flex;align-items:center;justify-content:center;
  font-family:"Noto Sans Devanagari",serif;font-size:19px;font-weight:700;color:var(--orpiment);line-height:1}
/* Same rule as index.template.html's own .erapill -- there it shows the
   live selected year/era; here it carries the site's one-line tagline
   instead (see TAGLINE in site-header.js), so the header reads as the
   same two-line shape on every page instead of one line shorter here. */
.erapill{margin:2px 0 0;font-size:11.5px;color:var(--paper-dim);font-variant-numeric:tabular-nums;white-space:nowrap}
.siteHeader-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
/* .langtog: kept in sync by hand with index.template.html's own .langtog
   rule (same property values) rather than shared by one stylesheet --
   this file also sets position:fixed and a body padding-top that only
   make sense on these secondary pages, so linking it into index.html
   wholesale would push its full-viewport app layout down by that much. */
.langtog{height:40px;font-size:13px;font-weight:600;padding:0 16px;gap:8px;
  background:var(--ink-3);border:1px solid var(--line);color:var(--paper);
  font-family:"Noto Sans Devanagari",Archivo,sans-serif;border-radius:3px;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;text-decoration:none;
  transition:background .15s ease,border-color .15s ease}
.langtog:hover{background:var(--ink-2);border-color:var(--orpiment)}
.langtog:active{background:var(--ink-3)}
.langtog[aria-current="page"]{background:var(--orpiment);color:var(--ink);border-color:var(--orpiment);font-weight:700}
@media (max-width:940px){.langtog{height:36px;font-size:12px;padding:0 13px;gap:6px}}
/* langBtn's icon+label split (site-header.js) -- the mobile rule below
   hides just .langtogLabel, same fix as index.template.html's own
   masthead. */
.langtogIcon{margin-right:6px}

/* Mobile-only bottom tab bar -- THE SAME component as index.html's own
   .mobileNav: same class names, same property values (kept in sync by
   hand, like everything else in this file), so the two pages render an
   identical bar rather than two that merely resemble each other.
   Appended straight to <body> by site-header.js's renderBottomNav()
   (unlike index.html, these pages have no single flex-column app shell
   to be a flex:none sibling within, so position:fixed stands in for
   that here -- the one necessary difference, not a visual one). Atlas/
   Explore move here on mobile from the header's own row -- see
   .siteHeaderNavLink below -- so language has room to stay beside the
   brand instead of wrapping under it. */
.mobileNav{display:none}
@media (max-width:940px){
  .siteHeader-top{flex-wrap:nowrap;gap:8px}
  .siteHeader-inner{padding:10px 14px}
  .siteHeaderNavLink{display:none}
  /* Hiding the TRIGGER button only, never .moreWrap itself -- the
     dropdown it opens (#siteHeaderMoreMenu) is also inside .moreWrap,
     and unlike index.html's own popovers (which reparent to <body> on
     open) this one just toggles a class in place. Hiding the whole
     wrapper hid the menu along with the button that no longer needed
     to be reachable here -- it opened (confirmed via its own "on"
     class) but could never actually be seen, which is what "Hub" opening
     to nothing on mobile actually was. */
  #siteHeaderMoreBtn{display:none}
  /* With its trigger button hidden, .moreWrap (the menu's own
     position:relative anchor) collapses to near-zero width wherever it
     falls in the now button-less controls row -- the menu's own
     right:0 then anchored to THAT point instead of the viewport's real
     right edge, so it opened well off the left side of the screen
     (confirmed via screenshot: its own cards ran off-screen, text
     clipped). Pinned to the viewport instead, as a sheet open from the
     bottom nav's own Hub tab rather than a corner dropdown -- it doesn't
     need to know anything about where .moreWrap itself ended up. */
  #siteHeaderMoreMenu{position:fixed;top:auto;left:12px;right:12px;bottom:76px;
    width:auto;max-height:min(60vh,440px)}
  /* Same fix as index.template.html's own masthead: margin-left:8px on
     the base .langtog rule (a leftover from before .siteHeader-controls
     had its own gap) stacked with that gap and was just enough to tip
     these two circles over the width left for them, forcing them onto
     two rows instead of staying beside the logo on one. */
  .siteHeader-controls{flex-wrap:nowrap}
  .siteHeader-controls .langtog{width:36px;height:36px;padding:0;border-radius:50%;margin-left:0}
  .siteHeader-controls .langtogIcon{margin-right:0}
  .siteHeader-controls .langtogLabel{display:none}
  body{padding-bottom:64px}
  .mobileNav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:50;
    align-items:center;justify-content:space-around;
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));
    background:var(--ink-2);border-top:1px solid var(--line)}
  .mobileNavBtn{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:3px;
    background:none;border:0;color:var(--paper-dim);font:inherit;font-family:"Noto Sans Devanagari",Archivo,sans-serif;
    font-size:10px;padding:6px 4px;cursor:pointer;text-decoration:none;border-radius:10px;
    transition:color .15s ease}
  .mobileNavBtn span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .mobileNavBtn:hover{color:var(--paper)}
  .mobileNavBtn[aria-current="page"]{color:var(--orpiment)}
}

/* Shared footer, same markup/content as the main atlas's own <footer> --
   see site-footer.js. Rules copied from index.template.html's footer CSS
   verbatim (same class/id names), since these secondary pages don't share
   that file's build step and so can't just reuse one stylesheet include. */
#siteFooter{max-width:1680px;margin:40px auto 0;padding:24px 30px 52px;border-top:1px solid var(--line);color:var(--paper-dim);font-size:12.5px}
#siteFooter section{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
#siteFooter section:first-child{margin-top:0;border-top:0;padding-top:0}
#siteFooter h3{font-family:Archivo,sans-serif;font-size:12.5px;font-weight:600;color:var(--paper);margin-bottom:7px}
#siteFooter ul{margin:6px 0;padding-left:18px}
#siteFooter li{margin-bottom:4px}
#siteFooter .needs{columns:2;column-gap:36px}
#siteFooter .fcols{display:grid;grid-template-columns:1fr 1fr;gap:36px;margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
#siteFooter .fcols .fcol{margin:0;border:0;padding:0}
#siteFooter .fcol h3{margin-bottom:6px}
#siteFooter .fcol p{margin:0 0 8px}
#siteFooter .fcol ul{margin:0;padding-left:18px}
#siteFooter .fcol li{margin-bottom:4px}
#siteFooter .fcol .contact{margin-top:10px;color:var(--paper)}
#siteFooter .fcol .contact b{color:var(--orpiment);font-weight:500}
#siteFooter .sources{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
#siteFooter .sources h3{margin-bottom:6px}
#siteFooter .sources ul{margin:8px 0 8px;padding-left:18px;columns:2;column-gap:36px}
#siteFooter .sources li{margin-bottom:3px}
#siteFooter .sources p{margin:0}
#siteFooter .contact{margin-top:10px}
#siteFooter .contact a{color:var(--orpiment);text-decoration:none;border-bottom:1px solid rgba(110,146,214,.4)}
#siteFooter .contact a:hover{border-bottom-color:var(--orpiment)}
#siteFooter b{color:var(--paper);font-weight:500}
#siteFooter #visitCounter{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
#siteFooter #visitCounter #visitCount{color:var(--paper);font-weight:500}
@media (max-width:760px){
  #siteFooter .fcols{grid-template-columns:1fr;gap:22px}
  #siteFooter .needs,#siteFooter .sources ul{columns:1}
}

@media (max-width:600px){
  .siteHeader-brand b{font-size:17px}
  .brandMark{width:26px;height:26px;font-size:16px}
}
/* Same breakpoint/rule as index.template.html's own @media(max-width:480px)
   .erapill{display:none} -- the tagline drops out to give the brand row
   room at phone width, same as that page's live year/era line does. */
@media (max-width:480px){.erapill{display:none}}

/* Tools & Hub dropdown: same card-shelf drawer as index.html's own
   masthead (see that file's own copy of these rules, kept in sync by
   hand like everything else here), so every page's header is the
   identical component, not a trimmed-down stand-in for it. */
.tab{
  background:var(--ink-3);border:1px solid var(--line);color:var(--paper-dim);
  padding:7px 15px;border-radius:3px;font:inherit;font-size:13px;font-weight:500;cursor:pointer;
  transition:color .15s ease,border-color .15s ease,background .15s ease;
}
.tab:hover{color:var(--paper);background:var(--ink-2);border-color:var(--orpiment)}
.tab:active{background:var(--ink-3)}
a.tab{display:inline-block;text-decoration:none;margin-right:6px}
.moreWrap{position:relative}
.moreMenu{position:absolute;top:44px;left:auto;right:0;z-index:60;display:none;flex-direction:column;gap:6px;padding:8px;
  background:var(--ink-2);border:1px solid var(--line);border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.08);
  max-height:calc(100vh - 24px);overflow-y:auto}
.moreMenu.on{display:flex}
.moreMenu .tab{white-space:nowrap;text-align:left}
.moreMenu.toolsHub{width:min(360px,calc(100vw - 16px));gap:0;padding:12px}
.toolsHubBody{max-height:min(62vh,440px);overflow-y:auto;overflow-x:hidden;
  padding-right:4px;margin-right:-4px;scrollbar-width:thin}
.toolShelf{margin-bottom:14px}
.toolShelf:last-child{margin-bottom:2px}
.toolShelfTitle{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--paper-dim);
  font-weight:700;margin:0 0 8px;font-family:Archivo,sans-serif}
.toolShelfGrid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media (max-width:520px){.toolShelfGrid{grid-template-columns:1fr}}
#siteHeaderMoreMenu .toolCard{display:flex;flex-direction:column;gap:3px;white-space:normal;padding:10px 12px;
  background:var(--ink-3);border-radius:10px;border:1px solid transparent;
  transition:border-color .15s ease,transform .15s ease}
.toolCard:hover{border-color:rgba(110,146,214,.5);transform:translateY(-1px)}
.toolCardTitle{font-size:13px;color:var(--paper);font-weight:600}
.toolCardDesc{font-size:11.5px;color:var(--paper-dim);line-height:1.4}

/* Ask-Kalakram-style floating chat widget -- mounted by ask-widget.js
   (shared by every secondary page via site-header.js, plus news.html's
   own separate instance), pixel-for-pixel copy of index.template.html's
   own #askWidget rules (kept in sync by hand, same convention as every
   other rule in this file). Two separate widget instances can coexist on
   the same page (not true today -- news.html only ever mounts its own,
   site-header.js skips news.html -- but the class-based selectors below
   don't assume only one #askWidget id exists, unlike index.html's own
   id-based copy, since ask-widget.js supports a custom widgetId). */
.askWidget{position:fixed;right:20px;bottom:20px;z-index:55}
.askToggle{width:56px;height:56px;border-radius:50%;background:var(--orpiment);color:var(--ink);
  border:0;font-size:24px;cursor:pointer;display:flex;align-items:center;justify-content:center;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
  transition:transform .15s ease,filter .15s ease}
.askToggle:hover{transform:translateY(-2px);filter:brightness(1.08)}
.askToggle:active{transform:translateY(0) scale(.94)}
.askPanel{position:absolute;right:0;bottom:68px;width:min(360px,calc(100vw - 40px));
  max-height:min(70vh,560px);display:flex;flex-direction:column;
  background:var(--ink-2);border:1px solid var(--line);border-radius:2px;
  box-shadow:0 1px 3px rgba(0,0,0,.08);overflow:hidden}
.askPanel[hidden]{display:none}
.askPanelHead{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:14px 16px;border-bottom:1px solid var(--line);flex:none}
.askPanelHead h2{font-size:16px;margin:0;font-family:Spectral,Georgia,serif;font-weight:500}
.askClose{background:none;border:0;color:var(--paper-dim);font-size:18px;cursor:pointer;padding:2px 4px}
.askClose:hover{color:var(--paper)}
.askMessages{flex:1 1 auto;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.askBubble{max-width:88%;padding:9px 13px;border-radius:2px;font-size:13.5px;line-height:1.45}
.askBubble.user{align-self:flex-end;background:var(--orpiment);color:var(--ink)}
.askBubble.assistant{align-self:flex-start;background:var(--ink-3);color:var(--paper)}
.askBubble p{margin:0 0 6px}
.askBubble p:last-child{margin-bottom:0}
.askChips{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.askChip{background:var(--ink-2);border:1px solid var(--line);color:var(--paper-dim);
  font:inherit;font-size:12px;padding:5px 10px;border-radius:3px;cursor:pointer}
.askChip:hover{color:var(--paper);border-color:var(--paper-dim)}
.askSources{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.askSourceLink{background:transparent;border:1px solid var(--clay);color:var(--clay);
  font-size:12px;padding:4px 9px;border-radius:3px;text-decoration:none}
.askSourceLink:hover{background:var(--clay);color:var(--ink)}
.askForm{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);flex:none}
.askInput{flex:1 1 auto;background:var(--ink);border:1px solid var(--line);color:var(--paper);
  border-radius:3px;padding:9px 14px;font:inherit;font-size:13.5px}
.askInput:focus{outline:2px solid var(--orpiment);outline-offset:1px}
.askSend{width:36px;height:36px;border-radius:50%;background:var(--orpiment);color:var(--ink);
  border:0;font-size:15px;cursor:pointer;flex:none}
.askSend:hover{filter:brightness(1.08)}
@media (max-width:600px){
  .askWidget{right:14px;bottom:14px}
  .askPanel{width:calc(100vw - 28px)}
  /* The bottom tab bar (site-header.css's own .mobileNav) already claims
     this screen edge on phone width -- without lifting the widget above
     it, the toggle button and the tab bar overlapped. */
  .askWidget{bottom:calc(14px + 64px + env(safe-area-inset-bottom))}
}
