/**
 * DM Media global design foundation.
 *
 * Batch 1 centralizes shared tokens and components without changing
 * service-specific page content or business logic.
 */

:root {
	--dm-color-ink: #11100e;
	--dm-color-charcoal: #1b1915;
	--dm-color-cream: #f5f0e7;
	--dm-color-paper: #fffdf8;
	--dm-color-white: #ffffff;
	--dm-color-gold: #b78a35;
	--dm-color-gold-strong: #956b1f;
	--dm-color-champagne: #dfbd70;
	--dm-color-muted: #655f56;
	--dm-color-line: rgba(17, 16, 14, 0.14);
	--dm-color-line-gold: rgba(183, 138, 53, 0.28);
	--dm-color-danger: #a73a32;
	--dm-font-sans: "Manrope", Arial, sans-serif;
	--dm-font-display: "Playfair Display", Georgia, serif;
	--dm-space-1: 0.5rem;
	--dm-space-2: 0.75rem;
	--dm-space-3: 1rem;
	--dm-space-4: 1.5rem;
	--dm-space-5: 2rem;
	--dm-space-6: 3rem;
	--dm-space-7: 4.5rem;
	--dm-space-section: clamp(4.75rem, 8vw, 7.5rem);
	--dm-content-gutter: clamp(1.25rem, 5vw, 4.5rem);
	--dm-content-max: 90rem;
	--dm-radius-sm: 0.75rem;
	--dm-radius-md: 1.125rem;
	--dm-radius-lg: 1.625rem;
	--dm-radius-pill: 999px;
	--dm-shadow-sm: 0 10px 30px rgba(35, 28, 17, 0.07);
	--dm-shadow-md: 0 22px 60px rgba(35, 28, 17, 0.12);
	--dm-header-height: 5.5rem;
	--dm-header-height-mobile: 4.5rem;

	/* Backward-compatible aliases used by existing theme and plugin styles. */
	--ink: var(--dm-color-ink);
	--cream: var(--dm-color-cream);
	--paper: var(--dm-color-paper);
	--gold: var(--dm-color-gold);
	--gold2: var(--dm-color-champagne);
	--muted: var(--dm-color-muted);
	--line: var(--dm-color-line);
	--dark: var(--dm-color-charcoal);
	--radius: var(--dm-radius-lg);
	--font-sans: var(--dm-font-sans);
	--font-display: var(--dm-font-display);
}

html {
	min-width: 20rem;
	overflow-x: clip;
	scroll-padding-top: calc(var(--dm-header-height) + 1.5rem);
}

