/* Blog: index + article pages. Builds on tokens and components in styles.css. */

.blog-page main { padding-top: calc(var(--hdr-h) + 2.5rem); }

.hdr-nav a[aria-current="page"]::after { transform: scaleX(1); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.post-head h1,
.blog-head h1 {
  font-size: clamp(2.4rem, 5.6vw, 5.2rem);
  font-stretch: 66%;
  line-height: 0.92;
  max-width: 20ch;
}

.post-dek {
  margin-top: 1.5rem;
  max-width: 44rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--ink-2);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.post-meta span:first-child { color: var(--ink); }

.post-hero { margin: 2.5rem auto 0; }
.post-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel);
}

/* Layout: sticky side column + reading column */
.post-grid {
  display: grid;
  grid-template-columns: minmax(200px, 270px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
}

.post-grid > * { min-width: 0; }
.prose h2, .prose h3 { overflow-wrap: break-word; }

.post-side {
  position: sticky;
  top: calc(var(--hdr-h) + 1.5rem);
  align-self: start;
  display: grid;
  gap: 2rem;
}

.toc-title { color: var(--muted); margin-bottom: 0.75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--line); }
.toc li a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.9rem;
  margin-left: -1.5px;
  border-left: 1.5px solid transparent;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.toc li a:hover { color: var(--ink); }
.toc li a.is-active { color: var(--ink); border-left-color: var(--orange); }

.side-cta {
  padding: 1.25rem;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  gap: 0.75rem;
}
.side-cta .mono { color: var(--orange); }
.side-cta p:not(.mono) { font-size: 0.9rem; color: rgba(236, 235, 230, 0.8); }
.side-cta .btn-solid { background: var(--orange); border-color: var(--orange); color: var(--ink); justify-self: start; }
.side-cta .btn-solid::before { background: var(--paper); }

/* Prose */
.prose { max-width: 46rem; font-size: 1.0625rem; line-height: 1.7; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  margin-top: 2.6em;
  padding-top: 1.1rem;
  border-top: 1.5px solid var(--ink);
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  color: var(--ink);
  scroll-margin-top: calc(var(--hdr-h) + 1rem);
}
.prose h3 {
  margin-top: 1.9em;
  font-size: 1.2rem;
  font-stretch: 85%;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--ink);
}
.prose h2 + *, .prose h3 + * { margin-top: 0.8em; }
.prose > p:first-child { font-size: 1.2rem; line-height: 1.6; color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose a:hover { background: rgba(242, 106, 33, 0.14); }
.prose a.btn { text-decoration: none; }
.prose a.btn-solid { color: var(--paper); background: var(--ink); }
.prose a.btn-solid:hover { color: var(--ink); background: var(--ink); }
.prose a.btn-line:hover { color: var(--paper); background: transparent; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--orange); font-weight: 700; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--orange);
  color: var(--ink);
  font-size: 1.15rem;
}
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--panel); padding: 0.1em 0.35em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

.prose .table-scroll { margin: 1.6em 0; border-top: 1.5px solid var(--ink); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.prose th, .prose td { padding: 0.7rem 0.8rem 0.7rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.prose tbody th { color: var(--ink); font-weight: 650; }
.prose tbody tr:hover { background: rgba(18, 18, 18, 0.03); }

/* Model comparison box */
.model-box {
  margin-top: 3.5em !important;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--panel);
  border: 1px solid var(--line);
}
.model-box .label { margin-bottom: 0.75rem; }
.model-box-title { margin: 0 !important; padding: 0 !important; border: 0 !important; font-size: clamp(1.5rem, 2.2vw, 2rem) !important; }
.model-box .table-scroll { margin: 1.25rem 0 0; }
.model-box tbody th a { text-decoration: none; }
.model-box tr.is-hit th a { color: var(--orange-ink); }
.model-box-foot { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* FAQ accordion */
.faq { margin-top: 3.5em !important; }
.faq > h2 { margin-bottom: 0.5rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 {
  margin: 0;
  font-size: 1.1rem;
  font-stretch: 85%;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.25;
}
.faq summary i {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}
.faq summary i::before,
.faq summary i::after {
  content: "";
  position: absolute;
  inset: 6px 0 auto;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out);
}
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq summary:hover h3 { color: var(--orange-ink); }
.faq-a { padding: 0 0 1.25rem; }
.faq-a > * + * { margin-top: 0.8em; }

/* Related + cards */
.related { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1.5px solid var(--ink); }
.related-head, .bcat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
}
.related-head h2, .bcat-head h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.related-head a:hover { color: var(--orange-ink); }

.bgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 1.75rem;
}

