/* Blog: blog home, article page, related grid, share buttons and comments. Loads after
   styles.css on blog pages (blog/_inc/layout.php) and in the live editor (prose only).
   Layout follows the Cutpoint 2027 blog: plain page, centered heads, rounded photos, one
   centered reading column. Uses the site's tokens; no divider lines anywhere. */

.blog-page { --card: var(--panel-light); --col: 46rem; }
.blog-page main { display: flex; flex-direction: column; }
/* The menu's glass sits over light backgrounds on blog pages (not over video like elsewhere),
   so it's made more solid to keep its links readable (WCAG AA). */
.blog-page .nav__menu { background: rgba(25, 24, 25, .88); }
.blog-page .avail.avail--nav { background: #b3301a; }

/* ---------- Shared bits ---------- */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 1.2em; color: var(--eyebrow); font-size: .59rem; font-weight: 600; letter-spacing: .13em; line-height: 1.4; text-transform: uppercase; }
.post-meta span + span::before { content: ""; display: inline-block; width: .35em; height: .35em; margin: 0 1.2em .15em -.6em; border-radius: 50%; background: currentColor; opacity: .5; vertical-align: middle; }
.pills { display: flex; flex-wrap: wrap; gap: .4em; }
.pill { display: inline-flex; align-items: center; padding: .7em 1.15em; border-radius: 50em; background: var(--inverse); color: var(--inverse-text); font-size: .62rem; font-weight: 600; letter-spacing: .12em; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.pill--quiet { background: var(--card); color: var(--ink-70); }
.pill--accent { background: var(--accent); color: #fff; }
.post-section-title { color: var(--ink); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 800; font-stretch: 125%; line-height: 1.02; }
.post-section-title .thin { color: inherit; }
.text-link { color: var(--accent-text); font-weight: 600; text-underline-offset: .22em; }

/* ---------- Blog home: centered head, then one grid ---------- */
.blog-head { display: flex; flex-direction: column; align-items: center; gap: 1.2em; padding: 11rem 1.5rem 4.5rem; text-align: center; }
.blog-head .kicker { margin: 0; }
.blog-head__title { max-width: 11em; color: var(--ink); font-size: clamp(2.8rem, 7.2vw, 6.2rem); font-weight: 800; font-stretch: 125%; line-height: .98; }
.blog-head__title .thin { color: inherit; }
.blog-head__intro { max-width: 24em; font-size: 1.06em; line-height: 1.6; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; margin-top: .6em; }
.filters a { padding: .75em 1.2em; border-radius: 50em; background: var(--card); color: var(--ink-70); font-size: .78em; font-weight: 600; line-height: 1.1; text-decoration: none; transition: color .3s var(--ease-soft); }
.filters a:hover { color: var(--ink); }
.filters a[aria-current] { background: var(--inverse); color: var(--inverse-text); }

.blog-section { width: 100%; max-width: 92rem; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.4rem) 6rem; }
.blog-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1em 2em; margin-bottom: 2.2rem; }
.blog-empty { max-width: 30em; margin: 0 auto; text-align: center; font-size: 1.06em; }

/* Columns adjust to the width: as many 20rem-plus columns as fit (1 on phones, 3 on laptops, 4 wide). */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 3.4rem clamp(1rem, 1.6vw, 1.6rem); }
.post-card { display: flex; flex-direction: column; gap: .55em; color: inherit; text-decoration: none; }
.post-card__img { position: relative; overflow: hidden; aspect-ratio: 3 / 2; margin-bottom: .6em; border-radius: var(--r-md); background: var(--card); }
.post-card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.post-card:hover .post-card__img img { transform: scale(1.04); }
.post-card__title { color: var(--ink); font-size: 1.28em; font-weight: 700; font-stretch: 115%; line-height: 1.25; transition: color .3s var(--ease-soft); }
.post-card:hover .post-card__title, .post-card:focus-visible .post-card__title { color: var(--accent-text); }
.post-card__meta { display: flex; flex-wrap: wrap; gap: .3em 1.1em; color: var(--ink-70); font-size: .62rem; font-weight: 600; letter-spacing: .12em; line-height: 1.4; text-transform: uppercase; }
.post-card__meta span + span::before { content: ""; display: inline-block; width: .32em; height: .32em; margin: 0 1.1em .15em -.55em; border-radius: 50%; background: currentColor; opacity: .5; vertical-align: middle; }
.post-card__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .9em; line-height: 1.6; }

