/* ==========================================================================
   Single post — two-column layout: TOC sidebar + article content
   Figma: node 52341:13980
   ========================================================================== */

/* ── Page wrapper ── */

.post-layout {
	display: grid;
	grid-template-columns: 349px 1fr;
	column-gap: 64px;
	align-items: start;
	padding-top: 48px;
	padding-bottom: 96px;
}

/* ==========================================================================
   TOC sidebar
   ========================================================================== */

.post-toc {
	position: sticky;
	top: calc(var(--hdr-height) + 24px);
	max-height: calc(100vh - var(--hdr-height) - 48px);
	overflow-y: auto;
	scrollbar-width: none;
}

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

.toc {
	border-left: 1px solid rgba(80, 88, 105, 0.2);
	padding-right: 32px;
}

.toc__title {
	font-family: var(--font-figtree);
	font-size: 11px;
	font-weight: 600;
	color: #848c97;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0 0 12px;
	padding-left: 16px;
}

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

.toc__item {
	margin: 0;
}

.toc__link {
	display: flex;
	align-items: stretch;
	gap: 16px;
	text-decoration: none;
	color: #505869;
	font-family: var(--font-figtree);
	font-size: 14px;
	font-weight: 400;
	line-height: 21px;
	transition: color 0.2s;
	margin-left: -1px; /* align indicator with container border */
}

.toc__link:hover {
	color: var(--nav-dark);
}

.toc__indicator {
	flex-shrink: 0;
	width: 1px;
	align-self: stretch;
	background: transparent;
	min-height: 21px;
	transition: background 0.2s;
}

.toc__text {
	flex: 1;
	min-width: 0;
}

.toc__link.is-active {
	color: var(--nav-dark);
	font-weight: 500;
}

.toc__link.is-active .toc__indicator {
	background: #505869;
}


/* ==========================================================================
   Article structure
   ========================================================================== */

.entry-footer {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--color-border-light);
}

.entry-tags {
	font-family: var(--font-figtree);
	font-size: 14px;
	color: #848c97;
	margin: 0;
}

.entry-tags a {
	color: #848c97;
	text-decoration: none;
}

.entry-tags a:hover {
	color: var(--nav-dark);
}

/* ==========================================================================
   Content typography — scoped to .entry-content
   ========================================================================== */

/* Grid items must have min-width: 0 to prevent content from expanding the grid track */
.post-layout > * {
	min-width: 0;
}

.entry-content {
	min-width: 0;
}

/* Headings — scroll offset for sticky header */
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5 {
	scroll-margin-top: calc(var(--hdr-height) + 16px);
}

.entry-content h2 {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 700;
	color: var(--nav-dark);
	line-height: 28px;
	letter-spacing: 0;
	margin: 48px 0 24px;
}

.entry-content h3,
.entry-content h3 p {
	font-family: var(--font-figtree);
	font-size: 20px;
	font-weight: 700;
	color: var(--nav-dark);
	line-height: 28px;
	letter-spacing: 0;
	margin: 40px 0 20px;
}

.entry-content h4,
.entry-content h4 p {
	font-family: var(--font-figtree);
	font-size: 18px;
	font-weight: 600;
	color: var(--nav-dark);
	line-height: 26px;
	margin: 32px 0 16px;
}

.entry-content h5,
.entry-content h6,
.entry-content h5 p,
.entry-content h6 p {
	font-family: var(--font-figtree);
	font-size: 16px;
	font-weight: 600;
	color: var(--nav-dark);
	line-height: 24px;
	margin: 24px 0 12px;
}

/* Paragraphs */
.entry-content p {
	font-family: var(--font-figtree);
	font-size: 17px;
	font-weight: 400;
	color: var(--nav-dark);
	line-height: 26px;
	margin: 0 0 24px;
}

.entry-content p:last-child {
	margin-bottom: 0;
}

/* Lists */
.entry-content ul,
.entry-content ol {
	font-family: var(--font-figtree);
	font-size: 17px;
	font-weight: 400;
	color: var(--nav-dark);
	line-height: 26px;
	padding-left: 25.5px;
	margin: 0 0 24px;
}

.entry-content li {
	margin-bottom: 6px;
}

.entry-content li:last-child {
	margin-bottom: 0;
}

