/* ============================================================
   resource-article.css — long-form /resources SPOKE pages
   (the actual guides, e.g. /resources/garage-door-wont-close).

   Page-specific (NOT in bundle.css). Loaded only by spoke
   pages via their own <link>. Uses global tokens from
   tokens.css (already in bundle.css).

   Design intent: an EDITORIAL "guide" voice, distinct from the
   conversion-forward /broken-springs article (article.css / tg-*).
   No big photo hero, no price strip up top. Text-forward header,
   sticky table of contents, answer-first leads, scannable
   diagnostic table. Harmonizes with the /resources hub
   (resources.css): same em-italic accents, eyebrow rules,
   paper/cream surfaces, hairlines.

   Namespace: .ra-*  (resource article)
   ============================================================ */

/* —— Editorial header (no photo; reads as a guide, not an ad) —— */
.ra-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--ink-line);
  padding: 40px 0 44px;
}
.ra-hero-inner { max-width: 820px; }
.ra-hero .crumbs {
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}
.ra-hero .crumbs a { color: var(--ink-mute); text-decoration: none; }
.ra-hero .crumbs a:hover { color: var(--rust); }
.ra-hero .crumbs .sep { margin: 0 8px; color: var(--ink-line); }

.ra-hero-tag {
  margin: 20px 0 14px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.ra-hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 460;
  letter-spacing: -0.022em;
  line-height: 1.05;
  color: var(--ink);
  max-width: 16ch;
}
.ra-hero h1 em { font-style: italic; color: var(--rust); }
.ra-hero-dek {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 18px;
  max-width: 60ch;
}

/* Byline / freshness row */
.ra-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--ink-mute);
}
.ra-meta strong { color: var(--ink-soft); font-weight: 600; }
.ra-meta-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.ra-meta-divider {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-line);
}

/* —— Two-column shell: sticky TOC + article body —— */
.ra-shell { background: var(--paper); }
.ra-grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 60px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 54px var(--gutter) var(--section-y);
  align-items: start;
}

/* Table of contents */
.ra-toc {
  position: sticky;
  top: 100px;
  font-family: var(--body);
}
.ra-toc-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--ink-line);
}
.ra-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.ra-toc li { margin: 0; }
.ra-toc a {
  display: block;
  padding: 7px 0;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-mute);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -2px;
  transition: color .15s ease, border-color .15s ease;
}
.ra-toc a:hover { color: var(--rust); }
.ra-toc a.is-active { color: var(--ink); border-left-color: var(--gold); font-weight: 600; }

/* —— Article body —— */
.ra-article { max-width: 720px; min-width: 0; }
.ra-article > section { scroll-margin-top: 100px; }
.ra-article h2 {
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 470;
  letter-spacing: -0.018em;
  line-height: 1.12;
  color: var(--ink);
  margin-top: 64px;
}
.ra-article > section:first-of-type h2 { margin-top: 0; }
.ra-article h2 em { font-style: italic; color: var(--rust); }
.ra-article h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 480;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: 38px;
  margin-bottom: 4px;
}
.ra-article h3 em { font-style: italic; color: var(--gold-deep); }
.ra-article p {
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink-soft);
  margin-top: 16px;
}
.ra-article p a {
  color: var(--rust);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-line);
  transition: border-color .15s ease;
}
.ra-article p a:hover { border-color: var(--rust); }
.ra-article strong { color: var(--ink); font-weight: 650; }
.ra-article ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.ra-article ul li {
  position: relative;
  padding-left: 24px;
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.ra-article ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 6px; height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* Answer-first lead — the snippet-bait sentence under each H2 */
.ra-answer {
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--ink);
  margin-top: 18px;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--gold);
  font-weight: 500;
}
.ra-answer strong { font-weight: 700; }

/* —— "Start here" key takeaways box —— */
.ra-keys {
  margin-top: 28px;
  background: var(--cream-deep);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  padding: 26px 28px;
}
.ra-keys-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 14px;
}
.ra-keys ul { margin: 0; padding: 0; list-style: none; }
.ra-keys li {
  position: relative;
  padding-left: 26px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.ra-keys li:first-child { margin-top: 0; }
.ra-keys li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  color: var(--green-ok);
  font-weight: 700;
}
.ra-keys li strong { color: var(--ink); }

