/* Blog-specific styles. Loaded after articles/articles.css and articles/article.css. */

/* Blog pages: never gate the main content on the scroll-reveal.
   script.js marks ".content-section > *" as reveal-item (opacity:0 until the
   IntersectionObserver adds .is-visible); on the tall blog hub that can leave
   the whole content shell invisible. Force it visible so content is always
   readable, keeping the reveal animation on the rest of the site. */
.js-ready .content-section > .reveal-item {
  opacity: 1;
  transform: none;
}

/* ---------- Card status badge (hub + category) ---------- */
.articles-grid .card-badge {
  display: inline-block;
  margin: 14px 0 4px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  color: var(--muted);
  font:
    500 9.5px "DM Mono",
    monospace;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.articles-grid .card-badge.published {
  color: var(--accent-text);
  border-color: currentColor;
}

.articles-grid .card-badge.planned {
  color: var(--muted);
}

/* keep a card with a badge bottom-aligned like the foot cards */
.articles-grid .card-badge {
  margin-top: auto;
}

/* ---------- Category "no live guides yet" state ---------- */
.library-empty {
  padding: 40px 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  background: var(--surface);
}

/* ---------- Hub search ---------- */
.blog-search {
  max-width: 460px;
  margin-top: 28px;
}

.blog-search input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}

.blog-search input::placeholder {
  color: var(--muted);
}

.blog-search input:focus {
  outline: none;
  border-color: var(--accent-text);
  background: var(--paper);
}

.blog-search-hint {
  margin-top: 12px;
  color: var(--muted);
  font:
    400 12px "DM Mono",
    monospace;
  letter-spacing: 0.3px;
  min-height: 1em;
}

/* when the search box has results, hide empty category lists */
#blog-library.filtered .library-group .library-count {
  display: none;
}

#blog-library.filtered .library-group[data-empty="true"] {
  display: none;
}

/* ---------- Planned-guide note on noindex outline pages ---------- */
.article-body .planned-note {
  border-left: 3px solid var(--accent-text);
  background: var(--surface);
  padding: 18px 22px;
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.article-body .planned-note strong {
  color: var(--accent-text);
}

/* hide the reading-progress bar on outline pages (no body to scroll through) */
article .reading-progress {
  display: none;
}

/* ---------- Cover images (listing cards + article hero) ---------- */
.articles-grid .card .card-media {
  align-self: stretch;
  margin: -30px -30px 18px; /* full-bleed to the card's top corners */
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--soft);
  line-height: 0;
}

.articles-grid .card .card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.articles-grid .card:hover .card-media img,
.articles-grid .card:focus-visible .card-media img {
  transform: scale(1.035);
}

@media (max-width: 430px) {
  .articles-grid .card .card-media {
    margin: -26px -22px 16px; /* match the tightened card padding */
  }
}

/* attribution line on article hero covers (CC BY / CC BY-SA only) */
.article-featured .cover-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .articles-grid .card .card-media img {
    transition: none;
  }
}
