/* card.css — shared stylesheet for all F55 cards */
:root {
  --bg: #fafaf7;
  --fg: #2a2a2a;
  --fg-bright: #111;
  --accent: #1a5c6b;
  --accent-hover: #13444f;
  --muted: #6b6b6b;
  --card-bg: #f0efeb;
  --border: #d8d5ce;
  --border-light: #c5c2ba;
  --doc-bg: #fdf8ee;
  --doc-border: #c8b070;
  --doc-color: #7a6520;
  --law-bg: #eef6f8;
  --law-border: #7ab0c0;
  --law-color: #1a5c6b;
  --heading: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --body: 'Lora', Georgia, serif;
  --mono: 'DM Mono', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.78; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* NAV */
.topnav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  gap: 2.5rem;
  justify-content: center;
}
.topnav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-bright);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.topnav a:hover, .topnav a.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* LAYOUT */
.container { max-width: 820px; margin: 0 auto; padding: 0 2rem 4rem; }

/* HEADER */
.card-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.card-eyebrow { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.6rem; }
.card-header h1 { font-family: var(--heading); font-size: 1.85rem; font-weight: 700; color: var(--fg-bright); letter-spacing: -0.025em; line-height: 1.22; margin-bottom: 1rem; }
.card-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; padding: 0.2rem 0.6rem; border: 1px solid; }
.tag-risk  { background: #fff2f2; border-color: #dba0a0; color: #7a2020; }
.tag-punch { background: #f0f3ff; border-color: #a0aadb; color: #202070; }


/* LEAD HEADER */
.lead-header {
  font-family: var(--heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--fg-bright);
  margin-bottom: 2rem;
}

/* PLAIN ENGLISH BLOCK */
.plain-english {
  background: var(--card-bg);
  border-radius: 4px;
  padding: 1.6rem 1.8rem;
  margin: 0 0 2rem;
  font-size: 1.02rem;
  line-height: 1.82;
}
.plain-english-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.9rem;
}
.plain-english p { margin: 0 0 0.8rem; }
.plain-english p:last-of-type { margin-bottom: 0; }
.bottom-line {
  display: block;
  background: #fff;
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.1rem;
  margin-top: 1.2rem;
  font-weight: 600;
  font-family: var(--body);
  font-size: 0.98rem;
  color: var(--fg-bright);
  line-height: 1.6;
}

/* LEGAL RECORD TOGGLE */
details.legal-record { margin-bottom: 1rem; }
details.legal-record > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  user-select: none;
  transition: background 0.12s;
}
details.legal-record > summary::-webkit-details-marker { display: none; }
details.legal-record > summary:hover { background: var(--law-bg); text-decoration: none; }
details.legal-record[open] > summary { background: var(--law-bg); margin-bottom: 0.5rem; }
details.legal-record > summary::before { content: '▸'; font-size: 0.6rem; }
details.legal-record[open] > summary::before { content: '▾'; }

/* SECTIONS */
.section { margin: 3rem 0; }
.section h2 { font-family: var(--heading); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 0.3rem; }
.section-rule { width: 30px; height: 3px; background: var(--accent); margin-bottom: 1.1rem; }
.section p { margin-bottom: 0.9rem; }
.section ol, .section ul { padding-left: 1.5em; }
.section li { margin-bottom: 0.75em; line-height: 1.75; }

/* BLOCKQUOTE */
blockquote { background: var(--card-bg); border-left: 3px solid var(--accent); padding: 1rem 1.4rem; margin: 1.2rem 0; font-style: italic; font-size: 0.96rem; }
blockquote cite { display: block; font-style: normal; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); margin-top: 0.5rem; letter-spacing: 0.03em; }

