.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;
}

.swt-widget {
  margin: 1.5rem auto;
  max-width: 460px;
  text-align: center;
}

.swt-grid {
  width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
}

.swt-caption {
  min-height: 2.6em;
  margin-top: 0.6rem;
  color: #374151;
  font-size: 0.98rem;
  line-height: 1.35;
}

.swt-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.swt-btn {
  min-width: 2.4rem;
  padding: 0.25rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: #1e7840;
  background: #ffffff;
  border: 1px solid #1e7840;
  border-radius: 0.35rem;
  cursor: pointer;
}

.swt-btn:hover:not(:disabled) {
  background: #e5f3ea;
}

.swt-btn:disabled {
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: default;
}

/* Post-specific "back to the technique step" button — accent-filled so it reads as the payoff control. */
.swt-btn-focus {
  color: #ffffff;
  background: #1e7840;
}

.swt-btn-focus:hover:not(:disabled) {
  background: #17632f;
}

.swt-btn-focus:disabled {
  color: #ffffff;
  background: #9cc6ac;
  border-color: #9cc6ac;
  cursor: default;
}

.swt-counter {
  min-width: 3.5rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* 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;
  }
}
