/*
 * DNews single post: title, subtitle, meta bar, featured image, tags,
 * previous/next, author box and comments. Loaded with the Post Content block
 * (single posts and pages).
 */
.dnews-single__title.dnews-single__title {
	margin: 0 0 0.4em;
	font-size: var(--wp--preset--font-size--title-single);
	font-weight: var(--wp--custom--type--title-single--weight);
	line-height: var(--wp--custom--type--title-single--line-height);
	letter-spacing: var(--wp--custom--type--title-single--tracking);
	word-spacing: var(--wp--custom--type--title-single--word-spacing);
}

.dnews-single__subtitle {
	margin: calc(-1 * var(--wp--preset--spacing--space-1)) 0 var(--wp--preset--spacing--space-4);
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--subtitle);
	line-height: var(--wp--custom--type--small--line-height);
}

@media (min-width: 768px) {

	.dnews-single__subtitle {
		margin: 0 0 var(--wp--preset--spacing--space-5);
	}
}

.dnews-single__subtitle:empty {
	display: none;
}

/* Meta bar: 2px top rule, round avatar, author link in accent, comment count
 * on the right. */
.dnews-meta-bar {
	padding-top: var(--wp--preset--spacing--space-3);
	border-top: 2px solid var(--wp--preset--color--line);
	font-size: var(--wp--preset--font-size--meta);
	color: var(--wp--preset--color--muted-text);
}

.dnews-meta-bar.dnews-meta-bar,
.dnews-meta-bar__main {
	align-items: center;
	gap: var(--wp--preset--spacing--space-2);
}

.dnews-meta-bar > *,
.dnews-meta-bar__main > * {
	margin: 0;
}

.dnews-meta-bar .wp-block-post-author {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--space-2);
}

.dnews-meta-bar .wp-block-post-author__avatar {
	margin: 0;
}

.dnews-meta-bar .wp-block-post-author__avatar img {
	display: block;
	width: 25px;
	height: 25px;
	border-radius: 100%;
}

@media (min-width: 481px) {

	.dnews-meta-bar .wp-block-post-author__avatar img {
		width: 35px;
		height: 35px;
	}
}

.dnews-meta-bar .wp-block-post-author__byline,
.dnews-meta-bar .wp-block-post-author__name {
	display: inline;
	margin: 0;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: var(--wp--custom--type--meta--weight);
}

.dnews-meta-bar .wp-block-post-author__name a {
	color: var(--wp--preset--color--accent-text);
}

.dnews-meta-bar__date {
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: var(--wp--custom--type--meta--tracking);
	text-transform: none;
}

.dnews-meta-bar__date::before {
	content: "\2014\00a0";
}

.dnews-meta-bar__terms {
	font-size: var(--wp--preset--font-size--meta);
}

.dnews-meta-bar__terms a {
	color: var(--wp--preset--color--ui);
}

.dnews-meta-bar__source {
	margin: 0;
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--meta);
}

.dnews-meta-bar__source:empty {
	display: none;
}

/* "Source: <name>", shown only when the post has a source (dnews_source). */
.dnews-meta-bar__source:not(:empty)::before {
	content: "Source: ";
}

.dnews-meta-bar__comments {
	font-size: var(--wp--preset--font-size--meta);
}

.dnews-single__image {
	margin: var(--wp--preset--spacing--space-5) 0 var(--wp--preset--spacing--space-7);
}

.dnews-single__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius--image);
}

/* Article body. */
.wp-block-post-content :where(iframe, video, embed) {
	max-width: 100%;
}

.wp-block-post-content :where(.alignwide, .alignfull) {
	max-width: 100%;
}

.wp-block-post-content table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-post-content :where(td, th) {
	padding: var(--wp--preset--spacing--space-2) var(--wp--preset--spacing--space-3);
	border: 1px solid var(--wp--preset--color--line);
}

/* Tags row. */
.dnews-tags {
	font-size: var(--wp--preset--font-size--meta);
}

.dnews-tags .wp-block-post-terms__prefix {
	margin-inline-end: var(--wp--preset--spacing--space-2);
	color: var(--wp--preset--color--heading);
	font-weight: var(--wp--custom--type--heading--weight);
}

/* Previous / next: two halves between #eee rules, stacked and centered on
 * phones. */
.dnews-post-nav {
	display: grid;
	gap: var(--wp--preset--spacing--space-4);
	padding: var(--wp--preset--spacing--space-5) 0;
	border-block: 1px solid var(--wp--preset--color--line);
	text-align: center;
}

@media (min-width: 481px) {

	.dnews-post-nav {
		grid-template-columns: 1fr 1fr;
		gap: var(--wp--preset--spacing--space-7);
		text-align: start;
	}

	/* Core's flow layout adds a block-gap top margin to every child after the
	 * first and outranks the reset below; side by side it pushed Next down. */
	.dnews-post-nav > .wp-block-post-navigation-link {
		margin-block-start: 0;
	}
}

.dnews-post-nav > * {
	margin: 0;
}

.dnews-post-nav .wp-block-post-navigation-link {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--space-1);
}

.dnews-post-nav .post-navigation-link-next {
	text-align: end;
}

.dnews-post-nav .wp-block-post-navigation-link__label {
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--meta);
	font-weight: var(--wp--custom--type--heading--weight);
}

.dnews-post-nav a {
	padding-inline-start: var(--wp--preset--spacing--space-2);
	border-inline-start: 10px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--heading);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--base);
	font-weight: var(--wp--custom--type--card-title--weight);
	line-height: var(--wp--custom--type--card-title--line-height);
	word-spacing: var(--wp--custom--type--card-title--word-spacing);
	transition: border-color 0.2s;
}

.dnews-post-nav a:hover {
	border-inline-start-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--heading);
}

/* Author box. */
.dnews-author-box {
	padding: var(--wp--preset--spacing--space-7) 0;
	border: 1px solid var(--wp--preset--color--line);
}

.dnews-author-box .wp-block-post-author {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--space-4);
	text-align: center;
}

@media (min-width: 481px) {

	.dnews-author-box .wp-block-post-author {
		flex-direction: row;
		align-items: flex-start;
		text-align: start;
	}
}

.dnews-author-box .wp-block-post-author__avatar {
	display: flex;
	justify-content: center;
	margin: 0;
}

@media (min-width: 481px) {

	.dnews-author-box .wp-block-post-author__avatar {
		flex: 0 0 150px;
	}
}

.dnews-author-box .wp-block-post-author__avatar img {
	border-radius: 100%;
}

.dnews-author-box .wp-block-post-author__name {
	margin: 0 0 var(--wp--preset--spacing--space-2);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--h-4);
	font-weight: var(--wp--custom--type--heading--weight);
}

.dnews-author-box .wp-block-post-author__bio {
	margin: 0;
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--small);
	line-height: var(--wp--custom--type--small--line-height);
}

/* Comments keep core styling with a small gutter. */
.dnews-comments {
	margin-block-start: var(--wp--preset--spacing--space-8);
}

.dnews-comment {
	gap: var(--wp--preset--spacing--space-4);
	margin-block-end: var(--wp--preset--spacing--space-5);
}

/* "by Name" reads inline. */
.dnews-meta-bar .wp-block-post-author__content {
	display: block;
	min-width: 0;
}

.dnews-meta-bar .wp-block-post-author__byline,
.dnews-meta-bar .wp-block-post-author__name {
	display: inline;
	margin: 0;
}

.dnews-meta-bar .wp-block-post-author__byline {
	margin-inline-end: 0.3em;
}
