/* ==========================================================================
   Main Layout, Sticky Rail, Verbatim Thread UI, Tables & Accordions
   ========================================================================== */

body {
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 16px;
}

/* Reading Progress Bar (Top Fixed) */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--role-gs-primary);
  transition: width 0.1s ease-out;
}

/* Hero Header */
.site-header {
  background-color: var(--accent-primary);
  color: #FFFFFF;
  padding: 3rem 1.5rem 2.5rem;
  border-bottom: 4px solid var(--role-gs-primary);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
/* <-- ADD THIS LINE */
  /* text-align: center; */
}

.dossier-kicker {
  display: block;
  width: fit-content;
  margin: 0 auto 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  color: #E2E8F0;
}

.site-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.65rem);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.site-subtitle {
  color: #CBD5E1;
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* Executive Summary Key Metrics Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.metric-card {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.metric-card:hover,
.metric-card:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--role-gs-primary);
  transform: translateY(-2px);
}

.metric-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: #FFFFFF;
}

/* Two-Column Asymmetric Split Layout */
.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* Sticky Left Navigation & Filter Rail */
.sidebar-rail {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.rail-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

/* Table of Contents Links */
.toc-list li + li {
  margin-top: 0.35rem;
}

.toc-link {
  display: block;
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 0.88rem;
  padding: 0.35rem 0.55rem;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all 0.15s ease;
}

.toc-link:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.toc-link.active {
  background: var(--role-gs-bg);
  color: var(--role-gs-primary);
  border-left-color: var(--role-gs-primary);
  font-weight: 600;
}

/* --- INSERT NEW BLOCKS HERE --- */
.toc-main {
  display: block;
  line-height: 1.3;
}

.toc-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}

.toc-link.active .toc-sub {
  color: var(--role-gs-primary);
}

/* Speaker & Medium Filter Controls */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.filter-option input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
}

.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.btn-reset-filters {
  margin-top: 0.65rem;
  width: 100%;
  padding: 0.4rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
}

.btn-reset-filters:hover {
  background: #E5E7EB;
}

/* Main Content Narrative Stream */
.main-stream {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
}

.dossier-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 1.5rem;
}

.section-header {
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--role-gs-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--ink-primary);
  line-height: 1.3;
}

.section-intro {
  color: var(--ink-secondary);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Section 1: Continuous Chronological Timeline (Aug 2023 - Oct 2025)
   ========================================================================== */
.chronological-list {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.chronological-list li {
  position: relative;
}

.chronological-list li::before {
  content: "";
  position: absolute;
  left: -1.88rem;
  top: 0.35rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--role-gs-primary);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--role-gs-primary);
}

.entry-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--role-gs-primary);
  background: var(--role-gs-bg);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   Forensic Verbatim Thread Container (WHATSAPP, EMAIL, MINUTES)
   ========================================================================== */
.thread-container {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.thread-container.hidden-by-filter,
.message.hidden-by-filter {
  display: none;
}

.thread-header {
  background: var(--bg-subtle);
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.thread-meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.exhibit-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-primary);
}

/* Single-Word Medium Badges */
.medium-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.tag-whatsapp {
  background: var(--med-wa-bg);
  color: var(--med-wa-text);
}

.tag-email {
  background: var(--med-email-bg);
  color: var(--med-email-text);
}

.tag-minutes {
  background: var(--med-min-bg);
  color: var(--med-min-text);
}

.thread-date {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.thread-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-cite,
.btn-copy-quote {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  transition: background 0.15s ease;
}

.btn-cite:hover,
.btn-copy-quote:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

/* Individual Speaker Message Blocks */
.thread-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--role-other-primary);
  background: var(--role-other-bg);
}

.message .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  letter-spacing: 0.03em;
}

