/*
Theme Name: Tide Moon Tales
Theme URI: https://tidemoontales.com
Author: Tide Moon Tales
Description: A quiet, literary block theme for Tide Moon Tales: narrative RPG adventures, battlemaps and artwork. Warm charcoal with antique gold, built to let the artwork carry the atmosphere. Designed for Easy Digital Downloads with the Tide Moon Tales Store companion plugin.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.2.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tidemoon
Tags: block-theme, full-site-editing, dark, e-commerce, one-column, wide-blocks, custom-colors, editor-style
*/

/* ---------------------------------------------------------------
   0. Foundations
---------------------------------------------------------------- */
/* Declared on body too, so the aliases pick up colours set in Customize (which apply on body). */
:root, body {
	--tmt-gold: var(--wp--preset--color--accent);
	--tmt-gold-2: var(--wp--preset--color--accent-2);
	--tmt-gold-3: var(--wp--preset--color--accent-3);
	--tmt-line: var(--wp--preset--color--line);
	--tmt-ink: var(--wp--preset--color--contrast);
	--tmt-ash: var(--wp--preset--color--muted);
	--tmt-bg: var(--wp--preset--color--base);
	--tmt-bg-2: var(--wp--preset--color--base-2);
	--tmt-bg-3: var(--wp--preset--color--base-3);
	--tmt-ember: var(--wp--preset--color--ember);
	--tmt-serif: var(--wp--preset--font-family--display);
	--tmt-sans: var(--wp--preset--font-family--body);
	--tmt-ease: 180ms ease;
	--tmt-radius: var(--wp--custom--radius, 3px);
	--tmt-bg-rgb: 27, 26, 25;
	--tmt-veil: 0.95;
}

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

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "kern", "liga";
}

::selection { background: var(--tmt-gold); color: var(--tmt-bg); }

:where(a) { transition: color var(--tmt-ease); }
:where(.wp-site-blocks) a:where(:not(.wp-element-button)):focus-visible,
:where(button, input, select, textarea, .wp-element-button):focus-visible {
	outline: 1px solid var(--tmt-gold);
	outline-offset: 3px;
}

/* Inline links in running text get a quiet underline. */
:where(.entry-content, .wp-block-post-content, .tmt-prose) p a:where(:not(.wp-element-button)) {
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--tmt-gold) 45%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

hr, .wp-block-separator { border-color: var(--tmt-line); opacity: 1; }

img { height: auto; }

.wp-site-blocks { min-height: 100vh; display: flex; flex-direction: column; }
.wp-site-blocks > main { flex: 1 0 auto; }

/* ---------------------------------------------------------------
   1. Block style variations
---------------------------------------------------------------- */
.is-style-eyebrow {
	font-family: var(--tmt-sans);
	font-size: 0.75rem !important;
	font-weight: 600;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--tmt-gold);
	line-height: 1.4;
}

.is-style-lede {
	font-family: var(--tmt-serif);
	font-size: clamp(1.3rem, 2.1vw, 1.6rem) !important;
	font-style: italic;
	line-height: 1.45;
	color: color-mix(in srgb, var(--tmt-ink) 86%, transparent);
}

.wp-block-separator.is-style-gold-short {
	width: 64px;
	max-width: 64px;
	border: 0;
	border-top: 1px solid var(--tmt-gold) !important;
	margin-left: 0;
	margin-right: auto;
	background: none !important;
}
.has-text-align-center + .wp-block-separator.is-style-gold-short,
.wp-block-separator.is-style-gold-short.aligncenter { margin-left: auto; margin-right: auto; }

.wp-block-button.is-style-quiet .wp-block-button__link {
	background: transparent;
	color: var(--tmt-ink);
	border: 1px solid color-mix(in srgb, var(--tmt-gold) 60%, transparent);
}
.wp-block-button.is-style-quiet .wp-block-button__link:hover,
.wp-block-button.is-style-quiet .wp-block-button__link:focus {
	background: transparent;
	color: var(--tmt-gold-2);
	border-color: var(--tmt-gold-2);
}

.wp-block-image.is-style-framed img {
	box-shadow: 0 0 0 1px var(--tmt-line), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
	border-radius: 2px;
}

