/**
 * Blog listing + single post typography for Foundation Redesign.
 */

/* ── Single post layout ───────────────────────────────────────────────────── */

.fr-theme .fe-post-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 3rem;
	align-items: start;
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
	padding: 4rem 1.5rem;
	box-sizing: border-box;
}

.fr-theme .fe-post-article {
	min-width: 0;
}

.fr-theme .fe-post-sidebar {
	height: fit-content;
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	background: var(--card);
}

.fr-theme .fe-post-sidebar__label {
	margin: 0 0 1.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--primary);
}

.fr-theme .fe-post-sidebar__meta {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
}

.fr-theme .fe-post-sidebar__meta li {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.fr-theme .fe-post-sidebar__meta span {
	color: var(--muted-foreground);
}

.fr-theme .fe-post-sidebar__meta strong {
	color: var(--foreground);
	font-weight: 600;
}

.fr-theme .fe-post-sidebar__cta {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.fr-theme .fe-post-sidebar__cta p {
	margin: 0;
	color: var(--muted-foreground);
	font-size: 0.875rem;
	line-height: 1.5;
}

@media (min-width: 1024px) {
	.fr-theme .fe-post-layout {
		grid-template-columns: minmax(0, 1fr) 17.5rem;
		gap: 4rem;
		padding-top: 5rem;
		padding-bottom: 5rem;
	}

	.fr-theme .fe-post-sidebar {
		position: sticky;
		top: 6rem;
	}
}

/* ── Byline ───────────────────────────────────────────────────────────────── */

.fr-theme .fe-post-byline {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	max-width: 42rem;
	margin: 0 0 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
	color: var(--muted-foreground);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.fr-theme .fe-post-byline__author {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 0.4em;
	row-gap: 0.15em;
	color: var(--foreground);
}

.fr-theme .fe-post-byline__label {
	color: var(--muted-foreground);
}

.fr-theme .fe-post-byline__name {
	font-weight: 600;
}

.fr-theme .fe-post-byline__role {
	color: var(--muted-foreground);
}

.fr-theme .fe-post-byline__sep {
	flex-shrink: 0;
	opacity: 0.45;
}

.fr-theme .fe-post-byline__dates {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 0.4em;
	row-gap: 0.15em;
	color: var(--muted-foreground);
	font-size: 0.8125rem;
	font-weight: 500;
}

/* ── Article body ─────────────────────────────────────────────────────────── */

.fr-theme .fe-post-body {
	max-width: 42rem;
	color: var(--muted-foreground);
}

.fr-theme .fe-post-body > * {
	margin: 0 0 1.25rem;
}

.fr-theme .fe-post-body > *:last-child {
	margin-bottom: 0;
}

.fr-theme .fe-post-body > p:first-child {
	font-size: 1.125rem;
	line-height: 1.75;
	color: var(--foreground);
}

.fr-theme .fe-post-body h2 {
	margin: 2.75rem 0 1rem;
	padding-top: 0.25rem;
	font-family: 'Foundation Display', sans-serif;
	font-size: clamp(1.5rem, 2.5vw, 1.875rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--foreground);
}

.fr-theme .fe-post-body h2:first-child {
	margin-top: 0;
}

.fr-theme .fe-post-body h3 {
	margin: 2rem 0 0.75rem;
	font-family: 'Foundation Display', sans-serif;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--foreground);
}

.fr-theme .fe-post-body p,
.fr-theme .fe-post-body li {
	font-size: 1.0625rem;
	line-height: 1.75;
}

.fr-theme .fe-post-body strong {
	color: var(--foreground);
	font-weight: 600;
}

.fr-theme .fe-post-body a {
	color: var(--primary);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.fr-theme .fe-post-body a:hover {
	opacity: 0.85;
}

.fr-theme .fe-post-body ul,
.fr-theme .fe-post-body ol {
	margin: 0 0 1.25rem;
	padding-left: 1.35rem;
}

.fr-theme .fe-post-body li {
	margin: 0 0 0.5rem;
}

.fr-theme .fe-post-body li::marker {
	color: var(--primary);
}

.fr-theme .fe-post-body ul.fe-post-checklist {
	list-style: none;
	margin: 1.5rem 0;
	padding: 1.25rem 1.25rem 1.25rem 1rem;
	border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
	border-radius: 0.75rem;
	background: color-mix(in srgb, var(--primary) 6%, var(--background));
}

.fr-theme .fe-post-body ul.fe-post-checklist li {
	position: relative;
	padding-left: 1.5rem;
	margin: 0 0 0.625rem;
	color: var(--foreground);
	font-weight: 500;
}

.fr-theme .fe-post-body ul.fe-post-checklist li:last-child {
	margin-bottom: 0;
}

.fr-theme .fe-post-body ul.fe-post-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 999px;
	background: var(--primary);
}

.fr-theme .fe-post-body blockquote {
	margin: 1.75rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 3px solid var(--primary);
	color: var(--foreground);
	font-family: 'Foundation Display', sans-serif;
	font-size: 1.25rem;
	font-style: italic;
	line-height: 1.55;
}

.fr-theme .fe-post-body img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 0.75rem;
}

.fr-theme .fe-post-body pre {
	padding: 1.125rem 1.25rem;
	overflow-x: auto;
	border-radius: 0.5rem;
	background: var(--foreground);
	color: var(--background);
	font-size: 0.875rem;
	line-height: 1.6;
}

.fr-theme .fe-post-body code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.9em;
}

.fr-theme .fe-post-body :not(pre) > code {
	padding: 0.15em 0.4em;
	border-radius: 0.25rem;
	background: color-mix(in srgb, var(--foreground) 6%, var(--background));
}

/* ── FAQ accordion (in post content) ─────────────────────────────────────── */

.fr-theme .fe-faq {
	display: grid;
	gap: 0.75rem;
	margin: 1.5rem 0 0;
}

.fr-theme .fe-faq__item {
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	background: var(--background);
}

.fr-theme .fe-faq__q {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1.125rem 1.25rem;
	list-style: none;
	cursor: pointer;
	font-family: 'Foundation Display', sans-serif;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--foreground);
}

.fr-theme .fe-faq__q::-webkit-details-marker {
	display: none;
}

.fr-theme .fe-faq__q::after {
	content: "+";
	flex-shrink: 0;
	margin-left: auto;
	font-size: 1.375rem;
	font-weight: 400;
	line-height: 1;
	color: var(--primary);
	transition: transform 0.2s ease;
}

.fr-theme .fe-faq__item[open] .fe-faq__q::after {
	transform: rotate(45deg);
}

.fr-theme .fe-faq__tag {
	align-self: flex-start;
	flex-shrink: 0;
	margin-top: 0.1em;
	padding: 0.25rem 0.625rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--primary) 12%, var(--background));
	color: var(--primary);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.fr-theme .fe-faq__text {
	flex: 1;
	min-width: 0;
}

.fr-theme .fe-faq__a {
	padding: 0 1.25rem 1.125rem;
}

.fr-theme .fe-faq__a p {
	margin: 0;
	color: var(--muted-foreground);
	line-height: 1.7;
}

.fr-theme .fe-faq__a a {
	color: var(--primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 680px) {
	.fr-theme .fe-post-body p,
	.fr-theme .fe-post-body li {
		font-size: 1rem;
	}

	.fr-theme .fe-post-body > p:first-child {
		font-size: 1.0625rem;
	}

	.fr-theme .fe-faq__q {
		padding: 1rem;
		font-size: 1rem;
	}

	.fr-theme .fe-faq__a {
		padding: 0 1rem 1rem;
	}
}
