/* Journal index + article pages */

/* ---------- Shared: story card (index grid, article "keep reading") ---------- */
.jn-meta { display: inline; }
.jn-grid { display: grid; gap: var(--s-7) var(--s-5); }
@media (min-width: 640px) { .jn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .jn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.jn-card { position: relative; display: grid; gap: var(--s-4); align-content: start; color: var(--fg); border-radius: var(--r-3); }
.jn-card__media { border-radius: var(--r-3); }
.jn-card__media img { transform: scale(1.01); }
.jn-card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgb(9 9 11 / 0.55)); pointer-events: none; }
.jn-card__tag { position: absolute; top: 12px; left: 12px; z-index: 1; }
.jn-card__body { display: grid; gap: var(--s-3); padding-inline: 4px; }
.jn-card__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.jn-card__ic { width: 32px; height: 32px; display: grid; place-items: center; flex: none; color: var(--fg-2); border: 1px solid var(--line-strong); border-radius: 50%; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-base) var(--ease-expo); }
.jn-card__ic svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jn-card__title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; max-width: 22ch; transition: color var(--t-fast); }
.jn-card__body p { color: var(--fg-2); font-size: var(--text-sm); max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) {
  .jn-card:hover .jn-card__media img { transform: scale(1.06); }
  .jn-card:hover .jn-card__ic { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); transform: rotate(-45deg); }
  .jn-card:hover .jn-card__title { color: var(--lime); }
}
.jn-card:focus-visible { outline-offset: 6px; }

/* ---------- Index ---------- */
.page-journal .page-head { margin-bottom: var(--s-5); }
.jn-bar { padding-block: var(--s-4); margin-bottom: var(--s-7); border-block: 1px solid var(--line); }
.jn-bar .chips { flex: 1 1 auto; }
.jn-bar .toolbar__count { margin-left: auto; }

/* Featured (newest) story */
.jn-feat { display: grid; gap: var(--s-5); padding-bottom: var(--s-7); margin-bottom: var(--s-7); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .jn-feat { grid-template-columns: 7fr 5fr; gap: var(--s-8); align-items: center; padding-bottom: var(--s-8); margin-bottom: var(--s-8); } }
.jn-feat__media { display: block; border-radius: var(--r-4); }
.jn-feat__media .media { border-radius: var(--r-4); }
.jn-feat__media img { transform: scale(1.01); }
.jn-feat__media .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgb(9 9 11 / 0.5)); pointer-events: none; }
.jn-feat__tags { position: absolute; top: 14px; left: 14px; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (hover: hover) { .jn-feat:hover .jn-feat__media img { transform: scale(1.04); } }
.jn-feat__media:focus-visible { outline-offset: 6px; }
.jn-feat__body { display: grid; gap: var(--s-4); justify-items: start; }
@media (min-width: 900px) { .jn-feat__body { padding-right: var(--s-6); } }
.jn-feat__title { font-size: var(--text-xl); letter-spacing: -0.03em; max-width: 16ch; }
.jn-feat__title a { transition: color var(--t-fast); }
.jn-feat__title a:hover { color: var(--lime); }
.jn-feat__body p { max-width: 44ch; }
/* Filter matched only the featured story: nothing follows it, so drop the divider and its spacing (toggled in journal.js). */
.jn-index.is-feat-only .jn-feat { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }

/* "Read the story" / "All stories": .link is 28px tall; on touch grow the hit area to --tap without moving the layout. */
@media (pointer: coarse) { .jn-link { min-height: var(--tap); margin-block: calc((28px - var(--tap)) / 2); } }

.jn-empty { display: grid; justify-items: center; gap: var(--s-4); padding: var(--s-9) 0; text-align: center; color: var(--fg-2); }

/* ---------- Article ---------- */
/* --col is 68ch measured at the body size (--text-md, Bricolage ≈ 0.65em per ch). It is pinned in rem so the
   title block, headings and share row share one left edge — `ch` would resolve against each element's own font. */
.article { --col: 47rem; --wide: 58rem; }
.article .page-head { margin-bottom: var(--s-5); }
.article__hero { border-radius: var(--r-3); }
@media (min-width: 900px) { .article__hero { border-radius: var(--r-4); } }
.article__hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 70%, rgb(9 9 11 / 0.4)); pointer-events: none; }

.article__title { display: grid; gap: var(--s-4); justify-items: start; max-width: var(--col); margin: var(--s-7) auto 0; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.article__meta .tag { position: relative; transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-base); }
.article__meta .tag::before { content: ""; position: absolute; inset: -10px 0; } /* 44px hit area for the category link */
.article__meta .tag:hover { transform: translateY(-1px); box-shadow: var(--glow-lime); }
.article__title h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 4.25rem); letter-spacing: -0.035em; line-height: 0.96; }
.article__lede { font-size: var(--text-lg); font-weight: 400; letter-spacing: -0.015em; line-height: 1.35; color: var(--fg-2); max-width: var(--col); }

/* Body: 68ch reading column, figures and quotes break out to the wide column */
.article__body { margin-top: var(--s-8); font-size: var(--text-md); line-height: 1.7; }
.article__body > * { max-width: var(--col); margin-inline: auto; }
.article__body > * + * { margin-top: var(--s-5); }
.article__body > p { color: rgb(244 244 246 / 0.84); }
.article__body > h2 { margin-top: var(--s-8); font-weight: 600; line-height: 1.1; }
.article__body > h2 + * { margin-top: var(--s-4); }
.article__body > figure, .article__body > blockquote { max-width: var(--wide); margin-block: var(--s-8); }
.article__figure .media { border-radius: var(--r-3); }
.article__figure figcaption { margin-top: var(--s-3); padding-inline: 4px; color: var(--fg-3); }
.article__quote { position: relative; display: grid; gap: var(--s-4); padding-left: var(--s-5); border-left: 3px solid var(--lime); }
@media (min-width: 720px) { .article__quote { padding-left: var(--s-6); } }
.article__quote p { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; line-height: 1.05; letter-spacing: -0.03em; max-width: 26ch; text-wrap: balance; color: var(--fg); }
.article__quote cite { font-style: normal; color: var(--lime); }
.article__quote cite::before { content: "— "; }

/* Share row */
.article__share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); max-width: var(--col); margin: var(--s-8) auto 0; padding-top: var(--s-5); border-top: 1px solid var(--line); }
.article__share > .mono { margin-right: auto; color: var(--fg-3); }
.article__share .btn { gap: 8px; }
@media (pointer: coarse) { .article__share .btn { min-height: var(--tap); } }
.art-ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.art-ic--check { display: none; }
/* Set background/color directly, not only --bg/--fg-c: .btn--glass:hover writes `background` and would win for the 2.2 s the pointer stays on the button after a click. */
#article-copy.is-copied, #article-copy.is-copied:hover { --bg: var(--lime); --fg-c: var(--lime-ink); background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
#article-copy.is-copied .art-ic--link { display: none; }
#article-copy.is-copied .art-ic--check { display: block; }
