/* ── Single post ── */

.post-single {
	background: var(--color-off-white-100);
	color: var(--color-black);
	padding-bottom: clamp(48px, 6vw, 88px);
}

/* ── Hero ── */

.post-hero {
	padding: clamp(28px, 3.4vw, 48px) 0 clamp(20px, 2.4vw, 32px);
	text-align: center;
}

.post-hero__title {
	margin: 0 auto;
	max-width: 940px;
	font-family: var(--font-base);
	font-size: var(--fs-h2);
	font-weight: var(--fw-medium);
	line-height: var(--lh-h2);
	letter-spacing: var(--ls-h2);
	color: var(--color-black);
}

.post-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px clamp(16px, 1.8vw, 24px);
	margin-top: clamp(16px, 1.8vw, 24px);
}

.post-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: var(--fw-medium);
	line-height: 1.4;
	letter-spacing: -0.14px;
	color: var(--color-gray-500);
}

.post-meta__item svg {
	flex-shrink: 0;
}

.post-meta__author {
	gap: 8px;
	color: var(--color-black);
}

.post-meta__avatar {
	display: block;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--color-gray-100);
}

/* ── Cover ── */

.post-cover {
	margin: 0 0 clamp(28px, 3.4vw, 48px);
	border-radius: 14px;
	overflow: hidden;
	background: var(--color-sky-200);
	aspect-ratio: 1264 / 470;
}

.post-cover__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── Layout ── */

.post-layout {
	display: grid;
	grid-template-columns: 297px minmax(0, 1fr);
	gap: clamp(32px, 5vw, 112px);
	align-items: start;
}

/* ── Sticky table of contents ── */

.post-toc {
	position: sticky;
	top: calc(68px + 24px);
}

.post-toc[hidden] {
	display: none;
}

.post-toc__inner {
	border-radius: 14px;
	border: 1px solid rgba(25, 25, 25, 0.08);
	background: var(--color-white);
	padding: 8px;
	max-height: calc(100vh - 68px - 48px);
	overflow-y: auto;
	scrollbar-width: none;
}

.post-toc__inner::-webkit-scrollbar {
	display: none;
}

.post-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.post-toc__item--h3 .post-toc__link { padding-left: 28px; }
.post-toc__item--h4 .post-toc__link { padding-left: 40px; }

