/* =========================================================
   BLOG.CSS — blog.php, post.php
   Reuses the :root variables, .wrap, .label, .highlight, .btn and
   .sect rules already defined in css/index.css (loaded first on both
   pages) rather than redefining them — this file only adds what's
   specific to the blog.
========================================================= */

/* ---------- hero ---------- */
.blog-hero { padding: 130px 0 60px; border-bottom: 1px solid var(--border); text-align: center; }
.blog-hero .wrap { display: flex; flex-direction: column; align-items: center; }
.blog-hero__dash { display: inline-block; width: 26px; height: 2px; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.blog-hero__title { font-size: clamp(2.1rem, 4.5vw, 3.1rem); margin: 14px 0 16px; max-width: 720px; }
.blog-hero__sub { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; line-height: 1.65; }

/* ---------- filters ---------- */
.blog-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.blog-filter {
  font-family: 'IBM Plex Mono', monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 50px;
  padding: 9px 18px; text-decoration: none; transition: .25s;
}
.blog-filter:hover { color: var(--text); border-color: var(--text-muted); }
.blog-filter.is-active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ---------- listing grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }

.blog-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: transform .3s, border-color .3s;
}
.blog-card:hover { transform: translateY(-5px); border-color: var(--accent); }

.blog-card__media { position: relative; aspect-ratio: 16/10; background: var(--surface-alt); overflow: hidden; }
.blog-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card__media-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--border); font-size: 2.2rem; }
.blog-card__tag {
  position: absolute; top: 12px; left: 12px; background: rgba(13,13,13,.8); backdrop-filter: blur(2px);
  color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; padding: 5px 11px; border-radius: 50px; border: 1px solid rgba(255,107,0,.4);
}

.blog-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.blog-card__body h3 { font-size: 1.12rem; margin-bottom: 8px; line-height: 1.35; }
.blog-card__body p { color: var(--text-muted); font-size: .9rem; line-height: 1.55; margin-bottom: 14px; flex: 1; }
.blog-card__date { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; color: var(--text-muted); letter-spacing: .03em; }
.blog-card__more {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 12px; font-weight: 600; font-size: .85rem;
  color: var(--accent); transition: gap .2s;
}
.blog-card:hover .blog-card__more { gap: 11px; }
.blog-home__btn-wrap { text-align: center; margin-top: 44px; }

.blog-empty { color: var(--text-muted); padding: 60px 0; text-align: center; font-size: 1.05rem; }

/* ---------- pagination ---------- */
.blog-pager { display: flex; gap: 8px; justify-content: center; margin-top: 48px; }
.blog-pager__link {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; color: var(--text-muted); text-decoration: none;
  font-family: 'IBM Plex Mono', monospace; font-size: .85rem;
}
.blog-pager__link:hover { border-color: var(--text-muted); color: var(--text); }
.blog-pager__link.is-active { background: var(--accent); border-color: var(--accent); color: #000; }

/* ---------- single post ---------- */
.post { padding: 130px 0 10px; }
.post__head { max-width: 760px; margin: 0 auto; text-align: center; }
.post__title { font-size: clamp(2rem, 4.5vw, 2.9rem); margin: 14px 0 18px; }
.post__lead { color: var(--text-muted); font-size: 1.12rem; line-height: 1.6; margin-bottom: 16px; }
.post__byline { font-family: 'IBM Plex Mono', monospace; font-size: .78rem; color: var(--text-muted); letter-spacing: .03em; }

.post__cover { max-width: 900px; margin: 36px auto 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.post__cover img { width: 100%; height: auto; display: block; }

.post__body-wrap { max-width: 720px; margin: 0 auto; padding-top: 44px; }
.post__body { font-size: 1.05rem; line-height: 1.85; color: #e6e6e6; }
.post__body p { margin-bottom: 22px; }
.post__body h2 { font-size: 1.7rem; margin: 42px 0 16px; }
.post__body h3 { font-size: 1.35rem; margin: 34px 0 14px; }
.post__body h4 { font-size: 1.12rem; margin: 26px 0 12px; }
.post__body ul, .post__body ol { margin: 0 0 22px 22px; }
.post__body li { margin-bottom: 9px; }
.post__body a { color: var(--accent); }
.post__body img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0 26px; }
.post__body blockquote {
  border-left: 3px solid var(--accent); padding-left: 20px; margin: 30px 0;
  color: var(--text-muted); font-style: italic; font-size: 1.1rem;
}

.post-missing { padding: 160px 0 120px; text-align: center; }
.post-missing h1 { font-size: 1.9rem; margin-bottom: 12px; }
.post-missing p { color: var(--text-muted); margin-bottom: 28px; }

/* post-foot / blog-btn reuse index.css's own definitions if that file
   already carries them; kept here as a fallback in case blog.php or
   post.php ever loads without index.css. */
.post-foot { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--border); }
.blog-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 50px; background: var(--accent); color: #000; font-weight: 600; font-size: .9rem; text-decoration: none; transition: .3s; }
.blog-btn:hover { background: #ff7b1a; color: #000; }
.blog-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.blog-btn.ghost:hover { border-color: var(--text); background: rgba(255,255,255,.05); }

.post-more { background: var(--surface-alt); }

@media (max-width: 600px) {
  .blog-hero { padding: 110px 0 44px; }
  .post { padding: 110px 0 10px; }
  .post__body-wrap { padding-top: 32px; }
}