body {
	min-width: 20rem;
	overflow-x: clip;
	background: var(--dm-color-paper);
	color: var(--dm-color-ink);
	font-family: var(--dm-font-sans);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.menu-open {
	overflow: hidden;
}

img,
svg,
video,
canvas,
iframe {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

p,
li,
label,
input,
select,
textarea,
button {
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: inherit;
	font-family: var(--dm-font-display);
	font-weight: 600;
	line-height: 1.08;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

::selection {
	background: var(--dm-color-champagne);
	color: var(--dm-color-ink);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	border-radius: 0.25rem;
	outline: 2px solid var(--dm-color-gold);
	outline-offset: 4px;
}

a,
button,
input,
select,
textarea,
summary {
	-webkit-tap-highlight-color: rgba(183, 138, 53, 0.18);
}

.section-pad,
.content-page {
	padding-left: var(--dm-content-gutter);
	padding-right: var(--dm-content-gutter);
}

.section-pad > *,
.content-page > *,
.site-footer__inner,
.site-footer__meta,
.site-header__inner {
	max-width: var(--dm-content-max);
	margin-right: auto;
	margin-left: auto;
}

.section-pad {
	padding-top: var(--dm-space-section);
	padding-bottom: var(--dm-space-section);
}

/* Shared controls */
.button,
.wp-element-button,
.hub-button {
	min-height: 3rem;
	padding: 0.875rem 1.35rem;
	align-items: center;
	gap: 0.45rem;
	border-radius: var(--dm-radius-pill);
	font-family: var(--dm-font-sans);
	font-size: 0.8125rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.button,
.wp-element-button,
.hub-button {
	display: inline-flex;
	justify-content: center;
}

.button:hover,
.wp-element-button:hover,
.hub-button:hover {
	transform: translateY(-2px);
	box-shadow: var(--dm-shadow-sm);
}

.button:disabled,
.wp-element-button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
	transform: none;
}

.scripture-close {
	width: 2.75rem;
	height: 2.75rem;
	display: inline-grid;
	place-items: center;
}

.entry-content summary {
	min-height: 2.75rem;
	display: flex;
	align-items: center;
}

.pressable {
	will-change: transform;
}

/* Shared surfaces */
:where(
	.value-card,
	.home-service-card,
	.showroom-card,
	.package-card,
	.type-preview,
	.entry-card,
	.care-plans article,
	.entry-content details
) {
	border-color: var(--dm-color-line-gold);
	box-shadow: var(--dm-shadow-sm);
}

:where(.value-card, .home-service-card, .showroom-card, .package-card) {
	transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

:where(.value-card, .home-service-card, .showroom-card, .package-card):hover {
	border-color: rgba(183, 138, 53, 0.5);
	box-shadow: var(--dm-shadow-md);
}

/* Shared form language */
#main-content :where(
	input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
	select,
	textarea
) {
	width: 100%;
	min-height: 3.25rem;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(17, 16, 14, 0.24);
	border-radius: var(--dm-radius-sm);
	background: var(--dm-color-white);
	color: var(--dm-color-ink);
	font: 600 1rem/1.4 var(--dm-font-sans);
	box-shadow: 0 1px 0 rgba(17, 16, 14, 0.03);
	transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#main-content textarea {
	min-height: 9rem;
	resize: vertical;
}

#main-content :where(input, select, textarea)::placeholder {
	color: #767066;
	opacity: 1;
}

#main-content :where(input, select, textarea):focus {
	border-color: var(--dm-color-gold);
	box-shadow: 0 0 0 4px rgba(183, 138, 53, 0.16);
	outline: 0;
}

#main-content :where(input, select, textarea)[aria-invalid="true"] {
	border-color: var(--dm-color-danger);
	box-shadow: 0 0 0 4px rgba(167, 58, 50, 0.12);
}

#main-content :where(input[type="checkbox"], input[type="radio"]) {
	width: 1.25rem;
	height: 1.25rem;
	accent-color: var(--dm-color-gold-strong);
}

#main-content input[type="file"] {
	max-width: 100%;
	min-height: 3rem;
	font: 600 0.875rem/1.4 var(--dm-font-sans);
}

#main-content input[type="file"]::file-selector-button {
	min-height: 2.75rem;
	margin-right: 0.75rem;
	padding: 0.65rem 1rem;
	border: 1px solid var(--dm-color-ink);
	border-radius: var(--dm-radius-pill);
	background: var(--dm-color-ink);
	color: var(--dm-color-white);
	font: 800 0.75rem/1 var(--dm-font-sans);
	cursor: pointer;
}

#main-content label,
#main-content legend {
	color: var(--dm-color-ink);
	font-weight: 700;
}

.dmc-color-swatch {
	width: 2.75rem;
	height: 2.75rem;
	min-width: 2.75rem;
	min-height: 2.75rem;
}

/* Header and navigation */
.site-header {
	top: 0;
	height: auto;
	padding: 0;
	background: rgba(255, 253, 248, 0.94);
	border-bottom: 1px solid var(--dm-color-line);
	backdrop-filter: blur(18px);
}

.admin-bar .site-header {
	top: 32px;
}

.site-header__inner {
	width: 100%;
	min-height: var(--dm-header-height);
	margin: 0 auto;
	padding: 0 var(--dm-content-gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--dm-space-4);
}

.brand {
	flex: 0 0 auto;
	min-height: 3rem;
	display: inline-flex;
	align-items: center;
}

.custom-logo {
	max-width: min(17rem, 35vw);
	max-height: 3.25rem;
}

.official-brand-lockup {
	width: clamp(12.5rem, 18vw, 16.25rem);
	display: inline-flex;
	align-items: center;
}

