/* Tenebrae: styles theme.json can't express. */

:root {
	--t-ink: var(--wp--preset--color--ink);
	--t-panel: var(--wp--preset--color--panel);
	--t-bone: var(--wp--preset--color--bone);
	--t-silver: var(--wp--preset--color--silver);
	/* Main accent #f04a32. Crimson and Blood are the same colour: Crimson is used for
	   text/links, Blood for fills (buttons, badges, back-to-top). Change both together. */
	--t-crimson: var(--wp--preset--color--crimson);
	--t-blood: var(--wp--preset--color--blood);
	--t-line: var(--wp--preset--color--line);
	--t-line-mid: #4a5160; /* medium gray: form field borders, row dividers */
	color-scheme: dark;
}

html { scroll-padding-top: 80px; }
body { overflow-x: hidden; }
p { max-width: 62ch; }
.has-text-align-center { margin-inline: auto; }

/* ---------- Header ---------- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--t-ink);
}
.admin-bar header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar header.wp-block-template-part { top: 0; } }

/* Header content lines up with the page content (wide size, 20px gutters). */
header.wp-block-template-part > .wp-block-group {
	width: min(var(--wp--style--global--wide-size, 1040px), calc(100% - 40px));
	max-width: none !important;
	margin-inline: auto !important;
	padding-inline: 0 !important;
	box-sizing: border-box;
}
header.wp-block-template-part .has-global-padding { padding-inline: 0 !important; }
header.wp-block-template-part > .wp-block-group > * { max-width: none !important; }

/* Tight header: half the space above the title and between title and menu when they stack. */
.tenebrae-header { padding-block: 6px; }
.tenebrae-bar { gap: 6px 12px; }
header.wp-block-template-part :is(.wp-block-site-title, .wp-block-navigation) { margin-block: 0 !important; }
/* Site title size: matches page titles (x-large preset, fluid 1.7rem → 2.6rem). */
header.wp-block-template-part .wp-block-site-title { font-size: var(--wp--preset--font-size--x-large); line-height: 1.15; }

.tenebrae-bar .wp-block-site-title a { color: var(--t-bone); }
.tenebrae-bar .wp-block-site-title a:hover { color: var(--t-crimson); }

.tenebrae-nav .wp-block-navigation-item__content {
	padding: 6px 10px;
	border-bottom: 2px solid transparent;
	color: var(--t-bone);
	white-space: nowrap;
}
.tenebrae-nav .wp-block-navigation-item__content:hover {
	color: var(--t-bone);
	border-color: var(--t-crimson);
}
/* Current page in the menu: red text. */
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation-item__content[aria-current="page"],
.wp-block-navigation .is-menu-open .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--t-crimson) !important;
	/* Dark red reads thinner/smaller than white on the dark bar; a hairline stroke
	   restores the visual weight without changing glyph width (no menu shift). */
	-webkit-text-stroke: .35px currentColor;
}
/* Mobile menu overlay: dark list with dividers, like the original. */
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--t-ink) !important;
	color: var(--t-bone) !important;
	padding: 20px 16px;
}
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close { color: var(--t-bone) !important; }
.wp-block-navigation__responsive-container-close:hover { color: var(--t-crimson) !important; }
.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 32px !important; }
.is-menu-open .wp-block-navigation__container { width: 100%; gap: 0 !important; }
.is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid var(--t-line); }
.wp-block-navigation .is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 14px 4px !important;
	border-bottom: 0;
	font-size: 1.05rem;
	color: var(--t-bone) !important;
}
.wp-block-navigation .is-menu-open .wp-block-navigation-item__content:hover,
.wp-block-navigation .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
	color: var(--t-crimson) !important;
}

