/* ============================================================
   ZBD — Blog & Article Styles (blog.css)
   Arcade / pixel-art console theme. Complements base.css.
   Colors come from the shared :root tokens in base.css — never
   hardcode hex here so the blog tracks the final palette.
   ============================================================ */

/* ---------- BLOG HERO ---------- */
.blog-hero {
  padding: clamp(96px, 14vw, 140px) 0 clamp(40px, 7vw, 64px);
  text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg2) 0%, var(--bg) 70%);
  border-bottom: var(--px) solid var(--line);
}
.blog-hero h1 {
  font-family: 'Press Start 2P', 'VT323', monospace;
  font-size: clamp(20px, 4.5vw, 38px);
  line-height: 1.35;
  margin: 14px 0 18px;
  color: var(--text);
  text-shadow: 0 var(--px) 0 var(--shadow);
}
.blog-hero h1 .grad {
  color: var(--accent);
}
.blog-hero p {
  color: var(--muted);
  font-family: 'VT323', monospace;
  font-size: clamp(17px, 2.4vw, 22px);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.45;
}

/* ---------- BLOG LISTING ---------- */
.blog-section {
  padding: clamp(48px, 8vw, 80px) 0 clamp(72px, 12vw, 120px);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}

/* cartridge-slot panel, like .product on the home page */
.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: var(--px) solid var(--shadow);
  box-shadow: inset 0 0 0 2px var(--line), 0 var(--px) 0 var(--shadow);
  padding: 26px 22px;
  overflow: hidden;
  transition: transform .1s, box-shadow .12s;
}
/* accent top rail like a console slot */
.blog-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--px);
  background: var(--accent);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: inset 0 0 0 2px var(--accent), 0 var(--px) 0 var(--shadow),
              0 0 38px color-mix(in srgb, var(--accent) 22%, transparent);
}

.blog-card .card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 16px;
}
.blog-card .card-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--shadow);
  background: var(--accent2);
  padding: 6px 9px;
  box-shadow: 0 0 0 2px var(--shadow);
}
.blog-card h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
  color: var(--text);
}
.blog-card p {
  color: var(--muted);
  font-family: 'VT323', monospace;
  font-size: 18px;
  line-height: 1.45;
  margin: 0 0 20px;
  flex-grow: 1;
}
.blog-card .read-more {
  margin-top: auto;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.blog-card .read-more svg {
  transition: transform .12s steps(2);
}
.blog-card:hover .read-more svg {
  transform: translateX(4px);
}

/* ---------- ARTICLE HEADER ---------- */
.article-header {
  padding: clamp(110px, 16vw, 150px) 0 clamp(40px, 7vw, 60px);
  background: radial-gradient(120% 90% at 50% 0%, var(--bg2) 0%, var(--bg) 70%);
  border-bottom: var(--px) solid var(--line);
}
.article-header-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 24px);
}
.article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: 'VT323', monospace;
  font-size: 17px;
  color: var(--muted);
}
.article-meta-top .tag-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--shadow);
  background: var(--accent2);
  padding: 6px 10px;
  box-shadow: 0 0 0 2px var(--shadow);
}
.article-header h1 {
  font-family: 'Press Start 2P', 'VT323', monospace;
  font-size: clamp(18px, 3.6vw, 30px);
  line-height: 1.45;
  margin: 0 0 8px;
  color: var(--text);
  text-shadow: 0 var(--px) 0 var(--shadow);
}
.article-header .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
  transition: color .12s, transform .12s;
}
.article-header .back-btn:hover {
  color: var(--accent);
  transform: translateX(-4px);
}

