/* Music Archive — Dark : global polish
 * Tokens come from theme.json (--wp--preset--color--*, --wp--custom--*).
 * This file only handles things theme.json can't express well: scrollbars,
 * selection, focus rings, form controls, header/footer chrome.
 * ------------------------------------------------------------------------- */

:root {
	color-scheme: dark;
	--mad-focus: 0 0 0 2px var(--wp--preset--color--base), 0 0 0 4px var(--wp--preset--color--accent);
	--mad-transition: 140ms ease;
}

html {
	background: var(--wp--preset--color--base);
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: #1a1206;
}

/* Firefox / WebKit scrollbars */
* {
	scrollbar-color: var(--wp--preset--color--border) transparent;
}
::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}
::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--border);
	border-radius: 999px;
	border: 3px solid var(--wp--preset--color--base);
}

/* Keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.wp-block-button__link:focus-visible,
summary:focus-visible {
	outline: none;
	box-shadow: var(--mad-focus);
	border-radius: var(--wp--custom--control--radius);
}

/* Native form controls -> dark */
input:where([type="text"], [type="search"], [type="email"], [type="url"], [type="tel"], [type="number"], [type="password"]),
select,
textarea {
	box-sizing: border-box;
	background: var(--wp--custom--control--bg);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--control--radius);
	padding: 0.55rem 0.75rem;
	font: inherit;
	line-height: 1.3;
	transition: border-color var(--mad-transition), box-shadow var(--mad-transition);
}
input::placeholder,
textarea::placeholder {
	color: var(--wp--preset--color--muted);
}
select {
	appearance: none;
	padding-right: 2.25rem;
	background-image: linear-gradient(45deg, transparent 50%, var(--wp--preset--color--muted) 50%),
		linear-gradient(135deg, var(--wp--preset--color--muted) 50%, transparent 50%);
	background-position: right 1rem center, right 0.75rem center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	cursor: pointer;
}
input:hover,
select:hover,
textarea:hover {
	border-color: var(--wp--preset--color--muted);
}

/* Header / footer chrome inherited from Twenty Twenty-Five block templates */
.wp-block-template-part.site-header,
header.wp-block-template-part {
	background: color-mix(in srgb, var(--wp--preset--color--base) 88%, #000);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

footer.wp-block-template-part,
.wp-block-template-part.site-footer {
	border-top: 1px solid var(--wp--preset--color--border);
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, #000);
	color: var(--wp--preset--color--muted);
}

/* Quiet utility link in the footer (My account) — deliberately low-key */
.mad-footer-utility {
	margin: 0;
}
.mad-footer-utility a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}
.mad-footer-utility a:hover,
.mad-footer-utility a:focus-visible {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Current nav item */
.wp-block-navigation .wp-block-navigation-item.current-menu-item > a,
.wp-block-navigation .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--contrast);
	text-underline-offset: 6px;
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 2px;
}

/* Nav dropdown (Browse Collection ▸ Music / Posters) — dark, matches header */
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	color: var(--wp--preset--color--muted);
	padding: 0.55rem 0.75rem;
	border-radius: 6px;
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus,
.wp-block-navigation .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--surface-raised);
	text-decoration: none;
}
.wp-block-navigation .wp-block-navigation__submenu-icon {
	fill: currentColor;
}

@media (min-width: 782px) {
	.wp-block-navigation .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
		min-width: 12rem;
		padding: 0.3rem;
		background-color: color-mix(in srgb, var(--wp--preset--color--base) 88%, #000);
		border: 1px solid var(--wp--preset--color--border);
		border-radius: 10px;
		box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.75);
	}
}

/* Give page content a consistent top rhythm */
.wp-site-blocks > main {
	padding-block: var(--wp--preset--spacing--60);
	min-height: 60vh;
}

/* Front page is a designed landing — hide the auto page title */
.home .wp-block-post-title,
.page-id-42 .wp-block-post-title {
	display: none;
}

/* Outline buttons (secondary CTAs) on dark */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--border);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-strong);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent);
}

/* Section eyebrow helper (used on Home / listing headers) */
.mad-eyebrow {
	font-family: var(--wp--preset--font-family--text);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin: 0 0 0.5rem;
}

/* Home product strips ([ma_shop_strip]) — the whole block is omitted by the
   shortcode when it has no products, so there is never an empty header. */
.mad-shop-strip {
	margin-top: var(--wp--preset--spacing--70);
}
.mad-shop-strip__heading {
	margin: 0 0 var(--wp--preset--spacing--50);
}
.mad-shop-strip .woocommerce,
.mad-shop-strip .woocommerce-page {
	margin: 0;
}