.wp-element-button, .wp-block-button__link {
	transition: background-color var(--tmt-ease), color var(--tmt-ease), border-color var(--tmt-ease);
}

/* ---------------------------------------------------------------
   2. Header
---------------------------------------------------------------- */
.tmt-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--tmt-bg) 88%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid transparent;
	transition: border-color var(--tmt-ease), background-color var(--tmt-ease);
}
body.admin-bar .tmt-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { body.admin-bar .tmt-header { top: 0; } }
.tmt-header.is-scrolled { border-bottom-color: var(--tmt-line); background: color-mix(in srgb, var(--tmt-bg) 96%, transparent); }

.tmt-header__inner {
	min-height: 76px;
	gap: 2rem;
}

/* Wordmark with a small crescent-over-tide mark. Replace with a Site Logo block when you have one. */
.tmt-wordmark {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin: 0;
	white-space: nowrap;
}
.tmt-wordmark .wp-block-site-title { text-transform: uppercase; font-size: 1.15rem !important; letter-spacing: 0.22em !important; }
.tmt-wordmark::before {
	content: "";
	width: 26px;
	height: 26px;
	flex: 0 0 26px;
	background-color: var(--tmt-gold);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M20.5 4.5a10 10 0 1 0 7 16.2A8.2 8.2 0 0 1 20.5 4.5z'/%3E%3Cpath d='M3 26.5c2.2 0 2.2-1.6 4.4-1.6s2.2 1.6 4.4 1.6 2.2-1.6 4.4-1.6 2.2 1.6 4.4 1.6 2.2-1.6 4.4-1.6 2.2 1.6 4.4 1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M20.5 4.5a10 10 0 1 0 7 16.2A8.2 8.2 0 0 1 20.5 4.5z'/%3E%3Cpath d='M3 26.5c2.2 0 2.2-1.6 4.4-1.6s2.2 1.6 4.4 1.6 2.2-1.6 4.4-1.6 2.2 1.6 4.4 1.6 2.2-1.6 4.4-1.6 2.2 1.6 4.4 1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tmt-wordmark .wp-block-site-logo img { height: var(--tmt-logo-h, 40px) !important; width: auto !important; max-width: none; }
body.tmt-has-logo .tmt-wordmark::before, body.tmt-no-mark .tmt-wordmark::before { display: none; }
body.tmt-logo-only .tmt-header .wp-block-site-title { display: none; }

.tmt-header .wp-block-navigation { gap: 2rem; }
.tmt-header .wp-block-navigation .wp-block-navigation-item__content { color: var(--tmt-ink); padding: 0.4rem 0; position: relative; }
.tmt-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 1px;
	background: var(--tmt-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--tmt-ease);
}
.tmt-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.tmt-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }
.tmt-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--tmt-gold-2); }

/* Mobile overlay menu */
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--tmt-bg) !important;
	color: var(--tmt-ink) !important;
	padding: 2rem clamp(1.25rem, 6vw, 3rem);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 4rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--tmt-serif);
	font-size: 2rem;
	text-transform: none;
	letter-spacing: 0.01em;
	font-weight: 500;
}
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg { fill: var(--tmt-ink); }

/* ---------------------------------------------------------------
   3. Footer
---------------------------------------------------------------- */
.tmt-footer {
	border-top: 1px solid var(--tmt-line);
	color: var(--tmt-ash);
	font-size: 0.9375rem;
}
.tmt-footer__cols h2, .tmt-footer__cols h3 {
	font-family: var(--tmt-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--tmt-ink);
}
.tmt-footer ul { list-style: none; padding: 0; margin: 0; }
.tmt-footer li + li { margin-top: 0.45rem; }
.tmt-footer a { color: var(--tmt-ash); }
.tmt-footer a:hover { color: var(--tmt-gold-2); }
.tmt-footer__fine {
	border-top: 1px solid var(--tmt-line);
	font-size: 0.8125rem;
	color: color-mix(in srgb, var(--tmt-ash) 80%, transparent);
}
.tmt-footer__fine p { margin: 0; }

