/*
 * Shared stylesheet for content pages built on the content template
 * (site/templates/content-page.html). Linked as /guides/guide.css?v=N; bump N
 * on every change (Cloudflare caches it for a long time).
 *
 * The base below started as the business-insurance guide's inline stylesheet.
 * Every guide except director-journey loads it and keeps only its
 * page-specific styles inline. Content-standard components (short answer,
 * key facts, FAQ, sources, …) follow the base.
 */

/* White background override for guide pages */
body { background: #FFFFFF; }

/* All variables inherited from brand.css */
/* Nav, logo, and footer styles inherited from brand.css */

/* ── Nav: blend into header gradient on guide pages ── */
.nav:not(.nav-scrolled) {
  background: var(--accent-light);
}

/* ── Header gradient ── */
.article-header-wrap {
  background: linear-gradient(180deg, var(--accent-light) 0%, #FFFFFF 100%);
}

/* ── Article layout ── */
.article-header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 24px 56px;
}
.article-brand-mark {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 1px;
  margin-bottom: 20px;
}
.article-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
}
.article-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.article-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 620px;
}
.reading-meta {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.reading-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.reading-meta-icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* ── Sidebar TOC layout ── */
.article-with-toc {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 48px;
  align-items: start;
}
.sidebar-toc {
  position: sticky;
  top: 80px;
  padding: 18px 0 0;
}
.sidebar-toc .toc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 16px;
}
.sidebar-toc ol {
  list-style: none;
}
.sidebar-toc li {
  margin-bottom: 2px;
}
.sidebar-toc a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 5px 0;
  transition: color var(--transition);
  line-height: 1.4;
  text-decoration: none;
}
.sidebar-toc a:hover {
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-toc a.is-active {
  color: var(--accent);
  font-weight: 600;
}
/* Divider between TOC and content, progress bar */
.toc-divider {
  position: absolute;
  right: 0;
  top: 0;
  width: 2px;
  background: var(--border-light);
  border-radius: 1px;
  pointer-events: none;
  overflow: hidden;
}
.toc-divider-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
  border-radius: 1px;
  transition: height 0.25s ease;
}
.article-content {
  min-width: 0;
  max-width: var(--max-w);
}

/* ── Mobile: collapse sidebar to top ── */
@media (max-width: 860px) {
  .article-with-toc {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: var(--max-w);
  }
  .sidebar-toc {
    position: relative;
    top: auto;
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
  }
  .toc-divider {
    display: none;
  }
  .sidebar-toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 24px;
  }
  .sidebar-toc a {
    padding: 5px 0;
  }
}

/* ── Content sections ── */
.section {
  margin-bottom: 48px;
}
.section-anchor {
  display: block;
  position: relative;
  top: -80px;
  visibility: hidden;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  margin-top: 8px;
  color: var(--text-primary);
}

h3 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

/* ── Inline lists ── */
.article-content ul,
.article-content ol {
  margin: 0 0 16px 24px;
  padding: 0;
}
.article-content li {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

/* ── Comparison / data table ── */
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 20px 0 24px;
}
.cmp-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.cmp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.6;
}
.cmp-table tr td:first-child {
  color: var(--text-primary);
  font-weight: 600;
  width: 45%;
}
.cmp-table tr:last-child td { border-bottom: none; }

/* ── Callout boxes ── */
.callout {
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.65;
}
.callout strong { font-weight: 700; }
.callout-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
}
.callout-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}
.callout-tip {
  background: var(--success-bg);
  border: 1px solid var(--tip-border);
  color: var(--success);
}
.callout-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

/* ── Obligation / item list ── */
.obligation-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}
.obligation-list li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.obligation-list li:last-child { border-bottom: none; }
.obligation-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.obligation-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Worked example block ── */
.example-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.example-box .example-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.example-box p {
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.6;
}
.example-box ul {
  margin: 8px 0 0 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.example-box ul li { font-size: 14px; margin-bottom: 4px; }

/* ── CTA ── */
.cta-section {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  margin-top: 48px;
}
.cta-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.cta-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-white);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  transition: background var(--transition), transform 0.15s, box-shadow 0.15s;
}
.cta-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(62,120,178,0.3); color: var(--bg-white); text-decoration: none; }

/* ── Inline code ── */
code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Misc ── */
.small-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -8px;
  margin-bottom: 16px;
}
.source-link {
  font-size: 12px;
  color: var(--text-muted);
}
.source-link a { color: var(--text-muted); }
.source-link a:hover { color: var(--text-secondary); }


/* ── Responsive ── */
@media (max-width: 640px) {
  .article-header-inner { padding: 36px 20px 40px; }
  .article-title { font-size: 28px; }
  .cmp-table { font-size: 12px; }
  .cmp-table td { padding: 8px 8px; }
  .sidebar-toc ol {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Content-standard components
   ══════════════════════════════════════════════════════════════════════ */

/* ── Updated date and byline (header) ── */
.article-updated,
.article-byline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}
.article-updated time { color: var(--text-secondary); font-weight: 600; }
.article-reviewer::before { content: ' · '; }

/* ── Short answer: the first thing under the header ── */
.short-answer {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 0 32px;
}
.short-answer-label,
.key-facts-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 8px;
}
.short-answer p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 0;
}
.short-answer p + p { margin-top: 10px; }

/* ── Key facts: bullets, each with its source ── */
.key-facts {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px 8px;
  margin: 0 0 40px;
}
.article-content .key-facts ul {
  list-style: none;
  margin: 0;
}
.article-content .key-facts li {
  font-size: 15px;
  padding-left: 18px;
  position: relative;
}
.key-facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.fact-source {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.fact-source a { color: var(--text-muted); }

/* ── Data block: a table, figures or a tool, with its source ── */
.data-block {
  margin: 24px 0 32px;
}
.data-block figcaption {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.data-block .cmp-table { margin: 8px 0 12px; }
.data-block .source-link { margin-bottom: 0; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 8px 0 12px;
  font-variant-numeric: tabular-nums;
}
.stat-row > div { background: var(--bg-white); padding: 14px 16px; }
.stat-row b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.stat-row span { display: block; font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* ── How Basics helps: one soft link, not a sales block ── */
.basics-helps {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  margin: 40px 0;
}
.basics-helps p { margin-bottom: 0; font-size: 15px; }
.basics-helps strong { color: var(--text-primary); }

/* ── FAQ ── */
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 4px 0 8px;
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin-top: 16px; margin-bottom: 6px; }
.faq-item p { margin-bottom: 8px; }

/* ── Sources ── */
.article-content .sources-list {
  margin-left: 20px;
}
.article-content .sources-list li {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.source-checked {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ── Single-column layout (data pages, short pages without a contents list) ── */
.article-single {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.article-single .article-content { max-width: none; }
/* The related-guides partial is offset for the contents sidebar; centre it here. */
body[data-layout="single"] .related-guides {
  padding-left: 24px;
  max-width: var(--max-w);
}

/* ── Data hub list (e.g. /sic-codes) ── */
.hub-search {
  display: block;
  margin: 0 0 16px;
}
.hub-search input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
}
.hub-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition);
}
.hub-row:last-child { border-bottom: none; }
.hub-row:hover { text-decoration: none; background: var(--bg-light); box-shadow: inset 3px 0 0 var(--accent); }
.hub-row[hidden] { display: none; }
.hub-row-kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.hub-row-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.hub-row-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
