.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.blog-search-form {
  display: flex;
  gap: 0.5rem;
  width: min(420px, 100%);
}

.blog-card-list {
  display: grid;
  gap: 0.75rem;
}

.blog-card,
.blog-detail-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}

.blog-card-title {
  color: #1b5e20;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}

.blog-card-title:hover {
  text-decoration: underline;
}

.blog-card-date {
  color: #6b7280;
  font-size: 0.9rem;
}

.blog-card-excerpt {
  margin-top: 0.5rem;
  color: #374151;
}

.blog-card-image {
  display: block;
  margin-bottom: 0.6rem;
}

.blog-card-image img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.blog-detail-hero {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.blog-card-tags,
.blog-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.blog-tag {
  display: inline-block;
  background: #e8f5e9;
  color: #1b5e20;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.8rem;
  text-decoration: none;
}

.blog-tag:hover {
  background: #c8e6c9;
}

.blog-content {
  line-height: 1.8;
  color: #111827;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  margin-top: 1.2rem;
  margin-bottom: 0.7rem;
  color: #0f5132;
}

.blog-content p {
  margin-bottom: 0.9rem;
}

.blog-content img {
  max-width: min(100%, 760px);
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 0.5rem;
}

.blog-content ul,
.blog-content ol {
  margin-bottom: 0.9rem;
  padding-left: 1.3rem;
}

.blog-quote {
  border-left: 4px solid #22c55e;
  padding-left: 0.8rem;
  color: #4b5563;
  margin: 1rem 0;
}

.blog-code {
  background: #111827;
  color: #f9fafb;
  padding: 0.8rem;
  border-radius: 0.5rem;
  overflow-x: auto;
}

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.blog-page-info {
  color: #374151;
}

@media (max-width: 768px) {
  .blog-header {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-search-form {
    width: 100%;
  }
}

/* ── Interactive Sudoku walkthrough (see js/sudoku-walkthrough.js) ───────────────────────────── */

/* Hide the raw walkthrough JSON block: with JS the player replaces it; without JS the reader sees
   only the static fallback image above it. Belt-and-suspenders so pre-:has() browsers still hide it. */
code.language-sudoku-walkthrough {
  display: none;
}
pre:has(> code.language-sudoku-walkthrough) {
  display: none;
}

/* Progressive-enhancement fallback: JS marks the preceding static image .swt-fallback and hides it on
   screen (the widget stands in), but restores it for print — the interactive widget can't print. */
.swt-fallback {
  display: none;
}

@media print {
  .swt-widget,
  .swt-controls {
    display: none;
  }
  .swt-fallback {
    display: block;
  }
}

/* ── Interactive Tents & Trees walkthrough (see js/tents-walkthrough.js) ─────────────────────── */

code.language-tents-walkthrough {
  display: none;
}
pre:has(> code.language-tents-walkthrough) {
  display: none;
}

.twt-fallback {
  display: none;
}

@media print {
  .twt-widget,
  .twt-controls {
    display: none;
  }
  .twt-fallback {
    display: block;
  }
}

/* Amiral Battı walkthrough: same treatment as tents — hide the raw fenced JSON before the player swaps in
   the widget, and swap back to the static image for print, where the interactive widget can't render. */
pre:has(> code.language-battleships-walkthrough) {
  display: none;
}

.bwt-fallback {
  display: none;
}

@media print {
  .bwt-widget,
  .bwt-controls {
    display: none;
  }
  .bwt-fallback {
    display: block;
  }
}

/* ── Interactive Kakuro walkthrough (see js/kakuro-walkthrough.js) ───────────────────────────── */

/* Both selectors, as sudoku and tents carry: :has() hides the whole block, and the bare code rule
   still hides the JSON where :has() is unsupported. */
code.language-kakuro-walkthrough {
  display: none;
}

pre:has(> code.language-kakuro-walkthrough) {
  display: none;
}

.kwt-fallback {
  display: none;
}

@media print {
  .kwt-widget,
  .kwt-controls,
  .kwt-chain {
    display: none;
  }
  .kwt-fallback {
    display: block;
  }
}
