/*
Theme Name: Mark David Turner
Theme URI: https://markdavidturner.com
Description: Child theme of Twenty Twenty-Four for markdavidturner.com. Portrait homepage, book typography (Cardo with Barlow Condensed), Entries with type labels, interview layout, grouped Publications, click-to-load video and a text footer.
Author: Mark David Turner
Template: twentytwentyfour
Version: 2.7.0
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: markdavidturner
*/

/* ===============================================================
   Type system
   Reading text: Cardo (comes with Twenty Twenty-Four).
   Names, page titles and small labels: Barlow Condensed (font library).
   To try other fonts, change these two lines.
   =============================================================== */

:root {
	--mdt-serif: var(--wp--preset--font-family--cardo, Cardo, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif);
	--mdt-condensed: var(--wp--preset--font-family--barlow-condensed, "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif);
	--mdt-ink: #111111;
	--mdt-grey: #5f5f5a;
	--mdt-rule: #d7d7d7;
	--mdt-band: #0e0f10;
	--mdt-light: #f5f5f2;
	--mdt-gutter: clamp(20px, 4vw, 48px);
}

body {
	font-family: var(--mdt-serif);
	color: var(--mdt-ink);
	background: #ffffff;
}

/* Small capitals labels: dates, categories, section heads */
.mdt-label,
.mdt-date,
.mdt-meta .wp-block-post-terms,
.mdt-meta .wp-block-post-date {
	font-family: var(--mdt-condensed);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-transform: uppercase;
}

.mdt-date,
.mdt-meta .wp-block-post-date {
	color: var(--mdt-grey);
}

h2.mdt-label,
h3.mdt-label {
	margin: 0;
	font-family: var(--mdt-condensed);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.16em;
}

/* Large condensed capitals: page titles */
.mdt-page-title,
.mdt-page .wp-block-post-content > .wp-block-post-title:first-child {
	margin: 0 0 0.25em;
	font-family: var(--mdt-condensed);
	font-size: clamp(44px, 6vw, 72px);
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.mdt-intro-line {
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--mdt-grey);
	font-style: italic;
	font-size: 1.15rem;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

/* ===============================================================
   Header
   =============================================================== */

.mdt-header {
	padding-block: 22px;
	padding-inline: var(--mdt-gutter);
	border-bottom: 1px solid var(--mdt-ink);
}

.home .mdt-header,
.front-page .mdt-header {
	border-bottom: 0;
}

.mdt-wordmark {
	margin: 0;
	font-family: var(--mdt-condensed);
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1;
}

.mdt-wordmark a {
	text-decoration: none;
	color: var(--mdt-ink);
}

.mdt-nav {
	gap: 30px;
	font-size: 17px;
}

.mdt-nav a {
	text-decoration: none;
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
}

.mdt-nav a:hover,
.mdt-nav a:focus-visible,
.mdt-nav .mdt-current > a {
	border-bottom-color: currentColor;
}

/* ===============================================================
   Homepage portrait banner
   =============================================================== */

.mdt-front {
	margin-top: 0;
}

.mdt-hero {
	position: relative;
	min-height: 520px;
	background: var(--mdt-band);
	color: var(--mdt-light);
	overflow: hidden;
	display: flex;
	align-items: center;
}

.mdt-hero__photo img {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: auto;
	max-width: none;
}

.mdt-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1100px;
	margin-inline: auto;
	padding: 56px var(--mdt-gutter);
	box-sizing: content-box;
}

.mdt-hero__inner > * {
	max-width: 30rem;
}

.mdt-hero__inner > .mdt-hero__name {
	max-width: none;
}

.mdt-hero__eyebrow {
	margin: 0 0 10px;
	color: #b4b4ae;
	letter-spacing: 0.2em;
}

.mdt-hero__name span {
	display: block;
	white-space: nowrap;
}

.mdt-hero__name {
	margin: 0 0 22px;
	font-family: var(--mdt-condensed);
	font-size: clamp(48px, 6.4vw, 92px);
	font-weight: 600;
	line-height: 0.95;
	letter-spacing: 0.005em;
	text-transform: uppercase;
	color: var(--mdt-light);
}

.mdt-hero__statement {
	margin: 0 0 16px;
	font-size: 1.3rem;
	line-height: 1.5;
	color: #e1e1dc;
}

/* On larger screens About is in the menu; the link shows only on phones, where the menu is folded away */
@media (min-width: 782px) {
	.mdt-hero__more {
		display: none;
	}
}

.mdt-hero__more {
	margin: 0;
	font-style: italic;
	font-size: 1.15rem;
}

.mdt-hero a {
	color: var(--mdt-light);
}

/* Phones: face at the top, words beneath */
@media (max-width: 781px) {
	.mdt-hero {
		display: block;
		min-height: 0;
	}

	.mdt-hero__photo img {
		position: static;
		width: 100%;
		height: auto;
		display: block;
	}

	.mdt-hero__inner {
		margin-top: -48px;
		padding: 0 20px 44px;
		box-sizing: border-box;
	}

	.mdt-hero__statement {
		font-size: 1.12rem;
	}
}

/* ===============================================================
   Homepage: recent entries list
   =============================================================== */

.mdt-recent {
	padding: 72px var(--mdt-gutter) 88px;
}

.mdt-section-head {
	margin-bottom: 14px;
}

.mdt-more {
	margin: 0;
	font-style: italic;
	font-size: 1.05rem;
}

.mdt-more a {
	text-decoration: none;
}

.mdt-more a:hover,
.mdt-more a:focus-visible {
	text-decoration: underline;
}

.mdt-list .wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--mdt-rule);
}

