/*
Theme Name: Diego Ponce de Leon Barido
Description: A small, plain theme for dleonb.com. Pages are built with standard WordPress blocks.
Author: Alex Rodriguez
Version: 2.0.6
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: dleonb
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
	--dl-navy: #093759;
	--dl-blue: #1E5F99;
	--dl-ink: #1C2329;
	--dl-gray: #55606A;
	--dl-line: #DDE3E8;
	--dl-mist: #F4F6F8;
	--dl-gutter: clamp(1.25rem, 4vw, 2.5rem);
	--dl-heading-font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: #fff;
	color: var(--dl-ink);
	font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.65;
	overflow-wrap: break-word;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--dl-blue);
}

h1,
h2,
h3 {
	color: var(--dl-ink);
	font-family: var(--dl-heading-font);
	font-weight: 700;
	line-height: 1.2;
}

h2 {
	font-size: clamp(1.5rem, 3vw, 1.875rem);
}

h3 {
	font-size: 1.125rem;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	white-space: nowrap;
}

.dl-skip:focus {
	position: fixed;
	z-index: 100;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.5rem 1rem;
	clip: auto;
	background: #fff;
}

/* Header */

.dl-header {
	border-bottom: 1px solid var(--dl-line);
	background: #fff;
}

.dl-header__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.875rem var(--dl-gutter);
}

.custom-logo-link,
.dl-site-name {
	display: block;
	color: inherit;
	font-family: var(--dl-heading-font);
	font-weight: 700;
	text-decoration: none;
}

.custom-logo {
	display: block;
	width: auto;
	height: 44px;
}

.dl-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dl-nav a {
	color: var(--dl-ink);
	font-family: var(--dl-heading-font);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

.dl-nav a:hover,
.dl-nav a:focus-visible,
.dl-nav .current-menu-item > a {
	color: var(--dl-blue);
}

.dl-menu-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--dl-line);
	border-radius: 0.25rem;
	background: transparent;
	color: var(--dl-ink);
	cursor: pointer;
}

.dl-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	margin: 4px auto;
	background: currentColor;
}

@media (max-width: 47.99em) {
	.dl-menu-toggle {
		display: block;
	}

	.dl-nav {
		position: absolute;
		z-index: 20;
		top: 100%;
		right: var(--dl-gutter);
		left: var(--dl-gutter);
		display: none;
		padding: 0.5rem 1rem;
		border-radius: 0.25rem;
		background: #fff;
		box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
	}

	.dl-nav.is-open {
		display: block;
	}

	.dl-nav ul {
		display: block;
	}

	.dl-nav a {
		display: block;
		padding: 0.75rem 0;
		color: var(--dl-ink) !important;
	}
}

/* Page */

.dl-title {
	margin: 2.25rem 0 1.5rem;
	padding-inline: var(--dl-gutter);
	font-size: clamp(1.75rem, 3.4vw, 2.5rem);
	text-align: center;
}

.dl-content {
	padding-inline: var(--dl-gutter);
	padding-bottom: 3rem;
}

.dl-content > .alignfull {
	width: auto;
	max-width: none;
	margin-right: calc(var(--dl-gutter) * -1) !important;
	margin-left: calc(var(--dl-gutter) * -1) !important;
}

.dl-content > *:last-child.alignfull {
	margin-bottom: -3rem;
}

/* Footer */

.dl-footer {
	padding: 1.75rem var(--dl-gutter);
	background: var(--dl-navy);
	color: #fff;
	text-align: center;
}

.dl-social {
	display: flex;
	justify-content: center;
	gap: 1.25rem;
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.dl-social a {
	display: block;
	padding: 0.25rem;
	color: #fff;
}

.dl-social svg {
	display: block;
}

.dl-copyright {
	margin: 0;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.dl-copyright a {
	color: #fff;
	text-underline-offset: 2px;
}

/* Home: the photos fill the screen, with the header and footer on top of them */

body.home {
	position: relative;
}

body.home .dl-content {
	padding: 0;
}

body.home .dl-header {
	position: absolute;
	z-index: 10;
	top: 0;
	left: 0;
	width: 100%;
	border: 0;
	background: transparent;
}

body.home .custom-logo {
	filter: brightness(0) invert(1);
}

body.home .dl-nav a,
body.home .dl-menu-toggle,
body.home .dl-site-name {
	color: #fff;
}

body.home .dl-menu-toggle {
	border-color: #fff;
}

body.home .dl-footer {
	position: absolute;
	z-index: 5;
	bottom: 0;
	left: 0;
	width: 100%;
	padding-block: 0.75rem;
	background: transparent;
}

body.home .dl-copyright {
	text-shadow: 0 1px 4px rgb(0 0 0 / 0.7);
}

body.home .fss-slide figcaption {
	bottom: 6.5rem;
}

body.home .fss::before {
	height: 10rem;
}

@media (max-width: 40em) {
	body.home .fss-slide figcaption {
		bottom: 8.5rem;
	}
}

/* Bands of color behind a section */

.dl-band {
	padding: 2.5rem var(--dl-gutter);
	background: var(--dl-mist);
}

.dl-band > *:first-child {
	margin-top: 0;
}

.dl-band > *:last-child {
	margin-bottom: 0;
}

/* Section headings in a band line up with the wide content below them */

.dl-band > h2 {
	max-width: var(--wp--style--global--wide-size) !important;
}

/* Diego: press cards */

.dl-press img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 0.25rem;
	object-fit: cover;
	object-position: top;
}

.dl-press figure {
	margin: 0 0 0.75rem;
}

.dl-press h3 {
	margin: 0.25rem 0 0.5rem;
}

.dl-press p {
	margin: 0;
}

.dl-meta {
	color: var(--dl-gray);
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Video and podcast grids */

.dl-video-grid,
.dl-podcasts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem 1.5rem;
	align-items: start;
}

.dl-video-grid--two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dl-video-grid > *,
.dl-podcasts > * {
	margin: 0 !important;
}

.dl-podcasts {
	gap: 1rem 1.5rem;
}

.dl-podcasts iframe {
	display: block;
	width: 100%;
	height: 152px;
	border: 0;
}

.dl-video {
	margin: 0;
}

.dl-video__play {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 0.25rem;
	background: #111;
	cursor: pointer;
}

.dl-video__play img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.dl-video__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 14px 0 14px 24px;
	border-color: transparent transparent transparent #fff;
	transform: translate(-40%, -50%);
	filter: drop-shadow(0 1px 4px rgb(0 0 0 / 0.7));
}

