/* ============================================================
   DocketDrift — overrides + additions on top of core + documents
   ============================================================
   The sidebar layout in core.css doesn't style a brand block; we add
   it here. Also tweak the doc-table cell layout to match an opinion
   row (case-number stamp + court + date + disposition pill + title),
   and add detail-page chrome.
   ============================================================ */

/* ----------  Sidebar brand block  ---------- */

.site-header .brand {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: var(--border-soft);
}

.site-header .brand a {
  display: block;
  color: var(--neon-pink);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-shadow: 0 0 10px rgba(255, 43, 179, 0.55);
  margin-bottom: 0.5rem;
  line-height: 1.1;
  border-bottom: none;
}

.site-header .brand a:hover {
  text-shadow: 0 0 18px rgba(255, 43, 179, 0.85);
  border-bottom: none;
}

.site-header .brand-subtitle {
  font-size: 0.74rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin: 0;
  font-style: italic;
  line-height: 1.45;
  max-width: none;
  border: none;
  padding: 0;
}

.site-header .search-module {
  margin: 0 0 1rem;
}

/* ----------  Apex (state picker)  ---------- */

.apex-hero {
  text-align: center;
}

.apex-hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  letter-spacing: 3px;
  margin: 0 0 1rem;
}

.apex-hero .lede {
  text-align: center;
  max-width: 52ch;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ----------  Opinion list (doc-table tweaks)  ---------- */

.doc-table .case-number-cell {
  width: 120px;
  white-space: nowrap;
  vertical-align: top;
}

.doc-table .case-number-cell .file-number {
  position: static;
  display: inline-block;
  background: rgba(20, 0, 30, 0.6);
  color: var(--neon-pink);
  border: 1px solid rgba(255, 43, 179, 0.4);
  border-left: 2px solid rgba(255, 43, 179, 0.7);
}

.doc-table td.title-cell {
  font-size: 0.92rem;
  line-height: 1.45;
}

.doc-table td.title-cell a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.doc-table td.title-cell a:hover {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

.doc-table .case-status {
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

/* ----------  Opinion detail page  ---------- */

.opinion-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin: 0 0 1.25rem;
}

.opinion-header .file-number {
  position: static;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.opinion-meta {
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  margin: 0 0 1.25rem;
  border-left: 2px solid rgba(169, 94, 255, 0.45);
  padding-left: 0.85rem;
  max-width: none;
}

.opinion-meta strong {
  color: var(--text-primary);
  font-weight: 700;
}

.opinion-actions {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.opinion-actions a {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 43, 179, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 43, 179, 0.08);
  color: var(--neon-pink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.opinion-actions a:hover {
  background: var(--neon-pink);
  color: #050505;
  box-shadow: 0 0 12px rgba(255, 43, 179, 0.45);
  border-bottom: none;
}

.opinion-body {
  white-space: pre-wrap;
  font-family: "JetBrains Mono", ui-monospace, "IBM Plex Mono", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
  max-height: 75vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  background: rgba(5, 5, 5, 0.45);
  border: var(--border-soft);
  border-radius: var(--radius-sm);
  margin: 0;
}

.opinion-body::-webkit-scrollbar { width: 8px; }
.opinion-body::-webkit-scrollbar-thumb {
  background: rgba(169, 94, 255, 0.3);
  border-radius: 4px;
}

/* ----------  Small-screen sidebar tweaks  ---------- */

@media (max-width: 1024px) {
  .site-header .brand {
    margin-top: 0;
  }
}

/* ============================================================
   Disposition color taxonomy (state_home table + detail pill)
   ============================================================
   Maps the case-status pill color to the disposition bucket so a
   user can scan the doc-table and instantly distinguish "affirmed"
   (status quo) from "reversed" (appellate action) from "vacated"
   (most disruptive) without reading. Buckets are also rendered as
   a sidebar legend so the key is always visible.
   ============================================================ */

.case-status.disposition-affirmed {
  color: var(--neon-cyan);
  border-left-color: var(--neon-cyan);
  background: rgba(38, 255, 230, 0.08);
  box-shadow: inset 0 0 10px rgba(38, 255, 230, 0.15), 0 0 6px rgba(38, 255, 230, 0.2);
}

.case-status.disposition-reversed {
  color: var(--neon-pink);
  border-left-color: var(--neon-pink);
  background: rgba(255, 43, 179, 0.08);
  box-shadow: inset 0 0 10px rgba(255, 43, 179, 0.15), 0 0 6px rgba(255, 43, 179, 0.2);
}

.case-status.disposition-vacated,
.case-status.disposition-denied {
  color: var(--hazard-red);
  border-left-color: var(--hazard-red);
  background: rgba(255, 77, 77, 0.08);
  box-shadow: inset 0 0 10px rgba(255, 77, 77, 0.15), 0 0 6px rgba(255, 77, 77, 0.2);
}

.case-status.disposition-remanded,
.case-status.disposition-modified {
  color: var(--neon-amber);
  border-left-color: var(--neon-amber);
  background: rgba(255, 191, 0, 0.10);
  box-shadow: inset 0 0 10px rgba(255, 191, 0, 0.15), 0 0 6px rgba(255, 191, 0, 0.2);
}

.case-status.disposition-mixed {
  color: var(--neon-violet);
  border-left-color: var(--neon-violet);
  background: rgba(169, 94, 255, 0.10);
  box-shadow: inset 0 0 10px rgba(169, 94, 255, 0.15), 0 0 6px rgba(169, 94, 255, 0.2);
}

.case-status.disposition-dismissed,
.case-status.disposition-other {
  color: var(--text-dim);
  border-left-color: rgba(148, 140, 161, 0.6);
  background: rgba(148, 140, 161, 0.08);
  box-shadow: none;
}

.case-status.disposition-granted {
  color: var(--neon-lime);
  border-left-color: var(--neon-lime);
  background: rgba(95, 201, 68, 0.08);
  box-shadow: inset 0 0 10px rgba(95, 201, 68, 0.15), 0 0 6px rgba(95, 201, 68, 0.2);
}

/* ============================================================
   Sidebar aside (tag cloud + disposition legend)
   ============================================================ */

.sidebar-aside {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: var(--border-soft);
}

.sidebar-aside-heading {
  font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

/* Tag cloud chips -- click pre-fills the search box. */
.tag-cloud {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-cloud li {
  display: inline-block;
}

.tag-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 43, 179, 0.35);
  background: rgba(255, 43, 179, 0.06);
  color: var(--neon-pink);
  text-decoration: none;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition);
  line-height: 1.2;
}

.tag-chip:hover,
.tag-chip:focus-visible {
  background: rgba(38, 255, 230, 0.1);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(38, 255, 230, 0.35);
  border-bottom: none;
}

/* Word-cloud sizing -- 5 buckets keyed off relative frequency in the
   current state's raw_text corpus. xs is "appears but barely"; xl is
   "the dominant phrase in this state's appellate work". */
.tag-chip--xs { font-size: 0.62rem; opacity: 0.62; padding: 0.18rem 0.5rem; }
.tag-chip--sm { font-size: 0.7rem;  opacity: 0.78; padding: 0.22rem 0.55rem; }
.tag-chip--md { font-size: 0.8rem;  padding: 0.28rem 0.65rem; }
.tag-chip--lg { font-size: 0.92rem; padding: 0.32rem 0.7rem; font-weight: 700; }
.tag-chip--xl { font-size: 1.05rem; padding: 0.36rem 0.78rem; font-weight: 700;
                box-shadow: inset 0 0 8px rgba(255, 43, 179, 0.15); }

/* Disposition legend in the sidebar -- one row per bucket, full width. */
.disposition-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.disposition-legend li {
  display: block;
}

.disposition-legend .case-status {
  display: block;
  margin: 0;
  font-size: 0.66rem;
  padding: 0.22rem 0.6rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.disposition-legend .case-status:hover,
.disposition-legend .case-status:focus-visible {
  transform: translateX(2px);
  border-bottom: none;
}

/* The currently-filtering disposition gets a stronger visual signal
   (slight inset glow + lateral nudge so it stands out from siblings). */
.disposition-legend .case-status.is-active-filter {
  transform: translateX(4px);
  box-shadow: inset 0 0 0 1px currentColor, inset 0 0 12px rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Court differentiation pill (state_home table COURT cell)
   ============================================================ */

.court-pill {
  display: inline-block;
  font-family: ui-monospace, "JetBrains Mono", "IBM Plex Mono", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.6rem;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
  text-transform: none;
}

.court-pill--supreme {
  color: var(--neon-pink);
  border-color: rgba(255, 43, 179, 0.5);
  background: rgba(255, 43, 179, 0.08);
}

.court-pill--appeals {
  color: var(--neon-cyan);
  border-color: rgba(38, 255, 230, 0.5);
  background: rgba(38, 255, 230, 0.08);
}

/* ============================================================
   Active-filter banner (above the doc-table when ?disposition= or ?q=)
   ============================================================ */

.active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.85rem;
  background: rgba(20, 0, 30, 0.55);
  border: var(--border-soft);
  border-left: 3px solid var(--neon-cyan);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.active-filters-label {
  font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.active-filters-query {
  font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
  color: var(--neon-cyan);
  padding: 0.18rem 0.5rem;
  background: rgba(38, 255, 230, 0.08);
  border: 1px solid rgba(38, 255, 230, 0.35);
  border-radius: 3px;
}

.active-filters-clear {
  margin-left: auto;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 140, 161, 0.4);
  padding: 0.22rem 0.55rem;
  border-radius: 3px;
  transition: color var(--transition), border-color var(--transition);
}

.active-filters-clear:hover {
  color: var(--hazard-red);
  border-color: var(--hazard-red);
  border-bottom: 1px solid var(--hazard-red);
}

/* ============================================================
   Current Judges roster page
   ============================================================
   17 COA judges + 7 SCt justices in a single column is unscannable.
   Redeclare the maddervramsey `cast-grid` + `cast-thumb` with
   tighter sizing so the roster reads as a wall of portraits the
   user can quickly scan, not a vertical scroll-of-doom.
*/

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem;
}

.cast-grid .entity-tile {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cast-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 4px;
  margin: 0.5rem 0 0.85rem;
  border: 1px solid rgba(169, 94, 255, 0.25);
}

.cast-grid .entity-tile .role-chip {
  align-self: flex-start;
  margin-bottom: 0.35rem;
}

.cast-grid .entity-tile h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.cast-grid .entity-tile h3 a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.cast-grid .entity-tile h3 a:hover {
  text-shadow: var(--shadow-glow-cyan);
  border-bottom: none;
}

.cast-grid .entity-tile .affiliation {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0.35rem 0 0;
}

.cast-grid .entity-tile .cast-summary {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-primary);
  margin: 0.5rem 0 0.75rem;
}

.cast-grid .entity-tile .inspect-link {
  margin-top: auto;
  font-size: 0.72rem;
}

/* Section headers between Supreme Court and Court of Appeals groupings. */
.cast-grid + .section-header {
  margin-top: 2rem;
}

/* Narrower screens -- shrink the photo and let the grid collapse to 2 columns. */
@media (max-width: 720px) {
  .cast-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
  }
  .cast-thumb {
    height: 180px;
  }
}

/* ============================================================
   Editorial review status
   ============================================================
   Surfaces whether an opinion has been human-reviewed vs. only
   machine-processed. Detail-page chip + list-view colored dot.
   ============================================================ */

/* Detail-page chip (alongside Precedential / Disposition in the header) */
.review-pill {
  display: inline-block;
  font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.6rem;
  border-radius: 3px;
  border: 1px solid;
  text-transform: uppercase;
  white-space: nowrap;
}

.review-pill--ai_only {
  color: #ffbf3d;
  border-color: rgba(255, 191, 61, 0.45);
  background: rgba(255, 191, 61, 0.08);
}

.review-pill--flagged {
  color: var(--hazard-red);
  border-color: rgba(255, 64, 84, 0.45);
  background: rgba(255, 64, 84, 0.08);
}

.review-pill--reviewed {
  color: var(--neon-cyan);
  border-color: rgba(38, 255, 230, 0.55);
  background: rgba(38, 255, 230, 0.1);
  box-shadow: 0 0 8px rgba(38, 255, 230, 0.2);
}

/* List-view dot (in the title cell, before the case link) */
.review-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: help;
}

.review-dot--ai_only {
  background: #ffbf3d;
  box-shadow: 0 0 5px rgba(255, 191, 61, 0.45);
}

.review-dot--flagged {
  background: var(--hazard-red);
  box-shadow: 0 0 5px rgba(255, 64, 84, 0.55);
}

.review-dot--reviewed {
  background: var(--neon-cyan);
  box-shadow: 0 0 6px rgba(38, 255, 230, 0.65);
}
