/* Shared site navigation for Shadow of Sorrow.
   - Top bar on every page with the list of secondary pages (alphabetical).
   - On the home page only: a collapsible side drawer with the home sections.
   Markup is generated by scripts/build_nav.py; behaviour lives in site-nav.js.
   All selectors are namespaced with "sos-" so page styles are not affected. */

.sos-topbar{
  --sos-bg:#0b1016f2;--sos-ink:#efe5d1;--sos-muted:#b9ab90;--sos-gold:#d9b978;--sos-line:#d3b77b33;
  position:relative;z-index:900;background:var(--sos-bg);border-bottom:1px solid var(--sos-line);
  color:var(--sos-ink);font:500 14px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);text-align:left;letter-spacing:normal;text-transform:none
}
/* Only the home page keeps the bar pinned: it carries the drawer button. */
.sos-topbar--home{position:sticky;top:0}
.sos-topbar *,.sos-drawer *{box-sizing:border-box}
.sos-topbar__in{overflow:visible;max-width:1680px;margin:0 auto;min-height:56px;padding:0 16px;display:flex;align-items:center;gap:14px}

.sos-topbar a.sos-brand{flex:0 0 auto;color:var(--sos-ink);text-decoration:none;font:600 13px/1 Georgia,"Times New Roman",serif;letter-spacing:.14em;text-transform:uppercase;white-space:nowrap;padding:8px 0;border:0;background:none}
.sos-topbar a.sos-brand b{color:var(--sos-gold);font-weight:400;margin-right:4px}
.sos-topbar a.sos-brand:hover{color:#fff}

/* Buttons share one look; explicit properties override page-level button rules. */
.sos-topbar .sos-btn,.sos-drawer .sos-btn{
  display:inline-flex;align-items:center;gap:8px;min-height:40px;margin:0;padding:0 13px;
  border:1px solid #d3b77b55;border-radius:999px;background:#ffffff08;color:var(--sos-ink,#efe5d1);
  font:600 13px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.02em;text-transform:none;
  cursor:pointer;box-shadow:none;-webkit-appearance:none;appearance:none;white-space:nowrap;width:auto;height:auto
}
.sos-topbar .sos-btn:hover,.sos-drawer .sos-btn:hover{background:#d3b77b1f;border-color:#d3b77b99;color:#fff}
.sos-topbar .sos-btn:focus-visible,.sos-drawer .sos-btn:focus-visible,.sos-topbar a:focus-visible,.sos-drawer a:focus-visible{outline:2px solid var(--sos-gold,#d9b978);outline-offset:2px}

/* Hamburger icon for the drawer button */
.sos-burger{position:relative;display:inline-block;width:16px;height:2px;background:currentColor;border-radius:2px}
.sos-burger::before,.sos-burger::after{content:"";position:absolute;left:0;width:16px;height:2px;background:currentColor;border-radius:2px}
.sos-burger::before{top:-5px}.sos-burger::after{top:5px}

/* The drawer button only makes sense with JavaScript. */
.sos-drawer-toggle{display:none!important}
.sos-js .sos-drawer-toggle{display:inline-flex!important}

/* Secondary pages menu */
.sos-topbar .sos-pages{margin:0 0 0 auto;padding:0;position:relative;min-width:0;overflow:visible;display:block;background:none;border:0}
.sos-pages-toggle{display:none!important}
.sos-pages-toggle .sos-caret{font-size:10px;transition:transform .2s}
.sos-pages-toggle[aria-expanded="true"] .sos-caret{transform:rotate(180deg)}
.sos-pages__list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:2px 4px}
.sos-pages__list li{margin:0;padding:0;list-style:none}
.sos-pages__list li::before{content:none}
.sos-topbar .sos-pages__list a{display:block;padding:8px 6px;border-radius:7px;color:var(--sos-muted);text-decoration:none;white-space:nowrap;border:0;background:none;font:inherit;font-size:13.5px}
.sos-topbar .sos-pages__list a:hover{color:#fff;background:#ffffff0d}
.sos-topbar .sos-pages__list a[aria-current="page"]{color:var(--sos-gold);box-shadow:inset 0 -2px 0 var(--sos-gold);border-radius:7px 7px 0 0}

/* Compact mode: site-nav.js adds html.sos-compact whenever the links do not
   fit on one line (narrow screens, larger fonts, more pages) and the list
   becomes the "Pagine" dropdown. Without JavaScript the links simply wrap. */
.sos-js .sos-pages__list{flex-wrap:nowrap;justify-content:flex-start}
.sos-compact .sos-pages-toggle{display:inline-flex!important}
.sos-compact .sos-pages__list{
  display:none;position:absolute;right:0;top:calc(100% + 8px);min-width:230px;max-width:calc(100vw - 32px);
  max-height:calc(100vh - 90px);overflow:auto;padding:8px;flex-direction:column;flex-wrap:nowrap;gap:2px;
  background:#101820;border:1px solid #d3b77b44;border-radius:12px;box-shadow:0 18px 50px #000a
}
.sos-compact .sos-pages__list.is-open{display:flex}
.sos-compact .sos-topbar .sos-pages__list a{padding:11px 12px;font-size:15px;color:var(--sos-ink)}
.sos-compact .sos-topbar .sos-pages__list a[aria-current="page"]{box-shadow:inset 3px 0 0 var(--sos-gold);border-radius:4px 7px 7px 4px}
/* Tight mode: the drawer button keeps only its icon to leave room for the links */
.sos-tight .sos-drawer-toggle .sos-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:520px){
  .sos-topbar__in{gap:8px;padding:0 12px}
  .sos-topbar a.sos-brand{font-size:11px;letter-spacing:.12em}
  .sos-topbar .sos-btn{padding:0 11px}
  .sos-drawer-toggle .sos-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
@media (max-width:360px){.sos-topbar a.sos-brand{letter-spacing:.06em}}

/* Home page side drawer */
.sos-drawer{position:fixed;inset:0;z-index:1000;visibility:hidden;transition:visibility 0s linear .28s}
.sos-drawer.is-open{visibility:visible;transition:none}
.sos-drawer__scrim{position:absolute;inset:0;background:#05080bb3;opacity:0;transition:opacity .28s}
.sos-drawer.is-open .sos-drawer__scrim{opacity:1}
.sos-drawer__panel{
  --sos-ink:#efe5d1;--sos-gold:#d9b978;
  position:absolute;top:0;bottom:0;left:0;width:min(320px,86vw);display:flex;flex-direction:column;
  background:linear-gradient(180deg,#121b22,#0b1016);border-right:1px solid #d3b77b44;box-shadow:20px 0 60px #000b;
  color:var(--sos-ink);font:500 15px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  transform:translateX(-102%);transition:transform .28s ease;outline:none
}
.sos-drawer.is-open .sos-drawer__panel{transform:none}
.sos-drawer__head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 14px 12px 20px;border-bottom:1px solid #d3b77b26}
.sos-drawer__title{margin:0;font:600 12px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.18em;text-transform:uppercase;color:var(--sos-gold)}
.sos-drawer .sos-close{width:40px;padding:0;justify-content:center;font-size:20px}
.sos-drawer__list{position:relative;list-style:none;margin:0;padding:8px 10px 24px;overflow-y:auto;overscroll-behavior:contain;flex:1}
.sos-drawer__list li{margin:0;padding:0;list-style:none}
.sos-drawer__list li::before{content:none}
.sos-drawer__list a{display:block;padding:10px 12px;border-radius:8px;color:#d8ccb4;text-decoration:none;border:0;background:none}
.sos-drawer__list a:hover{background:#ffffff0d;color:#fff}
.sos-drawer__list a[aria-current="location"]{color:var(--sos-gold);background:#d3b77b14;box-shadow:inset 3px 0 0 var(--sos-gold)}
.sos-drawer__foot{padding:12px 20px 18px;border-top:1px solid #d3b77b26;font-size:12px;color:#9d917b}
.sos-drawer__foot a{color:var(--sos-gold)}
html.sos-drawer-open{overflow:hidden;scrollbar-gutter:stable}

/* Hidden when a page is shown inside the home page (the atlas iframe). */
html.sos-embedded .sos-topbar,html.sos-embedded .sos-drawer{display:none!important}

@media (prefers-reduced-motion:reduce){
  .sos-drawer,.sos-drawer__scrim,.sos-drawer__panel,.sos-pages-toggle .sos-caret{transition:none}
}
