/* Botanical Library: block styles that theme.json cannot express. */

/* Drop caps */
.has-drop-cap:not(:focus)::first-letter {
	font-family: Fraunces, Georgia, serif;
	font-weight: 400;
	font-size: 4.6em;
	line-height: 0.82;
	margin: 0.08em 0.14em 0 0;
	color: var(--wp--preset--color--burgundy);
}

/* Small-caps label */
p.is-style-label {
	font-variant: small-caps;
	letter-spacing: 0.16em;
	font-size: 0.85rem;
	line-height: 1.5;
	margin-bottom: 0.5rem;
}
p.is-style-label:not(.has-text-color) {
	color: var(--wp--preset--color--burgundy);
}

/* Lead paragraph */
p.is-style-lead {
	font-family: Fraunces, Georgia, serif;
	font-style: italic;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}
p.is-style-lead:not(.has-text-color) {
	color: var(--wp--preset--color--pine);
}

/* Fleuron separator: two gilt lines with a fleuron in the middle */
hr.wp-block-separator.is-style-fleuron {
	border: 0 !important;
	height: 1.6rem;
	max-width: 760px;
	width: 100%;
	opacity: 1;
	overflow: visible;
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	background:
		linear-gradient(#C9AE78, #C9AE78) left center / calc(50% - 1.6rem) 1px no-repeat,
		linear-gradient(#C9AE78, #C9AE78) right center / calc(50% - 1.6rem) 1px no-repeat !important;
}
hr.wp-block-separator.is-style-fleuron::before {
	content: "\2766";
	display: block;
	font-size: 1.3rem;
	line-height: 1.6rem;
	color: var(--wp--preset--color--gilt);
}
.has-pine-background-color hr.wp-block-separator.is-style-fleuron::before,
.has-navy-background-color hr.wp-block-separator.is-style-fleuron::before {
	color: var(--wp--preset--color--gilt-light);
}

/* Images */
.wp-block-image.is-style-arch img {
	border-radius: 999px 999px 6px 6px;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	width: 100%;
}
.wp-block-image.is-style-arch {
	padding: 10px;
	border: 1px solid var(--wp--preset--color--gilt);
	border-radius: 999px 999px 12px 12px;
	background: var(--wp--preset--color--paper);
	box-sizing: border-box;
}
.wp-block-image.is-style-gilt-frame {
	padding: 10px;
	border: 1px solid var(--wp--preset--color--gilt);
	background: var(--wp--preset--color--paper);
	box-sizing: border-box;
}
.wp-block-image.is-style-gilt-frame img {
	width: 100%;
}

/* Groups */
.wp-block-group.is-style-card {
	border-radius: 4px;
	padding: clamp(1.5rem, 3vw, 2.5rem);
}
.wp-block-group.is-style-outlined-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: clamp(1.5rem, 3vw, 2.5rem);
}
.wp-block-group.is-style-arch-backdrop {
	border-radius: 999px 999px 18px 18px;
	padding: 22px 22px 0;
	max-width: 460px;
	margin-left: auto;
	margin-right: auto;
}
.wp-block-group.is-style-arch-backdrop > .wp-block-image {
	transform: translateY(22px);
	margin-bottom: 0;
}
.wp-block-group.is-style-arch-backdrop + .wp-block-paragraph,
.wp-block-group.is-style-arch-backdrop + p {
	margin-top: 2.5rem;
}
.wp-block-group.is-style-book-columns {
	column-width: 22rem;
	column-gap: clamp(2rem, 5vw, 4rem);
	display: block !important;
}
.wp-block-group.is-style-book-columns > * {
	break-inside: avoid-column;
	margin-top: 0 !important;
	margin-bottom: 1.25rem !important;
}

/* Contents list */
ul.is-style-contents,
ol.is-style-contents {
	list-style: none;
	padding-left: 0;
	border-top: 1px solid var(--wp--preset--color--line);
}
.is-style-contents > li {
	padding: 0.6rem 0;
	border-bottom: 1px dotted #B9A684;
	margin: 0;
}
.is-style-contents > li a {
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	display: block;
}
.is-style-contents > li a:hover {
	color: var(--wp--preset--color--burgundy);
}
.is-style-contents > li strong {
	font-family: Fraunces, Georgia, serif;
	font-weight: 400;
	color: var(--wp--preset--color--burgundy);
	display: inline-block;
	min-width: 2.4rem;
}

/* Ledger table: role on the left, dates on the right */
.wp-block-table.is-style-ledger table {
	border-collapse: collapse;
	width: 100%;
}
.wp-block-table.is-style-ledger td,
.wp-block-table.is-style-ledger th {
	border: 0;
	padding: 0.2rem 0;
	vertical-align: top;
}
.wp-block-table.is-style-ledger td:last-child {
	text-align: right;
	white-space: nowrap;
	padding-left: 1rem;
	color: var(--wp--preset--color--ink-soft);
}
.wp-block-table.is-style-ledger thead th {
	text-align: left;
	font-weight: 600;
	border: 0;
}
.wp-block-table.is-style-ledger figcaption {
	display: none;
}

/* Dark bands: keep links and labels readable */
.has-pine-background-color a,
.has-navy-background-color a,
.has-burgundy-background-color a,
.has-aubergine-background-color a {
	color: #F3D9A0;
}
.has-pine-background-color p.is-style-label:not(.has-text-color),
.has-navy-background-color p.is-style-label:not(.has-text-color),
.has-burgundy-background-color p.is-style-label:not(.has-text-color),
.has-aubergine-background-color p.is-style-label:not(.has-text-color) {
	color: var(--wp--preset--color--gilt-light);
}

/* Header */
.jvdl-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.wp-block-navigation .wp-block-navigation-item a[aria-current="page"],
.wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--burgundy);
	border-bottom: 1px solid currentColor;
}
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--paper) !important;
	padding: 2rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a {
	font-family: Fraunces, Georgia, serif;
	font-size: 1.6rem;
	padding: 0.4rem 0;
}

