/*
 * Styles for PHP templates (not blocks): article, archives, case hero/meta,
 * prose pages, 404 and search.
 */

/* Block-composed pages render their blocks full-width; each block manages its
   own container/max-width. */
.dd-page-content > * {
	margin-top: 0;
	margin-bottom: 0;
}

/* Stray core blocks placed directly on a block-composed page (e.g. a prose
   paragraph on a privacy page) stay at a readable width + gutter, while the
   theme's full-width section blocks keep spanning edge to edge. */
.dd-page-content > :where(p, h1, h2, h3, h4, ul, ol, blockquote, figure, pre, hr, .wp-block-table) {
	max-width: var(--dd-reading);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--dd-pad);
	padding-right: var(--dd-pad);
}

.dd-page-content > :where(h1, h2, h3) {
	font-family: var(--dd-serif);
	font-weight: 400;
}

.dd-page-content > :where(p, ul, ol) {
	margin-top: 1em;
}

/* ---------- Prose page (privacy/terms) ---------- */
.dd-prose-page__head {
	margin-bottom: 32px;
}

.dd-prose--reading {
	max-width: var(--dd-reading);
	font-size: 18px;
}

.dd-prose--reading h2 {
	font-family: var(--dd-serif);
	font-weight: 400;
	font-size: 32px;
	margin: 44px 0 16px;
}

.dd-prose--reading a {
	color: var(--dd-terracotta);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Breadcrumb spacing when it leads a template ---------- */
.dd-breadcrumb {
	padding-bottom: 0;
}

/* ---------- Case study ---------- */
.dd-case__hero {
	padding: 44px 0 44px;
	max-width: 940px;
}

.dd-breadcrumb + .dd-case .dd-case__hero,
.dd-case__hero {
	padding-top: 44px;
}

.dd-case__intro {
	margin-top: 24px;
	max-width: 620px;
}

.dd-case__meta {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	border-top: 1px solid var(--dd-line-14);
	border-bottom: 1px solid var(--dd-line-14);
	padding: 26px 0;
	margin-top: 36px;
}

.dd-case__meta-item .dd-mono {
	margin-bottom: 8px;
}

.dd-case__meta-val {
	font-size: 16px;
	font-weight: 600;
}

.dd-case__cover {
	padding-top: 40px;
}

.dd-case__cover .dd-media {
	aspect-ratio: 21 / 9;
}

.dd-case__cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dd-case__body {
	padding-top: 0;
}

.dd-case__next {
	padding-top: 80px;
	padding-bottom: 20px;
}

.dd-case__next-head {
	border-top: 1px solid var(--dd-line-14);
	padding-top: 36px;
	margin-bottom: 24px;
}

.dd-case__next-tile {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--dd-line);
}

.dd-case__next-tile .dd-placeholder {
	border-radius: 0;
}

.dd-case__next-body {
	background: var(--dd-paper-card);
	padding: 44px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.dd-case__next-cat {
	color: var(--dd-terracotta);
	margin-bottom: 12px;
}

.dd-case__next-excerpt {
	font-size: 15px;
	color: var(--dd-body);
	margin: 10px 0 0;
	line-height: 1.6;
}

/* ---------- Article (single insight / post) ---------- */
.dd-article__head {
	max-width: 760px;
	margin: 0 auto;
	padding: 0 32px;
}

.dd-article__topic {
	display: inline-flex;
	padding: 5px 12px;
	border: 1px solid rgba(181, 103, 74, 0.4);
	border-radius: var(--dd-radius-pill);
	font-family: var(--dd-mono);
	font-size: 12px;
	color: var(--dd-terracotta);
	margin-bottom: 22px;
}

.dd-article__title {
	font-family: var(--dd-serif);
	font-weight: 400;
	font-size: clamp(34px, 5vw, 52px);
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin: 0 0 24px;
}

.dd-article__dek {
	font-size: 21px;
	line-height: 1.55;
	color: var(--dd-body);
	margin: 0 0 32px;
}

.dd-article__byline {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 24px 0;
	border-top: 1px solid var(--dd-line-14);
	border-bottom: 1px solid var(--dd-line-14);
}

.dd-article__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--dd-ink-hover), var(--dd-ink));
	flex-shrink: 0;
	overflow: hidden;
}

.dd-article__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dd-article__byline-meta {
	flex: 1;
}

.dd-article__byline-name {
	font-weight: 700;
	font-size: 15px;
}

.dd-article__byline-sub {
	font-size: 13.5px;
	color: var(--dd-muted);
}

.dd-article__cover {
	max-width: 1080px;
	margin: 40px auto 0;
	padding: 0 32px;
}

.dd-article__cover .dd-media {
	aspect-ratio: 21 / 9;
}

.dd-article__body {
	max-width: var(--dd-reading);
	margin: 0 auto;
	padding: 56px 32px 0;
}

.dd-article__body > * {
	margin-left: auto;
	margin-right: auto;
}