/* —— Diagnostic table (the AIO-liftable centerpiece) —— */
.ra-table-wrap { margin-top: 24px; }
.ra-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--body);
  font-size: 15px;
  border: 1px solid var(--ink-line);
}
.ra-table thead th {
  text-align: left;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 14px;
}
.ra-table td {
  padding: 13px 14px;
  border-top: 1px solid var(--ink-line);
  vertical-align: top;
  color: var(--ink-soft);
  line-height: 1.45;
}
.ra-table tbody tr:nth-child(even) { background: var(--cream); }
.ra-table .sym { font-weight: 600; color: var(--ink); }
.ra-diy-yes { color: var(--green-ok); font-weight: 700; white-space: nowrap; }
.ra-diy-no { color: var(--rust); font-weight: 700; white-space: nowrap; }
.ra-diy-mix { color: var(--gold-deep); font-weight: 700; white-space: nowrap; }

/* —— Numbered how-to steps (sensor alignment) —— */
.ra-steps { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; }
.ra-step {
  position: relative;
  padding: 0 0 22px 56px;
  counter-increment: step;
}
.ra-step:last-child { padding-bottom: 0; }
.ra-step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: -2px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  color: var(--gold-deep);
}
/* connector line down the left of the step list */
.ra-step::after {
  content: "";
  position: absolute;
  left: 13px; top: 26px; bottom: 2px;
  width: 1px;
  background: var(--ink-line);
}
.ra-step:last-child::after { display: none; }
.ra-step h4 {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.ra-step p { margin-top: 0; font-size: 16px; }

/* —— Callouts: tip, warning, call-a-pro —— */
.ra-note, .ra-warn {
  margin-top: 24px;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
}
.ra-note {
  background: var(--cream-deep);
  border-left-color: var(--gold);
}
.ra-warn {
  background: #f7ece6;
  border-left-color: var(--rust);
}
.ra-note-label, .ra-warn-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.ra-note-label { color: var(--gold-deep); }
.ra-warn-label { color: var(--rust-deep); }
.ra-note p, .ra-warn p { margin-top: 0; font-size: 16px; line-height: 1.55; }

/* Inline "stuck right now / call a pro" conversion nudge (used sparingly) */
.ra-callpro {
  margin-top: 30px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.ra-callpro-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.ra-callpro-msg { font-size: 17px; line-height: 1.45; max-width: 42ch; }
.ra-callpro-msg em { font-style: italic; color: var(--gold); }
.ra-callpro p { margin: 0; color: var(--paper); }
.ra-callpro-phone {
  text-decoration: none;
  color: var(--paper);
  text-align: right;
  flex-shrink: 0;
}
.ra-callpro-num {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}
.ra-callpro-label {
  display: block;
  font-size: 12px;
  color: #b7ae9f;
  margin-top: 7px;
  letter-spacing: 0.04em;
}

/* —— Brand reset cards —— */
.ra-brands {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ra-brand {
  background: var(--paper);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  padding: 20px 20px 22px;
}
.ra-brand h4 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 480;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 8px;
}
.ra-brand p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-mute); }

/* —— FAQ accordion —— */
.ra-faq { margin-top: 24px; border-top: 1px solid var(--ink-line); }
.ra-faq details {
  border-bottom: 1px solid var(--ink-line);
  padding: 4px 0;
}
.ra-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 36px 16px 0;
  position: relative;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 460;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
}
.ra-faq summary::-webkit-details-marker { display: none; }
.ra-faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  color: var(--gold-deep);
  transition: transform .2s ease;
}
.ra-faq details[open] summary::after { transform: rotate(45deg); }
.ra-faq details[open] summary { color: var(--rust); }
.ra-faq-body { padding: 0 0 18px; }
.ra-faq-body p { margin: 0; font-size: 16px; line-height: 1.62; color: var(--ink-soft); }
.ra-faq-body p a { color: var(--rust); text-decoration: none; border-bottom: 1px solid var(--ink-line); }

