/* Resources section (generated by scripts/build-resources.mjs). Builds on styles.css tokens. */

.nav-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--tide); text-decoration-thickness: 2px; text-underline-offset: .45em; }

.res main { min-width: 0; }
.res-wrap { padding-block: clamp(2rem, 5vw, 3.5rem) var(--section-y); }
.res-head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.res-head .display-lg { max-width: 22ch; overflow-wrap: anywhere; }
.res-empty { color: var(--ink-soft); }

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: 0; margin: 0 0 1.5rem; list-style: none; font-size: .875rem; color: var(--ink-soft); }
.crumbs li { min-width: 0; overflow-wrap: anywhere; }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--rule-dark); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: clamp(1.5rem, 3vw, 2.25rem); padding: 0; list-style: none; }
.card { display: grid; grid-template-rows: auto 1fr; min-width: 0; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.card-media { display: block; border-radius: .75rem; overflow: hidden; background: var(--paper-2); aspect-ratio: 16 / 9; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: grid; gap: .6rem; align-content: start; padding-top: 1rem; min-width: 0; }
.card-meta { font-size: .875rem; color: var(--ink-soft); }
.card-title { font-size: 1.3125rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--tide); text-decoration: underline; }
.card-excerpt { color: var(--ink-soft); font-size: 1rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.tag-list a {
  display: inline-flex; align-items: center; min-height: 2rem; padding: .2rem .75rem; border-radius: 999px;
  background: var(--paper-2); color: var(--tide-deep); font-size: .8125rem; font-weight: 600; text-decoration: none;
}
.tag-list a:hover { background: var(--foam); }

/* Pagination */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pager-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 700; text-decoration: none; color: var(--tide); }
.pager-link:hover { text-decoration: underline; }
.pager > :last-child { justify-self: end; }
.pager-count { color: var(--ink-soft); font-size: .875rem; }

/* Post */
.post-head { display: grid; gap: 1rem; padding-top: clamp(2rem, 5vw, 3.5rem); max-width: 56rem; }
.post-head .crumbs ol { margin-bottom: .5rem; }
.post-kicker a { font-weight: 700; font-size: .875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--tide); text-decoration: none; }
.post-kicker a:hover { text-decoration: underline; }
.post-title {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.5rem, 7vw, 5rem); line-height: .95; letter-spacing: -.005em; text-wrap: balance; overflow-wrap: anywhere;
}
.post-dek { font-size: clamp(1.125rem, 2vw, 1.3125rem); color: var(--ink-soft); max-width: 44rem; }
.post-byline { font-size: .9375rem; color: var(--ink-soft); }
.post-byline a { color: var(--ink); font-weight: 600; }

.post-hero { margin-block: clamp(1.75rem, 4vw, 3rem); }
.post-hero img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .875rem; background: var(--tide); }
.post-hero figcaption, .post-body figcaption { margin-top: .6rem; font-size: .875rem; color: var(--ink-soft); }

.post-layout { display: grid; gap: 2rem; }
.post-layout.has-toc { grid-template-columns: minmax(0, 15rem) minmax(0, 42rem); justify-content: center; column-gap: clamp(2rem, 5vw, 4rem); }
.post-layout:not(.has-toc) .post-body { max-width: 42rem; margin-inline: auto; width: 100%; }
.toc { position: sticky; top: 5.5rem; align-self: start; font-size: .9375rem; }
.toc-title { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: .75rem; }
.toc ol { display: grid; gap: .5rem; padding: 0 0 0 1rem; margin: 0; border-left: 2px solid var(--rule); list-style: none; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--tide); text-decoration: underline; }

@media (max-width: 52rem) {
  .post-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding: 1rem 1.25rem; background: var(--paper-2); border-radius: .75rem; }
  .toc ol { border-left: 0; padding-left: 0; }
}

