/*
Theme Name: Zeliomar
Description: Block theme for a reference publication: blush-grey paper, plum ink, serif headings, a thin vertical stem as the recurring motif.
Text Domain: zeliomar
Requires at least: 7.0
Requires PHP: 8.1
Version: 0.1.17
Update URI: false
*/

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

:focus-visible {
	outline: 3px solid var(--wp--preset--color--gilt);
	outline-offset: 2px;
}

::selection {
	background: var(--wp--preset--color--thread);
	color: var(--wp--preset--color--crest-deep);
}

.colophon :focus-visible {
	outline-color: var(--wp--preset--color--parchment);
}

:where(h1, h2, h3) {
	text-wrap: balance;
}

@media print {
	.masthead,
	.colophon,
	.wp-block-search,
	.wp-block-query-pagination {
		display: none;
	}

	body {
		background: none;
		color: #000;
	}

	.wp-block-post-content a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
		word-break: break-all;
	}
}

/* Signet before the site title (design-system 11.3, 15 row 2): decorative, the title stays text. */
.masthead .wp-block-site-title a,
.colophon .wp-block-site-title a {
	--signet: 2rem;
	box-sizing: border-box;
	display: inline-block;
	line-height: 1;
	padding-block: calc((2.75rem - var(--signet)) / 2);
	text-decoration: none;
}

.masthead .wp-block-site-title a,
.colophon .wp-block-site-title a {
	min-height: 2.75rem;
}

.masthead .wp-block-site-title a::before,
.colophon .wp-block-site-title a::before {
	content: "";
	display: inline-block;
	margin-inline-end: 0.625rem;
	vertical-align: middle;
	width: var(--signet);
	height: var(--signet);
	background: url("assets/brand/signet.svg") center / contain no-repeat;
}

.colophon .wp-block-site-title a::before {
	background-image: url("assets/brand/signet-night.svg");
}

/* The footer closes the window on short pages: the page column fills the viewport height
   (minus the admin bar), the main region takes the spare height, the footer sits right after it. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* One rhythm step above the footer: the bottom padding of main, not that plus a block gap. */
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Touch targets (row 3, 10) */
.wp-block-navigation .wp-block-navigation-item__content {
	box-sizing: border-box;
	display: inline-block;
	min-height: 2.75rem;
	padding-block: 0.5rem;
	padding-block: calc((2.75rem - 1lh) / 2);
}

.colophon a {
	box-sizing: border-box;
	display: inline-block;
	min-height: 2.75rem;
	padding-block: 0.5rem;
	padding-block: calc((2.75rem - 1lh) / 2);
}

.wp-block-read-more,
.case-pager a {
	min-height: 2.75rem;
}

.case-pager a {
	display: block;
}

/* Phone and touch screens: rubric links, the two links of the "How we know this" note and the pagination links are 44px targets. A mouse on a wide screen keeps the compact look. The .wp-site-blocks prefix keeps the weight above the block sheets, whatever order they are printed in. The note links sit inside a sentence, so they stay plain inline boxes: the vertical padding grows the tap area without changing the line height of the paragraph (a min-height or inline-flex there would make every line with a link about 44px tall). Page-number links are only a few pixels wide, so they get a 44px minimum width as well. */
@media (max-width: 47.9375rem), (pointer: coarse) {
	.wp-site-blocks .wp-block-post-terms a,
	.wp-site-blocks .wp-block-query-pagination a {
		box-sizing: border-box;
		display: inline-block;
		min-height: 2.75rem;
		padding-block: 0.5rem;
		padding-block: calc((2.75rem - 1lh) / 2);
	}

	.wp-site-blocks .article-end p a {
		display: inline;
		padding-block: 0.8125rem;
	}

	.wp-site-blocks .wp-block-query-pagination-numbers a {
		text-align: center;
		min-width: 2.75rem;
	}

	/* Linked post titles (lists, cards, the lead, the glossary band): a one-line title is one line tall (about 23px), so the tap zone grows by the missing height to 44px without moving anything. Padding takes the zone, an equal negative margin gives the room back (the margin box stays the line box, so rows, wraps and the page height do not move); on an inline box (a wide screen with a coarse pointer) the margin is ignored and the padding alone reaches every wrapped line. The zone grows UPWARD by default: above a title there is a date or a label (not links), and a later box wins a hit test, so a zone must not grow into a link above it. */
	.wp-site-blocks .wp-block-post-title a {
		margin-block-start: -1.3rem;
		margin-block-start: calc(-1 * max(0px, 2.75rem - 1lh));
		padding-block-start: 1.3rem;
		padding-block-start: max(0px, calc(2.75rem - 1lh));
	}

	/* In a list entry the rubric link (a 44px box) sits 6px above the title, and it comes first, so the zone grows DOWNWARD there; nothing below is a link. */
	.wp-site-blocks .stem-entry .wp-block-post-title a {
		margin-block: 0 -1.3rem;
		margin-block: 0 calc(-1 * max(0px, 2.75rem - 1lh));
		padding-block: 0 1.3rem;
		padding-block: 0 max(0px, calc(2.75rem - 1lh));
	}
}

@media (forced-colors: active) {
	.stem-rail,
	.glossary-band {
		border-inline-start-color: CanvasText;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

/* Featured image: core/post-featured-image prints nothing without an image; no placeholder (design-system, Зображення). */
.wp-block-post-featured-image {
	margin-block: 0 var(--wp--preset--spacing--branch);
}

.wp-block-post-featured-image img {
	width: 100%;
	max-width: 100%;
	object-fit: cover;
}

/* Menu toggle: a 44px tap target. */
.wp-block-navigation__responsive-container-open {
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	min-width: 2.75rem;
}

/* Search button: the palette colour, not the core default grey (same specificity as the core rule lost to it). */
.wp-block-search .wp-block-search__button {
	background: var(--wp--preset--color--crest);
	color: var(--wp--preset--color--parchment);
}