/* ---------------------------------------------------------------
   4. Home: hero
---------------------------------------------------------------- */
.tmt-hero.wp-block-cover {
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--60);
	align-items: flex-end;
}
.tmt-hero.wp-block-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(var(--tmt-bg-rgb), calc(0.85 * var(--tmt-veil))) 0%, rgba(var(--tmt-bg-rgb), calc(0.7 * var(--tmt-veil))) 34%, rgba(var(--tmt-bg-rgb), calc(0.09 * var(--tmt-veil))) 70%, rgba(var(--tmt-bg-rgb), 0) 100%),
		linear-gradient(0deg, rgba(var(--tmt-bg-rgb), 1) 0%, rgba(var(--tmt-bg-rgb), 0) 34%);
}
.tmt-hero--center.wp-block-cover::after {
	background:
		radial-gradient(ellipse at 50% 60%, rgba(var(--tmt-bg-rgb), calc(0.8 * var(--tmt-veil))) 0%, rgba(var(--tmt-bg-rgb), calc(0.45 * var(--tmt-veil))) 45%, rgba(var(--tmt-bg-rgb), 0) 80%),
		linear-gradient(0deg, rgba(var(--tmt-bg-rgb), 1) 0%, rgba(var(--tmt-bg-rgb), 0) 34%);
}
.tmt-hero--center .tmt-hero__copy { margin-inline: auto; text-align: center; max-width: 44rem; }
.tmt-hero--center .tmt-hero__copy .is-style-lede { margin-inline: auto; }
.tmt-hero .wp-block-cover__inner-container { z-index: 2; max-width: var(--wp--style--global--wide-size); margin-inline: auto; width: 100%; }
.tmt-hero__copy { max-width: 34rem; }
.tmt-hero h1 {
	font-size: var(--wp--preset--font-size--huge);
	font-weight: 500;
	line-height: 1.02;
	letter-spacing: -0.005em;
	text-wrap: balance;
}
.tmt-hero h1 em { color: var(--tmt-gold-2); font-weight: 500; }
.tmt-hero .is-style-lede { max-width: 30rem; }
.tmt-hero__credit {
	position: absolute;
	right: clamp(1.25rem, 4vw, 3rem);
	bottom: 1.5rem;
	z-index: 2;
	margin: 0;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	color: color-mix(in srgb, var(--tmt-ink) 70%, transparent);
}
.tmt-hero__credit a { color: inherit; }
@media (max-width: 781px) {
	.tmt-hero.wp-block-cover { min-height: 78vh !important; }
	.tmt-hero.wp-block-cover::after, .tmt-hero--center.wp-block-cover::after {
		background: linear-gradient(0deg, rgba(var(--tmt-bg-rgb), 1) 0%, rgba(var(--tmt-bg-rgb), calc(0.8 * var(--tmt-veil))) 45%, rgba(var(--tmt-bg-rgb), calc(0.15 * var(--tmt-veil))) 100%);
	}
	.tmt-hero__credit { display: none; }
}