.mdt-list .wp-block-post {
	margin: 0;
	border-bottom: 1px solid var(--mdt-rule);
}

.mdt-list__row {
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	gap: 0 24px;
	align-items: baseline;
	padding: 18px 0;
}

.mdt-list__row > * {
	margin: 0 !important;
}

.mdt-list .wp-block-post-title {
	font-size: 1.45rem;
	line-height: 1.3;
}

.mdt-list .wp-block-post-title a,
.mdt-cards .wp-block-post-title a {
	text-decoration: none;
}

.mdt-list .wp-block-post-title a:hover,
.mdt-list .wp-block-post-title a:focus-visible,
.mdt-cards .wp-block-post-title a:hover,
.mdt-cards .wp-block-post-title a:focus-visible {
	text-decoration: underline;
}

@media (max-width: 600px) {
	.mdt-list__row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

/* ===============================================================
   Entries page and archives: cards
   =============================================================== */

.mdt-archive {
	padding: 56px var(--mdt-gutter) 88px;
}

.mdt-cards .wp-block-post-template {
	gap: 56px 40px;
}

.mdt-cards .wp-block-post-featured-image {
	margin: 0 0 16px;
}

.wp-block-post-featured-image,
.wp-block-post-featured-image img,
.wp-block-post-featured-image a,
.mdt-page .wp-block-image img {
	border-radius: 0 !important;
}

.mdt-cards .wp-block-post-featured-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.mdt-meta {
	margin: 0 0 8px;
}

.mdt-meta > * {
	margin: 0 !important;
}

.mdt-meta .wp-block-post-date {
	color: var(--mdt-grey);
}

.mdt-meta .wp-block-post-terms {
	margin-top: 2px !important;
	color: var(--mdt-ink);
}

.mdt-meta .wp-block-post-terms a {
	text-decoration: none;
	color: inherit;
}

.mdt-cards .wp-block-post-title {
	margin: 0 0 8px;
	font-size: 1.4rem;
	line-height: 1.25;
}

.mdt-cards .wp-block-post-excerpt {
	margin: 0;
	color: var(--mdt-grey);
	font-size: 1rem;
	line-height: 1.5;
}

.mdt-cards .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.mdt-cards .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
}

/* ===============================================================
   Single posts
   =============================================================== */

.mdt-single {
	padding: 64px var(--mdt-gutter) 88px;
}

.mdt-single > .mdt-meta {
	margin-bottom: 14px;
}

.mdt-single > .wp-block-post-title {
	margin-top: 0;
	font-size: clamp(34px, 4.4vw, 50px);
	line-height: 1.12;
}

.mdt-single-image {
	margin-top: 36px;
	margin-bottom: 40px;
}

.mdt-single-image img {
	width: 100%;
	height: auto;
}

.mdt-single-image figcaption,
.mdt-single .wp-element-caption {
	margin-top: 8px;
	color: var(--mdt-grey);
	font-size: 0.95rem;
	font-style: italic;
	text-align: left;
}

.mdt-single .wp-block-post-content {
	font-size: 1.2rem;
	line-height: 1.65;
}

.mdt-single .wp-block-post-content > * + * {
	margin-top: 1.05em;
}