/* SOURCE BADGE */
a.src {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  background: var(--doc-bg);
  border: 1px solid var(--doc-border);
  padding: 0.05rem 0.42rem;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--doc-color);
  border-radius: 2px;
  vertical-align: middle;
  white-space: nowrap;
  margin: 0 0.06rem;
  position: relative;
  transition: background 0.12s;
}
a.src:hover { background: #f5ecd8; border-color: #a88030; text-decoration: none; color: var(--doc-color); }
a.src::before {
  content: '';
  display: inline-block;
  width: 8px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%237a6520'%3E%3Cpath d='M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0H4zM9 1v3.5A1.5 1.5 0 0 0 10.5 6H14v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

/* HOVERCARD — CSS-only via title attribute */
a.src[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 0;
  width: 260px;
  background: var(--doc-bg);
  border: 1px solid var(--doc-border);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  font-family: var(--body);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg);
  white-space: normal;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
}
a.src[title]:hover::after { opacity: 1; }

/* LAW BADGE */
a.law {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  background: var(--law-bg);
  border: 1px solid var(--law-border);
  padding: 0.05rem 0.42rem;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--law-color);
  border-radius: 2px;
  vertical-align: middle;
  white-space: nowrap;
  margin: 0 0.06rem;
  transition: background 0.12s;
}
a.law:hover { background: #dceef2; border-color: #4a8a9a; text-decoration: none; color: var(--law-color); }
a.law::before {
  content: '';
  display: inline-block;
  width: 8px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231a5c6b'%3E%3Cpath d='M8 0L0 4v1h16V4L8 0zM1 6v6h2V6H1zm4 0v6h2V6H5zm4 0v6h2V6H9zm4 0v6h2V6h-2zM0 13v1h16v-1H0zm0 2v1h16v-1H0z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

/* REQUEST BADGE — CPRA/NextRequest portal sources */
a.req {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  background: #f0edf8;
  border: 1px solid #9e90c8;
  padding: 0.05rem 0.42rem;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: #483280;
  border-radius: 2px;
  vertical-align: middle;
  white-space: nowrap;
  margin: 0 0.06rem;
  position: relative;
  transition: background 0.12s;
  text-decoration: none;
}
a.req:hover { background: #e0d8f5; border-color: #7060a8; text-decoration: none; color: #483280; }
a.req::before {
  content: '';
  display: inline-block;
  width: 8px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23483280'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.44.884a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}
a.req[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 0;
  width: 260px;
  background: #f0edf8;
  border: 1px solid #9e90c8;
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  font-family: var(--body);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg);
  white-space: normal;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
}
a.req[title]:hover::after { opacity: 1; }

/* CARD LINK */
a.card-ref { font-family: var(--mono); font-size: 0.72rem; color: var(--fg); border-bottom: 1px dashed var(--border-light); padding-bottom: 1px; }
a.card-ref:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* RECORD CHAIN — collapsible */
.record-chain { margin-top: 0.5rem; }
.argument {
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 0.6rem;
}
.argument summary {
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  user-select: none;
}
.argument summary::-webkit-details-marker { display: none; }
.argument summary:hover { background: var(--card-bg); }
.argument[open] > summary { border-bottom: 1px solid var(--border); background: var(--card-bg); }
.arg-toggle { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); flex-shrink: 0; margin-top: 0.15em; }
.argument:not([open]) .arg-toggle::before { content: '+'; }
.argument[open] .arg-toggle::before { content: '−'; }
.arg-num { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); flex-shrink: 0; margin-top: 0.25em; min-width: 1.2em; }
.argument-body { padding: 1rem 1.4rem 1.2rem; font-size: 0.97rem; line-height: 1.75; }
.argument-body p { margin-bottom: 0.8rem; }
.argument-body p:last-child { margin-bottom: 0; }

/* BOTTOM */
.bottom { border-top: 2px solid var(--border); margin-top: 3.5rem; padding-top: 2rem; }
.bottom-section { margin-bottom: 2.5rem; }
.bottom-section h3 { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); margin-bottom: 0.8rem; }

/* SOURCE LIST */
.source-list { list-style: none; padding: 0; }
.source-list li { font-size: 0.86rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 0.8rem; align-items: baseline; flex-wrap: wrap; }
.source-list li:last-child { border-bottom: none; }
.source-id { font-family: var(--mono); font-size: 0.68rem; color: var(--fg-bright); font-weight: 500; flex-shrink: 0; min-width: 80px; }

/* SOURCE COLLAPSE */
details.source-collapse summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
details.source-collapse summary::-webkit-details-marker { display: none; }
details.source-collapse summary:hover { color: var(--accent); }
details.source-collapse summary::before { content: '▸'; font-size: 0.6rem; }
details.source-collapse[open] summary::before { content: '▾'; }
details.source-collapse .source-list { margin-top: 0.8rem; }

/* RELATED CHIPS */
.related-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related-chips a { font-family: var(--mono); font-size: 0.7rem; padding: 0.25rem 0.7rem; border: 1px solid var(--border); color: var(--fg); transition: border-color 0.15s, color 0.15s; }
.related-chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

footer { border-top: 1px solid var(--border); padding: 1.8rem 0; text-align: center; font-family: var(--mono); font-size: 0.65rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1rem; }

/* PRINT */
@media print {
  .topnav { display: none; }
  body { font-size: 11pt; line-height: 1.6; background: #fff; }
  .container { max-width: 100%; padding: 0 1cm; }
  .card-header { padding: 1rem 0; }
  a.src, a.law { background: none !important; border: none !important; padding: 0 !important; color: #000 !important; font-weight: 600; text-decoration: underline; }
  a.src::before, a.law::before, a.src::after { display: none !important; }
  .argument { border: none; margin-bottom: 0.3rem; }
  .argument summary { padding: 0; cursor: default; }
  .argument[open] > summary { border-bottom: none; background: none; }
  details > *:not(summary) { display: block !important; }
  details.source-collapse .source-list { display: block !important; }
  .related-chips { display: none; }
  blockquote { break-inside: avoid; }
}