/* —— Author bio —— */
.ra-bio {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--ink-line);
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.ra-bio-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  flex-shrink: 0;
}
.ra-bio-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 4px;
}
.ra-bio-name { font-family: var(--display); font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.ra-bio-desc { font-size: 14.5px; line-height: 1.55; color: var(--ink-mute); margin: 0; }

/* —— End CTA (soft, local) —— */
.ra-end {
  background: var(--ink);
  color: var(--paper);
}
.ra-end-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 48px;
  align-items: center;
  padding: var(--section-y-tight) 0;
}
.ra-end .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.ra-end h2 {
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 460;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--paper);
}
.ra-end h2 em { font-style: italic; color: var(--gold); }
.ra-end > .container > .ra-end-inner > div > p {
  color: #c9c0b2;
  font-size: 16px;
  line-height: 1.6;
  margin-top: 14px;
  max-width: 50ch;
}
.ra-end-card {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line-2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.ra-end-card .ph-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.ra-end-phone {
  display: block;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--paper);
  text-decoration: none;
  margin: 12px 0 6px;
}
.ra-end-hours { font-size: 12.5px; color: #b7ae9f; letter-spacing: 0.03em; }
.ra-end-or {
  display: block;
  font-style: italic;
  font-family: var(--serif);
  color: #b7ae9f;
  margin: 16px 0;
  font-size: 15px;
}
.ra-end-quote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
}
.ra-end-quote:hover { background: var(--gold); }

/* —— Price cells inside .ra-table (cost guides) —— */
.ra-table .price { font-family: var(--display); white-space: nowrap; color: var(--ink); font-size: 16px; }
.ra-table .tier { font-family: var(--display); letter-spacing: 0.06em; color: var(--gold-deep); white-space: nowrap; font-size: 16px; }

/* —— Two-column "this / that" decision comparison (repair-vs-replace, panel-vs-door) —— */
.ra-compare {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ra-compare .col {
  background: var(--paper);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
}
.ra-compare .col.yes { border-top: 3px solid var(--gold); }
.ra-compare .col.no { border-top: 3px solid var(--ink-mute); }
.ra-compare .col h4 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 480;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
}
.ra-compare ul { margin: 0; padding: 0; list-style: none; }
.ra-compare li {
  position: relative;
  padding-left: 22px;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.ra-compare li:first-child { margin-top: 0; }
.ra-compare li::before {
  content: "";
  position: absolute;
  left: 3px; top: 8px;
  width: 6px; height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* —— [DATA NEEDED] price placeholder flag — DRAFT ONLY, delete every .dn before publish —— */
.dn {
  background: #fff3cd;
  color: #7a5b00;
  padding: 0 5px;
  border-radius: 2px;
  font-style: normal;
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .ra-compare { grid-template-columns: 1fr; }
  .ra-grid { grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
  /* TOC becomes a collapsible card at the top on mobile */
  .ra-toc {
    position: static;
    margin-bottom: 36px;
    background: var(--cream-deep);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
  }
  .ra-toc-head { margin-bottom: 4px; }
  .ra-toc a { padding: 8px 0 8px 12px; }
  .ra-article { max-width: 100%; }
  .ra-brands { grid-template-columns: 1fr; }
  .ra-end-inner { grid-template-columns: 1fr; gap: 28px; padding: var(--section-y-tight) 0; }
}

@media (max-width: 620px) {
  .ra-callpro { flex-direction: column; align-items: flex-start; }
  .ra-callpro-phone { text-align: left; }

  /* Diagnostic table → stacked cards (data-label drives the row labels) */
  .ra-table, .ra-table thead, .ra-table tbody, .ra-table tr, .ra-table td { display: block; width: 100%; }
  .ra-table thead { display: none; }
  .ra-table { border: 0; }
  .ra-table tbody tr {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    padding: 6px 0;
    background: var(--paper);
  }
  .ra-table tbody tr:nth-child(even) { background: var(--paper); }
  .ra-table td {
    border: 0;
    padding: 8px 16px;
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 12px;
  }
  .ra-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-deep);
    align-self: center;
  }
  .ra-table .sym { color: var(--ink); }
}