.mdt-single .wp-block-post-content h2,
.mdt-single .wp-block-post-content h3,
.mdt-single .wp-block-post-content h4 {
	margin-top: 2em;
	font-family: var(--mdt-condensed);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* A final paragraph that holds only a link becomes a closing note. */
.mdt-single .wp-block-post-content > p:last-child:has(> a:only-child) {
	margin-top: 2em;
	padding-top: 1em;
	border-top: 1px solid var(--mdt-rule);
	font-size: 1.05rem;
}

/* Interviews: names stay inline; the interviewer's questions are set in bold */
.mdt-turn--q {
	font-weight: 700;
}

.mdt-back {
	margin-top: var(--wp--preset--spacing--50);
	font-style: italic;
}

.mdt-back a {
	text-decoration: none;
}

/* ===============================================================
   Pages (About, Publications, Privacy)
   =============================================================== */

.mdt-page {
	padding: 56px var(--mdt-gutter) 88px;
}

.mdt-page .wp-block-post-content {
	font-size: 1.15rem;
	line-height: 1.65;
}

/* Section heads: heavy rule, small capitals */
.mdt-section {
	margin-top: 64px !important;
	padding-top: 20px;
	border-top: 3px solid var(--mdt-ink);
	font-family: var(--mdt-condensed);
	font-size: 15px !important;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	scroll-margin-top: 24px;
}

/* Publications */
.mdt-jump {
	font-style: italic;
	font-size: 1.1rem;
}

.mdt-jump a {
	text-decoration: none;
	border-bottom: 1px solid var(--mdt-rule);
}

.mdt-jump a:hover,
.mdt-jump a:focus-visible {
	border-bottom-color: currentColor;
}

.mdt-pub-list > .wp-block-group {
	margin-block: 0 26px !important;
}

.mdt-pub-list p {
	margin: 0;
	line-height: 1.45;
}

.mdt-pub-list > .wp-block-group > p:first-child {
	font-size: 1.15rem;
}

.mdt-pub-list > .wp-block-group > p + p {
	font-size: 1rem;
}

/* the genre line under each entry */
.mdt-pub-list > .wp-block-group > p:last-child:not(:first-child) {
	margin-top: 4px;
	font-size: 0.95rem !important;
	color: var(--mdt-grey);
}

/* Books and Reports: one row per book, cover left, text right */
.mdt-books {
	margin-top: 32px !important;
}

.mdt-book {
	gap: 36px !important;
	padding: 26px 0;
	border-bottom: 1px solid var(--mdt-rule);
}

.mdt-book:first-child {
	padding-top: 8px;
}

.mdt-book:last-child {
	border-bottom: 0;
}

.mdt-book__cover {
	flex: 0 0 120px;
	width: 120px;
	margin: 0 !important;
}

.mdt-book__cover img {
	display: block;
	width: 120px !important;
	height: auto !important;
	box-shadow: 0 1px 3px rgba(17, 17, 17, 0.18);
}

.mdt-book__text {
	flex: 1 1 auto;
	min-width: 0;
}

.mdt-book__text p {
	margin: 0 !important;
}

.mdt-book__title {
	font-size: 1.3rem !important;
	line-height: 1.3 !important;
}

.mdt-book__by {
	margin-top: 4px !important;
	font-size: 1.05rem !important;
	line-height: 1.45 !important;
}

.mdt-book__note {
	margin-top: 6px !important;
	font-size: 0.92rem !important;
	line-height: 1.45 !important;
	color: var(--mdt-grey);
}

.mdt-book__by + .mdt-book__note {
	margin-top: 12px !important;
}

.mdt-book__link {
	margin-top: 12px !important;
	font-size: 0.98rem !important;
}

/* Talks: wider video still */
.mdt-book--wide > .wp-block-shortcode,
.mdt-book--wide > p:first-child,
.mdt-book--wide > .mdt-video-still {
	flex: 0 0 200px;
	width: 200px;
	margin: 0;
}

.mdt-video-still {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 200px;
	aspect-ratio: 16 / 9;
	background: var(--mdt-ink);
	overflow: hidden;
}

.mdt-video-still img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mdt-video-still__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 2px solid var(--mdt-light);
	border-radius: 50%;
	background: rgba(14, 15, 16, 0.55);
}

.mdt-video-still__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 55%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 7px 0 7px 11px;
	border-color: transparent transparent transparent var(--mdt-light);
}

.mdt-video-still:hover .mdt-video-still__icon,
.mdt-video-still:focus-visible .mdt-video-still__icon {
	background: rgba(14, 15, 16, 0.8);
}

@media (max-width: 600px) {
	.mdt-book {
		flex-wrap: wrap !important;
		gap: 16px !important;
	}
}

