/* ============================================================
   Delta Crown Extensions — Sidebar Navigation + Layout System
   Top-down information architecture for executives, directors,
   managers. Replaces the old top-nav with a chapter-style left
   rail that lets stakeholders scan, jump, and orient.
   ============================================================ */

/* --- Layout grid: sidebar on left, content on right --- */
:root {
  --sidebar-width: 288px;
  --sidebar-bg: #0A1F1C;
  --sidebar-bg-elev: rgba(255, 255, 255, 0.075);
  --sidebar-border: rgba(255, 255, 255, 0.16);
  --sidebar-text: rgba(255, 255, 255, 0.82);
  --sidebar-text-strong: #FFFFFF;
  --sidebar-text-muted: rgba(255, 255, 255, 0.76);
}

body.has-sidebar {
  margin-left: var(--sidebar-width);
}

/* --- Sidebar shell --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(0, 107, 94, 0.14) 0%, rgba(10, 31, 28, 0) 40%),
    var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* --- Logo + brand block --- */
.sidebar__brand {
  padding: 26px 24px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar__brand img {
  height: 28px;
  width: auto;
  margin-bottom: 14px;
}

.sidebar__brand-tag {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- View switcher (Project / Ops / MSP Brief) --- */
.sidebar__views {
  display: grid;
  gap: 8px;
  margin: 16px 24px 0;
}

.sidebar__view {
  align-items: center;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #FFFFFF;
  display: flex;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.08em;
  min-height: 38px;
  padding: 9px 14px;
  text-align: center;
  text-transform: uppercase;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.sidebar__view:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.44);
  color: #fff;
  transform: translateY(-1px);
}

.sidebar__view--active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 28px rgba(212, 168, 75, 0.20);
  color: var(--teal-deeper);
}

/* --- Navigation chapters --- */
.sidebar__nav {
  flex: 1;
  padding: 18px 0 16px;
}

.sidebar__chapter {
  padding: 18px 24px 6px;
}

.sidebar__chapter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  margin-bottom: 8px;
}

.sidebar__chapter-label .material-symbols-outlined {
  font-size: 14px;
  color: var(--gold);
}

.sidebar__list {
  display: flex;
  flex-direction: column;
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px 9px 28px;
  color: var(--sidebar-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.sidebar__link:hover {
  color: var(--sidebar-text-strong);
  background: var(--sidebar-bg-elev);
}

.sidebar__link--active {
  color: var(--sidebar-text-strong);
  background: linear-gradient(90deg, rgba(212, 168, 75, 0.18), rgba(212, 168, 75, 0));
  border-left-color: var(--gold);
}

.sidebar__link-tag {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text-muted);
}

.sidebar__link-tag--live {
  background: rgba(76, 175, 80, 0.18);
  color: #8BD68F;
}

.sidebar__link-tag--new {
  background: rgba(212, 168, 75, 0.2);
  color: var(--gold-light);
}

/* --- Footer in sidebar --- */
.sidebar__footer {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.72rem;
  color: var(--sidebar-text-muted);
  line-height: 1.5;
}

.sidebar__progress {
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  margin-bottom: 10px;
  overflow: hidden;
}

.sidebar__progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 120ms linear;
}

/* --- Mobile menu button --- */
.sidebar__toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1100;
  background: rgba(10, 31, 28, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  padding: 9px 12px;
  color: #FFF;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.sidebar__toggle .material-symbols-outlined {
  font-size: 18px;
  vertical-align: middle;
  margin-right: 4px;
}

.sidebar__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 999;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  body.has-sidebar { margin-left: 0; }

  /* WCAG 2.4.11 Focus Not Obscured: anchored jumps land below the floating Menu button */
  html { scroll-padding-top: 72px; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 280ms var(--ease-out);
    width: min(320px, 86vw);
  }

  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar__backdrop { display: block; }

  .sidebar__toggle { display: inline-flex; align-items: center; }

  /* Push hero down so the floating menu button doesn't collide with the logo */
  .hero { padding-top: 88px; }
}

/* --- Hide the old top nav when sidebar is active --- */
body.has-sidebar .nav { display: none; }