/* ---------- Article: cover, then one centered column with the sticky side rail ---------- */
.post-cover { position: relative; overflow: hidden; height: clamp(16rem, 62vh, 42rem); margin: var(--gutter); border-radius: var(--r-lg); background: var(--deep); }
.post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Three columns: the rail on the left, the article centered, an empty column to balance it. */
.post-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--col)) minmax(0, 1fr); column-gap: clamp(1.5rem, 4vw, 4rem); padding: 4.5rem clamp(1rem, 3vw, 2.4rem) 6rem; }
.post-wrap--no-cover { padding-top: 10rem; }
.post-wrap--comments { padding-top: 0; }
.post-main { grid-column: 2; min-width: 0; }
.post-rail { grid-column: 1; grid-row: 1; justify-self: end; width: min(14rem, 100%); position: sticky; top: 7.5rem; align-self: start; display: flex; flex-direction: column; gap: 2.4em; padding-top: .4rem; }
.post-rail__label { margin-bottom: .8em; color: var(--ink-70); font-size: .59rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.toc { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .15em; counter-reset: toc; }
.toc a { display: grid; grid-template-columns: 2em 1fr; padding: .45em .7em .45em 0; border-radius: .59em; color: var(--ink-70); font-size: .82em; font-weight: 600; line-height: 1.4; text-decoration: none; transition: color .3s var(--ease-soft); }
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); color: var(--accent-text); font-size: .85em; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a.is-current { color: var(--ink); }

.post-head { display: flex; flex-direction: column; align-items: flex-start; gap: 1.3em; margin-bottom: 3.2em; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; font-size: .78em; font-weight: 600; }
.crumbs a { color: var(--ink-70); text-decoration: none; transition: color .3s var(--ease-soft); }
.crumbs a:hover { color: var(--ink); }
.crumbs span { color: var(--ink-55); }
.post-title { color: var(--ink); font-size: clamp(2.3rem, 4.6vw, 4rem); font-weight: 800; font-stretch: 125%; line-height: 1.04; }
.post-title .thin { color: inherit; }
.post-lede { font-size: 1.18em; line-height: 1.65; }
.byline { display: flex; align-items: center; gap: .9em; margin-top: .4em; }
.byline img { width: 3em; height: 3em; border-radius: 50%; object-fit: cover; }
.byline a { text-decoration: none; }
.byline a:hover strong { color: var(--accent-text); }
.byline strong { display: block; color: var(--ink); font-size: .94em; line-height: 1.3; }
.byline span { display: block; font-size: .82em; line-height: 1.4; }