/* Linked cards: whole card is the target */
.jvdl-linked-card {
	transition: transform 0.2s ease;
}
.jvdl-linked-card:hover {
	transform: translateY(-2px);
}
.jvdl-linked-card .wp-block-heading a {
	text-decoration: none;
	color: inherit;
}

/* Seal icon used in recognition cards */
.jvdl-seal svg {
	display: block;
	margin: 0 auto;
}

/* Mobile */
@media (max-width: 781px) {
	.wp-block-columns.jvdl-hero {
		gap: 2.5rem !important;
	}
	.wp-block-columns.jvdl-hero.jvdl-image-last > .wp-block-column:last-child {
		order: -1;
	}
	.wp-block-group.is-style-arch-backdrop {
		max-width: 340px;
	}
	.has-drop-cap:not(:focus)::first-letter {
		font-size: 3.6em;
	}
}

/* ------------------------------------------------------------------ */
/* Accessibility                                                       */
/* ------------------------------------------------------------------ */

/* Screen-reader-only text */
.jvdl-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Hide the decorative fleuron from screen readers where supported */
hr.wp-block-separator.is-style-fleuron::before {
	content: "\2766" / "";
}

/* Clear, consistent keyboard focus */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--burgundy);
	outline-offset: 3px;
	border-radius: 2px;
}
:where(.has-pine-background-color, .has-navy-background-color, .has-burgundy-background-color, .has-aubergine-background-color) :where(a, button, summary):focus-visible {
	outline-color: var(--wp--preset--color--gilt-light);
}
.jvdl-linked-card .wp-block-heading a:hover,
.jvdl-linked-card .wp-block-heading a:focus-visible {
	text-decoration: underline;
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
	.jvdl-linked-card:hover {
		transform: none;
	}
}

/* Larger text (Reading comfort). Everything is sized in rem, so it all scales. */
html.jvdl-text-l { font-size: 112.5%; }
html.jvdl-text-xl { font-size: 125%; }

