/* PragmaWorks — shared sidebar navigation */

:root {
  --sidebar-width: 220px;
  --sb-bg:      #1A1611;
  --sb-border:  rgba(255,255,255,0.07);
  --sb-text:    #ECECF0;
  --sb-muted:   #C8C8CC;
  --sb-active:  #C44B1A;
  --sb-hover:   rgba(196,75,26,0.1);
}

/* ── SIDEBAR SHELL ── */
.pw-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
  border-right: 1px solid rgba(196,75,26,0.18);
}

/* ── BRAND ── */
.pw-sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.pw-sidebar-brand a {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #F5F0E8;
  text-decoration: none;
}
.pw-sidebar-brand a span { color: var(--sb-active); }

/* ── NAV SCROLL AREA ── */
.pw-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  background: var(--sb-bg) !important;
}
.pw-sidebar-nav::-webkit-scrollbar { width: 4px; }
.pw-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.pw-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── SECTION TOGGLE ── */
.pw-nav-section { margin-bottom: 1px; }

.pw-nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #ECECF0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: left;
  transition: color 0.15s;
}
.pw-nav-section-toggle:hover { color: #F5F0E8; }

.pw-chevron {
  font-style: normal;
  font-size: 10px;
  transition: transform 0.18s;
  flex-shrink: 0;
}
.pw-nav-section.is-open .pw-nav-section-toggle .pw-chevron {
  transform: rotate(90deg);
}
.pw-nav-section-toggle[aria-expanded="true"] { color: #D1D1D6; }

/* ── SECTION ITEMS ── */
.pw-nav-section-items {
  display: none;
  padding-bottom: 6px;
}
.pw-nav-section.is-open .pw-nav-section-items { display: block; }

/* ── NAV LINKS ── */
.pw-nav-item {
  display: block;
  padding: 6px 16px 6px 26px;
  color: var(--sb-text);
  text-decoration: none;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13px;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.pw-nav-item:hover {
  color: #F5F0E8;
  background: var(--sb-hover);
}
.pw-nav-item.is-active {
  color: var(--sb-active);
  border-left-color: var(--sb-active);
}

/* standalone items (no section) */
.pw-nav-standalone {
  display: block;
  padding: 8px 16px;
  color: #D5D5D9;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.pw-nav-standalone:hover { color: #F5F0E8; }
.pw-nav-standalone.is-active { color: var(--sb-active); }

/* ── SIDEBAR LANG TOGGLE ── */
.pw-sidebar-lang {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.pw-sidebar-lang button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  color: #D5D5D9;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.pw-sidebar-lang button:hover {
  color: #F5F0E8;
  background: rgba(255,255,255,0.12);
}
.pw-sidebar-lang button.is-active {
  color: var(--sb-active);
  border-color: rgba(196,75,26,0.5);
}

.pw-nav-divider {
  height: 1px;
  background: var(--sb-border);
  margin: 5px 16px;
}

/* ── FOOTER (HOME + CONTACT) ── */
.pw-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pw-sidebar-footer a {
  color: var(--sb-muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.pw-sidebar-footer a:hover { color: #F5F0E8; }

/* ── WORKSHOP CTA (sidebar + bottom band) ── */
.pw-sidebar-cta {
  display: block;
  background: var(--sb-active, #C44B1A);
  color: #F5F0E8 !important;
  text-align: center;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}
.pw-sidebar-cta:hover { background: #E8652E; }
.pw-cta-band {
  display: block;
  margin-left: var(--sidebar-width);
  background: #1A1611;
  color: #F5F0E8;
  text-decoration: none;
  padding: 28px 32px;
  text-align: center;
  border-top: 2px solid #C44B1A;
}
.pw-cta-band .pw-cta-h {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: #F5F0E8;
  margin-bottom: 6px;
}
.pw-cta-band .pw-cta-b {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #F4A623;
}
.pw-cta-band:hover .pw-cta-b { color: #E8652E; }
@media (max-width: 820px) { .pw-cta-band { margin-left: 0; } }

/* ── BODY OFFSET ── */
body.pw-has-sidebar {
  padding-left: var(--sidebar-width);
}
/* hide existing simple top-nav when sidebar is present */
body.pw-has-sidebar > nav {
  display: none;
}
/* lang-toggle always visible — fixed upper right, above sidebar */

/* ── MOBILE TOGGLE BUTTON ── */
.pw-sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 300;
  background: var(--sb-bg);
  border: 1px solid rgba(196,75,26,0.4);
  border-radius: 4px;
  color: #F5F0E8;
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.pw-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 190;
}

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  body.pw-has-sidebar {
    padding-left: 0;
  }
  .pw-sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }
  .pw-sidebar.is-open {
    transform: translateX(0);
  }
  .pw-sidebar-toggle {
    display: flex;
  }
  .pw-sidebar-overlay.is-open {
    display: block;
  }
  /* lang-toggle already always visible */
}
