/* HEADER-01 r2 and NAV-01 — the calm header and the top-left menu (20 October 2026).
   Founder request, 08:23: "do we need to show english and panjabi on the first page or can we
   somehow make it more minimal? the columns for bani, library, about and help – could that be
   placed to the top left corner so it takes up less space? and have it as an animated drop down
   menu when hovered over? then clean up 'tap into bani'". `#site-header` selectors outrank the
   legacy header rules in styles.css, layout.css, themes.css and design-v02.css, which remain
   untouched. See design/components/HEADER.md. The header stays navy in every theme. */
#site-header {
  --h-text:#f7f3e9; --h-muted:#c9d3df; --h-gold:#e8c47f; --h-line:rgba(232,196,127,.42); --h-panel:#0b2442; --h-hover:rgba(232,196,127,.13);
  position:relative; z-index:30; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); grid-template-areas:"menu brand controls";
  align-items:center; gap:12px; height:auto; min-height:0; margin:0; padding:14px max(20px,calc((100vw - 1120px) / 2)) 16px;
  background:#061a35; color:var(--h-text); border:0;
}
#site-header .site-menu { grid-area:menu; justify-self:start; position:relative; }
#site-header .brand-group { grid-area:brand; display:flex; flex-direction:column; align-items:center; gap:0; }
#site-header .header-controls { grid-area:controls; justify-self:end; display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:nowrap; margin:0; }
#site-header :focus-visible { outline:3px solid var(--h-gold); outline-offset:3px; }

/* Header buttons: quiet gold-edged pills on the navy band. */
#site-header .menu-button, #site-header .language-toggle, #site-header .header-resume {
  display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:44px; margin:0; padding:8px 16px;
  border:1px solid var(--h-line); border-radius:999px; background:transparent; color:var(--h-text);
  font:600 .9375rem/1.2 system-ui,'Noto Sans Gurmukhi','Nirmala UI',sans-serif; white-space:nowrap; cursor:pointer;
  transition:background-color .2s ease, border-color .2s ease, color .2s ease;
}
#site-header .menu-button { padding-left:13px; }
#site-header .menu-button:hover, #site-header .language-toggle:hover, #site-menu[data-open=true] .menu-button { background:var(--h-hover); border-color:var(--h-gold); }
#site-header .language-toggle { font-family:'Noto Sans Gurmukhi','Nirmala UI',system-ui,sans-serif; }
#site-header .header-resume { gap:8px; padding-left:12px; border-color:var(--h-gold); background:var(--h-gold); color:#132237; font-weight:650; }
#site-header .header-resume:hover { background:#f0d496; }
#site-header .header-resume svg { width:16px; height:16px; flex:none; fill:currentColor; }
#site-header .header-resume .resume-short { display:none; }

/* The menu icon turns into a close mark while the menu is open. */
#site-header .menu-icon { position:relative; display:inline-block; flex:none; width:18px; height:12px; color:var(--h-gold); }
#site-header .menu-icon i { position:absolute; left:0; width:100%; height:2px; border-radius:2px; background:currentColor; transition:transform .3s cubic-bezier(.2,.8,.2,1), opacity .18s ease; }
#site-header .menu-icon i:nth-child(1) { top:0; }
#site-header .menu-icon i:nth-child(2) { top:5px; }
#site-header .menu-icon i:nth-child(3) { top:10px; }
#site-menu[data-open=true] .menu-icon i:nth-child(1) { transform:translateY(5px) rotate(45deg); }
#site-menu[data-open=true] .menu-icon i:nth-child(2) { opacity:0; transform:scaleX(.2); }
#site-menu[data-open=true] .menu-icon i:nth-child(3) { transform:translateY(-5px) rotate(-45deg); }

/* The drop-down: it unfolds from the menu button and its items arrive one after another. */
#site-header .menu-panel {
  position:absolute; top:calc(100% + 12px); left:0; z-index:5; width:min(272px, calc(100vw - 32px)); padding:8px; box-sizing:border-box;
  border:1px solid var(--h-line); border-radius:18px; background:var(--h-panel); color:var(--h-text);
  box-shadow:0 24px 56px rgba(0,0,0,.46), 0 2px 8px rgba(0,0,0,.25);
  opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-10px) scale(.96); transform-origin:26px -8px;
  transition:opacity .16s ease, transform .2s ease, visibility 0s linear .2s;
}
#site-menu[data-open=true] .menu-panel { opacity:1; visibility:visible; pointer-events:auto; transform:none;
  transition:opacity .2s ease, transform .34s cubic-bezier(.2,.8,.2,1), visibility 0s; }
#site-header .menu-panel::before { content:''; position:absolute; top:-6px; left:24px; width:10px; height:10px; transform:rotate(45deg);
  background:var(--h-panel); border-left:1px solid var(--h-line); border-top:1px solid var(--h-line); }