.site-header .official-brand-lockup,
.site-header .official-brand-compact {
	padding: 0.3rem 0.55rem;
	border: 1px solid rgba(184, 137, 39, 0.52);
	border-radius: 0.8rem;
	background: #050505;
	box-shadow: 0 10px 26px rgba(20, 14, 3, 0.14);
}

.official-brand-lockup img,
.official-brand-compact img {
	width: 100%;
	height: auto;
	display: block;
}

.official-brand-compact {
	width: 3.35rem;
	display: none;
	align-items: center;
}

.nav {
	min-width: 0;
	gap: clamp(0.9rem, 2.2vw, 2rem);
}

.site-header .menu {
	gap: clamp(0.9rem, 2.2vw, 1.75rem);
}

.site-header .menu > li > a,
.hub-button {
	min-height: 2.875rem;
	display: inline-flex;
	align-items: center;
}

.site-header .menu > li > a {
	position: relative;
}

.site-header .menu > li > a::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0.35rem;
	left: 0;
	height: 1px;
	background: var(--dm-color-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 180ms ease;
}

.site-header .menu > li > a:hover::before,
.site-header .menu > li > a:focus-visible::before,
.site-header .current-menu-item > a::before,
.site-header .current-menu-ancestor > a::before {
	transform: scaleX(1);
}

.site-header .sub-menu {
	top: calc(100% + 0.75rem);
	min-width: 18rem;
	padding: 0.7rem;
	border-color: var(--dm-color-line-gold);
	background: rgba(255, 253, 248, 0.98);
	box-shadow: var(--dm-shadow-md);
}

.site-header .sub-menu a {
	min-height: 2.75rem;
	display: flex;
	align-items: center;
}

.site-header .sub-menu a:hover,
.site-header .sub-menu a:focus-visible {
	background: var(--dm-color-cream);
	color: var(--dm-color-gold-strong);
}

.hub-button {
	flex: 0 0 auto;
	padding-right: 1.15rem !important;
	padding-left: 1.15rem !important;
}

.menu-toggle {
	width: 3rem;
	height: 3rem;
	padding: 0.75rem;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--dm-color-line);
	border-radius: 50%;
	background: var(--dm-color-paper);
}

.menu-toggle > span:not(.screen-reader-text) {
	width: 1.35rem;
	height: 1px;
	display: block;
	background: var(--dm-color-ink);
	transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle[aria-expanded="true"] > span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] > span:nth-child(2) {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] > span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Footer */
.site-footer {
	padding: 0;
	display: block;
	background: var(--dm-color-charcoal);
	color: var(--dm-color-white);
	border-top: 1px solid rgba(223, 189, 112, 0.28);
}

.site-footer__inner,
.site-footer__meta {
	width: 100%;
	margin: 0 auto;
	padding-right: var(--dm-content-gutter);
	padding-left: var(--dm-content-gutter);
}

.site-footer__inner {
	padding-top: clamp(3.5rem, 7vw, 5.5rem);
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
	display: grid;
	grid-template-columns: minmax(15rem, 0.8fr) minmax(24rem, 1.35fr) auto;
	align-items: start;
	gap: clamp(2rem, 5vw, 5rem);
}

.site-footer__brand p {
	max-width: 24rem;
	margin: 1rem 0 0;
	color: #c9c2b7;
	font-size: 0.875rem;
	line-height: 1.7;
}

.site-footer .brand {
	color: var(--dm-color-white);
}

