/* ==========================================================================
   The Arena: blog (index, topics, single post). Loads after arena.css.
   ========================================================================== */

.blog { padding-block-start: calc(var(--header-h) + var(--header-drop) + var(--admin-bar)); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9rem; color: var(--ink-soft); }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--olive); }
.crumbs span { color: var(--olive); }

/* ---------- Index head ---------- */
.bhead { padding-block: clamp(36px, 4vw, 64px) clamp(32px, 4vw, 56px); }
.bhead .wrap > :first-child { margin-block-start: 0; }
.bhead__kicker { display: flex; align-items: center; gap: 10px; margin-block: clamp(28px, 3vw, 48px) var(--sp-2); font-size: .95rem; font-weight: 500; letter-spacing: .03em; color: var(--olive-deep); }
.bhead__title { max-width: 14ch; font-size: var(--fs-h2); font-weight: 200; line-height: 1.04; letter-spacing: -.01em; text-wrap: balance; }
.bhead__lede { max-width: 54ch; margin-block-start: var(--sp-3); font-size: var(--fs-lede); font-weight: 300; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }

.topics { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: var(--sp-5); }
.topic { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .35); font-size: .95rem; transition: border-color .25s, background-color .25s, color .25s; }
.topic:hover { border-color: var(--ink); }
.topic[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.topic__n { font-size: .78rem; color: var(--olive-deep); font-variant-numeric: tabular-nums; }
.topic[aria-current="page"] .topic__n { color: var(--on-dark-soft); }

/* ---------- Post cards ---------- */
.blist { padding-block-end: var(--section); }
.blist__grid {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(36px, 4vw, 64px) clamp(20px, 2.4vw, 36px);
	padding-block-start: clamp(32px, 4vw, 56px);
	border-block-start: 1px solid var(--line);
}
.pcard { position: relative; display: grid; align-content: start; gap: 20px; }
.pcard__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.pcard__media img, .pcard__media .img-ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.pcard:hover .pcard__media img { transform: scale(1.045); }
.pcard__body { display: grid; gap: 10px; }
.pcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .86rem; color: var(--ink-soft); }
.pcard__meta > * + *::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-inline-end: 12px; vertical-align: middle; border-radius: 50%; background: var(--olive); }
.pcard__cat { color: var(--olive-deep); font-weight: 500; }
.pcard__title { font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); font-weight: 400; line-height: 1.28; text-wrap: balance; }
.pcard__title a { background: linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat; transition: background-size .5s var(--ease-out); }
.pcard__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.pcard:hover .pcard__title a { background-size: 100% 1px; }
.pcard__title a:focus-visible { outline: none; }
.pcard:has(.pcard__title a:focus-visible) { outline: 2px solid var(--ink); outline-offset: 6px; }
.pcard__excerpt { font-size: 1rem; line-height: 1.65; color: var(--ink-soft); }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 6px; padding-block-start: 14px; border-block-start: 1px solid var(--line); font-size: .88rem; color: var(--ink-soft); }
.pcard__more { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.pcard__more svg { width: 18px; height: 18px; transition: transform .45s var(--ease-out); }
.pcard:hover .pcard__more svg { transform: translateX(-5px); }

.pcard--featured { grid-column: 1 / -1; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4.5vw, 72px); align-items: center; }
.pcard--featured .pcard__media { aspect-ratio: 16 / 10; }
.pcard--featured .pcard__body { gap: 16px; }
.pcard--featured .pcard__title { font-size: clamp(1.9rem, 1.1rem + 2.4vw, 3.2rem); font-weight: 250; line-height: 1.1; }
.pcard--featured .pcard__excerpt { font-size: 1.1rem; line-height: 1.7; }
.pcard--featured .pcard__foot { margin-block-start: 12px; }

.bempty { display: grid; justify-items: center; gap: 14px; padding: clamp(48px, 8vw, 120px) 20px; text-align: center; border: 1px dashed var(--line); }
.bempty h2 { font-size: var(--fs-h3); font-weight: 400; }
.bempty p { color: var(--ink-soft); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block-start: var(--sp-6); }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 46px; min-height: 46px; padding-inline: 16px; border: 1px solid var(--line); border-radius: 999px; transition: border-color .25s; }
.pager a.page-numbers:hover { border-color: var(--ink); }
.pager .current { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pager .dots { border-color: transparent; }

/* ---------- Single post ---------- */
.read-progress { position: fixed; inset-inline: 0; inset-block-start: var(--admin-bar); z-index: 60; height: 3px; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--olive-deep); transform: scaleX(0); transform-origin: right; will-change: transform; }

.post-hero { padding-block: clamp(36px, 4vw, 64px) clamp(28px, 3vw, 44px); }
.post-hero .wrap > * { max-width: 940px; }
.post-hero__title { margin-block-start: clamp(28px, 4vw, 56px); font-size: clamp(2.2rem, 1.1rem + 3.8vw, 4.6rem); font-weight: 250; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
.post-hero__lede { max-width: 62ch; margin-block-start: var(--sp-3); font-size: var(--fs-lede); font-weight: 300; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }
.post-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-block-start: var(--sp-4); font-size: .92rem; color: var(--ink-soft); }
.post-hero__meta > * + *::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-inline-end: 14px; vertical-align: middle; border-radius: 50%; background: var(--olive); }
.post-hero__by { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }

.post-cover { margin-block-end: clamp(40px, 5vw, 88px); }
.post-cover img, .post-cover .img-ph { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.post-cover figcaption { margin-block-start: 10px; font-size: .88rem; color: var(--ink-soft); }

.post-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; padding-block-end: var(--section); }
.prose { grid-column: 1 / span 8; grid-row: 1; max-width: 720px; }
.post-aside { grid-column: 10 / -1; grid-row: 1; align-self: stretch; }
.post-aside__in { position: sticky; inset-block-start: calc(var(--header-h) + var(--header-drop) + var(--admin-bar) + 28px); }

/* Reading typography */
.prose { font-size: 1.125rem; line-height: 1.9; color: #2B322D; }
.prose > * + * { margin-block-start: 1.15em; }
.prose > :first-child { margin-block-start: 0; }
.prose h2 { margin-block-start: 2.3em; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.15rem); font-weight: 400; line-height: 1.22; color: var(--ink); text-wrap: balance; scroll-margin-top: calc(var(--header-h) + var(--header-drop) + var(--admin-bar) + 24px); }
.prose h3 { margin-block-start: 1.9em; font-size: 1.3rem; font-weight: 500; line-height: 1.4; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-block-start: .6em; }
.prose strong, .prose b { font-weight: 500; color: var(--ink); }
.prose a:not(.btn):not(.topic) { text-decoration: underline; text-decoration-color: var(--olive); text-decoration-thickness: 1px; text-underline-offset: 5px; transition: text-decoration-color .2s; }
.prose a:not(.btn):not(.topic):hover { text-decoration-color: currentColor; }
.prose :is(ul, ol):not([class*="post-"]) { display: grid; gap: .5em; }
.prose ul:not([class*="post-"]):not(.arena-checklist) > li { position: relative; padding-inline-start: 1.5em; }
.prose ul:not([class*="post-"]):not(.arena-checklist) > li::before { content: ""; position: absolute; inset-inline-start: .1em; inset-block-start: .74em; width: .58em; height: .5em; background: var(--olive); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prose ol { counter-reset: arena-li; }
.prose ol > li { position: relative; padding-inline-start: 2.3em; counter-increment: arena-li; }
.prose ol > li::before { content: counter(arena-li, decimal-leading-zero); position: absolute; inset-inline-start: 0; inset-block-start: .12em; font-size: .86em; font-weight: 500; color: var(--olive-deep); font-variant-numeric: tabular-nums; }
.prose blockquote { padding-inline-start: 1.1em; border-inline-start: 2px solid var(--olive); font-size: 1.3rem; font-weight: 300; line-height: 1.6; color: var(--ink); }
.prose blockquote cite { display: block; margin-block-start: .6em; font-size: .9rem; font-style: normal; color: var(--ink-soft); }
.prose figure img { width: 100%; height: auto; }
.prose figcaption { margin-block-start: 8px; font-size: .88rem; color: var(--ink-soft); }
.prose hr { height: 1px; margin-block: 2.6em; border: 0; background: var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.prose th, .prose td { padding: 12px 14px; border-block-end: 1px solid var(--line); text-align: start; vertical-align: top; }
.prose th { background: var(--surface); font-weight: 500; }
.prose .wp-block-table { overflow-x: auto; }

/* Tip box */
.prose .arena-tip { position: relative; margin-block: 2em; padding: 24px 28px; padding-inline-start: 64px; background: var(--surface); line-height: 1.75; }
.prose .arena-tip::before { content: ""; position: absolute; inset-inline-start: 26px; inset-block-start: 31px; width: 18px; height: 16px; background: var(--olive-deep); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prose .arena-tip > * + * { margin-block-start: .6em; }

/* Checklist */
.prose ul.arena-checklist { gap: 0; border-block-start: 1px solid var(--line); }
.prose ul.arena-checklist > li { position: relative; padding-block: 13px; padding-inline-start: 2.3em; border-block-end: 1px solid var(--line); }
.prose ul.arena-checklist > li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 1.05em; width: 1.15em; height: 1.15em; border: 1.5px solid var(--olive-deep); border-radius: 4px; }
.prose ul.arena-checklist > li::after { content: ""; position: absolute; inset-inline-start: .4em; inset-block-start: 1.18em; width: .34em; height: .62em; border: solid var(--olive-deep); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

/* End-of-article call to action */
.prose .post-cta { position: relative; display: grid; gap: 12px; margin-block-start: 3em; padding: clamp(28px, 4vw, 48px); overflow: hidden; background: var(--ink); color: var(--on-dark-soft); }
.post-cta::after { content: ""; position: absolute; inset-inline-end: -36px; inset-block-end: -30px; width: 240px; height: 206px; background: var(--olive); opacity: .14; clip-path: polygon(50% 0, 100% 100%, 0 100%); pointer-events: none; }
.post-cta > * { position: relative; z-index: 1; }
.post-cta__kicker { font-size: .85rem; font-weight: 500; letter-spacing: .06em; color: var(--olive); }
.post-cta__title { max-width: 26ch; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.15rem); font-weight: 300; line-height: 1.2; color: var(--on-dark); }
.post-cta p:not([class]) { max-width: 48ch; font-size: 1.05rem; line-height: 1.65; }
.post-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 8px; }
.btn--ghost-light { --btn-bg: transparent; --btn-fg: var(--on-dark); --btn-bd: rgba(244, 221, 212, .4); }
.btn--ghost-light:hover { --btn-bd: var(--on-dark); }

.post-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-block-start: 2.4em; padding-block-start: 1.4em; border-block-start: 1px solid var(--line); font-size: .95rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--ink-soft); }
.post-share a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none !important; }
.post-share a:hover { color: var(--olive-deep); }
.post-share svg { width: 18px; height: 18px; }