/* ---------------------------------------------------------------
   5. Sections
---------------------------------------------------------------- */
.tmt-section { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); }
.tmt-section--raised { background: var(--tmt-bg-2); }
.tmt-section__head { margin-bottom: var(--wp--preset--spacing--50); }
.tmt-section__head h2 { text-wrap: balance; }
.tmt-section__head .tmt-section__more { margin: 0; font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.tmt-section__head .tmt-section__more a::after { content: " \2192"; }

/* Pillars */
.tmt-pillars { gap: clamp(2rem, 5vw, 4.5rem) !important; }
.tmt-pillar { border-top: 1px solid var(--tmt-line); padding-top: 1.5rem; }
.tmt-pillar__numeral {
	font-family: var(--tmt-serif);
	font-size: 1.1rem !important;
	font-style: italic;
	color: var(--tmt-gold);
	margin-bottom: 0.75rem !important;
}
.tmt-pillar h3 { font-size: 1.75rem; margin-top: 0; margin-bottom: 0.75rem; }
.tmt-pillar p:not(.tmt-pillar__numeral) { color: color-mix(in srgb, var(--tmt-ink) 78%, transparent); }

/* Excerpt / pull passage */
.tmt-excerpt { text-align: center; }
.tmt-excerpt__mark {
	font-family: var(--tmt-serif);
	color: var(--tmt-gold);
	font-size: 1.5rem !important;
	line-height: 1;
	margin-bottom: 1.5rem !important;
}
.tmt-excerpt__text {
	font-family: var(--tmt-serif);
	font-size: clamp(1.6rem, 3.2vw, 2.4rem) !important;
	line-height: 1.35;
	font-style: italic;
	font-weight: 400;
	text-wrap: balance;
	color: var(--tmt-ink);
}
.tmt-excerpt__answer { font-family: var(--tmt-serif); font-size: 1.35rem !important; color: var(--tmt-ash); font-style: italic; }
.tmt-excerpt__source { margin-top: 2rem !important; }

/* Membership */
.tmt-membership { gap: clamp(2rem, 6vw, 6rem) !important; align-items: center !important; }
.tmt-plan {
	background: var(--tmt-bg-3);
	border: 1px solid color-mix(in srgb, var(--tmt-gold) 35%, var(--tmt-line));
	border-radius: var(--tmt-radius);
	padding: clamp(1.75rem, 3vw, 2.75rem) !important;
	position: relative;
}
.tmt-plan::before {
	content: "";
	position: absolute;
	top: -1px; left: 2rem; right: 2rem;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--tmt-gold), transparent);
}
.tmt-plan__price {
	font-family: var(--tmt-serif);
	font-size: clamp(3rem, 6vw, 4rem) !important;
	line-height: 1 !important;
	color: var(--tmt-ink);
	margin-bottom: 0.25rem !important;
}
.tmt-plan__price span, .tmt-plan__price sub { font-family: var(--tmt-sans); font-size: 0.9rem; color: var(--tmt-ash); letter-spacing: 0.04em; vertical-align: baseline; }
.tmt-plan ul { list-style: none; padding: 0; margin: 1.5rem 0; }
.tmt-plan li { padding: 0.65rem 0 0.65rem 1.6rem; border-top: 1px solid var(--tmt-line); position: relative; }
.tmt-plan li:last-child { border-bottom: 1px solid var(--tmt-line); }
.tmt-plan li::before {
	content: "";
	position: absolute;
	left: 0.2rem; top: 1.15rem;
	width: 7px; height: 7px;
	border: 1px solid var(--tmt-gold);
	transform: rotate(45deg);
}
.tmt-plan__note { font-size: 0.8125rem !important; color: var(--tmt-ash); }
.tmt-plan .wp-block-buttons, .tmt-plan .wp-block-button, .tmt-plan .wp-block-button__link, .tmt-plan .edd-submit { width: 100%; text-align: center; }

/* Page hero (archives, simple pages) */
.tmt-page-head { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--40); }
.tmt-page-head h1 { margin-top: 0.5rem; }
.tmt-page-head .wp-block-term-description, .tmt-page-head .tmt-page-head__intro { color: var(--tmt-ash); max-width: 40rem; font-size: 1.125rem; }

/* Category filter row */
.tmt-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.75rem;
	padding: 0 0 1.25rem;
	margin: 0 0 var(--wp--preset--spacing--50);
	border-bottom: 1px solid var(--tmt-line);
	list-style: none;
}
.tmt-filter a {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--tmt-ash);
	padding-bottom: 1.3rem;
	margin-bottom: -1.3rem;
	border-bottom: 1px solid transparent;
	display: inline-block;
}
.tmt-filter a:hover { color: var(--tmt-ink); }
.tmt-filter a[aria-current="page"] { color: var(--tmt-ink); border-bottom-color: var(--tmt-gold); }