/* Submenus (desktop dropdown). */
.wp-block-navigation .wp-block-navigation__submenu-container {
	background-color: var(--t-panel) !important;
	color: var(--t-bone) !important;
	border: 1px solid var(--t-line) !important;
	border-radius: 3px;
	padding: 6px 0 !important;
	min-width: 200px !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	padding: 8px 16px !important;
	border-bottom: 0 !important;
	color: var(--t-bone) !important;
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content {
	color: var(--t-crimson) !important;
	background: rgba(255, 255, 255, .04);
}
.wp-block-navigation .wp-block-navigation__submenu-icon { color: currentColor; }

/* Submenus inside the mobile overlay: inline, indented, no box. */
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none;
	padding: 0 0 0 16px !important;
	min-width: 0 !important;
}
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { border-bottom: 0; }
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 4px !important;
	font-size: .98rem;
	color: var(--t-bone) !important;
	background: none;
}
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible,
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--t-crimson) !important;
}

/* Social row inside the mobile menu (injected by inc/setup.php). */
.tenebrae-menu-social { display: none; }
.is-menu-open .tenebrae-menu-social {
	display: flex;
	justify-content: center;
	order: 99;
	width: 100%;
	padding-top: 20px;
}
.is-menu-open .tenebrae-menu-social .wp-block-social-links { justify-content: center; gap: 12px; }

.tenebrae-social .wp-social-link a { padding: 8px; }
/* Header + mobile menu icons: white logos only, no brand colours or backgrounds
   (also covers a header saved in the Site Editor without the theme's icon settings). */
header.wp-block-template-part .wp-social-link,
header.wp-block-template-part .wp-social-link a,
.tenebrae-menu-social .wp-social-link,
.tenebrae-menu-social .wp-social-link a {
	color: var(--t-bone) !important;
	background: none !important;
}
header.wp-block-template-part .wp-social-link svg,
.tenebrae-menu-social .wp-social-link svg { fill: currentColor; }
.tenebrae-social .wp-social-link:hover,
header.wp-block-template-part .wp-social-link:hover,
header.wp-block-template-part .wp-social-link:hover a,
.tenebrae-menu-social .wp-social-link:hover,
.tenebrae-menu-social .wp-social-link:hover a { color: var(--t-crimson) !important; }
/* Header and footer icons: same spacing; the 8px padding on each icon alone sets it. */
header.wp-block-template-part .wp-block-social-links,
footer.wp-block-template-part .wp-block-social-links { gap: 0 !important; }
header.wp-block-template-part .wp-social-link a,
footer.wp-block-template-part .wp-social-link a { padding: 8px !important; }
/* One icon size everywhere (header, footer, mobile menu), whatever size the block is set to. */
header.wp-block-template-part .wp-social-link svg,
footer.wp-block-template-part .wp-social-link svg,
.tenebrae-menu-social .wp-social-link svg { width: 20px !important; height: 20px !important; }
@media (max-width: 900px) { .tenebrae-bar .tenebrae-social { display: none; } }

.wc-block-mini-cart__button { color: var(--t-bone); }

/* Account icon: white like the cart, red on hover (WooCommerce colours it blue on the account page). */
header.wp-block-template-part .wp-block-woocommerce-customer-account a,
header.wp-block-template-part .wc-block-mini-cart__button { color: var(--t-bone) !important; }
header.wp-block-template-part .wp-block-woocommerce-customer-account a:hover,
header.wp-block-template-part .wp-block-woocommerce-customer-account a:focus-visible,
header.wp-block-template-part .wc-block-mini-cart__button:hover,
header.wp-block-template-part .wc-block-mini-cart__button:focus-visible { color: var(--t-crimson) !important; }
/* Account and cart icons: same 8px padding (16px between icons) as the social icons. */
header.wp-block-template-part .wp-block-woocommerce-customer-account a,
header.wp-block-template-part .wc-block-mini-cart__button {
	display: flex;
	align-items: center;
	padding: 8px !important;
	margin: 0 !important;
	min-height: 0 !important;
	line-height: 1;
}
/* The group holding them: no extra gap, so only the padding spaces the icons. */
header.wp-block-template-part .wp-block-group:has(> .wp-block-woocommerce-mini-cart),
header.wp-block-template-part .wp-block-group:has(> .wp-block-woocommerce-customer-account) { gap: 0 !important; }

