/*
 * CRC Case Single View — crc-single.css
 * Scoped under .crc-sv  |  Tokens match archive + dashboard plugins
 */

/* ── Global resets for single-case pages ───────────────────────────────────── */
html body { margin-top: 0 !important; padding-top: 0 !important; }
#wpadminbar { display: none !important; }

/* ── Design tokens ──────────────────────────────────────────────────────────── */
.crc-sv {
  --crc-ink:       #0C1B4F;
  --crc-ink-2:     #2A376B;
  --crc-mark:      #FECA03;
  --crc-mark-soft: #FFF7CC;
  --crc-page:      #FAFAF7;
  --crc-card:      #FFFFFF;
  --crc-rule:      #E6E6E0;
  --crc-rule-2:    #F0F0EC;
  --crc-muted:     #6B6B6B;
  --crc-muted-2:   #9B9B9B;
  --crc-radius:    2px;
  --crc-shell:     1280px;
  --crc-gutter:    40px;
  --crc-mono:      "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
  --crc-sidebar:   300px;
  --crc-gap:       40px;

  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--crc-page);
  color: var(--crc-ink);
}

.crc-sv *, .crc-sv *::before, .crc-sv *::after {
  box-sizing: inherit;
}

.crc-sv button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* ── Shell ──────────────────────────────────────────────────────────────────── */
.crc-sv-shell {
  max-width: var(--crc-shell);
  margin: 0 auto;
  padding-left: var(--crc-gutter);
  padding-right: var(--crc-gutter);
}

/* ── Masthead ───────────────────────────────────────────────────────────────── */
.crc-sv-masthead {
  background: var(--crc-ink);
  position: relative;
  padding: 40px 0 48px;
  overflow: hidden;
}

/* Yellow right-edge stripe — mirrors archive + dashboard */
.crc-sv-masthead::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--crc-mark);
}

/* Subtle radial glow */
.crc-sv-masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 90% at 100% 50%, #1a2d6b 0%, transparent 70%);
  pointer-events: none;
}

.crc-sv-masthead .crc-sv-shell {
  position: relative;
  z-index: 1;
}

/* Breadcrumbs */
.crc-sv-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 20px;
}

.crc-sv-crumb {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 120ms ease;
}

.crc-sv-crumb:hover {
  color: var(--crc-mark);
}

.crc-sv-crumb--current {
  color: rgba(255,255,255,0.85);
}

.crc-sv-crumb-sep {
  color: rgba(255,255,255,0.25);
  font-size: 11px;
}

/* Eyebrow — court name */
.crc-sv-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crc-mark);
  font-family: var(--crc-mono);
  margin: 0 0 10px;
}

/* Title */
.crc-sv-title {
  font-size: clamp(26px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  color: #FFFFFF;
  margin: 0 0 22px;
  max-width: 820px;
  letter-spacing: -0.01em;
}

/* Head meta row — citation pill + copy + tags */
.crc-sv-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.crc-sv-citation-pill {
  display: inline-block;
  font-family: var(--crc-mono);
  font-size: 12px;
  color: var(--crc-ink);
  background: var(--crc-mark);
  padding: 4px 10px;
  border-radius: var(--crc-radius);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.crc-sv-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--crc-radius);
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.crc-sv-copy-btn:hover {
  color: var(--crc-mark);
  border-color: var(--crc-mark);
}

.crc-sv-copy-btn.is-copied {
  color: #6DD67A;
  border-color: rgba(109,214,122,0.5);
}

.crc-sv-copy-label { line-height: 1; }

/* Category tags in masthead */
.crc-sv-head-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crc-sv-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 3px 8px;
  border-radius: var(--crc-radius);
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}

.crc-sv-tag:hover {
  color: var(--crc-mark);
  border-color: var(--crc-mark);
}

/* ── Body layout ────────────────────────────────────────────────────────────── */
.crc-sv-body {
  padding-top: 40px;
  padding-bottom: 60px;
}

.crc-sv-layout {
  display: grid;
  grid-template-columns: 1fr var(--crc-sidebar);
  gap: var(--crc-gap);
  align-items: start;
}

/* ── Main content ───────────────────────────────────────────────────────────── */
.crc-sv-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sections */
.crc-sv-section {
  background: var(--crc-card);
  border: 1px solid var(--crc-rule);
  border-left: 4px solid var(--crc-rule);
  border-radius: var(--crc-radius);
  padding: 28px 32px;
  transition: border-left-color 160ms ease;
}



.crc-sv-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crc-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--crc-rule-2);
}

.crc-sv-section-num {
  font-family: var(--crc-mono);
  font-size: 10px;
  color: var(--crc-mark);
  background: var(--crc-ink);
  padding: 2px 6px;
  border-radius: var(--crc-radius);
  letter-spacing: 0.04em;
}

/* Ratio body */
.crc-sv-ratio-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--crc-ink);
  text-align: justify;
}

.crc-sv-ratio-body p {
  margin: 0 0 16px;
}