/* Themed placeholder for products with no cover art */
.mad-cover-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	background:
		radial-gradient(130% 100% at 50% 0%, color-mix(in srgb, var(--wp--preset--color--accent) 14%, transparent), transparent 55%),
		var(--wp--preset--color--surface-raised);
	color: color-mix(in srgb, var(--wp--preset--color--accent) 70%, var(--wp--preset--color--contrast));
}
.mad-cover-placeholder__disc {
	opacity: 0.85;
}
.mad-cover-placeholder__label {
	font-family: var(--wp--preset--font-family--text);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* Reference tables (grading guide etc.) */
.wp-block-table.mad-grade-table {
	margin-block: var(--wp--preset--spacing--50);
	overflow-x: auto;
}
.mad-grade-table table {
	width: 100%;
	border-collapse: collapse;
	min-width: 34rem;
	font-size: 0.92rem;
}
.mad-grade-table thead th {
	text-align: left;
	font-family: var(--wp--preset--font-family--text);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	padding: 0 0.9rem 0.55rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.mad-grade-table tbody td {
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	vertical-align: top;
	line-height: 1.5;
}
.mad-grade-table tbody tr:nth-child(even) td {
	background: color-mix(in srgb, var(--wp--preset--color--surface) 55%, transparent);
}
.mad-grade-table tbody td:first-child {
	width: 34%;
	white-space: normal;
}
.mad-grade-table tbody td:first-child strong {
	color: var(--wp--preset--color--accent-strong);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
}

/* Compact 2-row rate table (no header) */
.mad-grade-table.mad-rate-table table {
	min-width: 0;
	max-width: 26rem;
}
.mad-grade-table.mad-rate-table tbody td:first-child {
	width: 60%;
}
.mad-grade-table.mad-rate-table tbody td:last-child {
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
}

/* Inline callout box.
   The block's named borderColor emits core's `.has-border-color{color:var(--…--border)}`,
   which would grey out the body text — pin colour + border explicitly here. */
.wp-block-group.mad-callout {
	margin-block: var(--wp--preset--spacing--50);
	color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--border);
}
.mad-callout :where(p, li) {
	color: var(--wp--preset--color--contrast);
}
.mad-callout > :first-child {
	margin-top: 0;
}
.mad-callout > :last-child {
	margin-bottom: 0;
}

/* ---- Contact form (Contact Form 7) ------------------------------ */

.wpcf7 {
	margin-block: var(--wp--preset--spacing--50);
}
.mad-form {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--card--radius);
	padding: clamp(1.1rem, 4vw, 2rem);
}
.mad-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.1rem;
}
.mad-form__field,
.mad-form__actions {
	margin: 0;
	min-width: 0; /* let grid columns shrink instead of the input overflowing */
}
.mad-form__field label {
	display: block;
	font-family: var(--wp--preset--font-family--text);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.mad-form__optional {
	margin-left: 0.35rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: color-mix(in srgb, var(--wp--preset--color--muted) 80%, transparent);
}
.mad-form .wpcf7-form-control-wrap {
	display: block;
	margin-top: 0.4rem;
}
.mad-form input.wpcf7-text,
.mad-form input.wpcf7-email,
.mad-form input.wpcf7-tel,
.mad-form textarea.wpcf7-textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	font-family: var(--wp--preset--font-family--text);
	font-size: 0.95rem;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
	color: var(--wp--preset--color--contrast);
}
.mad-form textarea.wpcf7-textarea {
	min-height: 8rem;
	resize: vertical;
}

/* Submit */
.wpcf7 input.wpcf7-submit {
	appearance: none;
	cursor: pointer;
	background: var(--wp--preset--color--accent);
	color: #1a1206;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--control--radius);
	font: 700 0.85rem/1 var(--wp--preset--font-family--text);
	letter-spacing: 0.03em;
	padding: 0.85rem 1.6rem;
	transition: background 140ms ease, border-color 140ms ease;
}
.wpcf7 input.wpcf7-submit:hover,
.wpcf7 input.wpcf7-submit:focus-visible {
	background: var(--wp--preset--color--accent-strong);
	border-color: var(--wp--preset--color--accent-strong);
}
.wpcf7 input.wpcf7-submit[disabled] {
	opacity: 0.55;
	cursor: progress;
}

/* Validation */
.mad-form .wpcf7-not-valid {
	border-color: var(--wp--preset--color--danger) !important;
	box-shadow: 0 0 0 1px var(--wp--preset--color--danger);
}
.wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.35rem;
	color: var(--wp--preset--color--danger);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

/* Response banner under the form */
.wpcf7-response-output {
	margin: 1.1rem 0 0 !important;
	padding: 0.8rem 1rem !important;
	border: 1px solid var(--wp--preset--color--border) !important;
	border-left-width: 3px !important;
	border-radius: var(--wp--custom--control--radius);
	background: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
	font-size: 0.9rem;
}
.wpcf7-form.sent .wpcf7-response-output {
	border-left-color: var(--wp--preset--color--accent) !important;
}
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7-form.payment-required .wpcf7-response-output {
	border-left-color: var(--wp--preset--color--danger) !important;
}
.wpcf7-form.spam .wpcf7-response-output {
	border-left-color: var(--wp--preset--color--danger) !important;
}

/* Spinner + honeypot */
.wpcf7-spinner {
	background-color: var(--wp--preset--color--muted);
}
.mad-form [class*="honeypot"],
.mad-form input[name="company-website"] {
	position: absolute !important;
	left: -9999px !important;
}

@media (max-width: 600px) {
	.mad-form__row {
		grid-template-columns: 1fr;
	}
}

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