/* ---------- Footer ---------- */
footer.wp-block-template-part {
	color: #ffffff;
	font-size: var(--wp--preset--font-size--small);
}
.tenebrae-footer { padding-block: 30px; }
.tenebrae-footer p { margin: 0; }
/* Links line, then a quieter copyright line beneath. */
.tenebrae-footer-text { display: flex; flex-direction: column; gap: 4px; }
.tenebrae-footer .tenebrae-copyright { color: var(--t-bone); }
/* Footer text links (Privacy, Refund & Returns): red, underline on hover. */
.tenebrae-footer p a { color: var(--t-crimson); text-decoration: none; }
.tenebrae-footer p a:hover,
.tenebrae-footer p a:focus-visible { color: var(--t-crimson); text-decoration: underline; text-underline-position: under; }
/* Stacked footer: icons above the copyright line. */
@media (max-width: 782px) {
	footer.wp-block-template-part .wp-block-social-links { order: -1; width: 100%; }
}

/* ---------- Main ---------- */
.tenebrae-main { padding-block: 36px 70px; }
@media (max-width: 760px) { .tenebrae-main { padding-block: 26px 50px; } }
.tenebrae-meta, .tenebrae-meta p { color: #ffffff; font-size: var(--wp--preset--font-size--small); } /* 15px */

/* ---------- Hero ---------- */
.tenebrae-hero { text-align: center; padding-block: 24px 10px; }
.wp-block-image.tenebrae-eclipse {
	width: min(260px, 62vw);
	aspect-ratio: 1;
	margin: 0 auto 56px;
	border-radius: 50%;
	background: radial-gradient(circle closest-side, #05060a 55%, #301717 100%);
	box-shadow: 0 0 40px 20px #301717, 0 0 100px 10px #8b1f1f45;
	position: relative;
	overflow: hidden;
}
/* Emblem link: fills the circle; slight brighten on hover; focus ring around the circle
   (on the figure, since its overflow:hidden would clip an outline on the link). */
.wp-block-image.tenebrae-eclipse a { display: block; width: 100%; height: 100%; }
.wp-block-image.tenebrae-eclipse a:hover img { filter: brightness(.9); }
.wp-block-image.tenebrae-eclipse a:focus-visible { outline: none; }
.wp-block-image.tenebrae-eclipse:has(a:focus-visible) { outline: 2px solid var(--t-crimson); outline-offset: 4px; }
.wp-block-image.tenebrae-eclipse img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 52% 28%;
	transform: scale(1.155);
	filter: brightness(.75);
	-webkit-mask-image: radial-gradient(circle closest-side, #000 80%, transparent 100%);
	mask-image: radial-gradient(circle closest-side, #000 80%, transparent 100%);
}
.tenebrae-invocation {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-size: clamp(1.15rem, 3vw, 1.5rem);
	max-width: 46ch;
	margin-inline: auto;
}
.tenebrae-invocation-note { margin-top: 4px; font-size: .85rem; }

/* ---------- Cards / tags ---------- */
/* Centered wrap like the original .grid.center (overrides the block grid layout). */
.wp-block-group.tenebrae-features {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: 18px;
	margin-top: 40px;
}
.wp-block-group.tenebrae-features > .is-style-tenebrae-card { flex: 1 1 230px; max-width: 320px; }
@media (max-width: 480px) { .wp-block-group.tenebrae-features > .is-style-tenebrae-card { max-width: none; } }
.is-style-tenebrae-card {
	background: var(--t-panel);
	border: 1px solid var(--t-line);
	padding: 18px;
	gap: 6px;
	align-items: stretch !important;
}
.is-style-tenebrae-card > .wp-block-shortcode,
.is-style-tenebrae-card > p:empty { display: contents; }
/* h2 = current markup; h3 = pages/templates saved before the heading-level fix. */
.is-style-tenebrae-card :is(h2, h3) { margin: 0; }
.is-style-tenebrae-card :is(h2, h3) a { text-decoration: none; }
.is-style-tenebrae-card :is(h2, h3) a:hover,
.is-style-tenebrae-card :is(h2, h3) a:focus-visible { color: var(--t-crimson); text-decoration: underline; }
.tenebrae-card__action { margin-top: auto !important; justify-content: flex-end; display: flex; }

.is-style-tenebrae-tag { margin: 0; }
.is-style-tenebrae-tag a,
p.is-style-tenebrae-tag:not(:has(a)) {
	display: inline-block;
	font-size: .8rem;
	padding: 1px 8px;
	border: 1px solid var(--t-crimson);
	border-radius: 20px;
	color: var(--t-crimson);
	text-decoration: none;
}
.is-style-tenebrae-tag a:hover { background: rgba(240, 74, 50, .15); color: var(--t-crimson); }

/* ---------- Rows (resources, events, posts) ---------- */
.is-style-tenebrae-row,
.tenebrae-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	border-bottom: 1px solid var(--t-line-mid);
	padding-block: 16px;
	margin-block: 0 !important;
}
.is-style-tenebrae-row h2, .is-style-tenebrae-row h3,
.tenebrae-row h2, .tenebrae-row h3 { margin: 0; }
.is-style-tenebrae-row p, .tenebrae-row p { margin: 6px 0 0; }
.tenebrae-row__main { flex: 1 1 320px; min-width: 200px; }
.tenebrae-row__main > * { margin-block: 0; }
/* Row text starts at the left edge, not centered at reading width. */
.is-style-tenebrae-row > .wp-block-group > *,
.tenebrae-row__main > * { margin-inline: 0 !important; max-width: none !important; }
/* Resource and event titles: bold accent red, links underline only on hover. */
.tenebrae-resources .is-style-tenebrae-row :is(h2, h3),
.tenebrae-row__title { color: var(--t-crimson); font-weight: 700; }
.tenebrae-row__title a,
.tenebrae-resources a:not(.wp-element-button) { color: var(--t-crimson); text-decoration: none; }
.tenebrae-row__title a:hover, .tenebrae-row__title a:focus-visible,
.tenebrae-resources a:not(.wp-element-button):hover,
.tenebrae-resources a:not(.wp-element-button):focus-visible { color: var(--t-crimson); text-decoration: underline; }
.tenebrae-row__action { display: flex; align-items: center; gap: 14px; }
.tenebrae-btn { display: inline-block; text-decoration: none; }
/* Event date (events list, home card, single event product). */
.tenebrae-row__date,
.tenebrae-event-date { color: var(--t-bone); font-size: inherit; font-weight: 600; }
.tenebrae-row__date + .tenebrae-row__desc { margin-top: 2px; }
.tenebrae-card__date { margin: 0; font-weight: 600; }
/* Home card: the info line is a .tenebrae-meta paragraph (silver, small); keep it white, normal size. */
.tenebrae-meta.tenebrae-card__date { color: var(--t-bone); font-size: inherit; }
/* "Date:" / "Cost:" labels; sale prices keep WooCommerce's struck-through old price. */
.tenebrae-row__date .amount,
.tenebrae-card__date .amount { color: inherit; }
@media (max-width: 760px) {
	.is-style-tenebrae-row, .tenebrae-row { flex-direction: column; align-items: flex-start; }
	/* In a column, flex-basis is height: drop it so text and button sit together. */
	.tenebrae-row__main { flex: 0 1 auto; width: 100%; }
	.tenebrae-row__action, .is-style-tenebrae-row .wp-block-buttons { width: 100%; }
	.tenebrae-row__action .tenebrae-btn,
	.is-style-tenebrae-row .wp-block-button { flex: 1; text-align: center; }
	.is-style-tenebrae-row .wp-block-button__link { width: 100%; }
}

/* ---------- Course ---------- */
.tenebrae-course { counter-reset: ritual; }
.tenebrae-course > p { max-width: none; }
.tenebrae-phase { font-family: var(--wp--preset--font-family--body); font-size: 1rem !important; font-weight: 600; margin-top: 22px !important; margin-bottom: 0 !important; }
.tenebrae-phase + .tenebrae-meta { margin-top: 4px; }
.wp-block-details { margin-block: 8px 0 !important; }
.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 4px 0;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::before {
	content: "\25E6";
	color: var(--t-crimson);
	width: 1.4em;
	flex: none;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
}
.wp-block-details.is-style-tenebrae-numbered summary::before {
	counter-increment: ritual;
	content: counter(ritual);
}
.wp-block-details[open] { border-color: var(--t-crimson); }
.wp-block-details > :not(summary) { margin: 8px 0 6px calc(1.4em + 12px); max-width: none; }

/* ---------- Books (product collection) ---------- */
.tenebrae-books .wc-block-product-template { gap: 18px; }
.tenebrae-books .wc-block-product {
	display: flex;
	flex-direction: row;
	gap: 20px;
	align-items: stretch;
	background: var(--t-panel);
	border: 1px solid var(--t-line);
	padding: 18px;
	text-align: left;
}
.tenebrae-books .tenebrae-books__cover { width: 140px; flex: none; margin: 0 !important; align-self: flex-start; }
.tenebrae-books .tenebrae-books__cover img { aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--t-line); transition: filter .25s; }
.tenebrae-books .wc-block-product:hover .tenebrae-books__cover img { filter: brightness(1.08); }
.tenebrae-books__info { flex: 1; min-width: 0; gap: 8px; align-items: stretch !important; }
.tenebrae-books__info > * { margin: 0 !important; }
.tenebrae-books__info .wp-block-post-title a { text-decoration: none; }
.tenebrae-books__info .wp-block-post-excerpt { flex: 1; }
.tenebrae-books__info .wp-block-post-excerpt__more-text { display: none; }
.tenebrae-books__info .wc-block-components-product-button { align-self: flex-end; margin-top: auto !important; }
@media (max-width: 480px) {
	.tenebrae-books .wc-block-product { flex-direction: column; }
	.tenebrae-books .tenebrae-books__cover { width: 100%; max-width: 200px; }
	.tenebrae-books__info .wc-block-components-product-button { align-self: stretch; }
}

/* ---------- WooCommerce general ---------- */
.tenebrae-products .wc-block-product {
	background: var(--t-panel);
	border: 1px solid var(--t-line);
	padding: 14px;
}
.tenebrae-products .wp-block-post-title a { text-decoration: none; }
/* Shop, category, tag and search grids: cards 25% smaller than the 3-across default
   (4 across at full width, fewer on narrow screens). Text sizes match the home page cards. */
.tenebrae-products .wc-block-product-template {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)) !important;
}
/* Column cards: price + button pinned to the bottom, so they line up across a row
   whatever the title length. */