.crc-sv-ratio-body p:last-child {
  margin-bottom: 0;
}

/* Pincites */
.crc-sv-pincites {
  font-family: var(--crc-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--crc-ink-2);
  background: var(--crc-page);
  border: 1px solid var(--crc-rule);
  border-radius: var(--crc-radius);
  padding: 16px 20px;
}

/* Post content */
.crc-sv-content {
  font-size: 15px;
  line-height: 1.75;
  color: var(--crc-ink);
  text-align: justify;
}

.crc-sv-content p     { margin: 0 0 16px; }
.crc-sv-content h2,
.crc-sv-content h3    { color: var(--crc-ink); margin: 24px 0 12px; }
.crc-sv-content ul,
.crc-sv-content ol    { padding-left: 24px; margin: 0 0 16px; }
.crc-sv-content li    { margin-bottom: 8px; }
.crc-sv-content a     { color: var(--crc-ink); text-decoration: underline; text-decoration-color: var(--crc-mark); }
.crc-sv-content blockquote {
  border-left: 3px solid var(--crc-mark);
  margin: 20px 0;
  padding: 4px 0 4px 20px;
  color: var(--crc-muted);
  font-style: italic;
}

/* Empty state */
.crc-sv-empty {
  background: var(--crc-card);
  border: 1px dashed var(--crc-rule);
  border-radius: var(--crc-radius);
  padding: 40px 32px;
  color: var(--crc-muted);
  font-size: 14px;
  text-align: center;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.crc-sv-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

/* Cards */
.crc-sv-card {
  background: var(--crc-card);
  border: 1px solid var(--crc-rule);
  border-left: 4px solid var(--crc-rule);
  border-radius: var(--crc-radius);
  padding: 20px 22px;
  transition: border-left-color 160ms ease;
}



.crc-sv-card-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crc-muted);
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.crc-sv-card-title-note {
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 9px;
  color: var(--crc-muted-2);
  text-transform: none;
}

.crc-sv-card-desc {
  font-size: 12px;
  color: var(--crc-muted);
  margin: 0 0 14px;
  line-height: 1.55;
}

.crc-sv-card-sub-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crc-muted-2);
  margin: 16px 0 8px;
}

/* Definition list */
.crc-sv-dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

.crc-sv-dl-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--crc-rule-2);
}

.crc-sv-dl-row:last-child {
  border-bottom: none;
}

.crc-sv-dl dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crc-muted-2);
  padding-top: 1px;
}

.crc-sv-dl dd {
  font-size: 13px;
  color: var(--crc-ink);
  margin: 0;
  line-height: 1.5;
}

.crc-sv-mono {
  font-family: var(--crc-mono);
  font-size: 12px !important;
  letter-spacing: 0.02em;
}

/* Tag stack in sidebar */
.crc-sv-tag-stack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Sidebar tags have dark-on-light style */
.crc-sv-tag-stack .crc-sv-tag {
  color: var(--crc-ink);
  border-color: var(--crc-rule);
  font-size: 9px;
}

.crc-sv-tag-stack .crc-sv-tag:hover {
  border-color: var(--crc-ink);
  color: var(--crc-ink);
}

/* Categories */
.crc-sv-card-categories {
  margin-top: 4px;
}

/* Judgment button (standalone, no card wrapper) */
.crc-sv-judgment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crc-ink);
  background: #E7E7E0;
  border: none;
  padding: 11px 16px;
  border-radius: var(--crc-radius);
  text-decoration: none;
  transition: background 140ms ease;
  width: 100%;
}

.crc-sv-judgment-btn:hover {
  color: var(--crc-ink);
  background: #DDDDD6;
}

.crc-sv-pdf-icon {
  flex-shrink: 0;
  overflow: visible;
}

/* ── Floating share bar (left edge) ────────────────────────────────────────── */
.crc-sv-share-float {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--crc-card);
  border: 1px solid var(--crc-rule);
  border-left: none;
  border-radius: 0 var(--crc-radius) var(--crc-radius) 0;
  box-shadow: 2px 0 12px rgba(0,0,0,0.06);
  overflow: hidden;
}

.crc-sv-share-float .crc-sv-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--crc-muted);
  background: var(--crc-card);
  border: none;
  border-bottom: 1px solid var(--crc-rule-2);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  font-family: inherit;
}

.crc-sv-share-float .crc-sv-share-btn:last-child {
  border-bottom: none;
}

.crc-sv-share-float .crc-sv-share-btn:hover {
  color: var(--crc-ink);
  background: var(--crc-page);
}

.crc-sv-share-float .crc-sv-share-btn:focus,
.crc-sv-share-float .crc-sv-share-btn:active {
  outline: none;
  background: var(--crc-page);
  color: var(--crc-ink);
}

.crc-sv-share-float .crc-sv-share-btn.is-copied {
  color: #3a9e4a;
  background: #f0faf2;
}

