/* Blog: post cards, single post, and styles for post content blocks.
   Uses the design tokens from styles.css (--ink, --gold, --line, --soft, --muted, --accent, --wash). */

/* ---------- Card grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-grid > * { min-width: 0; }

.post-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--paper);
	overflow: hidden;
	transition: background .18s, border-color .18s, box-shadow .18s;
}
.post-card:hover { background: var(--wash); border-color: var(--accent); box-shadow: 0 8px 25px #172d4710; }

.post-card-media {
	aspect-ratio: 16 / 10;
	background: var(--ink-2);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.post-card:hover .post-card-media img { transform: scale(1.03); }
.post-card-media .icon-tile { background: #ffffff12; color: var(--gold-light); }

.post-card-body { display: flex; flex: 1; flex-direction: column; padding: 26px; }
.post-card-body h3 { margin: 0 0 12px; font-size: 1.4rem; }
.post-card-body p { color: var(--muted); font-size: .96875rem; }
.post-card-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-top: auto;
	padding-top: 22px;
	font-size: .8125rem;
	color: var(--muted);
}
.post-card-body p + .post-card-meta { margin-top: auto; }

.post-empty { color: var(--muted); font-size: 1.0625rem; }

/* ---------- Pagination ---------- */
.post-pagination { margin-top: 52px; }
.post-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.post-pagination a,
.post-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: 7px;
	font-size: .875rem;
	font-weight: 650;
}
.post-pagination a:hover { border-color: var(--accent); background: var(--wash); }
.post-pagination .current { background: var(--ink); border-color: var(--ink); color: #fff; }
.post-pagination .dots { border-color: transparent; }

/* ---------- Single post ---------- */
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; color: #afbed2; font-size: .875rem; }
.page-hero h1 + .post-meta { margin-top: 23px; }

/* Article column aligned with the title, sidebar on the right */
.post-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 72px; align-items: start; }
.post-main { min-width: 0; max-width: 860px; }
.post-sidebar { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 22px; }
.sidebar-card { padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.sidebar-card h2 { margin: 0 0 16px; font-size: 1.25rem; letter-spacing: -.02em; }
.sidebar-cta { background: var(--ink); border-color: var(--ink); color: #fff; }
.sidebar-cta h2 { font-size: 1.5rem; }
.sidebar-cta p { margin: 0 0 22px; color: #c4d1e2; font-size: .96875rem; }
.sidebar-cta .button { width: 100%; }
.sidebar-contact { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 0; padding: 20px 0 0; border-top: 1px solid #ffffff24; list-style: none; font-size: .9375rem; }
.sidebar-contact a { color: var(--gold-light); overflow-wrap: anywhere; }
.sidebar-contact a:hover { color: #fff; text-decoration: underline; }
.sidebar-links, .sidebar-latest { margin: 0; padding: 0; list-style: none; }
.sidebar-links li + li, .sidebar-latest li + li { border-top: 1px solid var(--line); }
.sidebar-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: .96875rem; font-weight: 550; }
.sidebar-links a::after { content: "→"; color: var(--accent); transition: transform .18s; }
.sidebar-links a:hover { color: var(--accent); }
.sidebar-links a:hover::after { transform: translateX(3px); }
.sidebar-latest a { display: block; padding: 12px 0; }
.sidebar-latest strong { display: block; font-size: .96875rem; font-weight: 550; line-height: 1.4; }
.sidebar-latest time { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.sidebar-latest a:hover strong { color: var(--accent); }

.post-layout { max-width: 860px; }
.shell.post-layout { width: min(calc(100% - 40px), 860px); }
.post-featured { margin: 0 0 48px; border-radius: 14px; overflow: hidden; background: var(--ink); }
.post-featured img { width: 100%; height: auto; display: block; }

/* Table of contents */
.post-toc { margin: 0 0 40px; padding: 26px 28px; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 12px; background: var(--soft); }
.post-toc h2 { margin: 0 0 14px; font-size: 1.25rem; letter-spacing: -.02em; }
.post-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.post-toc ol ol { margin: 6px 0 4px 22px; counter-reset: toc-sub; }
.post-toc li { counter-increment: toc; }
.post-toc ol ol li { counter-increment: toc-sub; }
.post-toc li + li { margin-top: 8px; }
.post-toc a { display: inline-flex; gap: 10px; font-size: 1rem; font-weight: 550; line-height: 1.45; color: var(--ink); }
.post-toc a::before { content: counter(toc) "."; min-width: 1.5em; color: var(--accent); font-weight: 700; }
.post-toc ol ol a { font-weight: 450; font-size: .96875rem; }
.post-toc ol ol a::before { content: counter(toc) "." counter(toc-sub); min-width: 2.2em; }
.post-toc a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.post-content { color: #2b3b52; font-size: 1.125rem; line-height: 1.8; overflow-wrap: anywhere; }
.post-content > * + * { margin-top: 1.5em; }
.post-content > :first-child { margin-top: 0; }
.post-content h2 { margin-top: 2.2em; font-size: clamp(1.7rem, 2.4vw, 2.2rem); color: var(--ink); }
.post-content h3 { margin-top: 1.9em; font-size: 1.45rem; color: var(--ink); }
.post-content h4 { margin-top: 1.7em; font-size: 1.2rem; font-weight: 650; color: var(--ink); }
.post-content h5, .post-content h6 { margin-top: 1.6em; font-size: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.post-content :is(h2, h3, h4, h5, h6) + * { margin-top: .8em; }
.post-content a:not(.wp-block-button__link) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:not(.wp-block-button__link):hover { color: var(--ink); }
.post-content strong { color: var(--ink); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li + li { margin-top: .5em; }
.post-content hr, .post-content .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.post-content figure { margin: 0; }
.post-content img { max-width: 100%; height: auto; border-radius: 10px; }
.post-content figcaption { margin-top: 12px; color: var(--muted); font-size: .875rem; text-align: center; }
.post-content .alignleft { float: left; margin: 0 1.5em 1em 0; max-width: 50%; }
.post-content .alignright { float: right; margin: 0 0 1em 1.5em; max-width: 50%; }
.post-content .aligncenter { margin-inline: auto; }
.post-content .alignwide { width: min(1100px, 100vw - 40px); max-width: none; margin-inline: calc(50% - min(550px, 50vw - 20px)); }
.post-content .alignfull { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); }
.post-content .alignfull img { border-radius: 0; }

.post-content blockquote,
.post-content .wp-block-quote {
	margin-inline: 0;
	padding: 6px 0 6px 28px;
	border-left: 3px solid var(--gold);
	color: var(--ink);
	font-size: 1.3rem;
	line-height: 1.6;
}
.post-content blockquote cite { display: block; margin-top: 14px; color: var(--muted); font-size: .9rem; font-style: normal; }
.post-content .wp-block-pullquote { padding: 32px 0; border-block: 1px solid var(--line); text-align: center; }
.post-content .wp-block-pullquote blockquote { border: 0; padding: 0; }

.post-content table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.post-content th, .post-content td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.post-content th { background: var(--soft); color: var(--ink); }
.post-content pre, .post-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.post-content pre { padding: 20px; overflow-x: auto; border-radius: 10px; background: var(--ink); color: #e6edf7; }
.post-content :not(pre) > code { padding: 2px 6px; border-radius: 5px; background: var(--soft); }

/* Buttons (core Buttons block) */
.post-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.post-content .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 13px 22px;
	border: 1px solid transparent;
	border-radius: 7px;
	background: var(--gold);
	color: var(--ink);
	font-size: .875rem;
	font-weight: 650;
	line-height: 1.4;
	text-decoration: none;
	transition: background .18s, border-color .18s;
}
.post-content .wp-block-button__link:hover { background: var(--gold-light); }
.post-content .is-style-outline > .wp-block-button__link { background: transparent; border-color: var(--ink); color: var(--ink); }
.post-content .is-style-outline > .wp-block-button__link:hover { background: var(--soft); }

/* Columns, galleries, embeds, video */
.post-content .wp-block-columns { display: flex; flex-wrap: nowrap; gap: 32px; }
.post-content .wp-block-column { flex: 1 1 0; min-width: 0; }
.post-content .wp-block-gallery { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; }
.post-content .wp-block-gallery > .wp-block-image { flex: 1 1 calc(33.333% - 14px); }
.post-content .wp-block-gallery img { width: 100%; height: 100%; object-fit: cover; }
.post-content .wp-block-embed__wrapper { position: relative; }
.post-content .wp-block-embed.is-type-video .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.post-content .wp-block-embed iframe, .post-content iframe { max-width: 100%; border: 0; }
.post-content .wp-block-embed.is-type-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.post-content video { max-width: 100%; height: auto; border-radius: 10px; }
.post-content .wp-block-group.has-background { padding: 28px; border-radius: 12px; }
.post-content .wp-block-file a { font-weight: 650; }

/* Tags + next/previous */
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 48px; }
.post-tags a {
	padding: 7px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--muted);
	font-size: .8125rem;
	font-weight: 600;
}
.post-tags a:hover { border-color: var(--accent); color: var(--ink); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.post-nav-link { display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; transition: background .18s, border-color .18s; }
.post-nav-link:hover { background: var(--wash); border-color: var(--accent); }
.post-nav-link strong { font-size: 1.1rem; font-weight: 500; line-height: 1.35; }
.post-nav-next { text-align: right; grid-column: 2; }

/* ---------- Responsive ---------- */
@media (width <= 1040px) {
	.post-grid { grid-template-columns: 1fr 1fr; }
	.post-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 56px; }
	.post-sidebar { position: static; }
}
@media (width <= 800px) {
	.post-content .wp-block-columns { flex-wrap: wrap; gap: 24px; }
	.post-content .wp-block-column { flex-basis: 100%; }
	.post-content .wp-block-gallery > .wp-block-image { flex-basis: calc(50% - 14px); }
	.post-content .alignleft, .post-content .alignright { float: none; max-width: 100%; margin: 0 auto 1em; }
}
@media (width <= 640px) {
	.post-grid { grid-template-columns: 1fr; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav-next { grid-column: auto; text-align: left; }
	.post-content { font-size: 1.0625rem; }
}