.tenebrae-products .wc-block-product { padding: 18px; display: flex; flex-direction: column; }
.tenebrae-products .wc-block-product > .wp-block-woocommerce-product-price,
.tenebrae-products .wc-block-product > .wc-block-components-product-price { margin-top: auto !important; }
.tenebrae-products .wp-block-post-title { font-size: var(--wp--preset--font-size--large) !important; }
.tenebrae-products .wc-block-components-product-price,
.tenebrae-products .wp-block-woocommerce-product-price { font-size: var(--wp--preset--font-size--medium) !important; }
.tenebrae-products .wp-block-button__link,
.tenebrae-products .wc-block-components-product-button__button {
	font-size: var(--wp--preset--font-size--medium) !important;
	padding: 8px 14px !important;
}
/* Product grids (Shop, category, tag, search): square images. Low specificity so the
   Books page's 3:4 covers (.tenebrae-books__cover) still win. */
:where(.wp-block-woocommerce-product-collection) :where(.wc-block-components-product-image) img {
	aspect-ratio: 1;
	object-fit: cover;
	width: 100%;
	height: auto;
}
.wc-block-components-product-price, .wp-block-woocommerce-product-price { color: var(--t-bone); }
.wc-block-components-product-sale-badge { background: var(--t-blood); color: #fff; border-color: var(--t-blood); }
.woocommerce-breadcrumb, .wc-block-breadcrumbs { color: var(--t-silver); font-size: .9rem; }
/* Current page (last crumb) in red. */
.woocommerce-breadcrumb .tenebrae-crumb:last-child { color: var(--t-crimson); }

/* Single posts use the same width as pages and the header (also for saved templates). */
body.single-post main .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
body.single-post main.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: var(--wp--style--global--wide-size, 1040px);
}
.tenebrae-post-nav { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--t-line); }
.tenebrae-product .wp-block-post-title { margin-top: 0; }
/* Single product: image column half its old width (40% → 20%); text gets the rest. */
@media (min-width: 782px) {
	.tenebrae-product > .wp-block-column:first-child { flex-basis: 20% !important; }
	.tenebrae-product > .wp-block-column:last-child { flex-basis: 80% !important; }
}
/* Stacked on phones/tablets: image at half the screen width, centred. */
@media (max-width: 781px) {
	.tenebrae-product > .wp-block-column:first-child { max-width: 50%; margin-inline: auto; }
}
/* Product meta (Category / Tags): stacked lines; term links red, underline on hover. */
.wp-block-woocommerce-product-meta > .wp-block-group { flex-direction: column; align-items: flex-start; gap: 4px; }
.wp-block-woocommerce-product-meta .wp-block-post-terms a { color: var(--t-crimson); text-decoration: none; }
.wp-block-woocommerce-product-meta .wp-block-post-terms a:hover,
.wp-block-woocommerce-product-meta .wp-block-post-terms a:focus-visible { color: var(--t-crimson); text-decoration: underline; text-underline-position: under; }

