/* ==========================================================================
   Blog layer — extends css/styles.css, never overrides its tokens.
   Everything here is expressed in the existing custom properties, so the
   light-mode toggle in js/main.js keeps working with no extra work.
   ========================================================================== */

/* ---------- Reading column ---------- */
.wrap--reading {
  max-width: 74ch;
}

/* ---------- Post header ---------- */
.hero--blog { padding-block: 2rem 2.5rem; }

.post-head {
  padding-block: 2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.post-head h1 {
  font-size: var(--step-4);
  margin-block: 1rem 1.1rem;
}
.post-head .lead {
  color: var(--text-soft);
  font-size: var(--step-1);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: var(--step--1);
}
.post-meta a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }
.post-meta a:hover { color: var(--brand); }
.post-meta .updated { color: var(--brand); }

/* ---------- Answer box (AEO: the quotable 40-60 word answer) ----------
   The gradient/glow card itself comes from styles.css section 10. Only the
   compact label treatment is blog-specific — on an article the heading is a
   label ("Short answer"), not a section title. */
.answer-box { margin-bottom: 2rem; }
.answer-box > h2 {
  font-size: var(--step-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 0.6rem;
}
.answer-box p { margin: 0; line-height: 1.6; }

/* ---------- Table of contents ----------
   styles.css already ships a full .toc component (section 11), including a
   counter literally named "toc". Re-declaring it here made both rules
   increment the same counter, so the list numbered 02, 04, 06. Only the
   pieces the base component does not cover belong here. */
.toc { margin-bottom: 2.5rem; }
.toc > p {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: var(--step-1);
}

/* ---------- Prose ---------- */
.prose { font-size: var(--step-0); line-height: 1.78; color: var(--text-soft); }
.prose > * + * { margin-top: 1.15rem; }

.prose h2 {
  font-size: var(--step-2);
  color: var(--text);
  margin-top: 3rem;
  padding-top: 0.4rem;
  scroll-margin-top: 100px;
}
.prose h3 {
  font-size: var(--step-1);
  color: var(--text);
  margin-top: 2.1rem;
  scroll-margin-top: 100px;
}
.prose h4 {
  font-size: var(--step-0);
  color: var(--text);
  margin-top: 1.6rem;
  font-family: var(--font-body);
  font-weight: 700;
}

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { text-decoration-thickness: 2px; }

.prose strong { color: var(--text); font-weight: 600; }

.prose ul, .prose ol { display: grid; gap: 0.6rem; padding-left: 1.5rem; }
.prose ul { list-style: none; padding-left: 1.35rem; }
.prose ul > li { position: relative; padding-left: 0.35rem; }
.prose ul > li::before {
  content: "";
  position: absolute;
  left: -0.95rem;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.prose ol { list-style: decimal; }
.prose ol > li::marker { color: var(--brand); font-weight: 700; }
.prose li > ul, .prose li > ol { margin-top: 0.55rem; }

.prose blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.2rem 0 0.2rem 1.25rem;
  color: var(--text);
  font-size: var(--step-1);
  line-height: 1.6;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12em 0.4em;
  color: var(--text);
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; line-height: 1.65; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }

/* .table-scroll itself is defined in styles.css section 16 — reused as-is so
   article tables look identical to the ones on the service pages. */
.prose table { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 34rem; }
.prose th, .prose td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.prose thead th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.prose tbody tr:last-child td { border-bottom: 0; }

.prose figure { margin-block: 1.6rem; }
.prose figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.6rem; }

/* Callouts */
.callout {
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 1.1rem 1.35rem;
  background: var(--bg-soft);
}
.callout > p:first-child { margin-top: 0; }
.callout--note    { border-left: 4px solid var(--brand-2); }
.callout--warning { border-left: 4px solid var(--brand-3); }
.callout--tip     { border-left: 4px solid var(--brand); }
.callout__label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.45rem;
  color: var(--text);
}

/* ---------- FAQ ---------- */
.post-faq { margin-top: 3.5rem; }
.post-faq > h2 { font-size: var(--step-2); margin-bottom: 1.2rem; }
.post-faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  margin-bottom: 0.7rem;
}
.post-faq summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after {
  content: "+";
  color: var(--brand);
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
}
.post-faq details[open] summary::after { content: "–"; }
.post-faq details > div { padding: 0 1.25rem 1.1rem; color: var(--text-soft); }

/* ---------- Author card ----------
   The two-column grid comes from styles.css section 17 (it already collapses
   to one column under 700px). Everything below is the article-footer skin. */
.author-card {
  gap: 1.2rem;
  margin-top: 3.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.author-card__photo {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
}
.author-card__name { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: var(--step-1); }
.author-card__role { color: var(--muted); font-size: var(--step--1); margin-top: 0.15rem; }
.author-card__bio  { color: var(--text-soft); margin-top: 0.6rem; font-size: var(--step--1); }
.author-card__links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.8rem; font-size: var(--step--1); }
.author-card__links a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- CTA ---------- */
.post-cta {
  margin-top: 2.5rem;
  padding: 1.8rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  box-shadow: var(--glow);
}
.post-cta h2 { font-size: var(--step-2); margin-bottom: 0.7rem; }
.post-cta p { color: var(--text-soft); }
.post-cta__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.2rem; }

/* ---------- Related ---------- */
.related { margin-top: 3.5rem; }
.related > h2 { font-size: var(--step-2); margin-bottom: 1.2rem; }
.related ul { display: grid; gap: 0.9rem; }
.related li a {
  display: block;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.related li a:hover { border-color: var(--brand); transform: translateY(-2px); }
.related__cat { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 0.3rem; }
.related__title { color: var(--text); font-weight: 600; }

/* ---------- Category chips ---------- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-block: 0.5rem 2.2rem; }
.cat-chips a {
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  font-size: var(--step--1);
  transition: border-color 0.18s ease, color 0.18s ease;
}
.cat-chips a:hover { border-color: var(--brand); color: var(--brand); }
.cat-chips a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  margin-bottom: 2.5rem;
}
.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 1.4rem;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card__cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); font-weight: 600; }
.post-card__title { font-family: var(--font-display); font-size: var(--step-1); color: var(--text); margin-block: 0.6rem 0.55rem; line-height: 1.25; }
.post-card__excerpt { color: var(--text-soft); font-size: var(--step--1); flex: 1; }
.post-card__meta { display: flex; gap: 0.5rem; align-items: center; margin-top: 1.1rem; color: var(--muted); font-size: 0.78rem; }

.post-card--featured { grid-column: 1 / -1; }
.featured-wrap { margin-bottom: 1.2rem; }
.post-card--featured .post-card__title { font-size: var(--step-3); max-width: 24ch; }
.post-card--featured .post-card__excerpt { max-width: 62ch; font-size: var(--step-0); }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; margin-block: 1rem 3rem; }
.pagination a, .pagination span {
  min-width: 2.5rem;
  padding: 0.5rem 0.85rem;
  text-align: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  font-size: var(--step--1);
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination [aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.pagination .is-disabled { opacity: 0.4; }

/* ---------- Empty state ---------- */
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  margin-bottom: 3rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .post-head h1 { font-size: var(--step-3); }
  .post-cta { padding: 1.35rem; }
}

@media print {
  .header, .footer, .fab, .post-cta, .toc, .cat-chips, .pagination { display: none !important; }
  .prose { color: #000; }
}