/* High contrast: from the Reading comfort panel, or automatically when the visitor asks their device for more contrast */
html.jvdl-contrast {
	--wp--preset--color--paper: #FFFFFF;
	--wp--preset--color--vellum: #FFFFFF;
	--wp--preset--color--ink: #000000;
	--wp--preset--color--ink-soft: #111111;
	--wp--preset--color--burgundy: #5A0F1F;
	--wp--preset--color--pine: #0E2A21;
	--wp--preset--color--navy: #0D1630;
	--wp--preset--color--aubergine: #33163B;
	--wp--preset--color--gilt: #5A3F0A;
	--wp--preset--color--line: #333333;
	--wp--preset--color--clay: #FFFFFF;
	--wp--preset--color--sage: #FFFFFF;
	--wp--preset--color--mist: #FFFFFF;
	--wp--preset--color--heather: #FFFFFF;
	--wp--preset--color--wheat: #FFFFFF;
	--wp--preset--color--cool-wash: #FFFFFF;
}
html.jvdl-contrast .is-style-card,
html.jvdl-contrast .is-style-outlined-card {
	border: 2px solid #000000;
}
html.jvdl-contrast :where(.has-pine-background-color, .has-navy-background-color) .is-style-outlined-card {
	border-color: #FFFFFF;
}
html.jvdl-contrast a {
	text-decoration: underline !important;
}
html.jvdl-contrast hr.wp-block-separator.is-style-fleuron {
	background:
		linear-gradient(#000, #000) left center / calc(50% - 1.6rem) 2px no-repeat,
		linear-gradient(#000, #000) right center / calc(50% - 1.6rem) 2px no-repeat !important;
}
@media (prefers-contrast: more) {
	html:not(.jvdl-contrast-off) {
		--wp--preset--color--paper: #FFFFFF;
		--wp--preset--color--vellum: #FFFFFF;
		--wp--preset--color--ink: #000000;
		--wp--preset--color--ink-soft: #111111;
		--wp--preset--color--line: #333333;
		--wp--preset--color--clay: #FFFFFF;
		--wp--preset--color--sage: #FFFFFF;
		--wp--preset--color--mist: #FFFFFF;
		--wp--preset--color--heather: #FFFFFF;
		--wp--preset--color--wheat: #FFFFFF;
		--wp--preset--color--cool-wash: #FFFFFF;
	}
	.is-style-card, .is-style-outlined-card { border: 2px solid currentColor; }
	a { text-decoration: underline !important; }
}

/* Windows high-contrast / forced colours: keep structure visible */
@media (forced-colors: active) {
	hr.wp-block-separator.is-style-fleuron {
		background: none !important;
		border-top: 1px solid CanvasText !important;
		height: 0;
	}
	hr.wp-block-separator.is-style-fleuron::before { content: none; }
	.is-style-card, .is-style-outlined-card, .wp-block-image.is-style-arch, .wp-block-image.is-style-gilt-frame {
		border: 1px solid CanvasText;
	}
}

/* Reading comfort control */
.jvdl-comfort {
	position: relative;
	font-size: 1rem;
}
.jvdl-comfort > summary {
	list-style: none;
	cursor: pointer;
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 3px;
	font-family: Fraunces, Georgia, serif;
	font-size: 1.15rem;
	color: var(--wp--preset--color--pine);
	padding: 0 0.6rem;
}
.jvdl-comfort > summary::-webkit-details-marker { display: none; }
.jvdl-comfort__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 50;
	width: min(18rem, 80vw);
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: 1rem 1.1rem 1.1rem;
	box-shadow: 0 8px 24px rgba(42, 36, 32, 0.12);
}
.jvdl-comfort__panel p {
	margin: 0 0 0.4rem;
	font-variant: small-caps;
	letter-spacing: 0.14em;
	font-size: 0.85rem;
	color: var(--wp--preset--color--burgundy);
}
.jvdl-comfort__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.9rem;
}
.jvdl-comfort__panel button {
	min-height: 44px;
	min-width: 44px;
	padding: 0 0.8rem;
	border: 1px solid var(--wp--preset--color--ink-soft);
	border-radius: 3px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
	cursor: pointer;
}
.jvdl-comfort__panel button[aria-pressed="true"] {
	background: var(--wp--preset--color--pine);
	border-color: var(--wp--preset--color--pine);
	color: #FFFFFF;
}
.jvdl-comfort__panel button[data-jvdl-reset] {
	border-style: dashed;
}

/* ------------------------------------------------------------------ */
/* Posts and pages: layouts and fold-outs                              */
/* ------------------------------------------------------------------ */

/* Column layouts inside posts and pages may use the wide width; plain text stays at book-page width. */
.wp-block-post-content > .wp-block-columns,
.wp-block-post-content > .wp-block-group:has(> .wp-block-columns) {
	max-width: var(--wp--style--global--wide-size) !important;
}
.wp-block-post-content > .wp-block-columns {
	gap: clamp(1.5rem, 4vw, 3.5rem);
	margin-top: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--40);
}

/* Category links above a post title */
.wp-block-post-terms a {
	text-decoration: none;
}

/* Fold-out sections (details) */
.wp-block-details {
	border-top: 1px solid var(--wp--preset--color--line);
	padding: 0.9rem 0;
	margin: 0 !important;
}
.wp-block-details + .wp-block-details {
	border-top: 1px solid var(--wp--preset--color--line);
}
.wp-block-details:last-of-type {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.wp-block-details > summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	font-family: Fraunces, Georgia, serif;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--pine);
	min-height: 44px;
	align-items: center;
}
.wp-block-details > summary::-webkit-details-marker {
	display: none;
}
.wp-block-details > summary::before {
	content: "+";
	content: "+" / "";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 1.6rem;
	height: 1.6rem;
	border: 1px solid var(--wp--preset--color--gilt);
	border-radius: 50%;
	font-family: "Source Serif 4", Georgia, serif;
	font-size: 1.1rem;
	line-height: 1;
	color: var(--wp--preset--color--burgundy);
}
.wp-block-details[open] > summary::before {
	content: "\2212";
	content: "\2212" / "";
}
.wp-block-details[open] > summary {
	margin-bottom: 0.6rem;
}
.wp-block-details > :not(summary) {
	padding-left: 2.35rem;
}
@media (max-width: 600px) {
	.wp-block-details > :not(summary) {
		padding-left: 0;
	}
}

