/* ==========================================================================
   Vyrloop — blog.css
   Blog listing, article and archive pages. Loaded only on /blog pages, after
   global.css and pages.css, and built from the same tokens and components
   (.l-hero, .crumbs, .eyebrow, .l-meta, .final, .btn, .link-arrow).
   ========================================================================== */

/* ---------- Listing header ---------- */
/* .l-hero's glow is positioned against its box; the article uses <header>, not <section>. */
.b-hero { position: relative; }
.b-hero h1 { max-width: 20ch; }
.b-hero h1 em { font-style: normal; color: var(--lime); }
.b-hero .eyebrow { margin-top: 4px; text-decoration: none; }
.b-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: clamp(24px, 3vw, 36px); }
.b-cats { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.b-cats a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  border: 1.5px solid var(--line); border-radius: 999px; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.b-cats a:hover { border-color: color-mix(in srgb, var(--paper) 30%, transparent); }
.b-cats a[aria-current="page"] { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.b-search { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line); min-width: min(100%, 340px); }
.b-search input {
  flex: 1; min-width: 0; min-height: 40px; padding: 8px 14px; font-size: 16px;
  color: var(--paper); background: transparent; border: 0; border-radius: 999px;
}
.b-search input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.b-search input:focus { outline: none; }
.b-search:focus-within { border-color: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent); }
.b-search .btn { min-height: 40px; }

.b-list { padding-top: clamp(36px, 5vw, 64px); }
.b-result { margin-bottom: 24px; color: var(--muted); font-weight: 600; }
.b-result a { color: var(--lime); }
.b-empty { display: grid; justify-items: start; gap: 14px; padding: clamp(24px, 4vw, 48px); border: 1px dashed var(--line); border-radius: var(--r-xl); }
.b-empty h2 { font-size: clamp(22px, 1.4vw + 14px, 30px); font-weight: 800; }
.b-empty p { color: var(--muted); max-width: 56ch; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card {
  position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden;
  border-radius: var(--r-lg); background: var(--ink-2); border: 1px solid var(--line);
  transition: border-color 0.3s, transform 0.3s;
}
.post-card:hover { border-color: color-mix(in srgb, var(--lime) 50%, transparent); transform: translateY(-4px); }
.post-card__media { aspect-ratio: 16 / 9; background: var(--ink-3); display: grid; place-items: center; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__media .post-card__mark { width: 64px; height: auto; opacity: 0.6; }
.post-card__body { display: grid; gap: 10px; align-content: start; padding: 22px 24px 26px; }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.post-card__meta a { position: relative; z-index: 1; color: var(--lime); text-decoration: none; }
.post-card__meta a:hover { text-decoration: underline; }
.post-card__title { font-size: clamp(19px, 0.5vw + 16px, 22px); font-weight: 800; line-height: 1.25; }
.post-card__title a { text-decoration: none; }
/* The whole card is clickable through the title link. */
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__title a:focus-visible { outline: none; }
.post-card:focus-within { outline: 2px solid var(--lime); outline-offset: 3px; }
.post-card__excerpt { color: var(--muted); font-size: 15px; }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: clamp(32px, 4vw, 48px); font-weight: 700; font-size: 14px; }
.pager ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; }
.pager a:hover { border-color: var(--lime); color: var(--lime); }
.pager [aria-current="page"] { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.pager [aria-disabled="true"] { color: var(--muted); opacity: 0.5; }
.pager .pager__gap { border-color: transparent; }

/* ---------- Article ---------- */
.b-narrow { max-width: calc(760px + 2 * var(--gutter)); }
.b-hero--post { border-bottom: 0; }
.b-hero--post h1 { max-width: 24ch; }
.b-figure { max-width: calc(1100px + 2 * var(--gutter)); margin-bottom: clamp(32px, 4vw, 56px); }
.b-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--ink-2); }
.b-body { padding-bottom: var(--section-y); }

.prose { font-size: 17px; line-height: 1.8; color: color-mix(in srgb, var(--paper) 86%, var(--muted)); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-size: clamp(24px, 1.2vw + 17px, 32px); font-weight: 800; line-height: 1.2; color: var(--paper); }
.prose h3 { margin-top: 1.8em; font-size: clamp(19px, 0.6vw + 16px, 23px); font-weight: 800; line-height: 1.3; color: var(--paper); }
.prose h4, .prose h5, .prose h6 { margin-top: 1.6em; font-size: 17px; font-weight: 800; color: var(--paper); }
.prose a { color: var(--lime); text-underline-offset: 3px; }
.prose strong { color: var(--paper); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--lime); font-weight: 700; }
.prose blockquote { padding: 4px 0 4px 22px; border-left: 3px solid var(--lime); color: var(--paper); font-size: 1.08em; font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.2em; }
.prose img { border-radius: var(--r); border: 1px solid var(--line); margin-inline: auto; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: var(--ink-3); color: var(--paper); }
.prose pre { overflow-x: auto; padding: 18px 20px; border-radius: var(--r); background: var(--ink-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; }
.prose .prose-table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose .prose-table th, .prose .prose-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose .prose-table th { color: var(--paper); font-weight: 800; }
.prose input[type="checkbox"] { accent-color: var(--lime); margin-right: 6px; }

.b-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-top: 40px; }
.b-tags a { display: inline-flex; min-height: 36px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; text-decoration: none; }
.b-tags a:hover { border-color: var(--lime); color: var(--lime); }
.b-author { display: flex; align-items: center; gap: 14px; margin-top: 32px; padding: 18px 20px; border-radius: var(--r); background: var(--ink-2); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.b-author img { flex: none; }
.b-author b { color: var(--paper); }
.b-author a { color: var(--lime); }

/* Admin preview banner */
.b-preview { background: color-mix(in srgb, #ffb84d 18%, var(--ink)); border-bottom: 1px solid color-mix(in srgb, #ffb84d 40%, transparent); color: var(--warn); font-size: 14px; }
.b-preview .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; min-height: 48px; padding-block: 8px; }
.b-preview a { color: var(--paper); font-weight: 700; }

@media (max-width: 1100px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .b-search { width: 100%; }
  .prose { font-size: 16px; }
}

/* Alignment and captions from the visual editor (classes kept by App\Support\RichText). */
.prose .align-left { text-align: left; }
.prose .align-center { text-align: center; }
.prose .align-right { text-align: right; }
.prose .align-justify { text-align: justify; }
.prose img.align-left { float: left; margin: 0.3em 1.4em 1em 0; max-width: 50%; }
.prose img.align-right { float: right; margin: 0.3em 0 1em 1.4em; max-width: 50%; }
.prose img.align-center, .prose figure.align-center { display: block; margin-inline: auto; }
.prose figure img { margin-inline: auto; }
.prose figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.prose::after { content: ""; display: block; clear: both; }
@media (max-width: 560px) {
  .prose img.align-left, .prose img.align-right { float: none; max-width: 100%; margin: 1em auto; }
}