/* An invisible bridge over the gap below the button, so a mouse moving down stays inside. */
#site-header .menu-panel::after { content:''; position:absolute; left:0; right:0; top:-14px; height:14px; }
#site-header .primary-nav { display:block; margin:0; padding:0; border:0; gap:0; }
#site-header .menu-list { list-style:none; display:flex; flex-direction:column; gap:2px; margin:0; padding:0; }
#site-header .menu-tools { margin-top:6px; padding-top:6px; border-top:1px solid rgba(232,196,127,.2); }
#site-header .menu-list button {
  display:flex; align-items:center; gap:12px; width:100%; min-width:0; min-height:48px; margin:0; padding:10px 12px;
  border:0; border-radius:12px; background:transparent; color:var(--h-text); font:600 1rem/1.3 system-ui,'Noto Sans Gurmukhi','Nirmala UI',sans-serif;
  text-align:left; cursor:pointer; transition:background-color .15s ease, color .15s ease;
}
#site-header .menu-list button:hover, #site-header .menu-list button:focus-visible { background:var(--h-hover); }
#site-header .menu-list button:focus-visible { outline-offset:-2px; }
#site-header .menu-list button[aria-current=page] { color:var(--h-gold); }
#site-header .menu-list button[aria-current=page]::after { content:''; flex:none; width:7px; height:7px; margin-left:auto; border-radius:50%; background:var(--h-gold); }
#site-header .menu-glyph { width:20px; height:20px; flex:none; fill:none; stroke:var(--h-gold); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#site-header .menu-list li { opacity:0; transform:translateY(-4px); transition:opacity .18s ease, transform .28s cubic-bezier(.2,.8,.2,1); }
#site-menu[data-open=true] .menu-list li { opacity:1; transform:none; }
#site-menu[data-open=true] .primary-nav li:nth-child(1) { transition-delay:.04s; }
#site-menu[data-open=true] .primary-nav li:nth-child(2) { transition-delay:.07s; }
#site-menu[data-open=true] .primary-nav li:nth-child(3) { transition-delay:.1s; }
#site-menu[data-open=true] .primary-nav li:nth-child(4) { transition-delay:.13s; }
#site-menu[data-open=true] .menu-tools li:nth-child(1) { transition-delay:.16s; }
#site-menu[data-open=true] .menu-tools li:nth-child(2) { transition-delay:.19s; }

/* Pages keep one language switch at the top; Settings also lists both languages. */
#dialog .dialog-language { display:none; }
body[data-page=settings] #dialog .dialog-language { display:flex; width:max-content; max-width:100%; margin:0 auto 20px; }

/* BANI-01: the Bani page opens straight onto the pucks. Its heading stays for screen readers. */
body[data-home=true]:not(.page-open) #collection-top { display:flex; flex-direction:column; align-items:center; gap:0; margin:20px auto 0; text-align:center; }
body[data-home=true] #collection-top .collection-heading { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
body[data-home=true] #collection-top .play-all {
  display:inline-flex; align-items:center; gap:10px; min-height:48px; margin:0; padding:10px 22px; border-radius:999px;
  border:1px solid color-mix(in srgb, var(--accent) 65%, transparent); background:color-mix(in srgb, var(--accent) 9%, transparent);
  color:var(--accent); font:650 1rem/1.2 system-ui,'Noto Sans Gurmukhi','Nirmala UI',sans-serif; box-shadow:none; filter:none;
}
body[data-home=true] #collection-top .play-all:hover { background:color-mix(in srgb, var(--accent) 17%, transparent); border-color:var(--accent); }
body[data-home=true] #library-tools:not([open]) { display:none; }
body[data-home=true] #library-tools[open] { margin:16px auto 0; }
body[data-home=true] #collection.disc-grid { margin-top:22px; }

/* ---------- Phones: menu and language on one slim row, the logo beneath ---------- */
@media (max-width:699px) {
  #site-header { grid-template-columns:auto minmax(0,1fr); grid-template-areas:"menu controls" "brand brand"; row-gap:2px; column-gap:8px; padding:10px 16px 14px; }
  #site-header .brand { width:202px; height:73px; }
  #site-header .brand img { width:226px; height:113px; left:-8px; top:-18px; }
  #site-header .brand-slogan { margin-top:-2px; }
  body[data-home=true] #collection-top { margin-top:16px; }
  body[data-home=true] #collection.disc-grid { margin-top:18px; }
}
@media (max-width:519px) {
  #site-header .header-resume .resume-long { display:none; }
  #site-header .header-resume .resume-short { display:inline; }
}
@media (max-width:359px) {
  #site-header { padding-left:12px; padding-right:12px; }
  #site-header .menu-button { padding:8px 13px; }
  #site-header .menu-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  #site-header .language-toggle, #site-header .header-resume { padding-left:12px; padding-right:12px; }
}
@media (prefers-reduced-motion:reduce) {
  #site-header .menu-panel, #site-menu[data-open=true] .menu-panel, #site-header .menu-list li, #site-header .menu-icon i { transition:none; transform:none; }
}
/* Touch screens keep a tapped button's hover look until the next tap; the header skips it. */
@media (hover:none) {
  #site-header .menu-button:hover, #site-header .language-toggle:hover { background:transparent; border-color:var(--h-line); }
  #site-menu[data-open=true] .menu-button:hover { background:var(--h-hover); border-color:var(--h-gold); }
  #site-header .menu-list button:hover:not(:focus-visible) { background:transparent; }
  #site-header .header-resume:hover { background:var(--h-gold); }
}
