/* SCOTUS Analytics — Components */

/* ── Navigation ── */
.site-nav {
  background: var(--bg-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

.nav-logo {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-logo .logo-text { color: var(--text-on-dark); }
.nav-logo .logo-accent { color: var(--accent-red); margin-left: 4px; }

/* The link row scrolls sideways on narrow screens instead of widening the page. */
.nav-links { display: flex; gap: var(--space-lg); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
/* On narrow screens the links scroll sideways: fade the right edge so that is visible. */
@media (max-width: 900px) { .nav-links { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 24px; } }
.nav-links a { white-space: nowrap; flex: 0 0 auto; }
.nav-links a {
  color: #ccc;
  font-family: var(--font-headline);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-on-dark);
  border-bottom-color: var(--accent-red);
  text-decoration: none;
}

/* Red accent line below nav */
.nav-accent {
  height: 3px;
  background: var(--accent-red);
}

/* ── Sponsor Banner ── */
.sponsor-banner {
  background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
  font-size: 0.88rem;
  position: relative;
  z-index: 99;
}

.sponsor-banner-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 10px var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.sponsor-banner-text {
  flex: 0 1 auto;
}

.sponsor-banner-text strong {
  color: #fff;
}

.sponsor-banner-btn {
  display: inline-block;
  padding: 5px 18px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 4px;
  font-family: var(--font-headline);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.sponsor-banner-btn:hover {
  background: var(--accent-red-light);
  color: #fff;
  text-decoration: none;
}

.sponsor-banner-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.sponsor-banner-close:hover {
  color: #fff;
}

@media (max-width: 600px) {
  .sponsor-banner-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
}

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-tertiary);
}
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb .sep { margin: 0 var(--space-xs); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

.card-sm { padding: var(--space-md); }

.card-elevated {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-xl);
}

.card-header {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-petitioner { background: var(--color-petitioner); color: #fff; }
.badge-respondent { background: var(--color-respondent); color: #fff; }
.badge-neutral { background: var(--color-neutral); color: #fff; }
.badge-argued { background: #6c5ce7; color: #fff; }
.badge-decided { background: var(--confidence-very-high); color: #fff; }
.badge-pending { background: var(--confidence-medium); color: #fff; }
.badge-dismissed { background: var(--color-neutral); color: #fff; }

/* Term headings between groups of case cards (homepage + /cases/) */
.term-group-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: var(--space-xl) 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--border-light);
}
.term-group-heading:first-child { margin-top: 0; }

.badge-confidence-very_high { background: var(--confidence-very-high); color: #fff; }
.badge-confidence-high { background: var(--confidence-high); color: #fff; }
.badge-confidence-medium { background: var(--confidence-medium); color: #fff; }
.badge-confidence-low { background: var(--confidence-low); color: #fff; }

/* ── Probability Bar ── */
.prob-bar-container {
  width: 100%;
  height: 24px;
  background: #eee;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.prob-bar-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.6s ease;
}

.prob-bar-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  padding: 0 8px;
}

/* ── Vote Split Bar ── */
.vote-split {
  display: flex;
  gap: 3px;
  align-items: center;
}

.vote-block {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.vote-block-pet { background: var(--color-petitioner); }
.vote-block-resp { background: var(--color-respondent); }

.vote-split-label {
  font-family: var(--font-data);
  font-size: 1.5rem;
  font-weight: 700;
  margin-left: var(--space-md);
}

/* ── Data Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--border-light);
}

.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.data-table tr:hover { background: #f8f8f8; }

/* ── Case page: procedural history + news ── */
.history-summary { font-size: 0.98rem; line-height: 1.55; margin: 0 0 var(--space-md); max-width: 760px; }
.history-timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border-light); }
.history-item { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-md); position: relative;
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md); }
.history-item::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--bg-card); border: 2px solid var(--text-tertiary); }
.history-item.history-scotus::before { background: var(--accent-red); border-color: var(--accent-red); }
.history-date { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }
.history-court { font-size: 0.82rem; color: var(--text-tertiary); }
.history-level { font-family: var(--font-headline); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary); margin-right: 4px; }
.history-event { font-size: 0.93rem; margin-top: 2px; }
.history-cite { font-family: var(--font-data); font-size: 0.78rem; color: var(--text-tertiary); white-space: nowrap; }
.history-outcome, .history-meta { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }
.cw-chip { display: inline-block; font-size: 0.72rem; padding: 2px 7px; margin: 1px 0; border-radius: 10px;
  background: var(--bg-primary); border: 1px solid var(--border-light); white-space: nowrap; }
.preview-issue { font-size: 1rem; line-height: 1.55; margin: 0 0 var(--space-md); max-width: 820px; }
.preview-args { margin: 0; padding-left: 1.1rem; font-size: 0.92rem; line-height: 1.5; }
.preview-args li { margin-bottom: var(--space-sm); }
.preview-quote { font-size: 0.8rem; color: var(--text-tertiary); font-style: italic; margin-top: 2px; }
.preview-us { font-size: 0.92rem; line-height: 1.5; margin: var(--space-md) 0 0; max-width: 820px; }
.media-group + .media-group { margin-top: var(--space-md); }
.media-stage { font-family: var(--font-headline); font-weight: 600; font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: var(--space-xs); }
.media-list { list-style: none; margin: 0; padding: 0; }
.media-list li { padding: var(--space-sm) 0; border-bottom: 1px solid var(--border-light); }
.media-list a { color: var(--accent-blue); text-decoration: none; font-weight: 600; font-size: 0.93rem; }
.media-meta { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 2px; }
.media-kind { font-weight: 600; color: var(--text-secondary); }
.media-featured { padding-bottom: var(--space-md); margin-bottom: var(--space-md); border-bottom: 2px solid var(--border-light); }
.media-featured > a { color: var(--accent-blue); text-decoration: none; font-weight: 700; font-size: 1rem; }
.media-summary, .media-note { font-size: 0.9rem; line-height: 1.55; margin: var(--space-sm) 0 0; max-width: 760px; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-md); }
.dash-card { text-align: center; }
.dash-num { font-family: var(--font-data); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.dash-label { font-size: 0.8rem; color: var(--text-tertiary); margin-top: var(--space-xs); }
.dash-bar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: var(--space-sm);
  font-size: 0.85rem; padding: 3px 0; }
.dash-bar-track { background: var(--border-light); border-radius: 3px; height: 10px; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; background: var(--accent-blue); }
.dash-bar-value { font-family: var(--font-data); font-size: 0.8rem; white-space: nowrap; }
.asg-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-bottom: var(--space-md); }
.asg-cell { border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 6px 2px; text-align: center; }
.asg-cell.asg-done { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.asg-name { display: block; font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-n { display: block; font-family: var(--font-data); font-weight: 700; font-size: 1rem; }
@media (max-width: 600px) { .asg-grid { grid-template-columns: repeat(5, 1fr); } }
.explainer { max-width: 860px; line-height: 1.6; font-size: 0.95rem; }
.explainer h3 { font-family: var(--font-headline); text-transform: uppercase; letter-spacing: 0.04em; font-size: 1rem;
  margin: var(--space-lg) 0 var(--space-sm); }
.explainer ol, .explainer ul { padding-left: 1.2rem; margin: 0; }
.explainer li { margin-bottom: var(--space-xs); }
.explainer a { color: var(--accent-blue); }
@media (max-width: 600px) {
  .history-item { grid-template-columns: 1fr; gap: 2px; }
}

/* ── Orders page (/orders/) ── */
.orders-note { max-width: 760px; margin-bottom: var(--space-md); font-size: 0.9rem; }
.orders-table-wrap { overflow-x: auto; padding: var(--space-sm); }
.orders-table td { vertical-align: top; font-size: 0.88rem; }
.orders-table .orders-date { white-space: nowrap; color: var(--text-secondary); }
.orders-table .orders-docket { white-space: nowrap; font-family: var(--font-data); font-size: 0.8rem; }
.orders-case { font-weight: 600; color: var(--text-primary); }
a.orders-case { color: var(--accent-blue); text-decoration: none; }
.orders-sub { font-size: 0.8rem; margin-top: 2px; }
.orders-links { white-space: nowrap; font-size: 0.82rem; }
.order-granted { color: var(--confidence-very-high); font-weight: 600; }
.order-denied { color: var(--accent-red); font-weight: 600; }
.order-other { color: var(--text-secondary); font-weight: 600; }
.orders-filters { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md); }
.orders-filters input, .orders-filters select {
  font: inherit; font-size: 0.9rem; padding: 6px 10px;
  border: 1px solid var(--border-medium); border-radius: var(--radius-sm); background: var(--bg-card);
}
.orders-filters input { flex: 1 1 220px; }

/* ── Accordion ── */
.accordion-item { border-bottom: 1px solid var(--border-light); }

.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-md) 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-trigger::after {
  content: '\25BC';
  font-size: 0.7rem;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.accordion-trigger.open::after { transform: rotate(180deg); }

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content.open {
  max-height: 2000px;
}

.accordion-body {
  padding: 0 0 var(--space-lg) 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-family: var(--font-headline);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent-red); color: #fff; }
.btn-primary:hover { background: var(--accent-red-light); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--accent-blue);
  border: 2px solid var(--accent-blue);
}
.btn-outline:hover { background: var(--accent-blue); color: #fff; }

/* ── Footer ── */
.site-footer {
  background: var(--bg-dark);
  color: #aaa;
  padding: var(--space-2xl) 0;
  margin-top: var(--space-2xl);
}

.site-footer .footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  text-align: center;
}

.footer-brand {
  font-family: var(--font-headline);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-on-dark);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: var(--space-md);
}

.footer-links a {
  color: #aaa;
  font-size: 0.85rem;
  margin: 0 var(--space-sm);
}
.footer-links a:hover { color: var(--text-on-dark); }

/* ── Justice Initials Circle ── */
.justice-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── Methodology Tag ── */
.method-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.method-tag-spaeth { background: #dfe6e9; color: #2d3436; }
.method-tag-sentiment { background: #ffeaa7; color: #2d3436; }
.method-tag-elp { background: #dfe6fd; color: #2d3436; }

/* ── Hero Layout ── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-meta {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
}

.hero-case-name {
  font-size: 2.2rem;
  margin-bottom: var(--space-xs);
}

.hero-date {
  font-size: 0.95rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.hero-prediction {
  margin-top: var(--space-md);
}

.hero-right {
  padding-top: var(--space-md);
}

.hero-scenarios {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

/* Justice card in grid */
.justice-card {
  transition: box-shadow 0.2s;
}
.justice-card:hover {
  box-shadow: var(--shadow-elevated);
}

/* ── Term Overview ── */
.term-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.term-title {
  font-family: var(--font-headline);
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.term-subtitle {
  font-size: 1rem;
  color: var(--text-tertiary);
  margin: var(--space-xs) 0 0;
}

.term-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
}

.term-stat {
  text-align: center;
}

.term-stat-number {
  font-family: var(--font-data);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.term-stat-label {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.term-orders-link { text-align: center; margin: var(--space-lg) 0 0; font-size: 0.95rem; }
.term-orders-link a { color: var(--accent-blue); text-decoration: none; }

/* ── Case Listing Cards ── */
.case-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.case-card:hover {
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-medium, #ccc);
}

.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.case-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.case-docket {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.case-term {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.case-date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.case-card-name {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--space-xs) 0 var(--space-md);
  color: var(--text-primary);
}

.case-card-prediction {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.case-pred-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.case-pred-result {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
}

.case-pred-split {
  font-family: var(--font-data);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.case-card-justices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.justice-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  cursor: default;
}

/* Opinion text (extracted from PDF) */
.opinion-prose p {
  font-size: 0.95rem;
  line-height: 1.75;
  margin: 0 0 1em 0;
  color: var(--text-primary);
}
.opinion-prose p:first-child {
  margin-top: 0;
}
.opinion-prose {
  max-width: 70ch;
}