/* ---------- ARTICLE CONTENT READER ---------- */
.article-body {
  padding: clamp(40px, 7vw, 60px) 0 clamp(72px, 12vw, 100px);
}
.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 24px);
  font-family: 'VT323', monospace;
  font-size: 21px;
  line-height: 1.6;
  color: var(--text);
}
.article-content p {
  margin: 0 0 22px;
}
.article-content h2 {
  font-family: 'Press Start 2P', monospace;
  color: var(--accent);
  font-size: 16px;
  line-height: 1.5;
  margin: 46px 0 20px;
  text-shadow: 0 var(--px) 0 var(--shadow);
}
.article-content h3 {
  font-family: 'Press Start 2P', monospace;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  margin: 34px 0 16px;
}
.article-content ul, .article-content ol {
  margin: 0 0 22px;
  padding-left: 24px;
}
.article-content li {
  margin-bottom: 8px;
}
.article-content a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-content a:hover {
  color: var(--accent);
}
.article-content strong {
  color: var(--accent);
  font-weight: 400;
}
.article-content img {
  max-width: 100%;
  height: auto;
  border: var(--px) solid var(--shadow);
  box-shadow: inset 0 0 0 2px var(--line);
  margin: 28px 0;
}

/* Callouts / Blockquotes */
.article-content blockquote {
  margin: 30px 0;
  padding: 22px 26px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: var(--px) solid var(--shadow);
  box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 2px var(--line);
  font-size: 21px;
  color: var(--text);
}
.article-content blockquote p {
  margin: 0;
}

/* Tip boxes (Alerts) */
.article-content .tip-box {
  margin: 30px 0;
  padding: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: var(--px) solid var(--shadow);
  box-shadow: inset 0 0 0 2px var(--line-bright);
  color: var(--text);
}
.article-content .tip-box h4 {
  margin: 0 0 12px;
  color: var(--accent2);
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Code Blocks */
.article-content pre {
  margin: 30px 0;
  padding: 20px;
  background: var(--shadow);
  border: var(--px) solid var(--line);
  box-shadow: inset 0 0 0 2px var(--shadow);
  overflow-x: auto;
}
.article-content code {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 18px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 1px 6px;
}
.article-content pre code {
  color: var(--accent2);
  background: none;
  padding: 0;
  display: block;
  line-height: 1.45;
}

/* Table styling */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 18px;
}
.article-content th, .article-content td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--line);
}
.article-content th {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--panel2);
}
.article-content tr:hover td {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* ---------- ARTICLE FOOTER / AUTHOR ---------- */
.article-footer {
  margin-top: 56px;
  padding-top: 36px;
  border-top: var(--px) solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.author-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  padding: 22px;
  border: var(--px) solid var(--shadow);
  box-shadow: inset 0 0 0 2px var(--line);
}
.author-avatar {
  width: 56px;
  height: 56px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: var(--shadow);
  box-shadow: 0 0 0 2px var(--shadow);
  flex-shrink: 0;
}
.author-info h5 {
  margin: 0 0 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--text);
}
.author-info p {
  margin: 0;
  font-family: 'VT323', monospace;
  font-size: 17px;
  color: var(--muted);
}

/* ---------- HOME PAGE BLOG WIDGET ---------- */
.home-blog-section {
  border-top: var(--px) solid var(--line);
}

/* ---------- SEARCH & FILTER BAR ---------- */
.blog-filter-section {
  padding: clamp(28px, 5vw, 40px) 0 10px;
  background: var(--bg);
}
.filter-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.search-box {
  position: relative;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  background: var(--panel);
  border: var(--px) solid var(--shadow);
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 19px;
  outline: none;
  transition: box-shadow .12s;
}
.search-box input::placeholder {
  color: var(--muted);
}
.search-box input:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.categories-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
}
.category-btn {
  background: var(--panel);
  border: var(--px) solid var(--shadow);
  box-shadow: inset 0 0 0 2px var(--line);
  padding: 9px 15px;
  color: var(--muted);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .12s, box-shadow .12s;
}
.category-btn:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--line-bright);
}
.category-btn.active {
  background: var(--accent);
  color: var(--shadow);
  box-shadow: 0 0 0 2px var(--shadow);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 680px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .article-content {
    font-size: 19px;
  }
  .article-content h2 { font-size: 13px; }
  .article-content h3 { font-size: 11px; }
  .blog-card h2 { font-size: 12px; }
  .author-card { flex-direction: column; text-align: center; }
}

/* ---------- MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card .read-more svg,
  .article-header .back-btn,
  .category-btn,
  .search-box input {
    transition: none;
  }
  .blog-card:hover {
    transform: none;
  }
}
