/* ============================================================
   Blog — additive styles for the WordPress blog section.

   styles.css stays BYTE-FOR-BYTE (the static build). This file
   is enqueued separately by functions.php (handle: tli-blog,
   depends on tli-styles) and uses ONLY the design tokens already
   declared in styles.css :root — same radii (22px), tinted
   shadows, and --ease-soft hover lift as .edu-card / .result.
   ============================================================ */

/* ---------- Listing grid: 3 → 2 → 1 (matches .results-grid) ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 1000px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .post-grid { grid-template-columns: 1fr; } }

/* ---------- Post card ---------- */
.post-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition:
    border-color .4s var(--ease-soft),
    transform .5s var(--ease-soft),
    box-shadow .5s var(--ease-soft);
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Featured image — 16:9, cover, gentle zoom on hover */
.post-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease-soft);
}
.post-card:hover .post-card-media img { transform: scale(1.04); }

/* Graceful fallback when a post has no featured image: a tinted
   band with the brand mark, so the grid rhythm stays even. */
.post-card.no-media .post-card-media {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-tint), var(--accent-soft));
}
.post-card.no-media .ph-mark {
  font-family: 'Fraunces', 'Fraunces Fallback', Georgia, serif;
  font-size: 44px;
  color: var(--accent);
  opacity: 0.45;
}

/* Body */
.post-card-body {
  padding: 22px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mute);
}
.post-card-cat { color: var(--accent); }
.post-card-meta .dot { color: var(--line); }
.post-card h3 {
  font-family: 'Fraunces', 'Fraunces Fallback', serif;
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.012em;
  line-height: 1.22;
  margin: 0 0 10px;
}
.post-card h3 a { color: var(--ink); transition: color .25s var(--ease-soft); }
.post-card:hover h3 a { color: var(--accent); }
.post-card-excerpt {
  margin: 0;
  flex: 1;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--mute);
}
.post-card-more {
  margin-top: 20px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}
.post-card-more .arrow { display: inline-block; transition: transform .25s var(--ease-soft); }
.post-card:hover .post-card-more .arrow { transform: translateX(3px); }

/* Whole-card click target: stretched link on the title, no nested
   <a> (the category in the card is plain text by design). */
.post-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---------- Pagination (the_posts_pagination) ---------- */
.blog-pagination { margin-top: 56px; }
.blog-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: border-color .25s, color .25s, background .25s;
}
.blog-pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.blog-pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.blog-pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* ---------- Single post additions ---------- */
.post-hero-media {
  margin: 4px 0 30px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.post-hero-media img { width: 100%; height: auto; display: block; }

/* Meta row sits on the existing .lab-article .meta-row layout (flex+gap) */
.post-meta { font-size: 13.5px; color: var(--mute); }
.post-meta .author { color: var(--ink-2); font-weight: 600; }
.post-meta .sep { color: var(--line); }

.post-tags { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags .pt-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; color: var(--mute);
}
.post-tags a {
  display: inline-block; padding: 6px 13px; font-size: 12.5px;
  background: var(--paper-2); color: var(--accent);
  border: 1px solid var(--accent-soft); border-radius: 999px;
  transition: background .25s, color .25s;
}
.post-tags a:hover { background: var(--accent); color: var(--white); }

/* Prev / next */
.post-nav {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  transition:
    border-color .3s var(--ease-soft),
    transform .3s var(--ease-soft),
    box-shadow .3s var(--ease-soft);
}
.post-nav a:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.post-nav .pn-next { text-align: right; }
.post-nav .pn-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em;
  font-weight: 600; color: var(--mute);
}
.post-nav .pn-title {
  font-family: 'Fraunces', 'Fraunces Fallback', serif;
  font-size: 16px; line-height: 1.3; color: var(--ink);
}

/* ---------- Search form ---------- */
.tli-search { display: flex; gap: 10px; max-width: 520px; }
.tli-search input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
}
.tli-search input[type="search"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

/* ---------- Empty state + 404 ---------- */
.blog-empty { max-width: 600px; margin: 0 auto; text-align: center; padding: 24px 0; }
.blog-empty .eyebrow { justify-content: center; }
.blog-empty .tli-search { margin: 22px auto 0; }
.blog-empty h1, .blog-empty h2 {
  font-family: 'Fraunces', 'Fraunces Fallback', serif;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.12;
  margin: 14px 0;
  color: var(--ink);
}
.err-code {
  display: block;
  font-family: 'Fraunces', 'Fraunces Fallback', serif;
  font-size: clamp(84px, 16vw, 150px);
  line-height: 0.9;
  color: var(--accent-soft);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.err-links {
  margin: 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.err-links a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  transition: border-color .25s, color .25s;
}
.err-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Accessibility helper (not defined in styles.css) ---------- */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: fixed;
  top: 8px; left: 8px;
  width: auto; height: auto;
  padding: 10px 16px;
  clip: auto;
  background: var(--white);
  color: var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100000;
}