/* Prose rhythm for article content */
.dd-article__body p {
	font-size: 18px;
	line-height: 1.75;
	color: var(--dd-body-dark);
	margin: 0 0 24px;
}

.dd-article__body > p:first-of-type {
	font-size: 20px;
	line-height: 1.7;
	color: var(--dd-ink);
}

.dd-article__body h2 {
	font-family: var(--dd-serif);
	font-weight: 400;
	font-size: 32px;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 44px 0 18px;
}

.dd-article__body h3 {
	font-family: var(--dd-serif);
	font-weight: 400;
	font-size: 24px;
	margin: 32px 0 12px;
}

.dd-article__body ul,
.dd-article__body ol {
	font-size: 18px;
	line-height: 1.75;
	color: var(--dd-body-dark);
	margin: 0 0 24px;
	padding-left: 1.2em;
}

.dd-article__body a {
	color: var(--dd-terracotta);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.dd-article__body blockquote {
	margin: 40px 0;
	padding: 0 0 0 28px;
	border-left: 3px solid var(--dd-terracotta);
	font-family: var(--dd-serif);
	font-style: italic;
	font-size: 28px;
	line-height: 1.3;
	color: var(--dd-ink);
}

.dd-article__body img {
	border-radius: var(--dd-radius-card);
}

.dd-article__author {
	max-width: var(--dd-reading);
	margin: 0 auto;
	padding: 48px 32px 0;
}

.dd-article__author-inner {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	border-top: 1px solid var(--dd-line-14);
	padding-top: 32px;
}

.dd-article__related {
	max-width: 1080px;
	margin: 0 auto;
	padding: 72px 32px 0;
}

/* ---------- Archives (Werk / Insights) ---------- */
.dd-archive__hero {
	padding: 80px 0 40px;
	max-width: 840px;
}

.dd-archive__intro {
	margin-top: 26px;
	max-width: 600px;
}

.dd-filters {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	padding: 12px 0 8px;
	font-size: 14px;
}

.dd-filter {
	padding: 9px 18px;
	border: 1px solid var(--dd-line-strong);
	border-radius: var(--dd-radius-pill);
	color: var(--dd-body);
	transition: all 0.18s ease;
}

.dd-filter:hover {
	border-color: var(--dd-ink);
	color: var(--dd-ink);
}

.dd-filter.is-active {
	background: var(--dd-ink);
	color: var(--dd-on-dark);
	border-color: var(--dd-ink);
	font-weight: 600;
}

.dd-case-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 22px;
	padding-top: 32px;
}

.dd-case-tile {
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--dd-line);
	background: var(--dd-paper-card);
	transition: transform 0.28s ease;
}

.dd-case-tile:hover {
	transform: translateY(-5px);
}

.dd-case-tile__body {
	padding: 28px 30px;
}

.dd-case-tile__cat {
	color: var(--dd-terracotta);
	margin-bottom: 10px;
}

.dd-case-tile__excerpt {
	font-size: 15px;
	color: var(--dd-body);
	line-height: 1.6;
	margin: 8px 0 0;
}

.dd-insight-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
	padding-top: 36px;
}

.dd-insight-card {
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--dd-line);
	background: var(--dd-paper-card);
	transition: transform 0.25s ease;
}

.dd-insight-card:hover {
	transform: translateY(-4px);
}

.dd-insight-card__body {
	padding: 26px 28px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.dd-insight-card__cat {
	color: var(--dd-terracotta);
	margin-bottom: 12px;
}

.dd-insight-card__title {
	font-family: var(--dd-serif);
	font-weight: 400;
	font-size: 23px;
	line-height: 1.2;
	margin: 0 0 12px;
}

.dd-insight-card__meta {
	margin-top: auto;
	font-size: 13px;
	color: var(--dd-muted);
}

.dd-insight-featured {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	border-radius: 18px;
	overflow: hidden;
	border: 1px solid var(--dd-line);
	transition: transform 0.25s ease;
}

.dd-insight-featured:hover {
	transform: translateY(-4px);
}

.dd-insight-featured__body {
	background: var(--dd-paper-card);
	padding: 48px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* ---------- 404 / search ---------- */
.dd-404 {
	text-align: center;
	padding: 120px 0;
}

.dd-404 .dd-h1 {
	margin-bottom: 20px;
}

.dd-archive-head {
	padding-bottom: 34px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.dd-case__meta {
		grid-template-columns: repeat(2, 1fr);
	}

	.dd-case__next-tile,
	.dd-insight-featured {
		grid-template-columns: 1fr;
	}

	.dd-insight-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.dd-case-grid,
	.dd-insight-grid {
		grid-template-columns: 1fr;
	}

	.dd-case__meta {
		grid-template-columns: 1fr 1fr;
	}

	.dd-insight-featured__body,
	.dd-case__next-body {
		padding: 30px;
	}
}