/* ------------------------------------------------------------------ */
/* Post lists that fill themselves from a category                     */
/* ------------------------------------------------------------------ */

/* Tinted chapter cards: tints cycle clay, sage, mist, heather; numbered I, II, III … */
.wp-block-post-template.is-style-tinted-series {
	counter-reset: jvdl-chapter;
	gap: 1.4rem;
}
.wp-block-post-template.is-style-tinted-series > li {
	counter-increment: jvdl-chapter;
	border-radius: 4px;
	padding: clamp(1.4rem, 3vw, 2rem);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	background: var(--wp--preset--color--clay);
}
.wp-block-post-template.is-style-tinted-series > li:nth-child(4n+2) { background: var(--wp--preset--color--sage); }
.wp-block-post-template.is-style-tinted-series > li:nth-child(4n+3) { background: var(--wp--preset--color--mist); }
.wp-block-post-template.is-style-tinted-series > li:nth-child(4n+4) { background: var(--wp--preset--color--heather); }
.wp-block-post-template.is-style-tinted-series > li::before {
	content: counter(jvdl-chapter, upper-roman);
	font-family: Fraunces, Georgia, serif;
	font-size: 2.6rem;
	line-height: 1;
	color: var(--wp--preset--color--burgundy);
}
.wp-block-post-template.is-style-tinted-series > li:nth-child(4n+2)::before { color: var(--wp--preset--color--pine); }
.wp-block-post-template.is-style-tinted-series > li:nth-child(4n+3)::before { color: var(--wp--preset--color--navy); }
.wp-block-post-template.is-style-tinted-series > li:nth-child(4n+4)::before { color: var(--wp--preset--color--aubergine); }
.wp-block-post-template.is-style-tinted-series .wp-block-post-title {
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0;
}
.wp-block-post-template.is-style-tinted-series .wp-block-post-title a,
.wp-block-post-template.is-style-gallery .wp-block-post-title a {
	text-decoration: none;
	color: inherit;
}
.wp-block-post-template.is-style-tinted-series .wp-block-post-title a:hover,
.wp-block-post-template.is-style-gallery .wp-block-post-title a:hover {
	text-decoration: underline;
}
.wp-block-post-template.is-style-tinted-series .wp-block-post-excerpt {
	color: var(--wp--preset--color--ink-soft);
	margin: 0;
}
.wp-block-post-template.is-style-tinted-series .wp-block-post-excerpt__more-text {
	margin-top: 0.6rem;
	font-style: italic;
}

/* Framed gallery: featured images in gilt frames, "plate I, II …" above each title */
.wp-block-post-template.is-style-gallery {
	counter-reset: jvdl-plate;
	gap: 2.5rem 1.75rem;
}
.wp-block-post-template.is-style-gallery > li {
	counter-increment: jvdl-plate;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.wp-block-post-template.is-style-gallery .wp-block-post-title {
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0;
}
.wp-block-post-template.is-style-gallery .wp-block-post-title::before {
	content: "plate " counter(jvdl-plate, upper-roman);
	display: block;
	font-family: "Source Serif 4", Georgia, serif;
	font-variant: small-caps;
	letter-spacing: 0.16em;
	font-size: 0.85rem;
	color: var(--wp--preset--color--burgundy);
	margin: 0.6rem 0 0.2rem;
}
.wp-block-post-template.is-style-gallery .wp-block-post-excerpt {
	color: var(--wp--preset--color--ink-soft);
	margin: 0;
}
.wp-block-post-featured-image.is-style-gilt-frame,
.wp-block-post-template.is-style-gallery .wp-block-post-featured-image {
	padding: 10px;
	border: 1px solid var(--wp--preset--color--gilt);
	background: var(--wp--preset--color--paper);
	box-sizing: border-box;
	margin: 0;
}
.wp-block-post-template.is-style-gallery .wp-block-post-featured-image img {
	aspect-ratio: 1;
	object-fit: cover;
	width: 100%;
}
html.jvdl-contrast .wp-block-post-template.is-style-tinted-series > li {
	border: 2px solid #000;
}
@media (forced-colors: active) {
	.wp-block-post-template.is-style-tinted-series > li { border: 1px solid CanvasText; }
}

/* Rose sprig beside the site title */
.jvdl-sprig { display: inline-flex; line-height: 0; }
.jvdl-sprig svg { display: block; }
html.jvdl-contrast .jvdl-sprig svg { stroke: currentColor; }
@media (forced-colors: active) { .jvdl-sprig svg { stroke: CanvasText; } }