/* My account: menu like the site menu (white, red for current page and hover);
   links in the content red, underline on hover. */
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }
.woocommerce-MyAccount-navigation li { margin: 0 !important; padding: 0 !important; }
.woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 6px 0;
	color: var(--t-bone) !important;
	text-decoration: none !important;
}
.woocommerce-MyAccount-navigation li a:hover,
.woocommerce-MyAccount-navigation li a:focus-visible,
.woocommerce-MyAccount-navigation li.is-active a { color: var(--t-crimson) !important; }
.woocommerce-account .woocommerce-MyAccount-content a:not(.button):not(.wp-element-button),
.woocommerce-account .woocommerce-form a:not(.button):not(.wp-element-button),
.woocommerce-account .woocommerce-LostPassword a {
	color: var(--t-crimson) !important;
	text-decoration: none !important;
}
.woocommerce-account .woocommerce-MyAccount-content a:not(.button):not(.wp-element-button):hover,
.woocommerce-account .woocommerce-MyAccount-content a:not(.button):not(.wp-element-button):focus-visible,
.woocommerce-account .woocommerce-form a:not(.button):not(.wp-element-button):hover,
.woocommerce-account .woocommerce-LostPassword a:hover {
	text-decoration: underline !important;
	text-underline-position: under;
}
/* Account buttons (View order, Download, Save changes, Log in): site button style. */
.woocommerce-account .button,
.woocommerce-account button[type="submit"] {
	background: var(--t-blood) !important;
	color: #fff !important;
	border: 1px solid var(--t-blood) !important;
	border-radius: 3px;
	text-decoration: none !important;
}
.woocommerce-account .button:hover,
.woocommerce-account button[type="submit"]:hover { background: #d63a23 !important; border-color: #d63a23 !important; }

.woocommerce-message, .woocommerce-info, .woocommerce-error,
.wc-block-components-notice-banner {
	background: var(--t-panel) !important;
	color: var(--t-bone) !important;
	border-color: var(--t-crimson) !important;
}
.wc-block-components-notice-banner svg { fill: var(--t-crimson); background: transparent; }
/* "View cart" link in the added-to-cart notice: red, no underline; underline on hover.
   Selectors out-rank WooCommerce's `.wc-block-components-notice-banner>.…__content .wc-forward` (color #2f2f2f !important). */
body .wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward,
body .woocommerce-message .wc-forward.wc-forward {
	color: var(--t-crimson) !important;
	opacity: 1 !important;
	text-decoration: none !important;
}
body .wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward:hover,
body .wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward:focus-visible,
body .woocommerce-message .wc-forward.wc-forward:hover,
body .woocommerce-message .wc-forward.wc-forward:focus-visible {
	color: var(--t-crimson) !important;
	text-decoration: underline !important;
	text-underline-position: under;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li,
.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	background: var(--t-panel);
	border-color: var(--t-line);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { border-bottom-color: var(--t-panel); }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { color: var(--t-bone); }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active,
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--t-crimson); }
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border-color: var(--t-line); }

