/* Zypheral — single article / tutorial / page. */

/* Article head ---------------------------------------------------------------- */
.article-head { padding-top: clamp(24px, 4vw, 48px); }
.container--article-head { max-width: calc(880px + var(--gutter) * 2); }
.article-head__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.article-head__title {
	font-size: clamp(30px, 4.4vw, 48px);
	line-height: 1.1;
	letter-spacing: -0.03em;
	text-wrap: balance;
}
.article-head__dek {
	margin-top: 16px;
	font-size: clamp(17px, 1.6vw, 20px);
	line-height: 1.55;
	color: var(--muted);
	text-wrap: pretty;
}

.article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 32px;
	margin-top: 28px;
	padding-block: 16px;
	border-block: 1px solid var(--line);
}
.article-meta__author { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.article-meta__avatar { border-radius: 50%; }
.article-meta__label {
	display: block;
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted-2);
}
.article-meta__name { font-weight: 600; }
.article-meta__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14.5px;
	color: var(--ink-2);
}
.article-meta__facts .is-updated time { color: var(--link); font-weight: 600; }

.article-hero { max-width: calc(1040px + var(--gutter) * 2); margin-block: clamp(24px, 4vw, 40px) 0; }
.article-hero__img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--radius-lg);
	background: var(--surface-2);
}
.article-hero figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* Three-column layout ------------------------------------------------------------- */
.article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "toc" "main" "aside";
	gap: 32px;
	padding-block: clamp(28px, 4vw, 48px) clamp(40px, 6vw, 72px);
}
.article-layout__toc { grid-area: toc; }
.article-layout__main { grid-area: main; min-width: 0; max-width: 760px; width: 100%; margin-inline: auto; }
.article-layout__aside { grid-area: aside; display: grid; gap: 24px; align-content: start; max-width: 760px; width: 100%; margin-inline: auto; }

@media (min-width: 1100px) {
	.article-layout {
		grid-template-columns: 240px minmax(0, 720px) 240px;
		grid-template-areas: "toc main aside";
		justify-content: space-between;
		gap: 40px;
	}
	.article-layout:not(.has-toc) {
		grid-template-columns: minmax(0, 720px) 240px;
		grid-template-areas: "main aside";
		justify-content: center;
		gap: 64px;
	}
	.article-layout__main { margin: 0; }
	.article-layout__toc,
	.article-layout__aside { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
	.admin-bar .article-layout__toc,
	.admin-bar .article-layout__aside { top: calc(var(--header-h) + 56px); }
}

/* TOC -------------------------------------------------------------------------- */
.toc__details {
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}
.toc__summary {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 16px;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	cursor: pointer;
	list-style: none;
}
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-left: auto;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s var(--ease);
}
.toc__details[open] .toc__summary::after { transform: rotate(-135deg); }
.toc__list { margin: 0; padding: 0 8px 12px; list-style: none; counter-reset: toc; }
.toc__item a {
	display: block;
	padding: 7px 10px 7px 12px;
	border-left: 2px solid transparent;
	border-radius: 0 8px 8px 0;
	color: var(--ink-2);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
}
.toc__item--h3 a { padding-left: 26px; font-size: 13.5px; color: var(--muted); }
.toc__item a:hover { background: var(--surface-2); color: var(--ink); }
.toc__item a.is-active { border-left-color: var(--accent-2); background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }

@media (min-width: 1100px) {
	.toc__details { background: transparent; border: 0; box-shadow: none; }
	.toc__summary { padding: 0 12px; cursor: default; pointer-events: none; }
	.toc__summary::after { display: none; }
	.toc__list { padding: 0; }
}