/* Sidebar: table of contents + availability card */
.toc__title { margin-block-end: 12px; font-size: .85rem; font-weight: 500; letter-spacing: .04em; color: var(--olive-deep); }
.toc ol { display: grid; border-inline-start: 1px solid var(--line); }
.toc a { display: block; margin-inline-start: -1px; padding: 7px 16px; border-inline-start: 2px solid transparent; font-size: .93rem; line-height: 1.45; color: var(--ink-soft); transition: color .25s, border-color .25s; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { border-inline-start-color: var(--ink); color: var(--ink); font-weight: 500; }
.aside-cta { display: grid; justify-items: start; gap: 6px; margin-block-start: var(--sp-5); padding: 26px 24px; background: var(--surface); }
.aside-cta__title { font-size: 1.35rem; font-weight: 400; line-height: 1.3; }
.aside-cta p:not([class]) { font-size: .95rem; color: var(--ink-soft); }
.aside-cta .btn { margin-block-start: 10px; }
.aside-cta__wa { display: inline-flex; align-items: center; gap: 8px; margin-block-start: 4px; font-size: .9rem; color: var(--ink-soft); transition: color .2s; }
.aside-cta__wa:hover { color: var(--ink); }
.aside-cta__wa svg { width: 18px; height: 18px; }

.toc--inline { display: none; }

/* Related posts */
.related { padding-block: var(--section); background: var(--surface); }
.related__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-block-end: var(--sp-5); }
.related__title { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3rem); font-weight: 250; line-height: 1.1; }
.related__all { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.related__all svg { width: 18px; height: 18px; transition: transform .45s var(--ease-out); }
.related__all:hover svg { transform: translateX(-5px); }
.related .blist__grid { padding: 0; border: 0; }
.related .pcard__foot { border-color: rgba(33, 40, 35, .12); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.blist__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.prose { grid-column: 1 / span 8; }
	.post-aside { grid-column: 9 / -1; }
}

@media (max-width: 899px) {
	.pcard--featured { grid-template-columns: 1fr; }
	.post-cover { padding-inline: 0; }
	.post-cover img, .post-cover .img-ph { aspect-ratio: 16 / 10; }
	.post-cover figcaption { padding-inline: var(--gutter); }
	.post-body { grid-template-columns: 1fr; gap: var(--sp-4); }
	.prose { grid-column: 1; grid-row: auto; max-width: none; font-size: 1.0625rem; line-height: 1.85; }
	.post-aside { display: none; }
	.toc--inline { display: block; border: 1px solid var(--line); background: rgba(255, 255, 255, .45); }
	.toc--inline summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 20px; font-weight: 500; cursor: pointer; list-style: none; }
	.toc--inline summary::-webkit-details-marker { display: none; }
	.toc--inline summary::after { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-3px); transition: transform .3s var(--ease-out); }
	.toc--inline[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
	.toc__n { margin-inline-start: auto; font-size: .85rem; font-weight: 400; color: var(--ink-soft); }
	.toc--inline ol { display: grid; gap: 2px; padding: 0 20px 16px; counter-reset: toc; }
	.toc--inline li { counter-increment: toc; }
	.toc--inline a { display: flex; gap: 12px; padding-block: 8px; color: var(--ink-soft); line-height: 1.45; }
	.toc--inline a::before { content: counter(toc, decimal-leading-zero); flex: none; font-size: .85rem; color: var(--olive-deep); font-variant-numeric: tabular-nums; }
	.prose .arena-tip { padding: 22px 20px; padding-inline-start: 52px; }
	.prose .arena-tip::before { inset-inline-start: 20px; inset-block-start: 29px; }
	.prose .post-cta { margin-inline: calc(var(--gutter) * -1); }
}

@media (max-width: 599px) {
	.blist__grid { grid-template-columns: 1fr; }
	.bhead__title { max-width: none; }
	.post-hero__meta { font-size: .88rem; }
}

@media print {
	.read-progress, .post-aside, .toc--inline, .post-cta, .post-share, .related, .contact { display: none !important; }
	.blog { padding-block-start: 0; }
	.prose { grid-column: 1 / -1; max-width: none; }
}