/* ---------------------------------------------------------------
   6. Product grid (tmt/catalog)
---------------------------------------------------------------- */
.tmt-grid {
	display: grid;
	grid-template-columns: repeat(var(--tmt-cols, 3), minmax(0, 1fr));
	gap: clamp(1.75rem, 3.5vw, 3rem) clamp(1.25rem, 2.5vw, 2.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (max-width: 1000px) { .tmt-grid { --tmt-cols: 2 !important; } }
@media (max-width: 560px) { .tmt-grid { --tmt-cols: 1 !important; } }

.tmt-card { position: relative; display: flex; flex-direction: column; }
.tmt-card__media {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--tmt-bg-3);
	border-radius: 2px;
	box-shadow: 0 0 0 1px var(--tmt-line);
	margin-bottom: 1.1rem;
}
.tmt-card--landscape .tmt-card__media { aspect-ratio: 3 / 2; }
.tmt-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 600ms cubic-bezier(.2, .6, .2, 1), filter 600ms ease;
	filter: saturate(0.94);
}
.tmt-card:hover .tmt-card__media img, .tmt-card:focus-within .tmt-card__media img { transform: scale(1.025); filter: saturate(1); }
.tmt-card:hover .tmt-card__media, .tmt-card:focus-within .tmt-card__media { box-shadow: 0 0 0 1px color-mix(in srgb, var(--tmt-gold) 55%, transparent); }
.tmt-card__placeholder {
	width: 100%; height: 100%;
	display: grid; place-items: center;
	font-family: var(--tmt-serif); font-style: italic; color: var(--tmt-ash);
}
.tmt-card__kicker {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--tmt-gold);
	margin: 0 0 0.4rem;
}
.tmt-card__title {
	font-family: var(--tmt-serif);
	font-size: 1.6rem;
	font-weight: 500;
	line-height: 1.12;
	margin: 0 0 0.45rem;
}
.tmt-card__title a { color: var(--tmt-ink); }
.tmt-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.tmt-card__title a:hover { color: var(--tmt-gold-2); }
.tmt-card__tagline { color: var(--tmt-ash); font-size: 0.975rem; line-height: 1.5; margin: 0 0 0.75rem; }
.tmt-card__meta {
	margin-top: auto;
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	font-size: 0.875rem;
	color: var(--tmt-ink);
}
.tmt-card__price { font-weight: 600; letter-spacing: 0.02em; }
.tmt-card__member { color: var(--tmt-ash); font-size: 0.8125rem; }
.tmt-card__member::before { content: "\25C7  "; color: var(--tmt-gold); }
.tmt-card__owned { color: var(--tmt-gold); font-size: 0.8125rem; letter-spacing: 0.06em; }

.tmt-empty { color: var(--tmt-ash); font-style: italic; font-family: var(--tmt-serif); font-size: 1.35rem; }

/* Featured release (single large card) */
.tmt-feature { gap: clamp(2rem, 6vw, 5.5rem) !important; align-items: center !important; }
.tmt-feature .wp-block-image img { aspect-ratio: 4 / 5; object-fit: cover; }

/* Pagination */
.tmt-pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: var(--wp--preset--spacing--50); flex-wrap: wrap; }
.tmt-pagination .page-numbers {
	min-width: 2.5rem; height: 2.5rem;
	display: inline-grid; place-items: center;
	border: 1px solid var(--tmt-line);
	color: var(--tmt-ink);
	font-size: 0.875rem;
	padding: 0 0.75rem;
}
.tmt-pagination .page-numbers.current { border-color: var(--tmt-gold); color: var(--tmt-gold); }
.tmt-pagination a.page-numbers:hover { border-color: var(--tmt-gold-3); }

/* ---------------------------------------------------------------
   7. Product page
---------------------------------------------------------------- */
.tmt-product-top { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--60); }
.tmt-product-top__cols { gap: clamp(2rem, 6vw, 5.5rem) !important; }
.tmt-product-art .wp-block-post-featured-image { margin: 0; }
.tmt-product-art .wp-block-post-featured-image img {
	width: 100%;
	box-shadow: 0 0 0 1px var(--tmt-line), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
	border-radius: 2px;
}
@media (min-width: 782px) {
	.tmt-product-art { position: sticky; top: 110px; align-self: flex-start !important; }
}
.tmt-product-info .wp-block-post-title {
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.02;
	margin-top: 0.4rem;
	text-wrap: balance;
}
.tmt-product-info .wp-block-post-terms { margin: 0; }
.tmt-product-info .wp-block-post-terms a { color: var(--tmt-gold); }

