/* BuyCoded — blog.css
   Loaded only on /blog paths (see views/layout/header.php).
   Uses the LOCKED dark palette tokens from base.css only. No new hues. */

/* ---------- index head ---------- */
.blog-head { padding-block: var(--s-8) var(--s-5); }
.blog-head h1 { margin: var(--s-3) 0 var(--s-3); }
.blog-head-sub {
  color: var(--text-soft);
  max-width: 62ch;
  line-height: var(--lh-relaxed);
  margin: 0;
}

/* ---------- card grid (mirrors .product-grid) ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 640px)  { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.blog-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: .85;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--sh-md);
  color: var(--text);
}
.blog-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.blog-card-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  min-width: 0;
}
.blog-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .85rem;
}
.blog-card-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.blog-card-title {
  font-size: var(--fs-lg);
  line-height: 1.35;
  margin: 0 0 var(--s-2);
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Equal card heights: reserve both title lines. */
  min-height: calc(2 * 1.35em);
}
.blog-card-desc {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--text-soft);
  margin: 0 0 var(--s-4);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(3 * 1.55em);
}
.blog-card-foot {
  margin-top: auto;
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.blog-card-read { white-space: nowrap; }

/* ---------- empty state ---------- */
.blog-empty { flex-direction: column; }
.blog-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: var(--s-4);
}
.blog-empty p { max-width: 52ch; margin-inline: auto; }
.blog-empty .btn { margin-top: var(--s-5); }

/* ---------- pagination ---------- */
.blog-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-subtle);
}
.blog-pager-status { font-size: var(--fs-sm); color: var(--text-muted); }
.blog-pager-spacer { min-width: 1px; }

/* ---------- article ---------- */
.blog-article-head { padding-block: var(--s-8) var(--s-5); }
.blog-article-head h1 {
  margin: var(--s-3) 0 var(--s-4);
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
}
@media (max-width: 640px) { .blog-article-head h1 { font-size: var(--fs-2xl); } }

.blog-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--s-4);
}
.blog-crumbs a { color: var(--text-muted); text-decoration: none; }
.blog-crumbs a:hover { color: var(--accent); }

.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* "In short" answer box — the AEO extraction target. */
.blog-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: var(--s-5);
  margin-bottom: var(--s-6);
}
.blog-summary h2 {
  font-size: var(--fs-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s-2);
}
.blog-summary p {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
}
@media (max-width: 640px) { .blog-summary p { font-size: var(--fs-base); } }

.blog-body { padding-bottom: var(--s-6); }
.blog-body h2 { font-size: var(--fs-2xl); }
@media (max-width: 640px) { .blog-body h2 { font-size: var(--fs-xl); } }

/* Wide content must scroll inside itself, never the page. */
.blog-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
@media (min-width: 768px) { .blog-body table { display: table; white-space: normal; } }
.blog-body th, .blog-body td {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.blog-body th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.blog-body td { color: var(--text-soft); }
.blog-body caption { caption-side: bottom; padding-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); }

.blog-body dl { margin: 1em 0; }
.blog-body dt { color: var(--text); font-weight: 600; margin-top: var(--s-3); }
.blog-body dd { margin: var(--s-1) 0 0; padding-left: var(--s-4); color: var(--text-soft); }
.blog-body pre { max-width: 100%; }
.blog-body hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--s-6) 0; }

/* ---------- FAQ accordion ---------- */
.blog-faq { margin: var(--s-6) 0 0; }
.blog-faq > h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-4); }
.blog-faq-list { display: grid; gap: var(--s-3); }
.blog-faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
}
.blog-faq-item > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 28px;
}
.blog-faq-item > summary::-webkit-details-marker { display: none; }
.blog-faq-item > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: var(--fs-lg);
  line-height: 1;
  transition: transform 200ms var(--ease);
}
.blog-faq-item[open] > summary::after { content: "−"; }
.blog-faq-answer { margin-top: var(--s-3); }
.blog-faq-answer p { color: var(--text-soft); line-height: var(--lh-relaxed); margin: 0 0 var(--s-2); }
.blog-faq-answer p:last-child { margin-bottom: 0; }

/* ---------- closing CTA ---------- */
.blog-cta {
  margin: var(--s-8) 0 var(--s-10);
  padding: var(--s-6);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  text-align: center;
}
.blog-cta h2 { margin: 0 0 var(--s-3); font-size: var(--fs-xl); }
.blog-cta p { color: var(--text-soft); max-width: 56ch; margin: 0 auto var(--s-5); line-height: var(--lh-relaxed); }

.blog-related { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .blog-card, .blog-faq-item > summary::after { transition: none; }
  .blog-card:hover { transform: none; }
}