/* Links inside product content (short description + description/tab panels): red, underline on hover. */
.tenebrae-product .wp-block-post-excerpt a,
.woocommerce div.product .woocommerce-Tabs-panel a {
	color: var(--t-crimson);
	text-decoration: none;
}
.tenebrae-product .wp-block-post-excerpt a:hover,
.tenebrae-product .wp-block-post-excerpt a:focus-visible,
.woocommerce div.product .woocommerce-Tabs-panel a:hover,
.woocommerce div.product .woocommerce-Tabs-panel a:focus-visible {
	color: var(--t-crimson);
	text-decoration: underline;
	text-underline-position: under;
}

/* Checkout field labels sit inside the dark fields: keep them light. */
.wc-block-components-form .wc-block-components-text-input label,
.wc-block-components-text-input label { color: var(--t-silver); }
/* Etsy / external */
.product-type-external .wc-block-components-product-button__button::after,
.product_type_external::after { content: " \2197"; }

/* ---------- Forms (core, WooCommerce) ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"],
input[type="password"], input[type="search"], input[type="date"], select, textarea {
	font: inherit;
	background: var(--t-ink);
	color: var(--t-bone);
	border: 1px solid var(--t-line);
	border-radius: 3px;
	padding: 11px 12px;
	max-width: 100%;
	box-sizing: border-box; /* padding inside the width, so all fields line up */
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
	outline: 2px solid var(--t-crimson);
	outline-offset: 2px;
}