.post-toc__link {
	position: relative;
	display: block;
	padding: 14px 34px 14px 16px;
	border-radius: 6px;
	border: 1px solid transparent;
	font-size: 16px;
	font-weight: var(--fw-medium);
	line-height: 1.4;
	letter-spacing: -0.08px;
	color: rgba(8, 8, 2, 0.45);
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.post-toc__link::after {
	content: '';
	position: absolute;
	right: 16px;
	top: 50%;
	width: 6px;
	height: 6px;
	margin-top: -3px;
	border-radius: 50%;
	background: var(--color-black);
	opacity: 0;
	transform: scale(0.4);
	transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-toc__link:hover {
	color: var(--color-black);
	background: var(--color-off-white-100);
}

.post-toc__link.is-active {
	border-color: rgba(25, 25, 25, 0.08);
	background: var(--color-off-white-100);
	color: var(--color-black);
}

.post-toc__link.is-active::after {
	opacity: 1;
	transform: scale(1);
}

/* ── Body typography ── */

.post-body {
	min-width: 0;
}

.post-editor > *:first-child { margin-top: 0; }
.post-editor > *:last-child  { margin-bottom: 0; }

.post-editor h2,
.post-editor h3,
.post-editor h4 {
	color: var(--color-black);
	font-weight: var(--fw-medium);
	scroll-margin-top: calc(68px + 24px);
}

.post-editor h2 {
	margin: clamp(32px, 3.4vw, 48px) 0 clamp(16px, 1.6vw, 22px);
	padding-top: clamp(28px, 3vw, 40px);
	border-top: 1px solid rgba(25, 25, 25, 0.08);
	font-size: var(--fs-h4);
	line-height: var(--lh-h4);
	letter-spacing: var(--ls-h4);
}

.post-editor h3 {
	margin: clamp(28px, 3vw, 40px) 0 clamp(14px, 1.4vw, 18px);
	font-size: var(--fs-h5);
	line-height: var(--lh-h5);
	letter-spacing: var(--ls-h5);
}

.post-editor h4 {
	margin: clamp(24px, 2.4vw, 32px) 0 12px;
	font-size: var(--fs-body-m);
	line-height: 1.3;
	letter-spacing: -0.2px;
}

/* The first heading of the article needs no separator above it. */
.post-body > .post-editor:first-child > h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.post-editor p {
	margin: 0 0 clamp(14px, 1.4vw, 18px);
	font-size: var(--fs-body-s);
	font-weight: var(--fw-medium);
	line-height: 1.55;
	color: rgba(25, 25, 25, 0.8);
}

.post-editor strong,
.post-editor b {
	font-weight: var(--fw-semibold);
	color: var(--color-black);
}

.post-editor a {
	color: var(--color-black);
	text-decoration: underline;
	text-decoration-color: rgba(25, 25, 25, 0.28);
	text-underline-offset: 3px;
	transition: text-decoration-color 0.25s ease;
}

.post-editor a:hover {
	text-decoration-color: var(--color-black);
}

.post-editor hr {
	height: 0;
	border: 0;
	border-top: 1px solid rgba(25, 25, 25, 0.08);
	margin: clamp(28px, 3vw, 40px) 0;
}

/* Lists */

.post-editor ul {
	list-style: none;
	margin: 0 0 clamp(16px, 1.6vw, 20px);
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.post-editor ul li {
	position: relative;
	padding-left: 18px;
	font-size: var(--fs-body-s);
	font-weight: var(--fw-medium);
	line-height: 1.55;
	color: rgba(25, 25, 25, 0.8);
}

.post-editor ul li::before {
	content: '';
	position: absolute;
	left: 2px;
	top: 0.62em;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--color-gold);
}

.post-editor ol {
	list-style: none;
	counter-reset: post-ol;
	margin: 0 0 clamp(16px, 1.6vw, 20px);
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.post-editor ol li {
	position: relative;
	counter-increment: post-ol;
	padding-left: 28px;
	font-size: var(--fs-body-s);
	font-weight: var(--fw-medium);
	line-height: 1.55;
	color: rgba(25, 25, 25, 0.8);
}

.post-editor ol li::before {
	content: counter(post-ol) '.';
	position: absolute;
	left: 2px;
	top: 0;
	color: var(--color-black);
	font-variant-numeric: tabular-nums;
}

.post-editor li > ul,
.post-editor li > ol {
	margin: 10px 0 0;
}

/* ── Image block ── */

.post-figure {
	margin: clamp(24px, 2.6vw, 32px) 0;
}

.post-figure__media {
	border-radius: 14px;
	overflow: hidden;
	background: var(--color-off-white-200);
}

.post-figure__img {
	display: block;
	width: 100%;
	height: auto;
}

.post-figure__caption {
	margin-top: 14px;
	font-size: var(--fs-body-xs);
	font-weight: var(--fw-medium);
	line-height: 1.5;
	color: var(--color-gray-500);
}

/* ── Quote block ── */

.post-quote {
	margin: clamp(28px, 3vw, 40px) 0;
	padding: clamp(22px, 2.4vw, 32px);
	border-radius: 14px;
	border: 1px solid rgba(25, 25, 25, 0.06);
	background: var(--color-off-white-200);
}

.post-quote__mark {
	display: block;
	margin-bottom: clamp(14px, 1.6vw, 20px);
	color: var(--color-green);
	line-height: 0;
}

.post-quote__text {
	margin: 0;
	font-size: var(--fs-body-m);
	font-weight: var(--fw-medium);
	line-height: 1.45;
	letter-spacing: -0.2px;
	color: var(--color-black);
}

.post-quote__author {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: clamp(16px, 1.8vw, 22px);
}

.post-quote__name {
	font-size: var(--fs-body-xs);
	font-weight: var(--fw-medium);
	line-height: 1.4;
	color: var(--color-black);
}

.post-quote__position {
	font-size: 14px;
	font-weight: var(--fw-medium);
	line-height: 1.4;
	color: var(--color-gray-500);
}

/* ── CTA block ── */

.post-cta {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: clamp(28px, 3vw, 40px) 0;
	padding: clamp(16px, 1.6vw, 20px);
	border-radius: 14px;
	background: var(--color-gold);
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(16px, 2vw, 32px);
}

.post-cta--green { background: var(--color-green); }
.post-cta--sky   { background: var(--color-sky); }
.post-cta--black { background: var(--color-black); }

.post-cta::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: url(../img/Line-pattern.svg) right center / auto 160% no-repeat;
	opacity: 0.45;
	pointer-events: none;
}

.post-cta__body {
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.14);
	padding: clamp(18px, 1.8vw, 24px);
}

.post-cta__title {
	margin: 0;
	max-width: 18ch;
	font-size: var(--fs-body-m);
	font-weight: var(--fw-semibold);
	line-height: 1.25;
	letter-spacing: -0.2px;
	color: var(--color-black);
}

.post-cta--green .post-cta__title,
.post-cta--black .post-cta__title,
.post-cta--green .post-cta__text,
.post-cta--black .post-cta__text {
	color: var(--color-white);
}

.post-cta__text {
	margin: 12px 0 0;
	max-width: 44ch;
	font-size: var(--fs-body-xxs);
	font-weight: var(--fw-medium);
	line-height: 1.45;
	color: rgba(25, 25, 25, 0.72);
}

.post-cta__mail {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: clamp(16px, 1.8vw, 22px);
	padding: 10px 16px 10px 12px;
	border-radius: 8px;
	background: var(--color-white);
	text-decoration: none;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.post-cta__mail:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px -14px rgba(26, 26, 18, 0.5);
}

.post-cta__mail-icon {
	display: inline-flex;
	color: var(--color-gray-500);
	line-height: 0;
}

.post-cta__mail-body {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.post-cta__mail-label {
	font-size: 12px;
	font-weight: var(--fw-medium);
	line-height: 1.3;
	color: var(--color-gray-500);
}

.post-cta__mail-value {
	font-size: 14px;
	font-weight: var(--fw-medium);
	line-height: 1.3;
	color: var(--color-black);
}

.post-cta__media {
	display: grid;
	place-items: center;
	width: clamp(76px, 8vw, 104px);
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--color-white);
	overflow: hidden;
}

.post-cta__img {
	display: block;
	width: 62%;
	height: 62%;
	object-fit: contain;
}

/* ── Share ── */

.post-share {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: clamp(20px, 2.2vw, 28px);
	padding: clamp(14px, 1.4vw, 18px) clamp(18px, 1.8vw, 24px);
	border-radius: 14px;
	border: 1.5px solid var(--color-gold);
	background: var(--color-white);
}

.post-share__title {
	margin: 0;
	font-size: var(--fs-body-m);
	font-weight: var(--fw-medium);
	line-height: 1.3;
	letter-spacing: -0.2px;
	color: var(--color-black);
}

.post-share__list {
	display: flex;
	align-items: center;
	gap: 8px;
}

.post-share__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(25, 25, 25, 0.08);
	background: var(--color-off-white-100);
	color: var(--color-black);
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-share__btn:hover {
	background: var(--color-white);
	border-color: var(--color-black);
	transform: translateY(-2px);
}

.post-share__btn svg {
	pointer-events: none;
}

/* Copied tooltip */

.post-share__tip {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--color-black);
	color: var(--color-white);
	font-size: 12px;
	font-weight: var(--fw-medium);
	line-height: 16px;
	letter-spacing: -0.12px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 6px);
	transition:
		opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 0.25s;
}

.post-share__tip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -4px;
	border: 4px solid transparent;
	border-top-color: var(--color-black);
}

.post-share__btn.is-copied .post-share__tip {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	transition:
		opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 0s;
}

/* ── Responsive ── */

@media (max-width: 1100px) {
	.post-layout {
		grid-template-columns: 240px minmax(0, 1fr);
		gap: 40px;
	}

	.post-toc__link {
		font-size: 15px;
		padding: 11px 30px 11px 14px;
	}
}

@media (max-width: 900px) {
	.post-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.post-toc {
		position: relative;
		top: 0;
	}

	.post-toc__inner {
		max-height: none;
	}

	.post-cover {
		aspect-ratio: 16 / 10;
	}
}

@media (max-width: 640px) {
	.post-cta {
		grid-template-columns: minmax(0, 1fr);
		justify-items: start;
	}

	.post-cta::before {
		background-position: right top;
	}

	.post-share {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}
}