/* Article body: Ghost HTML */
.post-body { min-width: 0; font-size: 1.125rem; line-height: 1.7; overflow-wrap: break-word; }
.post-body > * + * { margin-top: 1.25em; }
.post-body h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.2; letter-spacing: -.01em; margin-top: 2em; scroll-margin-top: 5.5rem; }
.post-body h3 { font-size: 1.3125rem; line-height: 1.3; margin-top: 1.75em; scroll-margin-top: 5.5rem; }
.post-body h4 { font-size: 1.125rem; margin-top: 1.5em; }
.post-body a { color: var(--tide); }
.post-body a:hover { color: var(--tide-deep); }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body ul { list-style: disc; }
.post-body li + li { margin-top: .4em; }
.post-body li::marker { color: var(--tide); }
.post-body blockquote { margin-inline: 0; padding-left: 1.25rem; border-left: 3px solid var(--tide); color: var(--ink-soft); font-style: italic; }
.post-body img { max-width: 100%; height: auto; border-radius: .625rem; }
.post-body figure { margin-inline: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.post-body code { font-size: .9em; padding: .1em .35em; border-radius: 4px; background: var(--paper-2); }
.post-body pre { overflow-x: auto; padding: 1rem; border-radius: .625rem; background: var(--ink); color: var(--paper); font-size: .9375rem; }
.post-body pre code { background: none; padding: 0; }
.post-body iframe, .post-body video { max-width: 100%; }

.table-scroll { overflow-x: auto; max-width: 100%; border-radius: .5rem; }
.table-scroll:focus-visible { outline-offset: 2px; }
.post-body table { width: 100%; min-width: 32rem; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.post-body th, .post-body td { text-align: left; vertical-align: top; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--rule); }
.post-body thead th { border-bottom: 2px solid var(--ink); font-size: .875rem; color: var(--ink-soft); }

/* Ghost cards */
.post-body .kg-callout-card { display: flex; gap: .75rem; padding: 1rem 1.25rem; border-radius: .75rem; background: var(--paper-2); }
.post-body .kg-bookmark-card a { display: block; padding: 1rem; border: 1px solid var(--rule); border-radius: .75rem; text-decoration: none; color: var(--ink); }
.post-body .kg-bookmark-thumbnail, .post-body .kg-bookmark-icon { display: none; }
.post-body .kg-button-card a, .post-body .kg-btn { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.25rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; }
.post-body .kg-gallery-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.post-body .kg-gallery-image { flex: 1 1 12rem; min-width: 0; }

/* FAQ (Ghost toggle cards, rendered as <details>) */
.post-body .faq { border-top: 1px solid var(--rule); padding-block: .25rem; }
.post-body .faq:last-of-type { border-bottom: 1px solid var(--rule); }
.post-body .faq + .faq { margin-top: 0; }
.post-body .faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.75rem; padding-block: .6rem; cursor: pointer; font-weight: 700; list-style: none; }
.post-body .faq summary::-webkit-details-marker { display: none; }
.post-body .faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--tide); }
.post-body .faq[open] summary::after { content: "–"; }
.post-body .faq-a { padding-bottom: 1rem; color: var(--ink-soft); }

.post-foot { display: grid; gap: 1rem; max-width: 42rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.post-layout.has-toc ~ .post-foot { max-width: calc(42rem + 15rem + clamp(2rem, 5vw, 4rem)); }
.post-md { font-size: .875rem; color: var(--ink-soft); }

.post-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.post-pager-link { display: grid; gap: .25rem; padding: 1rem 1.25rem; min-height: 2.75rem; border: 1px solid var(--rule); border-radius: .75rem; text-decoration: none; font-weight: 700; overflow-wrap: anywhere; }
.post-pager-link span { font-size: .8125rem; font-weight: 600; color: var(--ink-soft); }
.post-pager-link:hover { border-color: var(--tide); color: var(--tide); }
.post-pager-link.is-next { text-align: right; }
@media (max-width: 36rem) { .post-pager { grid-template-columns: minmax(0, 1fr); } .post-pager-link.is-next { text-align: left; } }

.related { margin-block: clamp(3rem, 6vw, 4.5rem) var(--section-y); }
.related-title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1; margin-bottom: 1.5rem; }
.res article.post + .wrap:not(:has(.related)) { padding-bottom: var(--section-y); }