/* Prose -------------------------------------------------------------------------- */
.prose {
	font-size: 18px;
	line-height: 1.75;
	color: var(--ink-2);
	overflow-wrap: break-word;
}
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; margin-top: 2.2em; letter-spacing: -0.02em; }
.prose h3 { font-size: clamp(20px, 2vw, 23px); line-height: 1.3; margin-top: 1.8em; }
.prose h4 { font-size: 18px; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.75em; }
.prose > :first-child { margin-top: 0; }
.prose a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(10, 122, 75, 0.35); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent-2); }
.prose ol > li::marker { font-family: var(--font-mono); font-size: 0.9em; }
.prose blockquote,
.prose .wp-block-quote {
	margin-inline: 0;
	padding: 4px 0 4px 22px;
	border-left: 3px solid var(--accent);
	font-family: var(--font-display);
	font-size: 1.1em;
	color: var(--ink);
}
.prose blockquote cite { display: block; margin-top: 8px; font-family: var(--font-body); font-size: 14px; font-style: normal; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose img, .prose .wp-block-image img { border-radius: var(--radius-sm); }
.prose figure { margin-inline: 0; }
.prose figcaption, .prose .wp-element-caption { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.prose .alignwide { margin-inline: clamp(-80px, -6vw, 0px); }

.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.prose .wp-block-table { overflow-x: auto; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose thead th { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }

.prose code,
.prose kbd {
	font-family: var(--font-mono);
	font-size: 0.86em;
	padding: 0.15em 0.4em;
	border-radius: 6px;
	background: var(--surface-2);
	border: 1px solid var(--line-soft);
	color: var(--ink);
}
.prose pre,
.prose .wp-block-code {
	position: relative;
	margin-inline: 0;
	padding: 18px 20px;
	overflow-x: auto;
	background: var(--dark-bg);
	color: #E6EDF3;
	border-radius: var(--radius-sm);
	font-family: var(--font-mono);
	font-size: 14.5px;
	line-height: 1.65;
	tab-size: 2;
}
.prose pre code { padding: 0; background: none; border: 0; color: inherit; font-size: inherit; }
.code-wrap { position: relative; }
.code-copy {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--dark-line);
	border-radius: var(--radius-pill);
	background: var(--dark-surface);
	color: var(--dark-muted);
	font-family: var(--font-mono);
	font-size: 12px;
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s var(--ease), color .2s var(--ease);
}
.code-wrap:hover .code-copy,
.code-copy:focus-visible,
.code-copy.is-done { opacity: 1; }
.code-copy:hover { color: #fff; }
.code-copy.is-done { color: var(--accent); }
@media (hover: none) { .code-copy { opacity: 1; } }

/* Tutorial steps: numbered H2s (add class "zy-nostep" to opt a heading out). */
.prose--tutorial { counter-reset: step; }
.prose--tutorial > h2:not(.zy-nostep) { counter-increment: step; display: flex; align-items: baseline; gap: 14px; }
.prose--tutorial > h2:not(.zy-nostep)::before {
	content: counter(step);
	flex-shrink: 0;
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--ink);
	color: var(--accent);
	font-family: var(--font-mono);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0;
	transform: translateY(-3px);
}

/* Callouts (block styles: Tip / Note / Warning / What you'll need) */
.prose .is-style-zy-tip,
.prose .is-style-zy-note,
.prose .is-style-zy-warning,
.prose .is-style-zy-prereq {
	position: relative;
	padding: 18px 20px 18px 22px;
	border: 1px solid var(--line-soft);
	border-left-width: 4px;
	border-radius: var(--radius-sm);
	font-size: 16.5px;
	line-height: 1.65;
}
.prose .is-style-zy-tip,
.prose .is-style-zy-note,
.prose .is-style-zy-warning,
.prose .is-style-zy-prereq { --label-color: var(--muted); }
.prose .is-style-zy-tip { background: var(--accent-soft); border-left-color: var(--accent-2); --label-color: var(--accent-ink); }
.prose .is-style-zy-note { background: var(--info-soft); border-left-color: var(--info); --label-color: var(--info); }
.prose .is-style-zy-warning { background: var(--warn-soft); border-left-color: var(--warn); --label-color: var(--warn); }
.prose .is-style-zy-prereq { background: var(--surface); border-left-color: var(--ink); box-shadow: var(--shadow-sm); }
.prose [class*="is-style-zy-"]:not(.is-style-zy-checklist)::before {
	display: block;
	margin-bottom: 6px;
	font-family: var(--font-mono);
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--label-color);
}
.prose .is-style-zy-tip::before { content: "Tip"; }
.prose .is-style-zy-note::before { content: "Note"; }
.prose .is-style-zy-warning::before { content: "Warning"; }
.prose .is-style-zy-prereq::before { content: "What you’ll need"; }
.prose [class*="is-style-zy-"] > :first-child { margin-top: 0; }
.prose [class*="is-style-zy-"] > * + * { margin-top: 0.75em; }

.prose .is-style-zy-checklist { list-style: none; padding-left: 0; }
.prose .is-style-zy-checklist li { position: relative; padding-left: 30px; }
.prose .is-style-zy-checklist li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.45em;
	width: 16px;
	height: 16px;
	border-radius: 5px;
	background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A3B25' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* After content ------------------------------------------------------------------- */
.page-links { margin-top: 24px; display: flex; gap: 8px; font-family: var(--font-mono); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding: 0; list-style: none; }

.post-nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin-top: 40px;
}
.post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 20px;
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	color: var(--ink);
	text-decoration: none;
	box-shadow: var(--shadow-sm);
}
.post-nav__link:hover { color: var(--ink); border-color: var(--accent-2); }
.post-nav__link--next { text-align: right; }
.post-nav__link--next .post-nav__label { justify-content: flex-end; }
.post-nav__label { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.post-nav__title { font-family: var(--font-display); font-weight: 600; line-height: 1.3; }

.author-box {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	margin-top: 40px;
	padding: clamp(20px, 3vw, 28px);
	background: var(--surface);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}
.author-box__avatar { border-radius: 50%; flex-shrink: 0; }
.author-box .eyebrow { margin-bottom: 4px; }
.author-box__name { font-size: 20px; }
.author-box__bio { margin-top: 8px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.author-box__links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 14.5px; font-weight: 500; }
.author-box__links a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
@media (max-width: 520px) { .author-box { flex-direction: column; } }

/* Aside: share + CTA ----------------------------------------------------------------- */
.share .eyebrow { margin-bottom: 8px; }
.share__list { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.share [data-copy-url].is-done { color: var(--accent-2); border-color: var(--accent-2); }

.cta-card {
	display: grid;
	gap: 10px;
	justify-items: start;
	padding: 22px;
	border-radius: var(--radius);
	background:
		radial-gradient(120% 100% at 100% 0%, rgba(20, 224, 138, 0.22), transparent 60%),
		var(--dark-bg);
	color: var(--dark-muted);
}
.cta-card__mark { height: 32px; width: auto; }
.cta-card__title { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.25; color: #fff; }
.cta-card__text { font-size: 14.5px; line-height: 1.55; }
.cta-card .btn { margin-top: 4px; }

/* Related ---------------------------------------------------------------------- */
.related {
	padding-block: clamp(40px, 6vw, 72px);
	background: var(--surface-2);
	border-top: 1px solid var(--line-soft);
}

/* Comments ------------------------------------------------------------------------- */
.comments { padding-block: 40px 64px; }
.comments__list { margin: 20px 0 32px; padding: 0; list-style: none; }
.comments__list .children { list-style: none; padding-left: clamp(16px, 4vw, 40px); }
.comments__list .comment-body { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.comments__list .avatar { border-radius: 50%; float: left; margin-right: 12px; }
.comment-meta { font-size: 14px; color: var(--muted); }
.comment-meta a { color: inherit; text-decoration: none; }
.comment-content { clear: both; padding-top: 8px; }
.comment-form { display: grid; gap: 14px; margin-top: 16px; }
.comment-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	font-size: 16px;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