.dl-video__play:hover img,
.dl-video__play:focus-visible img {
	opacity: 0.8;
}

.dl-video iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 0.25rem;
}

.dl-video figcaption {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	line-height: 1.35;
}

@media (max-width: 61.99em) {
	.dl-video-grid,
	.dl-podcasts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 40em) {
	.dl-video-grid,
	.dl-video-grid--two,
	.dl-podcasts {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Photos: album name under each photo, with no blur over the image */

.dl-albums .wp-block-image::before,
.dl-albums .wp-block-image::after {
	display: none !important;
}

.dl-albums .wp-block-image {
	display: flex !important;
	flex-direction: column;
}

.dl-albums .wp-block-image a {
	display: block;
}

.dl-albums .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	border-radius: 0.25rem;
	object-fit: cover;
}

.dl-albums .wp-block-image figcaption {
	position: static !important;
	margin: 0.5rem 0 0;
	padding: 0 !important;
	max-height: none !important;
	overflow: visible !important;
	background: none !important;
	color: var(--dl-ink) !important;
	font-family: var(--dl-heading-font);
	font-size: 0.9375rem !important;
	font-weight: 600;
	text-align: left !important;
	text-shadow: none !important;
}

/*
 * With a mouse, the name appears over the photo on hover or keyboard focus. Phones have no hover, so
 * they keep the name under the photo. .dl-content limits this to the live page: in the editor the
 * captions stay visible so they can be edited.
 */

@media (hover: hover) and (pointer: fine) {
	.dl-content .dl-albums .wp-block-image {
		position: relative;
	}

	.dl-content .dl-albums .wp-block-image figcaption {
		position: absolute !important;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0;
		padding: 1rem !important;
		border-radius: 0.25rem;
		background: rgb(9 55 89 / 0.72) !important;
		color: #fff !important;
		font-size: 1.125rem !important;
		line-height: 1.3;
		opacity: 0;
		pointer-events: none;
		text-align: center !important;
		transition: opacity 200ms ease;
	}

	.dl-content .dl-albums .wp-block-image:hover figcaption,
	.dl-content .dl-albums .wp-block-image:focus-within figcaption {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dl-content .dl-albums .wp-block-image figcaption {
		transition: none;
	}
}

/* Projects */

.wp-block-media-text {
	margin-block: 2.5rem;
}

.dl-page-projects .wp-block-media-text {
	max-width: 960px !important;
}

.wp-block-media-text__media img {
	max-height: 20rem;
	object-fit: contain;
}

/* Writing: a research list that's easy to scan */

.dl-pub-index {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dl-pub-index li {
	margin-bottom: 0.375rem;
}

.dl-pub-group {
	margin-top: 2rem;
	scroll-margin-top: 1.5rem;
}

.dl-pub-group h3 {
	margin: 0 0 0.75rem;
}

.dl-pubs {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dl-pubs > li {
	margin: 0;
	padding-block: 0.75rem;
	border-top: 1px solid var(--dl-line);
	color: var(--dl-gray);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.dl-pubs > li strong {
	color: var(--dl-ink);
}

.dl-pubs a {
	font-weight: 700;
	white-space: nowrap;
}

/* Books: the jump list */

.dl-books-index {
	margin-bottom: 2rem;
	padding: 0.875rem 1rem;
	border: 1px solid var(--dl-line);
	border-radius: 0.25rem;
}

.dl-books-index summary {
	font-weight: 700;
	cursor: pointer;
}

.dl-books-index ul {
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
	columns: 2;
	column-gap: 2rem;
	font-size: 0.9375rem;
}

.dl-books-index li {
	margin-bottom: 0.375rem;
	break-inside: avoid;
}

[id^="book-"] {
	scroll-margin-top: 1.5rem;
}

@media (max-width: 40em) {
	.dl-books-index ul {
		columns: 1;
	}
}

/* In the page editor: keep the empty-space "add block" buttons inside the grids usable */

.editor-styles-wrapper .dl-video-grid > .block-list-appender,
.editor-styles-wrapper .dl-podcasts > .block-list-appender {
	position: relative;
	grid-column: 1 / -1;
}
