/* ===================================================================
   Tiny Sleeps — content pages (guides, guide index)
   Layered on top of styles.css: every colour, font, radius and spacing
   value comes from the tokens in styles.css :root. No new tokens here.
   =================================================================== */

/* --- Header (static; the homepage keeps its own JS nav) --- */
.site-header {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  background: rgba(240, 245, 250, 0.85);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.site-header-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.9375rem;
  font-weight: 500;
}
.site-header-links a { color: var(--color-text-secondary); transition: color var(--transition-fast); }
.site-header-links a:hover { color: var(--color-text); }
.site-header-links a.site-header-cta {
  white-space: nowrap;
  color: var(--color-white);
  background: var(--color-text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
}

/* --- Page frame --- */
.article-wrap {
  max-width: 760px;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xl);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}
.breadcrumb li + li::before { content: '/'; margin-right: 0.5rem; opacity: 0.6; }
.breadcrumb a { text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb [aria-current='page'] {
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-header { margin-bottom: var(--space-lg); }
.article-header h1 { font-size: clamp(1.875rem, 4.5vw, 2.75rem); margin-bottom: var(--space-sm); }
.article-meta, .guide-card-meta { font-size: 0.875rem; color: var(--color-text-secondary); }
.article-lede { font-size: 1.125rem; }

/* --- Article typography --- */
.prose { color: var(--color-text); }
/* styles.css pads every <section> for the homepage's full-width bands; content sections
   (the footnotes, the FAQ) sit in the reading column and must not inherit that. */
.prose section, .content-page main section { padding: 0; }
.prose p, .prose li { color: var(--color-text); font-size: 1.0625rem; line-height: 1.75; max-width: none; }
.prose p { margin-bottom: 1.15em; }
.prose h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin: 2.2em 0 0.7em;
  scroll-margin-top: var(--space-md);
}
.prose h3 { font-size: 1.2rem; margin: 1.8em 0 0.5em; scroll-margin-top: var(--space-md); }
.prose ul, .prose ol { margin: 0 0 1.2em 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4em; }
.prose a { color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-primary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--color-text); }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-lg) 0; }
.prose blockquote {
  margin: 0 0 1.5em;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-card);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.prose th { font-weight: 600; }
.prose sup a { text-decoration: none; font-weight: 600; }
.prose .footnotes, .prose section[data-footnotes] { font-size: 0.9rem; }
.prose .footnotes li, .prose section[data-footnotes] li { font-size: 0.9rem; }

/* --- FAQ --- */
.faq { margin-top: var(--space-xl); }
.faq-item { padding: var(--space-sm) 0; border-bottom: 1px solid var(--color-border); }
.faq-item h3 { margin: 0 0 0.4em; font-size: 1.1rem; }
.faq-item p { margin: 0; }

/* --- Guide index --- */
.guide-list { display: grid; gap: var(--space-md); }
.guide-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.guide-card h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.guide-card h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide-card p { font-size: 1rem; margin-bottom: 0.5rem; }

@media (max-width: 640px) {
  .site-header-links { gap: var(--space-sm); font-size: 0.875rem; }
  .site-header-links a.site-header-cta { padding: 0.4rem 0.8rem; }
  .site-header .nav-logo { font-size: 1.15rem; }
  .breadcrumb [aria-current='page'] { max-width: 22ch; }
}

/* Visually hidden, still read by screen readers (the footnotes' "Footnotes" label). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