.timestamp {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.verbatim-text {
  font-size: 0.96rem;
  line-height: 1.75; /* Prevents upper/lower Devanagari matras from clipping */
  color: var(--ink-primary);
  white-space: pre-line;
}

/* Role-Specific Accent Styling */

/* Role-Specific Accent Styling */
.role-gs {
  border-left-color: var(--role-gs-primary);
  background: var(--role-gs-bg);
}
.role-gs .badge { background: var(--role-gs-primary); }

.role-pres {
  border-left-color: var(--role-pres-primary);
  background: var(--role-pres-bg);
}
.role-pres .badge { background: var(--role-pres-primary); }

.role-vp {
  border-left-color: var(--role-vp-primary);
  background: var(--role-vp-bg);
}
.role-vp .badge { background: var(--role-vp-primary); }

.role-treas {
  border-left-color: var(--role-treas-primary);
  background: var(--role-treas-bg);
}
.role-treas .badge { background: var(--role-treas-primary); }

/* Other 2 Office Bearers: Standard text color with neutral slate tag */
.role-other {
  border-left-color: var(--role-other-primary);
  background: var(--role-other-bg);
}
.role-other .badge { background: var(--role-other-primary); }

/* Standalone Role Badge Modifiers (for inline use inside tables/summaries) */
.badge-gs    { background: var(--role-gs-primary); }
.badge-pres  { background: var(--role-pres-primary); }
.badge-vp    { background: var(--role-vp-primary); }
.badge-treas { background: var(--role-treas-primary); }
.badge-other { background: var(--role-other-primary); }

/* Compact Single-Line Statement List inside Executive Overview Table */
.inline-quote-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.inline-quote-list li {
  line-height: 1.45;
}

.inline-quote-list .badge {
  vertical-align: middle;
  margin-right: 0.35rem;
  font-size: 0.68rem;
  padding: 0.12rem 0.42rem;
}

/* Compact Date Stamp inside Executive Overview List */
.inline-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-right: 0.35rem;
}

/* Bold-Italic Highlighted Quote */
.quote-highlight {
  font-weight: 700;
  font-style: italic;
  color: var(--ink-primary);
  background-color: #FEF9C3; /* Soft archival yellow highlight */
  padding: 0.08rem 0.32rem;
  border-radius: 3px;
}

/* ==========================================================================
   Procedural Irregularities Comparison Table (Section 3)
   ========================================================================== */
.comparison-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.forensic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.forensic-table th,
.forensic-table td {
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.25rem;
  text-align: left;
  vertical-align: top;
}

.forensic-table th {
  background: var(--accent-primary);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.forensic-table tr:nth-child(even) td {
  background: var(--bg-subtle);
}

/* Explicit Column Widths for the 3-Column Executive Overview Table */
#executive-overview .forensic-table {
  table-layout: fixed;
}

#executive-overview .forensic-table th:nth-child(1) {
  width: 20%; /* Governance / Due-Process Standard */
}

#executive-overview .forensic-table th:nth-child(2) {
  width: 80%; /* Documented Violation & Factual Finding */
}

/* ==========================================================================
   Two-Column Annotated Minutes / NDA Clause Viewer (Sections 4 & 5)
   ========================================================================== */
.annotated-split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.clause-quote {
  background: #FFFFFF;
  padding: 1rem;
  border-left: 4px solid var(--role-pres-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 0.95rem;
}

.clause-analysis {
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.clause-analysis strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--role-vp-primary);
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   Section 6: Interactive Allegation vs. Factual Rebuttal Accordion
   ========================================================================== */
.rebuttal-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rebuttal-item {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  overflow: hidden;
}

.rebuttal-item summary {
  padding: 0.95rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-subtle);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.rebuttal-item summary::-webkit-details-marker {
  display: none;
}

.rebuttal-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--role-gs-primary);
}

.rebuttal-item[open] summary::after {
  content: "−";
}

.rebuttal-body {
  padding: 1.15rem;
  border-top: 1px solid var(--border-light);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border-light);
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .page-shell {
    grid-template-columns: 1fr;
  }
  .sidebar-rail {
    position: static;
  }
  .annotated-split {
    grid-template-columns: 1fr;
  }
}

/* Print Optimization (Clean Legal/Community Handout) */
@media print {
  .sidebar-rail,
  .progress-container,
  .thread-actions {
    display: none !important;
  }
  .page-shell {
    display: block;
    padding: 0;
  }
  .dossier-section {
    box-shadow: none;
    border: none;
    padding: 0 0 2rem;
    page-break-inside: avoid;
  }
}