/* Links */
.entry-content a {
	color: var(--nav-blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color 0.15s;
}

.entry-content a:hover {
	color: var(--nav-blue-hover);
}

/* ==========================================================================
   Key takeaways box
   Gutenberg group block: add class "key-takeaways" in editor
   ========================================================================== */

.entry-content .key-takeaways,
.entry-content .wp-block-group.is-style-key-takeaways {
	background: rgba(234, 236, 238, 0.25);
	padding: 32px;
	border-radius: 6px;
	margin-bottom: 32px;
}

.entry-content .key-takeaways h2,
.entry-content .wp-block-group.is-style-key-takeaways h2 {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 700;
	color: #848c97;
	line-height: 28px;
	margin-top: 0;
	margin-bottom: 24px;
}

.entry-content .key-takeaways ul,
.entry-content .wp-block-group.is-style-key-takeaways ul {
	margin-bottom: 0;
}

/* ==========================================================================
   Blockquote
   ========================================================================== */

.entry-content blockquote {
	margin: 48px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
	border: none;
	font-style: normal;
}

.entry-content blockquote::before {
	content: '';
	display: block;
	width: 64px;
	height: 48px;
	flex-shrink: 0;
	background-image: url('../images/quote.svg');
	background-size: contain;
	background-repeat: no-repeat;
}

.entry-content blockquote p {
	font-family: var(--font-figtree);
	font-size: 17px;
	font-weight: 500;
	color: var(--nav-dark);
	line-height: 26px;
	margin: 0;
}

/* ==========================================================================
   Images & media
   ========================================================================== */

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.entry-content figure {
	margin: 32px 0;
}

.entry-content figcaption {
	font-family: var(--font-figtree);
	font-size: 13px;
	color: #848c97;
	line-height: 18px;
	margin-top: 8px;
	text-align: center;
}

/* Video embeds */
.entry-content .wp-block-embed__wrapper {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: 8px;
}

.entry-content .wp-block-embed__wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* ==========================================================================
   Code
   ========================================================================== */

.entry-content code {
	font-size: 15px;
	font-family: 'Menlo', 'Consolas', monospace;
	background: rgba(234, 236, 238, 0.6);
	color: #c04e3f;
	padding: 2px 6px;
	border-radius: 4px;
}

.entry-content pre {
	background: var(--nav-dark);
	padding: 24px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 32px 0;
}

.entry-content pre code {
	background: none;
	padding: 0;
	color: #eaecee;
	font-size: 14px;
}

/* ==========================================================================
   Tables — Figma node 52349:5809
   ========================================================================== */

.wp-block-table thead {
    border-bottom: none;
}
/* Figure: outer border + radius + scroll
   overflow-x on the element itself — scrollbar is not clipped by the parent */
.entry-content .wp-block-table,
.entry-content figure.wp-block-table {
	margin: 32px 0;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow-x: scroll;
	-webkit-overflow-scrolling: touch;
	/* scrollbar-width: thin; */
	scrollbar-color: #cbd5e1 #f1f5f9;
}

.entry-content .wp-block-table::-webkit-scrollbar,
.entry-content figure.wp-block-table::-webkit-scrollbar {
	height: 6px;
}

.entry-content .wp-block-table::-webkit-scrollbar-track,
.entry-content figure.wp-block-table::-webkit-scrollbar-track {
	background: #f1f5f9;
}

.entry-content .wp-block-table::-webkit-scrollbar-thumb,
.entry-content figure.wp-block-table::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.entry-content .wp-block-table table,
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--font-figtree);
	font-size: 14px;
	color: #334155;
	border: none;
	display: block;
}

/* Raw <table> without .wp-block-table wrapper (e.g. from parser) */
.entry-content table:not(.wp-block-table table) {
	margin: 32px 0;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-color: #cbd5e1 #f1f5f9;
}
.entry-content table:not(.wp-block-table table)::-webkit-scrollbar {
	height: 6px;
}
.entry-content table:not(.wp-block-table table)::-webkit-scrollbar-track {
	background: #f1f5f9;
}
.entry-content table:not(.wp-block-table table)::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

/* Reset WP default cell borders */
.entry-content td,
.entry-content th {
	border: none;
	min-width: 150px;
	width: 1%;
}

/* Header row */
.entry-content thead tr {
	background: #ffffff;
}

.entry-content th {
	font-size: 14px;
	font-weight: 600;
	color: #334155;
	text-align: left;
	padding: 11.5px 16px;
	border-bottom: 1px solid #e2e8f0;
	line-height: 17px;
}

/* Body rows */
.entry-content td {
	padding: 14px 16px;
	border-bottom: 1px solid #e2e8f0;
	vertical-align: middle;
	line-height: 17px;
	color: #334155;
}

.entry-content tbody tr:last-child td {
	border-bottom: none;
}

.entry-content tbody tr:hover {
	background: rgba(226, 232, 240, 0.2);
}

/* ==========================================================================
   Summarize with AI — Figma node 52354:12783
   ========================================================================== */

.summarize-ai {
	position: relative;
	display: flex;
	align-items: center;
	gap: 32px;
	padding: 16px 0;
	margin-top: 72px;
}

.summarize-ai__label {
	font-family: var(--font-heading);
	font-size: 17px;
	font-weight: 500;
	color: var(--nav-dark);
	white-space: nowrap;
}

.summarize-ai__buttons {
	display: flex;
	gap: 8px;
}

.summarize-ai__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: #f1f5f9;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s;
	padding: 0;
	flex-shrink: 0;
}

.summarize-ai__btn:hover {
	background: #e2e8f0;
}

.summarize-ai__btn img {
	width: 16px;
	height: 16px;
	display: block;
	border-radius: 0;
	margin: 0;
}

.summarize-ai__toast {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 0;
	background: var(--nav-dark);
	color: #fff;
	font-family: var(--font-figtree);
	font-size: 13px;
	padding: 6px 12px;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	animation: toast-in 0.15s ease;
}

@keyframes toast-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Horizontal rule
   ========================================================================== */

.entry-content hr {
	border: none;
	border-top: 1px solid var(--color-border-light);
	margin: 48px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
	.post-layout {
		grid-template-columns: 260px 1fr;
		column-gap: 40px;
	}
}

@media (max-width: 900px) {
	.post-layout {
		grid-template-columns: 1fr;
		padding-top: 32px;
		padding-bottom: 64px;
	}

	.post-toc {
		position: static;
		max-height: none;
		overflow-y: visible;
		order: 1; /* below content on mobile */
	}

	/* hide TOC on mobile by default — JS can toggle */
	.post-toc {
		display: none;
	}

	.entry-content h2,
	.entry-content h2 p {
		font-size: 22px;
		margin-top: 40px;
	}

	.entry-content h3,
	.entry-content h3 p {
		font-size: 18px;
	}

	.summarize-ai {
		margin-top: 48px;
	}

}

@media(max-width: 576px) {
	.summarize-ai {
		flex-direction: column;
		gap: 24px;
		padding: 0;
	}
}