.tmt-tagline {
	font-family: var(--tmt-serif);
	font-size: clamp(1.3rem, 2vw, 1.55rem);
	font-style: italic;
	line-height: 1.4;
	color: color-mix(in srgb, var(--tmt-ink) 85%, transparent);
	margin: 0.5rem 0 0;
}

/* Purchase box */
.tmt-purchase {
	margin-top: 2rem;
	padding: 1.5rem 0;
	border-top: 1px solid var(--tmt-line);
	border-bottom: 1px solid var(--tmt-line);
}
.tmt-purchase__row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.tmt-purchase__price { font-family: var(--tmt-serif); font-size: 2.4rem; line-height: 1; color: var(--tmt-ink); }
.tmt-purchase__price small { font-family: var(--tmt-sans); font-size: 0.8rem; color: var(--tmt-ash); margin-left: 0.25rem; letter-spacing: 0.04em; }
.tmt-purchase form.edd_download_purchase_form { margin: 0; flex: 1 1 auto; }
.tmt-purchase .edd_purchase_submit_wrapper { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.tmt-purchase__member {
	margin: 1.1rem 0 0;
	font-size: 0.9375rem;
	color: var(--tmt-ash);
}
.tmt-purchase__member::before { content: "\25C7"; color: var(--tmt-gold); margin-right: 0.55rem; }
.tmt-purchase__owned { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tmt-purchase__owned p { margin: 0; color: var(--tmt-gold-2); font-family: var(--tmt-serif); font-style: italic; font-size: 1.35rem; }

/* At a glance */
.tmt-glance { margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.tmt-glance > div { padding: 0.85rem 0; border-bottom: 1px solid var(--tmt-line); }
.tmt-glance dt {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--tmt-ash);
	margin: 0 0 0.2rem;
}
.tmt-glance dd { margin: 0; font-size: 1.0625rem; color: var(--tmt-ink); }
@media (max-width: 420px) { .tmt-glance { grid-template-columns: 1fr; } }

/* Epigraph — echoes the opening of the books */
.tmt-epigraph { text-align: center; padding: var(--wp--preset--spacing--60) 0; margin: 0; border: 0; }
.tmt-epigraph::before {
	content: "";
	display: block;
	width: 22px; height: 22px;
	margin: 0 auto 2rem;
	background-color: var(--tmt-gold);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M20.5 4.5a10 10 0 1 0 7 16.2A8.2 8.2 0 0 1 20.5 4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M20.5 4.5a10 10 0 1 0 7 16.2A8.2 8.2 0 0 1 20.5 4.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tmt-epigraph p {
	font-family: var(--tmt-serif);
	font-style: italic;
	font-size: clamp(1.1rem, 2.6vw, 1.9rem);
	line-height: 1.55;
	color: var(--tmt-ink);
	margin: 0 auto;
	max-width: 36rem;
	white-space: pre-line;
}
.tmt-epigraph cite {
	display: block;
	margin-top: 1.5rem;
	font-style: normal;
	font-size: 0.75rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--tmt-gold);
}

/* Product body copy */
.tmt-product-body { padding-bottom: var(--wp--preset--spacing--60); }
.tmt-product-body .wp-block-post-content > p:first-child::first-letter {
	font-family: var(--tmt-serif);
	float: left;
	font-size: 4.2em;
	line-height: 0.82;
	padding: 0.06em 0.12em 0 0;
	color: var(--tmt-gold);
}
.tmt-product-body .wp-block-post-content h2 { margin-top: 3rem; }
.tmt-product-body .wp-block-post-content blockquote { margin: 2.5rem 0; }

/* Content notes */
.tmt-notes {
	margin: 3rem 0 0;
	padding: 1.5rem 1.75rem;
	background: var(--tmt-bg-2);
	border-left: 2px solid var(--tmt-ember);
}
.tmt-notes h2 {
	font-family: var(--tmt-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--tmt-ink);
	margin: 0 0 0.75rem;
}
.tmt-notes p { color: var(--tmt-ash); font-size: 0.9375rem; margin: 0 0 0.9rem; }
.tmt-notes ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tmt-notes li {
	font-size: 0.875rem;
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--tmt-line);
	border-radius: 99px;
	color: var(--tmt-ink);
}
.tmt-notes li::before { content: "\25C6"; color: var(--tmt-ember); font-size: 0.6rem; margin-right: 0.5rem; vertical-align: 0.15em; }

/* Free preview */
.tmt-preview {
	margin: 2rem 0 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 2rem;
	flex-wrap: wrap;
	padding: 1.75rem;
	border: 1px solid var(--tmt-line);
	border-radius: var(--tmt-radius);
}
.tmt-preview h2 { font-size: 1.6rem; margin: 0 0 0.25rem; }
.tmt-preview p { margin: 0; color: var(--tmt-ash); font-size: 0.9375rem; }

/* Related */
.tmt-related { border-top: 1px solid var(--tmt-line); }

/* Gallery (battlemaps & art) */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 2px; }
.tmt-product-body .wp-block-gallery { margin: 2.5rem 0; }