/* About */
.mdt-videos .wp-block-embed {
	margin: 0;
}

.mdt-videos p {
	margin-top: 10px;
	color: var(--mdt-grey);
	font-size: 0.92rem !important;
	line-height: 1.45;
}

.mdt-albums figcaption {
	font-size: 0.92rem;
}

/* Square corners for every image on pages, matching the rest of the site */
.mdt-page .wp-block-image,
.mdt-page .wp-block-image img,
.mdt-page .wp-block-image a,
.mdt-albums img {
	border-radius: 0 !important;
}

/* ===============================================================
   Click-to-load YouTube
   =============================================================== */

.mdt-yt .wp-block-embed__wrapper {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--mdt-ink);
	border-radius: 0;
	overflow: hidden;
}

.mdt-yt .wp-block-embed__wrapper::before {
	content: none;
}

.mdt-yt iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.mdt-yt__play {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 16px;
	border: 0;
	background: transparent;
	color: var(--mdt-light);
	font: inherit;
	cursor: pointer;
}

.mdt-yt__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.85;
}

/* With a preview image, show only the play button; the words stay for screen readers */
.mdt-yt__play:has(.mdt-yt__thumb) .mdt-yt__label,
.mdt-yt__play:has(.mdt-yt__thumb) .mdt-yt__note {
	display: none;
}

.mdt-yt__play:has(.mdt-yt__thumb) .mdt-yt__icon {
	background: rgba(14, 15, 16, 0.55);
}

.mdt-yt__play > span {
	position: relative;
}

.mdt-yt__icon {
	display: block;
	width: 56px;
	height: 56px;
	border: 2px solid currentColor;
	border-radius: 50%;
	position: relative;
	transition: transform 0.15s ease;
}

.mdt-yt__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent currentColor;
}

.mdt-yt__label {
	font-size: 16px;
}

.mdt-yt__note {
	font-size: 13px;
	opacity: 0.75;
}

.mdt-yt__play:hover .mdt-yt__icon {
	transform: scale(1.06);
}

.mdt-yt__play:focus-visible {
	outline: 3px solid var(--mdt-light);
	outline-offset: -6px;
}

@media (prefers-reduced-motion: reduce) {
	.mdt-yt__icon {
		transition: none;
	}
}

/* ===============================================================
   Footer
   =============================================================== */

.mdt-footer {
	border-top: 1px solid var(--mdt-ink);
	padding: 32px var(--mdt-gutter) 40px;
	text-align: center;
	font-size: 16px;
}

.mdt-footer__line {
	margin: 0;
	line-height: 1.9;
}

.mdt-footer a {
	text-decoration: none;
	color: var(--mdt-ink);
}

.mdt-footer a:hover,
.mdt-footer a:focus-visible {
	text-decoration: underline;
}

.mdt-sep {
	display: inline-block;
	margin-inline: 0.75em;
	color: #a0a09a;
}

@media (max-width: 600px) {
	.mdt-footer__line {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 4px 20px;
		line-height: 1.6;
	}

	.mdt-footer__line + .mdt-footer__line {
		margin-top: 10px;
	}

	.mdt-sep {
		display: none;
	}
}

/* Mid-size screens: move the portrait right so it clears the words */
@media (min-width: 782px) and (max-width: 1100px) {
	.mdt-hero__photo img {
		right: -22%;
	}

	.mdt-hero__inner > * {
		max-width: 24rem;
	}
}


/* Entries: type filters */
.mdt-filters {
	margin: 0 0 var(--wp--preset--spacing--40);
	font-size: 1.05rem;
}

.mdt-filters a {
	text-decoration: none;
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
}

.mdt-filters a:hover,
.mdt-filters a:focus-visible,
.mdt-filters a.mdt-current {
	border-bottom-color: currentColor;
}

/* Reading time beside the date */
.mdt-readtime::before {
	content: "·";
	margin: 0 10px;
	color: #a0a09a;
}

/* Section links under a post title */
.mdt-toc {
	margin-top: 0 !important;
	margin-bottom: 8px !important;
	font-size: 1.02rem;
}

.mdt-toc__lead {
	font-style: italic;
	color: var(--mdt-grey);
	margin-right: 6px;
}

.mdt-toc a {
	text-decoration: none;
	border-bottom: 1px solid var(--mdt-rule);
}

.mdt-toc a:hover,
.mdt-toc a:focus-visible {
	border-bottom-color: currentColor;
}

.mdt-single [id^="section-"] {
	scroll-margin-top: 24px;
}