/* Prose written in Markdown lands here */
.prose { color: var(--ink-70); font-size: 1.06em; line-height: 1.8; min-width: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { margin-top: 2.4em; color: var(--ink); font-size: 1.75em; font-weight: 800; font-stretch: 125%; line-height: 1.08; scroll-margin-top: 6em; }
.prose h3 { margin-top: 2em; font-size: 1.2em; line-height: 1.3; }
.prose h2 + *, .prose h3 + * { margin-top: .8em; }
/* Text links only; buttons and roll links keep the site's own styles */
.prose :is(p, li) > a:not(.roll):not(.button) { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: .5em; }
.prose ul li { position: relative; padding-left: 1.4em; }
.prose ul li::before { content: ""; position: absolute; left: .15em; top: .72em; width: .42em; height: .42em; border-radius: 50%; background: var(--accent); }
.prose ol { counter-reset: ol; }
.prose ol li { position: relative; padding-left: 2.2em; counter-increment: ol; }
.prose ol li::before { content: counter(ol, decimal-leading-zero); position: absolute; left: 0; top: .1em; color: var(--accent-text); font-size: .82em; font-weight: 700; letter-spacing: .06em; }
.prose blockquote { margin-top: 2em; margin-bottom: 2em; padding: 1.6em 1.8em; border-radius: var(--r-md); background: var(--card, var(--surface)); color: var(--ink); font-size: 1.35em; font-weight: 300; line-height: 1.4; }
.prose figure { margin-top: 2em; margin-bottom: 2em; }
.prose figure img { width: 100%; height: auto; border-radius: var(--r-md); }
.prose figcaption { margin-top: .8em; color: var(--ink-70); font-size: .78em; line-height: 1.5; }
.prose .video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); background: #1d1c1d; }
.prose .video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.prose .video .yt-card__play { width: 4em; height: 4em; margin: -2em 0 0 -2em; }
.prose hr { height: 0; margin: 2.6em 0; border: 0; }
.prose pre { overflow-x: auto; padding: 1.2em 1.4em; border-radius: var(--r-md); background: var(--card, var(--surface)); font-size: .82em; line-height: 1.6; }
.prose pre code { padding: 0; background: none; }
.prose .video a { position: absolute; inset: 0; display: block; }
.prose .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose figure.video { margin-top: 2em; margin-bottom: 2em; }
.prose figure.video figcaption { position: absolute; left: .9em; bottom: .9em; margin: 0; padding: .6em .9em; border-radius: var(--r-sm); background: var(--glass); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.prose .video.is-playing figcaption { display: none; }
.prose code { padding: .15em .4em; border-radius: .4em; background: var(--card, var(--surface)); color: var(--ink); font-size: .88em; }


.post-end { display: flex; flex-direction: column; gap: var(--gutter); margin-top: 3.6em; }

/* Author card */
.author { display: grid; grid-template-columns: auto 1fr; gap: 1.2em 1.4em; align-items: start; padding: 1.8em; border-radius: var(--r-md); background: var(--card); }
.author img { width: 4.4em; height: 4.4em; border-radius: 50%; object-fit: cover; }
.author__name { color: var(--ink); font-size: 1.1em; font-weight: 700; line-height: 1.3; }
.author p { font-size: .88em; line-height: 1.6; }
.author .roll { margin-top: .8em; font-size: .82em; }

/* Plan box */
.post-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.2em 2em; padding: 1.8em; border-radius: var(--r-md); background: var(--panel-dark); color: var(--on-dark-60); }
.post-cta strong { display: block; color: var(--on-dark); font-size: 1.15em; font-weight: 800; font-stretch: 125%; line-height: 1.2; }
.post-cta span { font-size: .88em; }

/* ---------- Share ---------- */
.share { display: flex; flex-wrap: wrap; gap: .45em; }
.share a, .share button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 2.6rem; min-width: 2.6rem; padding: 0 .8em; border: 0; border-radius: var(--r-sm);
  background: var(--card, var(--surface)); color: var(--ink-70); font: inherit; font-size: .78em; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease-soft), color .3s var(--ease-soft);
}
.share a:hover, .share button:hover { background: var(--inverse); color: var(--inverse-text); }
.share svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.share--row { align-items: center; }
.share a[aria-pressed], .share button.is-done { background: var(--inverse); color: var(--inverse-text); }
.share--row .share__label { margin-right: .6em; color: var(--ink); font-size: .88em; font-weight: 600; }
.post-rail .share { display: grid; grid-template-columns: repeat(4, 2.6rem); }
.post-rail .share .share__copy { grid-column: 1 / -1; justify-content: flex-start; }


