/* News and articles: /news, /materials and the page of one record (docs/POSTS.md). Colours only through tokens of base.css. */

/* ---------- List ---------------------------------------------------------- */
.post-grid { display: grid; gap: var(--s-6) var(--s-5); grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s-7); }
@media (min-width: 40em) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.post-card { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-1); transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
@media (hover: hover) { .post-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-2); transform: translateY(-3px); } }
.post-card:focus-within { border-color: var(--accent); }
.post-card__cover { aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.post-card__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card__cover--none { display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 14%, var(--surface-2)) 0%, var(--surface-2) 60%); }
.post-card__cover .post-card__mark { width: 30%; height: auto; max-height: 60%; object-fit: contain; opacity: .35; }
.post-card__body { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-4) var(--s-4) var(--s-5); min-width: 0; }
.post-card__date { color: var(--text-faint); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.post-card__title { font-family: var(--font-display); font-weight: var(--fw-display); font-synthesis: none; font-size: var(--fs-lg); line-height: 1.15; overflow-wrap: anywhere; }
.post-card__link { color: var(--text-strong); text-decoration: none; }
/* the whole card is the link */
.post-card__link::after { content: ""; position: absolute; inset: 0; }
.post-card:hover .post-card__link { color: var(--accent-hot); }
.post-card__lede { color: var(--text-muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }

/* ---------- One record ---------------------------------------------------- */
.post { max-width: 46rem; margin-inline: auto; min-width: 0; }
.post .breadcrumbs a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.post .breadcrumbs li { min-width: 0; overflow-wrap: anywhere; }
.post__head { display: grid; gap: var(--s-3); margin-bottom: var(--s-5); }
.post__date { color: var(--text-faint); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.post__title { font-family: var(--font-display); font-weight: var(--fw-display); font-synthesis: none; font-size: var(--fs-2xl); line-height: 1.05; overflow-wrap: anywhere; text-wrap: balance; }
.post__lede { color: var(--text-muted); font-size: var(--fs-md); line-height: 1.55; overflow-wrap: anywhere; }
.post__cover { margin: 0 0 var(--s-6); }
.post__cover img { display: block; max-width: 100%; width: auto; height: auto; max-height: 36rem; margin-inline: auto; border: 1px solid var(--sleeve-edge); border-radius: var(--radius); }

.post__body { font-size: 1.0625rem; line-height: 1.7; overflow-wrap: anywhere; }
.post__body > * + * { margin-top: var(--s-4); }
.post__body h2, .post__body h3 { font-family: var(--font-display); font-weight: var(--fw-display); font-synthesis: none; line-height: 1.15; color: var(--text-strong); }
.post__body h2 { font-size: var(--fs-xl); }
.post__body h3 { font-size: var(--fs-lg); }
.post__body > * + h2 { margin-top: var(--s-7); }
.post__body > * + h3 { margin-top: var(--s-6); }
.post__body ul { list-style: disc; padding-left: 1.4rem; }
.post__body li + li { margin-top: var(--s-2); }
.post__body li::marker { color: var(--accent); }
.post__body strong { color: var(--text-strong); }

.post__body > .post-photo, .post__body > .post-audio, .post__body > .post-embed { margin-block: var(--s-6); }
.post-photo { margin-inline: 0; }
.post-photo img { display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: var(--radius); }
.post-photo figcaption { margin-top: var(--s-2); color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.5; text-align: center; }

.post-audio { display: grid; gap: var(--s-2); margin-inline: 0; padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.post-audio figcaption { font-weight: 600; color: var(--text-strong); line-height: 1.4; }
.post-audio audio { display: block; width: 100%; min-width: 0; }

/* ---------- Players (frame sizes by App\Posts\Embed variant) -------------- */
.post-embed { min-width: 0; }
.post-embed iframe { display: block; width: 100%; border: 0; border-radius: var(--radius); background: var(--surface-2); }
.post-embed--video iframe { aspect-ratio: 16 / 9; height: auto; }
.post-embed--short { max-width: 22rem; margin-inline: auto; }
.post-embed--short iframe { aspect-ratio: 9 / 16; height: auto; }
.post-embed--sc-track iframe { height: 166px; }
.post-embed--sc-set iframe { height: 400px; }
.post-embed--ym-track iframe { height: 180px; }
.post-embed--ym-album iframe { height: 450px; }
.post-embed--bc-small iframe { height: 42px; }
.post-embed--bc-slim iframe { height: 120px; }
.post-embed--bc-list iframe { height: 340px; }
.post-embed--bc-square { max-width: 350px; margin-inline: auto; }
.post-embed--bc-square iframe { aspect-ratio: 1; height: auto; }
.post-embed--bc-card, .post-embed--bc-cardlist { max-width: 350px; margin-inline: auto; }
.post-embed--bc-card iframe { height: 470px; }
.post-embed--bc-cardlist iframe { height: 700px; }

.post__foot { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); }

/* ---------- Admin preview ------------------------------------------------- */
.post-preview-bar { max-width: 46rem; margin: 0 auto var(--s-5); padding: var(--s-3) var(--s-4); display: grid; gap: var(--s-2); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); font-size: var(--fs-sm); }
.post-preview-bar ul { list-style: disc; padding-left: 1.1rem; }

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

/* Years above the list (?year=) */
.post-years { margin-bottom: var(--s-5); }
.post-years ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.post-years__chip {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 1rem;
  border: 1px solid var(--control-border); border-radius: 999px; color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.post-years__chip:hover { color: var(--accent-hot); border-color: var(--accent); background: var(--hover-wash); }
.post-years__chip.is-current, .post-years__chip.is-current:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.post-years__chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.post-years__n { font-size: var(--fs-xs); font-weight: 500; opacity: .75; }