/* ---------- Contact Form 7 ---------- */
.wpcf7-form label { display: block; font-size: inherit; }
.wpcf7-form label br { display: none; }
.wpcf7-form .wpcf7-form-control-wrap {
	display: block;
	margin-top: 6px;
	font-size: var(--wp--preset--font-size--medium);
}
/* Full width; borders medium gray (lighter than the global --t-line). */
.wpcf7-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wpcf7-form select,
.wpcf7-form textarea { width: 100%; border-color: var(--t-line-mid); }
.wpcf7-form textarea { resize: vertical; }
.wpcf7-form .wpcf7-submit {
	font: inherit;
	cursor: pointer;
	background: var(--t-blood);
	color: #fff;
	border: 1px solid var(--t-blood);
	border-radius: 3px;
	padding: 8px 36px; /* 36px sides: 25% wider than the standard button */
}
.wpcf7-form .wpcf7-submit:hover { filter: brightness(.92); }
.wpcf7-form .req { color: var(--t-crimson); }
.wpcf7-not-valid-tip { color: var(--t-crimson); font-size: .88rem; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output {
	margin: 0;
	padding: 16px;
	background: var(--t-panel);
	border: 1px solid var(--t-crimson);
}
.wpcf7-spinner { background-color: var(--t-silver); }
@media (max-width: 480px) { .wpcf7-form .wpcf7-submit { width: 100%; min-height: 44px; } }

/* Contact form layout: centered, two columns. Name / Email / Subject on the left,
   Message on the right at the height of those three fields. One column on phones. */
.wpcf7 { max-width: none !important; margin-inline: auto !important; }
.wpcf7 .wpcf7-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 390px));
	justify-content: center;
	column-gap: 24px;
	row-gap: 16px;
}
.wpcf7 .wpcf7-form > p { margin: 0; max-width: none; grid-column: 1; }
.wpcf7 .wpcf7-form > p:has(textarea) {
	grid-column: 2;
	grid-row: 1 / span 3;
	display: flex;
}
/* Label as a grid: "Message *" on one line, the field filling the rest of the height. */
.wpcf7 .wpcf7-form > p:has(textarea) label {
	flex: 1;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto 1fr;
	column-gap: .3em;
	justify-items: start;
}
.wpcf7 .wpcf7-form > p:has(textarea) .wpcf7-form-control-wrap {
	grid-column: 1 / -1;
	justify-self: stretch;
	display: flex;
	flex-direction: column;
}
/* height 0 + flex-grow: the left column sets the height, the textarea's rows attribute doesn't. */
.wpcf7 .wpcf7-form > p:has(textarea) textarea { flex: 1 1 0; height: 0; min-height: 160px; }
/* Send button: centered under both columns. */
.wpcf7 .wpcf7-form > p:has(.wpcf7-submit) {
	grid-column: 1 / -1;
	justify-self: center;
	position: relative;
}
/* Spinner sits beside the button without pushing it off centre. */
.wpcf7 .wpcf7-form > p:has(.wpcf7-submit) .wpcf7-spinner { position: absolute; left: 100%; top: 50%; translate: 0 -50%; }
.wpcf7 .wpcf7-form > :not(p) { grid-column: 1 / -1; }
@media (max-width: 760px) {
	.wpcf7 .wpcf7-form { grid-template-columns: minmax(0, 1fr); }
	.wpcf7 .wpcf7-form > p,
	.wpcf7 .wpcf7-form > p:has(textarea),
	.wpcf7 .wpcf7-form > p:has(.wpcf7-submit) { grid-column: 1; grid-row: auto; }
}
@media (max-width: 480px) {
	.wpcf7 .wpcf7-form > p:has(.wpcf7-submit) { justify-self: stretch; }
	.wpcf7 .wpcf7-form > p:has(.wpcf7-submit) .wpcf7-spinner { left: auto; right: 8px; }
}