.bcard a { display: grid; gap: 0.75rem; }
.bcard-media { overflow: hidden; background: var(--panel); }
.bcard-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.bcard a:hover .bcard-media img { transform: scale(1.04); }
.bcard-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); padding-top: 0.25rem; }
.bcard h3 { font-size: 1.35rem; font-stretch: 80%; line-height: 1.05; }
.bcard a:hover h3 { color: var(--orange-ink); }
.bcard-desc { font-size: 0.92rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Blog index */
.blog-head { padding-bottom: 2.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.chips a {
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--ink);
  transition: background 0.2s, color 0.2s;
}
.chips a:hover { background: var(--ink); color: var(--paper); }

.bfeature a {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  background: var(--ink);
  color: var(--paper);
}
.bfeature-media { overflow: hidden; }
.bfeature-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; transition: transform 0.8s var(--ease-out); }
.bfeature a:hover .bfeature-media img { transform: scale(1.03); }
.bfeature-text { padding: clamp(1.5rem, 3.5vw, 3rem); display: flex; flex-direction: column; justify-content: center; gap: 1.25rem; }
.bfeature-text .label { color: rgba(236, 235, 230, 0.7); margin: 0; }
.bfeature-text .label span { background: var(--orange); color: var(--ink); }
.bfeature-text h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); }
.bfeature-text p:not(.label) { color: rgba(236, 235, 230, 0.75); }
.bfeature-text .btn { align-self: flex-start; background: var(--orange); border-color: var(--orange); color: var(--ink); }
.bfeature-text .btn::before { background: var(--paper); }

.bcat { padding-top: clamp(3.5rem, 7vw, 6rem); scroll-margin-top: var(--hdr-h); }
.bcat:last-of-type { padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.bcat-head { padding-top: 1rem; border-top: 1.5px solid var(--ink); }
.bcat-head .mono { color: var(--muted); }

@media (max-width: 1100px) {
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-side { position: static; }
  .toc { display: none; }
  .side-cta { order: 2; }
  .post-side { order: 2; }
  .bfeature a { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .bgrid { grid-template-columns: 1fr; }
  .prose { font-size: 1rem; }
  .prose > p:first-child { font-size: 1.1rem; }
  .post-hero { padding-inline: 0; }
}

/* Homepage guides block */
.guides { padding-block: clamp(4rem, 8vw, 7rem); border-top: 1.5px solid var(--ink); }
.guides-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.guides-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.guides-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.guides-list .mono { grid-column: 1; color: var(--muted); }
.guides-list strong { grid-column: 1; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.guides-list i { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; transition: transform 0.3s var(--ease-out); }
.guides-list a:hover strong { color: var(--orange-ink); }
.guides-list a:hover i { transform: translateX(5px); }
.guides-all { display: inline-block; margin-top: 1.5rem; }

/* Homepage FAQ reuses .faq */
.home-faq { padding-block: clamp(4rem, 8vw, 7rem); background: var(--panel); }
.home-faq .faq { max-width: 52rem; margin: 0; }
.home-faq .faq-a { max-width: 44rem; color: var(--ink-2); }

@media (max-width: 960px) {
  .guides-grid { grid-template-columns: 1fr; }
}