/* ---------- Comments: one column under the article ---------- */
.post-section-intro { margin-top: .9em; }
.comment-form { margin: 1.6em 0 3em; padding: 1.8em; background: var(--card); }
.comment-form__replying { padding: .8em 1em; border-radius: .7em; background: var(--bg); color: var(--ink-70); font-size: .82em; }
.comment-form__replying strong { color: var(--ink); }
.comment-form__replying a { margin-left: .6em; color: var(--accent-text); font-weight: 600; }
.comment .comment-form { margin: 1em 0 .4em; padding: 1.3em; background: var(--bg); }
.comment .comment .comment-form { background: var(--card); }
.comment .comment-form .field input, .comment .comment-form .field textarea { background-color: var(--card); }
.comment .comment .comment-form .field input, .comment .comment .comment-form .field textarea { background-color: var(--bg); }
.comment-form .field input, .comment-form .field textarea { background-color: var(--bg); }
.comment-form .field textarea { min-height: 7.5em; }
.form__note { color: var(--ink-70); font-size: .76em; line-height: 1.5; }

.thread-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1em; margin-bottom: 1.2em; }
.thread-bar__count { color: var(--ink); font-size: 1.15em; font-weight: 700; }
.sort { display: inline-flex; margin: 0; border: 0; min-width: 0; padding: .3em; border-radius: var(--r-sm); background: var(--card); }
.sort[hidden] { display: none; }
.sort label { position: relative; }
.sort input { position: absolute; opacity: 0; pointer-events: none; }
.sort span { display: block; padding: .7em 1.05em; border-radius: .55em; color: var(--ink-70); font-size: .78em; font-weight: 600; line-height: 1.1; cursor: pointer; transition: background-color .3s var(--ease-soft), color .3s var(--ease-soft); }
.sort input:checked + span { background: var(--inverse); color: var(--inverse-text); }
.sort input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.comments { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--gutter); }
.comment { padding: 1.4em 1.5em 1.2em; border-radius: var(--r-md); background: var(--card); }
.comment .comment { margin-top: .9em; padding: 1.2em 1.3em 1em; background: var(--bg); }
.comment .comment .comment { background: var(--card); }
.comment__replies { list-style: none; padding: 0 0 0 1.6em; margin-top: .2em; }
/* Past three levels, replies stop stepping in so threads stay readable on phones. */
.comment__replies .comment__replies .comment__replies { padding-left: 0; }
.comment { scroll-margin-top: 7em; transition: box-shadow .6s var(--ease-soft); }
.comment.is-new, .comment:target { box-shadow: 0 0 0 2px var(--accent); }
.comment__removed { color: var(--ink-70); font-size: .88em; font-style: italic; font-weight: 400; }
.comments__empty { padding: 1.4em 1.5em; border-radius: var(--r-md); background: var(--card); color: var(--ink-70); }
.comment__head { display: flex; align-items: center; gap: .75em; margin-bottom: .55em; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.3em; height: 2.3em; border-radius: 50%; background: var(--bg); color: var(--ink); font-size: .82em; font-weight: 700; }
.comment .comment .avatar { background: var(--card); }
.comment .comment .comment .avatar { background: var(--bg); }
img.avatar { object-fit: cover; }
.comment__name { color: var(--ink); font-size: .9em; font-weight: 700; line-height: 1.2; }
.comment__time { color: var(--ink-70); font-size: .76em; }
.comment__time a { color: inherit; text-decoration: none; }
.comment__time a:hover { text-decoration: underline; }
.badge { padding: .35em .7em; border-radius: 50em; background: var(--accent); color: #fff; font-size: .62em; font-weight: 700; letter-spacing: .1em; line-height: 1; text-transform: uppercase; }
.comment__body { color: var(--ink-70); font-size: .92em; line-height: 1.65; overflow-wrap: anywhere; }
.comment__body p + p { margin-top: .7em; }
.comment__actions { display: flex; gap: 1.4em; margin-top: .6em; }
.comment__actions a, .comment__actions button { padding: .3em 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: .78em; font-weight: 600; cursor: pointer; }
.comment__actions a { text-decoration: none; }
.comment__actions a:hover, .comment__actions button:hover { color: var(--accent-text); }
.comment__actions .is-quiet { color: var(--ink-70); }
html:not(.js) .comment__copy, html:not(.js) .share__copy { display: none; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1em 2.4em; margin-top: 4em; }
.pager__at { color: var(--ink-70); font-size: .82em; }
.blog-rss { margin-top: 3em; font-size: .78em; text-align: center; }
.blog-rss a { color: var(--accent-text); font-weight: 600; text-underline-offset: .22em; }
.blog-mod { min-height: 70vh; justify-content: center; }
.blog-mod .heading--xl { max-width: 12em; margin-bottom: .5em; }
.blog-mod__body { max-width: 34em; margin-bottom: 2em; }
.blog-mod__quote { margin-bottom: 1em; padding: 1.4em 1.6em; border-radius: var(--r-md); background: var(--surface); }
.blog-mod__quote p + p { margin-top: .6em; }


/* ---------- FAQ page (faq/index.html): the article layout with topics in the side rail ---------- */
.faq-head { padding-bottom: 3.5rem; }
.faq-head .blog-head__title { max-width: 12em; }
.faq-jump { display: none; }
.faq-wrap { padding-top: 1.5rem; }
.toc__meta { grid-column: 2; color: var(--ink-70); font-size: .86em; font-weight: 400; }
.faq-ask { display: flex; flex-direction: column; align-items: flex-start; gap: .35em; padding: 1.3em 1.4em; border-radius: var(--r-md); background: var(--card); }
.faq-ask .roll { margin-top: .7em; font-size: .88em; }
.faq-group { scroll-margin-top: 6rem; }
.faq-group + .faq-group { margin-top: 5.5rem; }
.faq-group__title { margin-bottom: 2.2rem; color: var(--ink); font-size: clamp(1.9rem, 3.2vw, 2.75rem); font-weight: 800; font-stretch: 125%; line-height: 1.04; }
.faq-group__title .thin { color: inherit; }
.faq-q + .faq-q { margin-top: 2.3em; }
.faq-q h3 { margin-bottom: .45em; color: var(--ink); font-size: 1.22em; font-weight: 700; font-stretch: 115%; line-height: 1.3; }
.faq-q p { font-size: 1.06em; line-height: 1.75; }
.faq-q a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.faq-terms { margin-top: 4.5rem; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1099px) {
  /* The side rail folds away; sharing stays at the end of the article. */
  .post-wrap { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: calc(var(--col) + 6rem); margin: 0 auto; }
  .post-main { grid-column: 1; }
  .post-rail { display: none; }
  .faq-jump { display: flex; }
}
@media (max-width: 767px) {
  .blog-head { padding-top: 8rem; padding-bottom: 3rem; }
  .post-cover { height: auto; aspect-ratio: 4 / 3; }
  .post-wrap { padding-top: 2.6rem; }
  .post-wrap--no-cover { padding-top: 7.5rem; }
  .post-head { margin-bottom: 2.4em; }
  .post-meta, .post-rail__label { font-size: .68rem; }
  .pill, .post-card__meta { font-size: .66rem; }
  .prose { font-size: 1em; }
  .prose h2 { font-size: 1.5em; }
  .comment__replies { padding-left: .7em; }
  .comment, .comment .comment { padding-left: 1.1em; padding-right: 1.1em; }
  .comment-form { padding: 1.3em; }
  .author { grid-template-columns: 1fr; }
  .author img { width: 3.6em; height: 3.6em; }
  .post-cta .button { width: 100%; }
  .faq-q p { font-size: 1em; }
}