/* ---------- Buttons ---------- */
.wp-element-button, .wp-block-button__link { transition: filter .2s, background-color .2s; }
@media (max-width: 480px) { .wp-element-button, .wp-block-button__link { min-height: 44px; } }

/* ---------- Back to top ---------- */
#tenebrae-totop {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 60;
	width: 52px;
	height: 52px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--t-blood);
	background: var(--t-blood);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08) inset;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s, visibility .2s, transform .2s;
}
#tenebrae-totop.show { opacity: 1; visibility: visible; }
#tenebrae-totop:hover { transform: translateY(-2px); }
/* While the consent panel shows, the back-to-top button sits above it. */
.has-consent-panel #tenebrae-totop { bottom: calc(var(--tenebrae-consent-h, 0px) + 32px); }

/* ---------- Cookie consent (inc/consent.php) ---------- */
.tenebrae-consent {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 70;
	width: min(400px, calc(100vw - 40px));
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 20px;
	background: var(--t-panel);
	color: var(--t-bone);
	border: 1px solid var(--t-line-mid);
	border-left: 3px solid var(--t-crimson);
	border-radius: 3px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}
.tenebrae-consent[hidden], .tenebrae-consent [hidden] { display: none !important; }
.tenebrae-consent__title { margin: 0; font-size: var(--wp--preset--font-size--large); font-weight: 700; color: var(--t-crimson); outline: none; }
.tenebrae-consent p { margin: 0; max-width: none; }
.tenebrae-consent a { color: var(--t-crimson); text-decoration: none; }
.tenebrae-consent a:hover,
.tenebrae-consent a:focus-visible { color: var(--t-crimson); text-decoration: underline; text-underline-position: under; }
.tenebrae-consent__prefs { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.tenebrae-consent__opt { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.tenebrae-consent__opt input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--t-blood); cursor: pointer; }
.tenebrae-consent__opt input:disabled { cursor: not-allowed; opacity: .7; }
.tenebrae-consent__opt strong { display: block; }
.tenebrae-consent__opt span { color: var(--t-silver); }
.tenebrae-consent__opt strong { color: var(--t-bone); font-weight: 600; }
/* Accept and Reject: same size and style, side by side (equal prominence is a legal requirement). */
.tenebrae-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tenebrae-consent__actions .wp-element-button { cursor: pointer; width: 100%; }
.tenebrae-consent__actions [data-consent="save"] { grid-column: 1 / -1; }
.tenebrae-consent__more {
	grid-column: 1 / -1;
	justify-self: center;
	background: none;
	border: 0;
	padding: 4px;
	font: inherit;
	color: var(--t-crimson);
	cursor: pointer;
}
.tenebrae-consent__more:hover, .tenebrae-consent__more:focus-visible { text-decoration: underline; text-underline-position: under; }
@media (max-width: 480px) {
	.tenebrae-consent { right: 16px; bottom: 16px; width: calc(100vw - 32px); max-height: calc(100vh - 32px); }
}

/* Visually hidden, still read by screen readers. */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
