/* Blog article pages – builds on the tokens in site.css */

body.blog { font-size: 17px; line-height: 1.7; }

/*---------------------------------- Top bar ----------------------------------*/
.site-bar {
	position: sticky; top: 0; z-index: 10;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--line);
}
.site-bar::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--navy) 0 62%, var(--orange) 62% 100%); }
.site-bar-inner {
	max-width: 1140px; margin: 0 auto; padding: 14px 24px;
	display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.site-bar .brand-logo img { height: 30px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
	padding: 8px 12px; border-radius: 999px;
	font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	color: var(--muted); text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--heading); }
.site-nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--orange); border-radius: 0; }
.site-nav .nav-cta { background: var(--navy); color: #fff; margin-left: 6px; }
.site-nav .nav-cta:hover { background: var(--navy-soft); color: #fff; }

/*---------------------------------- Article ----------------------------------*/
.post-wrap { max-width: 860px; margin: 0 auto; padding: 40px 24px 24px; }
.post {
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 52px 64px 56px;
}
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--orange-ink); }
.post h1 { font-size: clamp(32px, 4.4vw, 46px); line-height: 1.1; margin-bottom: 22px; }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 13.5px; line-height: 1.4; color: var(--muted); margin-bottom: 28px; }
.post-meta img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; }
.post-meta strong { color: var(--ink); font-weight: 600; }
.post .lead { font-size: 20px; line-height: 1.6; max-width: none; color: var(--ink); }

.diagram { margin: 36px -28px; }
.diagram img {
	width: 100%; height: auto; border-radius: 16px;
	border: 1px solid var(--line);
	box-shadow: 0 10px 30px -16px rgba(8, 30, 52, .25);
}
.diagram figcaption { margin: 12px 28px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

.prose h2, .takeaways h2, .faq h2, .related h2 { font-size: clamp(24px, 3vw, 29px); line-height: 1.2; }
.prose h2 { margin: 44px 0 14px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 0; }
.prose ul > li, .prose ol > li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.prose ul > li::before {
	content: ""; position: absolute; left: 8px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--orange);
}
.prose ol { counter-reset: step; list-style: none; }
.prose ol > li { counter-increment: step; padding-left: 40px; }
.prose ol > li::before {
	content: counter(step); position: absolute; left: 0; top: .15em;
	display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
	background: color-mix(in srgb, var(--navy) 10%, transparent); color: var(--heading);
	font-size: 13px; font-weight: 700;
}
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { color: var(--heading); text-decoration-color: color-mix(in srgb, var(--orange) 70%, transparent); text-decoration-thickness: 2px; }
.prose a:hover { color: var(--orange-ink); }
.formula {
	font-family: var(--serif); font-size: 19px; color: var(--heading);
	background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--orange);
	border-radius: 12px; padding: 16px 20px;
}
.formula span { font-weight: 600; }

.table-wrap { overflow-x: auto; margin: 4px 0 26px; border: 1px solid var(--line); border-radius: 14px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; min-width: 520px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap thead th { background: var(--surface-2); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table-wrap thead th:last-child { color: var(--heading); }
.table-wrap tbody td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.table-wrap tbody td:last-child { color: var(--heading); font-weight: 500; }
.table-wrap tr:last-child td { border-bottom: 0; }

.takeaways {
	margin: 44px 0 0; padding: 26px 30px;
	background: color-mix(in srgb, var(--navy) 6%, var(--surface));
	border: 1px solid color-mix(in srgb, var(--navy) 14%, transparent);
	border-radius: 16px;
}
.takeaways h2 { font-size: 22px; margin-bottom: 12px; }
.takeaways li { position: relative; padding-left: 30px; margin-top: 8px; }
.takeaways li::before {
	content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%;
	background: color-mix(in srgb, var(--orange) 20%, transparent)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5.5 10.5 3 3 6-7' fill='none' stroke='%23A65D00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.faq { margin-top: 44px; }
.faq h2 { margin-bottom: 12px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
	cursor: pointer; list-style: none;
	display: flex; justify-content: space-between; gap: 16px;
	padding: 16px 0; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--orange-ink); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); }

.author-cta {
	display: flex; gap: 22px; align-items: flex-start;
	margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line);
}
.author-cta img { flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; }
.author-cta .ac-name { font-family: var(--serif); font-size: 21px; color: var(--heading); font-weight: 600; margin-bottom: 4px; }
.author-cta p { font-size: 15px; color: var(--muted); margin-bottom: 16px; }

/*---------------------------------- Related ----------------------------------*/
.related { margin: 48px 0 0; }
.related h2 { margin: 0 0 18px 4px; }
.related ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related a {
	display: flex; flex-direction: column; height: 100%;
	background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
	text-decoration: none; color: inherit;
	transition: transform .25s, box-shadow .25s, border-color .25s;
}
.related a:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -18px rgba(8, 30, 52, .3); border-color: color-mix(in srgb, var(--orange) 35%, var(--line)); }
.related img { width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.rel-cat { padding: 14px 16px 0; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange-ink); }
.rel-title { padding: 6px 16px 18px; font-family: var(--serif); font-size: 17px; line-height: 1.3; color: var(--heading); font-weight: 500; }

.site-foot { text-align: center; padding: 40px 24px 48px; font-size: 13px; color: var(--muted); }

/*---------------------------------- Blog index ----------------------------------*/
.blog-index { max-width: 1040px; }
.index-head { padding: 44px 56px 46px; }
.index-head h1 { margin-bottom: 16px; }
.index-head .lead { font-size: 18px; color: var(--muted); max-width: 62ch; }
.post-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 28px; }
.post-list > li.featured { grid-column: 1 / -1; }
.post-list a {
	display: flex; flex-direction: column; height: 100%;
	background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
	text-decoration: none; color: inherit;
	transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post-list a:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -18px rgba(8, 30, 52, .3); border-color: color-mix(in srgb, var(--orange) 35%, var(--line)); }
.post-list img { width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.post-list .featured a { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto 1fr; align-content: center; column-gap: 8px; }
.post-list .featured img { grid-row: 1 / span 3; align-self: center; border-bottom: 0; }
.post-list .featured .rel-cat { padding-top: 28px; }
.post-list .featured .rel-title { font-size: 24px; }
.rel-excerpt { padding: 0 16px 20px; font-size: 15px; line-height: 1.55; color: var(--muted); }

/*---------------------------------- Responsive ----------------------------------*/
@media (max-width: 760px) {
	body.blog { font-size: 16.5px; }
	.site-bar .brand-text { display: none; }
	.site-bar .brand-logo { display: grid; }
	.site-bar-inner { padding: 10px 16px; }
	.site-nav a:first-child { display: none; }
	.related img { display: none; }
	.site-nav a { padding: 8px 9px; font-size: 12px; letter-spacing: .05em; }
	.post-wrap { padding: 0 0 16px; }
	.post { border-radius: 0; box-shadow: none; padding: 32px 22px 40px; }
	.post .lead { font-size: 18px; }
	.diagram { margin: 28px -10px; }
	.diagram img { border-radius: 10px; }
	.diagram figcaption { margin: 10px 10px 0; }
	.related { padding: 0 16px; }
	.related ul { grid-template-columns: 1fr; }
	.author-cta { flex-direction: column; gap: 14px; }
	.index-head { padding: 28px 22px 32px; }
	.index-head .lead { font-size: 16.5px; }
	.post-list { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; padding: 0 16px; }
	.post-list .featured a { display: flex; }
	.post-list .featured img { height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
	.post-list .featured .rel-cat { padding-top: 14px; }
	.post-list .featured .rel-title { font-size: 19px; }
}