/* ── Fix theme pink tap-highlight on copy citation button ──────────────────── */
.crc-sv-copy-btn,
.crc-sv-copy-btn:focus,
.crc-sv-copy-btn:focus-visible,
.crc-sv-copy-btn:active {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: none !important;
  box-shadow: none !important;
}

/* Override any theme button :focus / :active background */
.crc-sv button:focus,
.crc-sv button:active,
.crc-sv button:focus-visible {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* Related cases */
.crc-sv-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.crc-sv-related-item + .crc-sv-related-item {
  border-top: 1px solid var(--crc-rule-2);
}

.crc-sv-related-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  text-decoration: none;
  transition: color 120ms ease;
}

.crc-sv-related-link:hover .crc-sv-related-title {
  color: var(--crc-ink-2);
  text-decoration: underline;
  text-decoration-color: var(--crc-mark);
}

.crc-sv-related-court {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crc-muted-2);
}

.crc-sv-related-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--crc-ink);
  line-height: 1.4;
}

.crc-sv-related-citation {
  font-family: var(--crc-mono);
  font-size: 10px;
  color: var(--crc-muted);
}

.crc-sv-related-all {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--crc-rule);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crc-ink);
  text-decoration: none;
  transition: color 120ms ease;
}

.crc-sv-related-all:hover {
  color: var(--crc-ink-2);
}

/* ── Prev / next navigation ──────────────────────────────────────────────────── */
.crc-sv-case-nav {
  background: var(--crc-card);
  border-top: 1px solid var(--crc-rule);
  padding: 28px 0;
}

.crc-sv-case-nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.crc-sv-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  padding: 16px 20px;
  border: 1px solid var(--crc-rule);
  border-left: 4px solid var(--crc-rule);
  border-radius: var(--crc-radius);
  background: var(--crc-page);
  transition: border-left-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.crc-sv-nav-item:hover {
  border-left-color: var(--crc-ink);
  box-shadow: 0 3px 0 var(--crc-rule);
  transform: translateY(-2px);
}

.crc-sv-nav-item--next {
  text-align: right;
}

.crc-sv-nav-arrow {
  font-size: 20px;
  color: var(--crc-muted-2);
  line-height: 1;
  padding-top: 2px;
  flex-shrink: 0;
  transition: color 120ms ease;
}

.crc-sv-nav-item:hover .crc-sv-nav-arrow {
  color: var(--crc-ink);
}

.crc-sv-nav-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.crc-sv-nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crc-muted-2);
}

.crc-sv-nav-court {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crc-muted);
}

.crc-sv-nav-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--crc-ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crc-sv-nav-citation {
  font-family: var(--crc-mono);
  font-size: 10px;
  color: var(--crc-muted);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

/* Tablet: collapse sidebar below main */
@media (max-width: 960px) {
  .crc-sv-layout {
    grid-template-columns: 1fr;
  }

  .crc-sv-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }


  .crc-sv-case-nav-row {
    grid-template-columns: 1fr;
  }

  .crc-sv-nav-item--next {
    text-align: left;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .crc-sv {
    --crc-gutter: 20px;
    --crc-gap:    24px;
  }

  .crc-sv-masthead {
    padding: 28px 0 36px;
  }

  .crc-sv-title {
    font-size: 24px;
  }

  .crc-sv-sidebar {
    grid-template-columns: 1fr;
  }

  .crc-sv-section {
    padding: 20px;
  }

  .crc-sv-dl-row {
    grid-template-columns: 70px 1fr;
  }

  .crc-sv-body {
    padding-top: 24px;
    padding-bottom: 40px;
  }

  .crc-sv-share-float {
    display: none;
  }
}

/* ── Search-term highlight ──────────────────────────────────────────────────── */

/* Override any theme mark resets */
.crc-sv mark[data-crc-highlight],
mark.crc-sv-highlight,
.crc-sv mark.crc-sv-highlight,
.crc-sv-main mark.crc-sv-highlight,
.crc-sv-sidebar mark.crc-sv-highlight,
.crc-sv-masthead mark.crc-sv-highlight,
body mark[data-crc-highlight="true"],
html body mark.crc-sv-highlight {
  background: #FECA03 !important;
  background-color: #FECA03 !important;
  color: #0C1B4F !important;
  padding: 1px 4px !important;
  border-radius: 2px !important;
  font-style: inherit !important;
  font-weight: inherit !important;
  display: inline !important;
  box-shadow: 0 0 0 1px rgba(254, 202, 3, 0.4) !important;
  animation: crc-sv-highlight-pulse 1.2s ease 1 !important;
  -webkit-text-fill-color: #0C1B4F !important;
}

@keyframes crc-sv-highlight-pulse {
  0%   { background-color: #FECA03 !important; box-shadow: 0 0 0 0 rgba(254, 202, 3, 0.6) !important; }
  40%  { background-color: #ffe766 !important;  box-shadow: 0 0 0 6px rgba(254, 202, 3, 0) !important; }
  100% { background-color: #FECA03 !important; box-shadow: 0 0 0 0 rgba(254, 202, 3, 0) !important; }
}