/* ---------------------------------------------------------------
   8. Journal
---------------------------------------------------------------- */
.tmt-journal-list .wp-block-post { padding: 2rem 0; border-bottom: 1px solid var(--tmt-line); }
.tmt-journal-list .wp-block-post:first-child { border-top: 1px solid var(--tmt-line); }
.tmt-journal-list .wp-block-post-title { font-size: 2rem; margin: 0.35rem 0 0.5rem; }
.tmt-journal-list .wp-block-post-excerpt { color: var(--tmt-ash); }
.tmt-journal-list .wp-block-post-excerpt__more-link { font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }

.tmt-article-head { padding-top: var(--wp--preset--spacing--60); text-align: center; }
.tmt-article-head .wp-block-post-title { text-wrap: balance; }
.tmt-article .wp-block-post-content { font-size: 1.125rem; }
.tmt-article .wp-block-post-content > p:first-of-type { font-size: 1.25rem; color: var(--tmt-ink); }

.wp-block-query-pagination { font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2.5rem; }

/* ---------------------------------------------------------------
   9. Forms (shared with EDD)
---------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"],
input[type="number"], input[type="url"], select, textarea {
	background: var(--tmt-bg-2);
	color: var(--tmt-ink);
	border: 1px solid var(--tmt-line);
	border-radius: var(--tmt-radius);
	padding: 0.75rem 0.9rem;
	font: inherit;
	font-size: 1rem;
	line-height: 1.3;
	transition: border-color var(--tmt-ease), background-color var(--tmt-ease);
	max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--tmt-gold); outline: none; background: var(--tmt-bg-3); }
::placeholder { color: color-mix(in srgb, var(--tmt-ash) 75%, transparent); }
label { font-size: 0.9375rem; }

.wp-block-search__input { background: var(--tmt-bg-2); }
.wp-block-search__button { margin-left: 0.5rem; }

/* Generic page content */
.tmt-page .wp-block-post-content > * + h2 { margin-top: 2.75rem; }

/* 404 */
.tmt-404 { text-align: center; padding: var(--wp--preset--spacing--70) 0; }

/* Utility */
.tmt-muted { color: var(--tmt-ash); }
.tmt-center { text-align: center; }

/* ---------------------------------------------------------------
   10. Header actions (account + cart)
---------------------------------------------------------------- */
.tmt-header__nav { gap: 2rem; }
.tmt-actions { display: flex; align-items: center; gap: 0.35rem; padding-left: 1.25rem; border-left: 1px solid var(--tmt-line); }
.tmt-actions__link {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 38px; height: 38px;
	color: var(--tmt-ink);
	border-radius: 50%;
	transition: color var(--tmt-ease), background-color var(--tmt-ease);
}
.tmt-actions__link:hover, .tmt-actions__link:focus-visible { color: var(--tmt-gold-2); background: var(--tmt-bg-3); }
.tmt-actions__count {
	position: absolute;
	top: -1px; right: -3px;
	min-width: 16px; height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: var(--tmt-gold);
	color: var(--tmt-bg);
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	display: none;
}
.tmt-actions__cart.has-items .tmt-actions__count { display: block; }
@media (max-width: 600px) {
	.tmt-header__nav { gap: 0.75rem; }
	.tmt-actions { border-left: 0; padding-left: 0; }
	.tmt-wordmark .wp-block-site-title { font-size: 0.95rem !important; letter-spacing: 0.16em !important; }
}

