/* ============ Article template ============ */
.read-bar { position: fixed; z-index: 60; top: 0; inset-inline: 0; height: 3px; pointer-events: none; }
.read-bar span { display: block; height: 100%; background: var(--ochre); transform-origin: right; transform: scaleX(0); }

.ar-hero { padding: 140px 0 60px; overflow: clip; border-bottom: 1px solid var(--line); }
.ar-top { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(30px, 6vw, 90px); align-items: end; }
.crumbs { display: flex; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--ochre); text-decoration: none; }
.ar-title { font: 700 clamp(2.3rem, 4.4vw, 4rem)/1.35 var(--display); max-width: 20ch; }
.ar-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.ar-meta span + span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-inline-end: 20px; border-radius: 50%; background: var(--sand); vertical-align: middle; }

/* hero visual: the book from the shelf, now facing you */
.cover { --c: var(--ink); --t: var(--paper); position: relative; justify-self: center; display: grid; justify-items: center; align-content: space-between; gap: 18px; width: 220px; aspect-ratio: 3 / 4.2; padding: 26px 20px 22px; border-radius: 4px 14px 14px 4px; background: var(--c); color: var(--t); text-align: center; box-shadow: inset 12px 0 0 rgba(0, 0, 0, .14), inset 14px 0 0 rgba(255, 255, 255, .12), 0 40px 60px -34px rgba(27, 26, 23, .7); transform-origin: 0% 100%; }
.cover::before, .cover::after { content: ""; position: absolute; inset-inline: 22px 16px; height: 2px; background: currentColor; opacity: .3; }
.cover::before { top: 14px; } .cover::after { bottom: 14px; }
.cover-k { font-size: .78rem; font-weight: 700; opacity: .75; }
.cover .ic { width: 84px; height: 84px; stroke: currentColor; stroke-width: 1.8; }
.cover .ic .d, .cover .ic .f { fill: currentColor; }
.cover-t { font: 700 1.6rem/1.35 var(--display); }
.cover-m { font-size: .8rem; font-weight: 700; opacity: .7; }

/* body + table of contents */
.ar-body { padding: clamp(50px, 7vw, 90px) 0 var(--sec); }
.ar-grid { display: grid; grid-template-columns: minmax(0, 720px) 250px; justify-content: space-between; gap: clamp(30px, 6vw, 90px); align-items: start; }
.toc { padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.toc-t { font: 700 1.15rem var(--display); margin-bottom: 10px; }
.toc ol { display: grid; gap: 2px; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 7px 0; font-size: .88rem; line-height: 1.6; font-weight: 600; color: var(--muted); text-decoration: none; transition: color .3s; }
.toc a::before { content: counter(t, arabic-indic); font: 700 .95rem var(--display); color: var(--sand); transition: color .3s; }
.toc a:hover, .toc a.is-on { color: var(--ink); }
.toc a.is-on::before { color: var(--ochre); }
.toc-bar { height: 3px; margin-top: 14px; border-radius: 2px; background: var(--paper-2); overflow: hidden; }
.toc-bar i { display: block; height: 100%; background: var(--ochre); transform-origin: right; transform: scaleX(0); }

/* the article itself */
.prose { font-size: 1.12rem; line-height: 2; color: #2b2925; min-width: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 700 clamp(1.8rem, 3vw, 2.4rem)/1.45 var(--display); color: var(--ink); margin-top: 2.2em; scroll-margin-top: 100px; }
.prose h3 { font: 700 clamp(1.35rem, 2.2vw, 1.65rem)/1.5 var(--display); color: var(--ink); margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { color: var(--ochre); font-weight: 600; text-underline-offset: 4px; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; right: -1.1em; top: .85em; width: 7px; height: 7px; border-radius: 50%; background: var(--ochre); }
.prose ol { list-style: arabic-indic; }
.prose ol > li::marker { font-family: var(--display); font-weight: 700; color: var(--ochre); }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin: 1.6em 0; padding: 18px 24px; border-inline-start: 4px solid var(--ochre); border-radius: 0 12px 12px 0; background: rgba(181, 72, 42, .07); }
.prose blockquote p { margin: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--paper-2); direction: ltr; unicode-bidi: isolate; }
.tbl { overflow-x: auto; margin: 1.6em 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; line-height: 1.7; }
.prose th { background: var(--ink); color: var(--paper); font-weight: 700; text-align: right; padding: 12px 16px; }
.prose td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.prose tr:nth-child(even) td { background: rgba(235, 226, 204, .35); }
.callout { margin: 1.8em 0; padding: 24px 28px; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line); }
.callout > :first-child { margin-top: 0; }
.quick-answer { padding: 28px 30px; border-radius: 20px; background: var(--ink); color: rgba(243, 236, 220, .85); }
.quick-answer h2 { margin-top: 0; color: var(--paper); font-size: 1.6rem; }
.quick-answer strong { color: #fff; }
.quick-answer a { color: var(--sand); }
.quick-answer blockquote { background: rgba(243, 236, 220, .08); border-color: var(--ochre); }
.quick-answer ul > li::before { background: var(--sand); }

/* after the article */
.ar-more { padding: var(--sec) 0; background: var(--paper-2); border-top: 1px solid var(--line); }
.byline { display: flex; align-items: center; gap: 18px; max-width: 720px; padding: 24px; margin-bottom: clamp(50px, 7vw, 80px); border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.byline img { flex: none; }
.byline b { display: block; font: 700 1.2rem var(--display); }
.byline p { color: var(--muted); }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.more { display: grid; align-content: start; gap: 10px; padding: 30px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .4s, box-shadow .4s; }
.more:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -36px rgba(27, 26, 23, .5); }
.more-k { font-size: .85rem; font-weight: 700; color: var(--ochre); }
.more h3 { font: 700 1.5rem/1.45 var(--display); }
.more p { color: var(--muted); }
.more-m { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .88rem; font-weight: 700; }
.more-m .arrow { width: 18px; height: 18px; stroke-width: 3; }

@media (max-width: 960px) {
	.ar-hero { padding: 120px 0 50px; }
	.ar-top { grid-template-columns: minmax(0, 1fr); }
	.cover { width: 170px; justify-self: start; margin-top: 10px; }
	.cover .ic { width: 60px; height: 60px; }
	.cover-t { font-size: 1.25rem; }
	.ar-grid { grid-template-columns: minmax(0, 1fr); }
	.toc { display: none; }
	.prose { font-size: 1.05rem; }
	.more-grid { grid-template-columns: minmax(0, 1fr); }
}

.js .ar-title, .js .crumbs, .js .ar-meta, .js .cover { visibility: hidden; }

/* The pinned contents scroll on their own if the screen is short. */
.toc { max-height: calc(100svh - 130px); overflow-y: auto; scrollbar-width: thin; }
