/**
 * reading.css — SignLater reading-experience layer (v1.4.0).
 *
 * Design goal: make long guides irresistible to read and easy to act on.
 * Works WITHOUT any changes to article HTML: the JS (reading.js) tags the
 * lede paragraph, and the rest targets stable structural patterns.
 *
 * Palette (matches the brand system set in the Site Editor):
 *   --sl-navy: #0f2a43  (authority: verdicts, table headers)
 *   --sl-blue: #1a56db  (action: links, buttons, progress)
 *   --sl-paper: #fafbfc (page)
 *   --sl-ink: #1c2733   (body text)
 *   --sl-muted: #5b6470 (secondary text)
 *   --sl-line: #e4e9ef  (borders)
 *   --sl-lede-bg: #eef4ff (lede tint)
 *   --sl-amber: #b45309 (caution accents)
 */

:root {
  --sl-navy: #0f2a43;
  --sl-blue: #1a56db;
  --sl-paper: #fafbfc;
  --sl-ink: #1c2733;
  --sl-muted: #5b6470;
  --sl-line: #e4e9ef;
  --sl-lede-bg: #eef4ff;
  --sl-amber: #b45309;
}

/* ---- Reading progress bar (injected by reading.js) ---- */
.sl-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--sl-blue);
  z-index: 9999;
  transition: width 80ms linear;
}

/* ---- Lede ("The short answer") — tagged by reading.js ---- */
.sl-lede {
  background: var(--sl-lede-bg) !important;
  border-left: 4px solid var(--sl-navy) !important;
  border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.3rem !important;
  font-size: 1.08rem !important;
  line-height: 1.65 !important;
  margin: 0 0 1.75rem !important;
}
.sl-lede strong:first-child {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sl-navy);
  margin-bottom: 0.35rem;
}

/* ---- In-article CTA boxes (existing inline-styled divs, upgraded) ---- */
div[style*="background:#f4f7fb"] {
  background: #ffffff !important;
  border: 1px solid var(--sl-line) !important;
  border-left: 4px solid var(--sl-blue) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(15, 42, 67, 0.07) !important;
  padding: 1.15rem 1.35rem !important;
  margin: 2rem 0 !important;
}
div[style*="background:#f4f7fb"] a {
  font-weight: 700;
}

/* ---- Verdict / comparison boxes ---- */
.sbdt-fa-verdict {
  background: var(--sl-navy);
  color: #ffffff;
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  font-size: 1.06rem;
  line-height: 1.6;
  margin: 0;
}
.sbdt-fa-verdict strong {
  color: #ffffff;
}
.sbdt-fa-compare {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}
.sbdt-fa-compare h3 {
  margin-bottom: 0.6rem;
}

/* ---- Tables: authority headers, calm rows ---- */
.entry-content table,
.wp-block-table table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0 2rem;
  font-size: 0.96rem;
  border: 1px solid var(--sl-line);
  border-radius: 8px;
  overflow: hidden;
}
.entry-content thead th,
.wp-block-table thead th {
  background: var(--sl-navy);
  color: #ffffff;
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}
.entry-content tbody td,
.wp-block-table tbody td {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--sl-line);
  vertical-align: top;
}
.entry-content tbody tr:nth-child(even),
.wp-block-table tbody tr:nth-child(even) {
  background: #f6f8fb;
}
.entry-content tbody tr:hover,
.wp-block-table tbody tr:hover {
  background: var(--sl-lede-bg);
}

/* ---- Calculator panels: color-code the two offers ---- */
.sbdt-fa-panels .sbdt-fa-panel:first-child {
  border-top: 4px solid var(--sl-amber);
}
.sbdt-fa-panels .sbdt-fa-panel:last-child {
  border-top: 4px solid var(--sl-blue);
}
.sbdt-fa-panel legend {
  font-size: 1.02rem;
}
.sbdt-fa-card {
  box-shadow: 0 4px 14px rgba(15, 42, 67, 0.06);
}
.sbdt-fa-total {
  color: var(--sl-navy);
}

/* ---- Methodology / caveat fine print: keep honest, keep readable ---- */
.entry-content p > em:only-child,
.entry-content > p em:only-child {
  color: var(--sl-muted);
}

/* ---- Headings: rhythm for long reads ---- */
.entry-content h2 {
  margin-top: 2.75rem;
  padding-top: 0.25rem;
}
.entry-content h2:first-child {
  margin-top: 0;
}

/* ---- Anchor offset for the fixed progress bar ---- */
.entry-content h2[id],
.entry-content h3[id] {
  scroll-margin-top: 16px;
}

@media (max-width: 640px) {
  .sl-lede {
    font-size: 1.02rem !important;
    padding: 1rem 1.1rem !important;
  }
  .entry-content table,
  .wp-block-table table {
    font-size: 0.88rem;
  }
  .entry-content thead th,
  .entry-content tbody td,
  .wp-block-table thead th,
  .wp-block-table tbody td {
    padding: 0.55rem 0.65rem;
  }
}