/* ---------------------------------------------------------------
   11. Footer layout, FAQ, article nav
---------------------------------------------------------------- */
.tmt-footer__cols { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--50); gap: 2rem !important; }
.tmt-footer__cols .tmt-wordmark { margin-bottom: 1rem; }
.tmt-footer__cols p { max-width: 22rem; }
.tmt-footer__fine { padding-top: 1.5rem; padding-bottom: 2rem; gap: 0.5rem 2rem !important; }

.tmt-faq {
	border-bottom: 1px solid var(--tmt-line);
	padding: 1.1rem 0;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
.tmt-faq:first-of-type { border-top: 1px solid var(--tmt-line); }
.tmt-faq summary {
	cursor: pointer;
	font-family: var(--tmt-serif);
	font-size: 1.45rem;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}
.tmt-faq summary::-webkit-details-marker { display: none; }
.tmt-faq summary::after { content: "+"; color: var(--tmt-gold); font-family: var(--tmt-sans); font-weight: 300; font-size: 1.5rem; line-height: 1; }
.tmt-faq[open] summary::after { content: "\2212"; }
.tmt-faq p { color: color-mix(in srgb, var(--tmt-ink) 80%, transparent); margin-top: 0.75rem; }

.tmt-article-nav { border-top: 1px solid var(--tmt-line); padding-top: 1.5rem; margin-top: 3rem; font-size: 0.9375rem; }

/* Membership page: purchase inside the plan card */
.tmt-plan .tmt-purchase { border: 0; padding: 0; margin: 0 0 0.5rem; }
.tmt-plan .tmt-purchase__row { flex-direction: column; align-items: stretch; gap: 1.25rem; }
.tmt-plan .tmt-purchase__price { font-size: clamp(3rem, 6vw, 4rem); }
.tmt-plan .edd_purchase_submit_wrapper, .tmt-plan .edd_purchase_submit_wrapper a { width: 100%; }
.tmt-plan .edd-submit { width: 100%; }

/* ---------------------------------------------------------------
   12. Customizer options
---------------------------------------------------------------- */
body.tmt-header-static .tmt-header { position: relative; top: auto; }
body.tmt-no-header-icons .tmt-actions { display: none; }
body.tmt-cards-square .tmt-card__media { aspect-ratio: 1 / 1; }
body.tmt-cards-landscape .tmt-card__media { aspect-ratio: 3 / 2; }
body.tmt-sans-headings :where(h1, h2, h3, h4, .wp-block-post-title, .tmt-card__title) { letter-spacing: -0.01em; font-weight: 600; }
body.tmt-sans-headings .tmt-wordmark .wp-block-site-title { font-weight: 600; }
.tmt-footer__about { max-width: 22rem; }
.tmt-footer__fine-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; width: 100%; }
.tmt-hidden-note {
	margin: 0 auto;
	padding: 1rem;
	text-align: center;
	font-size: 0.875rem;
	color: var(--tmt-ash);
	border: 1px dashed var(--tmt-line);
	max-width: var(--wp--style--global--wide-size);
}
.tmt-section-edit { min-height: 40px; }
/* Keep the empty logo placeholder small in the editor */
.editor-styles-wrapper .tmt-wordmark .wp-block-site-logo .components-placeholder { width: 40px !important; min-width: 0 !important; height: 40px !important; min-height: 0 !important; padding: 0 !important; }

/* Placeholders in draft pages: highlighted so they can't slip through unnoticed */
mark { background: color-mix(in srgb, var(--tmt-gold) 28%, transparent); color: var(--tmt-ink); padding: 0 0.2em; border-radius: 2px; }

/* Library page: section headings only make sense when signed in */
body:not(.logged-in) .tmt-library-heading { display: none; }
.tmt-subscriptions { margin-top: 2.5rem; }
.tmt-page .wp-block-edd-login, .tmt-page .wp-block-edd-user-downloads, .tmt-page .wp-block-edd-order-history { margin-top: 1.5rem; }
