/* ========================================================================== */
/* Article-Like Pages (SEO + Bio + Distance + Single Articles)               */
/* ========================================================================== */

/* 1) Title + text alignment */
body.ds-article-like .wp-block-post-title {
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	margin-bottom: clamp(1.4rem, 3vw, 2rem);
	margin-top: 0;
	padding-bottom: clamp(0.9rem, 2vw, 1.3rem);
}

/* Article-like pages: left-align all editorial headings/subheadings/text. */
body.ds-article-like .wp-block-post-title,
body.ds-article-like .wp-block-post-content,
body.ds-article-like .wp-block-post-content :is(h1, h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, figcaption, dd, dt) {
	text-align: left;
}

body.ds-article-like .wp-block-post-content :is(.has-text-align-center, .has-text-align-right, .has-text-align-left) {
	text-align: left;
}

/* Keep article-like content in the same constrained column as page titles. */
body.ds-article-like .wp-block-post-content {
	margin-left: auto;
	margin-right: auto;
	max-width: var(--wp--style--global--content-size);
	width: 100%;
}

/* Article-like pages: keep editorial text full block width (no premium narrowing). */
body.ds-article-like .wp-block-post-content > :is(p, ul, ol, blockquote, pre, table, figure) {
	max-width: 100%;
}

/* Bio title: keep second forced break only on mobile; remove it on tablet/desktop. */
@media (min-width: 721px) {
	body.page-id-45 .wp-block-post-title br:nth-of-type(2),
	body.ds-page-bio .wp-block-post-title br:nth-of-type(2) {
		display: none;
	}
}

body.ds-article-like .ds-article-nav {
	align-items: center;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	column-gap: 1rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-top: clamp(1.1rem, 2.2vw, 1.4rem);
	padding-top: clamp(0.9rem, 1.8vw, 1.2rem);
	row-gap: 0.5rem;
}

body.ds-article-like .ds-article-nav a {
	color: #ffd400;
	font-size: clamp(0.98rem, 1.1vw, 1.06rem);
	line-height: 1.45;
}

body.ds-article-like .ds-article-nav a:first-child {
	justify-self: start;
}

body.ds-article-like .ds-article-nav a:last-child {
	justify-self: end;
	text-align: right;
}

body.ds-article-like .ds-article-nav a:only-child {
	justify-self: start;
	text-align: left;
}

body.ds-article-like .ds-article-nav a:hover {
	color: #fff;
}

/* Interview dialogue labels (DR:, Name:) — make visibly heavier. */
body.ds-article-like .wp-block-post-content p > :is(b, strong):first-child {
	font-weight: 900;
}

body.ds-article-like .wp-block-post-content p > :is(b, strong) {
	font-weight: 900;
}

/* 2) Top rhythm + alignfull normalization */
body.ds-article-like main#wp--skip-link--target {
	/* Needed to override core block padding rhythm on article-like templates. */
	margin-top: 0;
	padding-top: var(--wp--preset--spacing--50);
}

body.ds-article-like main#wp--skip-link--target > .wp-block-group.alignfull.has-global-padding {
	/* Needed to override Gutenberg has-global-padding inline paddings for article flow. */
	padding-left: var(--wp--preset--spacing--40);
	padding-right: var(--wp--preset--spacing--40);
	padding-top: 0;
	margin-top: 0;
}

body.ds-article-like main#wp--skip-link--target > .wp-block-group.alignfull {
	margin-top: 0;
	/* Needed to preserve bottom rhythm after alignfull normalization. */
	padding-bottom: var(--wp--preset--spacing--50);
}

/* Single article templates add inline top spacing wrappers before the title. */
body.ds-single-articles main#wp--skip-link--target {
	margin-top: 0 !important;
	padding-top: var(--wp--preset--spacing--50) !important;
}

body.ds-single-articles main#wp--skip-link--target > .wp-block-group.alignfull.has-global-padding {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Article-like pages with alignfull post-content: normalize to constrained column width. */
body.ds-article-like .wp-block-post-content.alignfull {
	margin-left: auto;
	margin-right: auto;
	/* Needed to constrain Gutenberg alignfull container back to content width. */
	max-width: var(--wp--style--global--content-size);
	padding-left: 0;
	padding-right: 0;
	width: 100%;
}

/* Centralized normalization for all article-like post-content wrappers. */
body.ds-article-like .entry-content.wp-block-post-content.has-global-padding {
	padding-left: 0;
	padding-right: 0;
}

body.ds-article-like .wp-block-post-content > .alignfull {
	/* Needed to neutralize alignfull breakout margins inside article-like content. */
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

/* 3) Wrapped images */
body.ds-article-like .wp-block-post-content p:has(> img) {
	clear: both;
	margin-top: 0;
	padding-top: 0;
}

body.ds-article-like .wp-block-post-content p > img {
	float: left;
	height: auto;
	margin: calc(0.6rem + 1ex) 1.15rem 0.7rem 0;
	max-width: 30%;
	width: 30%;
}

body.postid-1114 .wp-block-post-content p:has(> img[src*="note-value-"]),
body.postid-1114 .wp-block-post-content p:has(> img[data-lazy-src*="note-value-"]) {
	clear: both;
	margin-top: 0;
	padding-top: 0;
	text-align: left;
}

body.postid-1114 .wp-block-post-content p > img[src*="note-value-"],
body.postid-1114 .wp-block-post-content p > img[data-lazy-src*="note-value-"] {
	display: inline-block;
	float: left;
	height: auto;
	margin: calc(0.6rem + 1ex) 1.15rem 0.7rem 0;
	max-width: 33.333%;
	width: 33.333%;
}

/* 4) Mobile behavior */
@media (max-width: 720px) {
	/* Needed to override mobile alignfull width behavior from Gutenberg wrappers. */
	body.ds-article-like :is(.wp-block-post-title, .wp-block-post-content) {
		box-sizing: border-box;
		margin-left: auto;
		margin-right: auto;
		max-width: 100%;
		width: 100%;
	}

	body.ds-article-like .wp-block-post-content p > img {
		float: none;
		margin: 1rem 0;
		max-width: 100%;
		width: 100%;
	}

	body.postid-1114 .wp-block-post-content p:has(> img[src*="note-value-"]),
	body.postid-1114 .wp-block-post-content p:has(> img[data-lazy-src*="note-value-"]) {
		text-align: center;
	}

	body.postid-1114 .wp-block-post-content p > img[src*="note-value-"],
	body.postid-1114 .wp-block-post-content p > img[data-lazy-src*="note-value-"] {
		display: block;
		float: none;
		margin: 1rem 0;
		max-width: 100%;
		width: 100%;
	}

	/* Needed to keep horizontal mobile gutters after alignfull reset. */
	body.ds-article-like main#wp--skip-link--target > .wp-block-group.alignfull.has-global-padding {
		padding-left: var(--wp--preset--spacing--40) !important;
		padding-right: var(--wp--preset--spacing--40) !important;
	}
}
