/* Notebook — refinements beyond theme.json.
   Words on paper, images in the darkroom. */

:root {
	--nb-measure: 40rem;
	--nb-hairline: 1px solid var(--wp--preset--color--line);
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
	transition: background-color 0.28s ease, color 0.28s ease;
}

/* Optical margins on headings and titles. */
.wp-block-post-title,
h1, h2, h3 {
	text-wrap: balance;
	hanging-punctuation: first last;
}

/* Longer prose reads better slightly relaxed. */
.wp-block-post-content p {
	text-wrap: pretty;
}

/* Links: quiet underline offset. */
a {
	text-underline-offset: 0.14em;
	text-decoration-thickness: 0.5px;
}

/* ---- Header ---------------------------------------------------- */

.nb-masthead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
	padding-block: 1.6rem;
	border-bottom: var(--nb-hairline);
}

.nb-masthead .wp-block-site-title {
	font-weight: 440;
	letter-spacing: -0.01em;
}

.nb-masthead .wp-block-site-title a {
	text-decoration: none;
}

.nb-nav .wp-block-navigation__container,
.nb-nav ul {
	gap: 1.4rem;
}

.nb-nav a {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.06em;
	text-transform: lowercase;
	text-decoration: none;
	color: var(--wp--preset--color--muted);
}

.nb-nav a:hover {
	color: var(--wp--preset--color--ink);
}

/* ---- Contact-sheet meta --------------------------------------- */

.nb-meta,
.wp-block-post-date,
.nb-meta * {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--muted);
}

.wp-block-post-date a {
	text-decoration: none;
	color: inherit;
}

/* ---- The index (home / archives) ------------------------------ */

.nb-index .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
	line-height: 1.2;
	margin: 0.15rem 0 0;
}

.nb-index .wp-block-post-title a {
	text-decoration: none;
}

.nb-index .wp-block-post-title a:hover {
	text-decoration: underline;
}

.nb-index li + li,
.nb-index .wp-block-post-template > li {
	padding-block: 1.4rem;
	border-top: var(--nb-hairline);
}

.nb-index .wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Photography grid archive. */
.nb-grid .wp-block-post-template {
	gap: 1rem;
}

.nb-grid figure,
.nb-grid img {
	margin: 0;
	width: 100%;
	height: auto;
	display: block;
}

.nb-grid .wp-block-post-featured-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* ---- Reading: essays and poems -------------------------------- */

.wp-block-verse {
	font-family: var(--wp--preset--font-family--serif);
	white-space: pre-wrap;
	padding: 0;
	margin-block: var(--wp--preset--spacing--40);
	color: inherit;
}

.wp-block-post-content > * {
	margin-inline: auto;
}

/* First line of an essay eases in without a drop cap. */
.wp-block-post-content > p:first-of-type {
	margin-top: var(--wp--preset--spacing--30);
}

/* ---- Images --------------------------------------------------- */

figure.wp-block-image {
	margin-inline: auto;
}

figure.wp-block-image img {
	display: block;
}

.wp-element-caption,
figcaption {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--muted);
	text-align: left;
	margin-top: 0.6rem;
}

/* Gallery as a quiet stack rather than a tight mosaic. */
.wp-block-gallery.is-nb-stack {
	gap: var(--wp--preset--spacing--40) !important;
}

.wp-block-gallery.is-nb-stack .wp-block-image {
	width: 100% !important;
}

/* Native lightbox: dim to the darkroom, not to grey. */
.wp-lightbox-overlay {
	background: rgba(10, 10, 10, 0.97);
}

.wp-lightbox-overlay .close-button {
	color: var(--wp--preset--color--bone);
}

/* ---- Footer --------------------------------------------------- */

.nb-colophon {
	border-top: var(--nb-hairline);
	padding-block: 2rem 3rem;
	margin-top: var(--wp--preset--spacing--60);
}

.nb-colophon p {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--muted);
	margin: 0;
}

/* ---- The darkroom surround ------------------------------------ */

body.is-dark {
	background: var(--wp--preset--color--dark);
	color: var(--wp--preset--color--bone);
}

body.is-dark a,
body.is-dark .wp-block-post-title a,
body.is-dark .wp-block-site-title a {
	color: var(--wp--preset--color--bone);
}

body.is-dark .nb-masthead,
body.is-dark .nb-colophon,
body.is-dark .nb-index li + li,
body.is-dark .nb-index .wp-block-post-template > li {
	border-color: rgba(232, 232, 228, 0.14);
}

body.is-dark .nb-nav a,
body.is-dark .nb-meta,
body.is-dark .wp-block-post-date,
body.is-dark .wp-element-caption,
body.is-dark figcaption,
body.is-dark .nb-colophon p {
	color: #8b8b84;
}

body.is-dark .nb-nav a:hover {
	color: var(--wp--preset--color--bone);
}

/* ---- Floor: focus, motion, mobile ----------------------------- */

:where(a, button, input, .wp-block-navigation-item a):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 1px;
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

@media (max-width: 600px) {
	.nb-masthead {
		padding-block: 1.1rem;
	}
}
