/* =====================================================================
   The house blog — every blog index and post, and the legal pages.
   Extends /css/house.css (loaded first). Article typography, index
   cards, tables, CTA panels. Mobile-first; breakpoints at 768/1100/1280px.
   ===================================================================== */

/* ===== Shared page scaffolding ===== */
/* The same column and spacing as a product page's hero (.hero in
   /css/house.css): 1280px, 20px then 40px at the sides, and the
   hero's top and bottom padding at each breakpoint. */
.blog-main { padding: 130px var(--gutter) 48px; }
.blog-narrow,
.blog-wide { max-width: var(--maxw); margin: 0 auto; }

/* ===== Blog index ===== */
.blog-hero { text-align: left; margin-bottom: 40px; }
.blog-hero h1 {
  /* As the blog index's heading (/css/blog-hub.css): every list of guides
     opens at one size. */
  font-size: clamp(34px, 4.8vw, 52px);
  margin-bottom: 12px;
}
.blog-hero p { font-size: 17px; max-width: 620px; }

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px 24px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.post-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.post-card .post-tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.post-card h2 {
  font-size: 21px;
  line-height: 1.25;
}
.post-card h2 a:hover { color: var(--primary); }
.post-card p { font-size: 15px; color: var(--body); }
.post-card .post-meta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-card .post-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border); }

/* ===== Article ===== */
.article-head { margin-bottom: 34px; }
.article-head .post-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  margin-bottom: 16px;
}
.article-head h1 {
  font-size: clamp(28px, 4.6vw, 42px);
  margin-bottom: 14px;
}
.article-head .article-lead {
  font-size: 18px;
  color: var(--body);
  max-width: 680px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.article-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border); }

.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 34px 24px;
}

.article h2 {
  font-size: 25px;
  margin: 38px 0 14px;
  scroll-margin-top: 96px;
}
.article h2:first-child { margin-top: 0; }
.article h3 {
  font-size: 19px;
  margin: 28px 0 10px;
  scroll-margin-top: 96px;
}
.article p { margin: 0 0 16px; font-size: 16.5px; }
.article ul, .article ol { margin: 0 0 18px; padding-left: 24px; }
.article li { margin-bottom: 8px; font-size: 16.5px; }
.article a:not(.btn) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-active);
  text-underline-offset: 3px;
}
.article a:not(.btn):hover { text-decoration-color: var(--primary); }
.article strong { color: var(--ink); }
.article img {
  /* The width and height attributes give the ratio; the column gives the
     width, so the height must follow it or the picture stretches. */
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin: 8px 0 18px;
}
.article blockquote {
  margin: 0 0 18px;
  padding: 14px 20px;
  border-left: 3px solid var(--primary-2);
  background: var(--surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink);
  font-size: 16px;
}

/* Callout box */
.callout {
  display: flex;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-active);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 0 0 18px;
  font-size: 15.5px;
}
.callout svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); margin-top: 2px; }
.callout p { margin: 0; font-size: 15.5px; }

/* Comparison table */
.table-scroll { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--r-md); }
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 640px;
  background: var(--surface);
}
.article th {
  text-align: left;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.article td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--body);
}
.article tr:last-child td { border-bottom: none; }
.article td:first-child { color: var(--ink); font-weight: 600; }
.yes { color: var(--mint); font-weight: 700; }
.no { color: #DC2626; font-weight: 700; }
.partial { color: #D97706; font-weight: 700; }

/* Steps list */
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 14px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* In-article CTA panel */
.article-cta {
  background: linear-gradient(135deg, #16243F 0%, #1E3A8A 100%);
  border-radius: var(--r-lg);
  padding: 30px 26px;
  margin: 30px 0;
  color: #DBE7FB;
}
.article-cta h3 {
  color: #fff;
  font-size: 21px;
  margin: 0 0 8px;
}
.article-cta p { color: #B9CBEE; margin: 0 0 18px; font-size: 15.5px; }
.article-cta .btn-primary { box-shadow: none; }
.article-cta .fine { font-size: 13px; color: #8FA6D4; margin: 12px 0 0; }

/* Article FAQ (reuses faq-item look, denser) */
.article-faq { margin-top: 6px; }
.article-faq .faq-q { font-weight: 700; color: var(--ink); margin-bottom: 4px; font-size: 16.5px; }
.article-faq .faq-a { margin-bottom: 18px; }

/* "On this page": the post's sections beside it (written by scripts/toc.js,
   the current one marked by /js/toc.js). Only where there's room for two
   columns; narrower, the article has the column to itself. */
.toc { display: none; }
.toc-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px 10px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: var(--body);
  padding: 7px 10px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.toc a:hover { color: var(--primary-ink); }
.toc a.is-current {
  background: var(--surface-2);
  color: var(--primary-ink);
  font-weight: 600;
}

/* Related posts */
.related {
  margin: 40px auto 0;
}
.related h2 { font-size: 22px; margin-bottom: 16px; }
.related .post-grid { grid-template-columns: 1fr; }

/* The way from a guide to every guide (/blog/). The breadcrumbs follow the
   address, so they lead to the product; this is the other way. */
.related-all { margin-top: 18px; font-size: 15px; }
.related-all a { font-weight: 600; color: var(--primary); }
.related-all a:hover { text-decoration: underline; }

/* ===== Breakpoints ===== */
@media (min-width: 768px) {
  .blog-main { padding: 150px var(--gutter) 60px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .article { padding: 46px 52px; }
  .related .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .blog-main { padding-top: 156px; }
}

@media (min-width: 1100px) {
  .post-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 880px);
    gap: 48px;
    align-items: start;
  }
  /* Below the sticky header (~81px); a long list scrolls on its own. */
  .toc {
    display: block;
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 128px);
    overflow: auto;
  }
}

@media (min-width: 1280px) {
  .blog-main { padding-top: 172px; }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .post-card.featured { grid-column: span 3; }
  .related .post-grid { grid-template-columns: repeat(2, 1fr); }
}
