/* ==========================================================================
   creditprofile.org — guide / long-form article supplements
   Depends on tokens defined in styles.css (load styles.css first).
   Class names frozen in ARCHITECTURE.md.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Article header
   -------------------------------------------------------------------------- */
.guide-header {
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.guide-header h1 {
  font-size: var(--step-4);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  max-width: 34ch;
}

.guide-header .lede {
  max-width: 66ch;
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.6;
}

.guide-header .meta {
  margin-top: 0.5rem;
}

.pillar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-ink);
  font-size: var(--step--1);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pillar-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   2. Two-column guide body
   -------------------------------------------------------------------------- */
.guide-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1000px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 3rem;
  }
}

.guide-body {
  min-width: 0;
}

/* Sticky table of contents on wide screens */
.guide-aside {
  align-self: start;
}

@media (min-width: 1000px) {
  .guide-aside {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
  }
}

/* --------------------------------------------------------------------------
   3. Key takeaways placement
   -------------------------------------------------------------------------- */
.guide-body .key-takeaways {
  margin-bottom: 1.75rem;
}

/* --------------------------------------------------------------------------
   4. Quick answer / snippet block
   -------------------------------------------------------------------------- */
.quick-answer {
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.quick-answer > :first-child {
  margin-top: 0;
}

.quick-answer h2,
.quick-answer h3 {
  margin-top: 0;
  font-size: var(--step-1);
}

.quick-answer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   5. Comparison table
   -------------------------------------------------------------------------- */
.guide-body .comparison {
  margin: 1.75rem 0;
  overflow-x: auto;
}

.guide-body .comparison table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.guide-body .comparison th,
.guide-body .comparison td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.guide-body .comparison thead th {
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
}

.guide-body .comparison tbody tr:nth-child(even) {
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   6. Step list
   -------------------------------------------------------------------------- */
.steps {
  counter-reset: step;
  margin: 1.75rem 0;
  padding: 0;
  list-style: none;
}

.steps > li {
  position: relative;
  padding: 0 0 1.25rem 3rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-size: var(--step--1);
  font-weight: 700;
}

.steps > li::after {
  content: "";
  position: absolute;
  left: 1rem;
  top: 2.25rem;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.steps > li:last-child {
  padding-bottom: 0;
}

.steps > li:last-child::after {
  display: none;
}

.steps > li strong {
  display: block;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   7. Callout variants
   -------------------------------------------------------------------------- */
.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  background: var(--surface);
  color: var(--ink-soft);
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--step--1);
  letter-spacing: 0.05em;
}

.callout-info {
  border-left-color: var(--accent);
}

.callout-tip {
  border-left-color: var(--ok);
}

.callout-warn {
  border-left-color: var(--accent-2);
  background: #fdf6ef;
}

.callout-warn .callout-title {
  color: var(--accent-2);
}

/* --------------------------------------------------------------------------
   8. Related links (guide footer)
   -------------------------------------------------------------------------- */
.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: var(--step-2);
  margin-top: 0;
}

.related-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .related-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.related-list a {
  display: block;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.related-list a:hover {
  border-color: var(--accent);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   9. Guide index list
   -------------------------------------------------------------------------- */
.guide-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.guide-list-item {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.guide-list-item a {
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 700;
  text-decoration: none;
}

.guide-list-item a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.guide-list-item p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   10. Sources / citations
   -------------------------------------------------------------------------- */
.sources {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.sources h2 {
  font-size: var(--step-1);
  margin-top: 0;
}

.sources ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.sources li + li {
  margin-top: 0.4rem;
}

.sources li::marker {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   11. Print
   -------------------------------------------------------------------------- */
@media print {
  .guide-aside,
  .related,
  .guide-header .meta {
    display: none !important;
  }

  .guide-layout {
    display: block;
  }

  .callout {
    break-inside: avoid;
    border-color: #999;
    background: #fff;
  }

  .faq-item > summary::after {
    display: none;
  }

  .faq-item > :not(summary) {
    display: block !important;
  }
}