.site-footer .official-brand-lockup {
	width: min(17rem, 100%);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.site-footer .menu {
	display: grid;
	grid-template-columns: repeat(2, minmax(9rem, 1fr));
	gap: 0.4rem 1.25rem;
}

.site-footer .menu a {
	min-height: 2.75rem;
	display: inline-flex;
	align-items: center;
	color: #eee9e0;
	font-size: 0.8125rem;
	font-weight: 700;
}

.site-footer .menu a:hover,
.site-footer .menu a:focus-visible {
	color: var(--dm-color-champagne);
}

.footer-hub {
	border-color: rgba(255, 255, 255, 0.5) !important;
	color: var(--dm-color-white);
	white-space: nowrap;
}

.site-footer__meta {
	min-height: 4.5rem;
	padding-top: 1rem;
	padding-bottom: 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: #aaa398;
}

.site-footer__meta small,
.site-footer__meta span {
	font-size: 0.6875rem;
	line-height: 1.5;
}

@media (max-width: 1120px) {
	.site-header__inner {
		gap: 1rem;
	}

	.site-header .menu,
	.nav {
		gap: 0.9rem;
	}

	.site-header .official-brand-lockup {
		display: none;
	}

	.site-header .official-brand-compact {
		display: inline-flex;
	}

	.site-footer__inner {
		grid-template-columns: 1fr 1.4fr;
	}

	.footer-hub {
		grid-column: 1 / -1;
		justify-self: start;
	}
}

@media (max-width: 960px) {
	html {
		scroll-padding-top: calc(var(--dm-header-height-mobile) + 1rem);
	}

	.site-header__inner {
		min-height: var(--dm-header-height-mobile);
	}

	.menu-toggle {
		display: inline-flex;
		flex-direction: column;
		gap: 0.375rem;
		z-index: 52;
	}

	.nav {
		position: fixed;
		inset: var(--dm-header-height-mobile) 0 auto;
		max-height: calc(100dvh - var(--dm-header-height-mobile));
		padding: 1rem var(--dm-content-gutter) 1.5rem;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0.35rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: rgba(255, 253, 248, 0.99);
		border-bottom: 1px solid var(--dm-color-line-gold);
		box-shadow: var(--dm-shadow-md);
	}

	.admin-bar .nav {
		inset: calc(32px + var(--dm-header-height-mobile)) 0 auto;
		max-height: calc(100dvh - 32px - var(--dm-header-height-mobile));
	}

	.nav.open {
		display: flex;
	}

	.site-header .menu {
		width: 100%;
		display: block;
	}

	.site-header .menu > li {
		border-bottom: 1px solid var(--dm-color-line);
	}

	.site-header .menu > li > a {
		width: 100%;
		min-height: 3.25rem;
		padding: 0.85rem 0;
		justify-content: space-between;
	}

	.site-header .menu > li > a::before {
		display: none;
	}

	.site-header .sub-menu,
	.site-header .services-menu {
		position: static;
		width: 100%;
		min-width: 0;
		margin: 0 0 0.8rem;
		padding: 0.25rem 0 0.35rem 0.9rem;
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none !important;
		border: 0;
		border-left: 1px solid var(--dm-color-gold);
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	.site-header .menu-item-has-children.submenu-open > .sub-menu {
		display: block;
	}

	.site-header .sub-menu a {
		min-height: 3rem;
		padding: 0.75rem;
	}

	.nav > .hub-button {
		width: 100%;
		margin-top: 0.65rem;
		justify-content: center;
		background: var(--dm-color-ink);
		color: var(--dm-color-white);
	}

	.site-footer__inner {
		grid-template-columns: 1fr;
	}

	.footer-hub {
		grid-column: auto;
	}
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}

	.admin-bar .nav {
		inset: calc(46px + var(--dm-header-height-mobile)) 0 auto;
		max-height: calc(100dvh - 46px - var(--dm-header-height-mobile));
	}
}

@media (max-width: 640px) {
	:root {
		--dm-content-gutter: 1.25rem;
		--dm-space-section: 4.5rem;
	}

	.custom-logo {
		max-width: 12.5rem;
	}

	.site-header .official-brand-compact {
		width: 3rem;
	}

	.site-footer .menu {
		grid-template-columns: 1fr;
	}

	.site-footer__meta {
		align-items: flex-start;
		flex-direction: column;
	}

	.button-row {
		align-items: stretch;
		flex-direction: column;
	}

	.button-row .button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto !important;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}

	.pressable,
	.button,
	.wp-element-button,
	.hub-button,
	:where(.value-card, .home-service-card, .showroom-card, .package-card) {
		transform: none !important;
	}

	.hero-video,
	.hero-motion,
	.home-orbit,
	.home-gold-line,
	.scanner-line {
		display: none !important;
	}

	.reveal-on-scroll,
	.page-enter {
		opacity: 1 !important;
		transform: none !important;
	}
}
