/**
 * Lingmidu Stage — Front-end supplemental CSS.
 *
 * theme.json handles tokens & block presets. This file covers:
 *   1. Accessibility (skip link, focus ring)
 *   2. Block style variations declared in inc/block-styles.php
 *   3. Floating contact + WeChat QR modal (template-helpers.php)
 *   4. Header / footer / showcase polish
 *   5. Reduced-motion fallbacks
 */

/* ===========================================================
   1. Accessibility
   =========================================================== */
.lm-skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--stage);
	font-weight: 700;
	letter-spacing: 0;
	text-decoration: none;
	transition: top 0.2s ease;
}
.lm-skip-link:focus {
	top: 8px;
	outline: 2px solid var(--wp--preset--color--gold-bright);
	outline-offset: 2px;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
	border-radius: 0;
}

/* Claude-imported Gutenberg page compatibility.
   These pages intentionally live in post_content, while the theme only provides
   small token/class fallbacks for colors that are not in this block theme's
   original palette. */
.has-vivid-red-background-color {
	background-color: #C8362B !important;
}
.has-base-background-color {
	background-color: #F5F0E6 !important;
}
.has-white-color {
	color: #FFFFFF !important;
}
.has-black-background-color {
	background-color: #000000 !important;
}
.wp-block-button__link.has-contrast-color {
	color: #0E0E12 !important;
}
.wp-block-button__link.has-base-background-color {
	background-color: #F5F0E6 !important;
}
.cd-eyebrow {
	font-weight: 800;
}
.cd-process-list {
	padding-left: 1.25rem;
}
.cd-process-list li + li {
	margin-top: 0.85rem;
}
#lm-main-content :is(.has-base-background-color, [style*="background-color:#F5F0E6"], [style*="background-color:#EFE8DA"]) {
	color: #1F1B1A;
}
#lm-main-content :is(.has-base-background-color, [style*="background-color:#F5F0E6"], [style*="background-color:#EFE8DA"]) :where(h1, h2, h3, h4, h5, h6, p, li, pre, cite):not(.has-text-color) {
	color: #1F1B1A;
}
#lm-main-content :is(.has-base-background-color, [style*="background-color:#F5F0E6"], [style*="background-color:#EFE8DA"]) a:not(.wp-block-button__link) {
	color: #8F241E;
}

/* ===========================================================
   2. Block style variations
   =========================================================== */

/* Group: card-stage — dark card with subtle gold border */
.wp-block-group.is-style-card-stage {
	background: var(--wp--preset--color--stage-card);
	border: 1px solid var(--wp--preset--color--stage-line);
	padding: var(--wp--preset--spacing--40);
	transition: border-color 0.3s ease, transform 0.3s ease;
}
.wp-block-group.is-style-card-stage:hover {
	border-color: var(--wp--preset--color--gold);
	transform: translateY(-2px);
}

/* Group: spotlight — radial gold glow at top */
.wp-block-group.is-style-spotlight {
	position: relative;
	overflow: hidden;
}
.wp-block-group.is-style-spotlight::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 0%, rgba(201,169,110,0.18) 0%, rgba(10,10,10,0) 60%);
	pointer-events: none;
}

/* Separator: gold-line */
.wp-block-separator.is-style-gold-line {
	border: 0;
	height: 1px;
	background: var(--wp--preset--color--gold) !important;
	max-width: 60px;
	margin: var(--wp--preset--spacing--40) auto;
	opacity: 1;
}

/* Separator: asterism (⁂) */
.wp-block-separator.is-style-asterism {
	border: 0;
	background: transparent !important;
	text-align: center;
	height: auto;
	margin: var(--wp--preset--spacing--40) 0;
}
.wp-block-separator.is-style-asterism::before {
	content: "⁂";
	color: var(--wp--preset--color--gold);
	font-size: 1.5rem;
	letter-spacing: 0;
}

/* Image: gold-frame */
.wp-block-image.is-style-gold-frame img {
	padding: 8px;
	background: var(--wp--preset--color--stage-card);
	border: 1px solid var(--wp--preset--color--gold);
}

/* Image: desaturate */
.wp-block-image.is-style-desaturate img {
	filter: grayscale(100%) brightness(0.85);
	transition: filter 0.4s ease;
}
.wp-block-image.is-style-desaturate img:hover {
	filter: grayscale(0%) brightness(1);
}

/* Button: ghost-gold (transparent + gold border) */
.wp-block-button.is-style-ghost-gold .wp-block-button__link {
	background: transparent !important;
	color: var(--wp--preset--color--gold) !important;
	border: 1px solid var(--wp--preset--color--gold);
	transition: all 0.25s ease;
}
.wp-block-button.is-style-ghost-gold .wp-block-button__link:hover,
.wp-block-button.is-style-ghost-gold .wp-block-button__link:focus {
	background: var(--wp--preset--color--gold) !important;
	color: var(--wp--preset--color--stage) !important;
}

/* Button: solid-light (cream solid) */
.wp-block-button.is-style-solid-light .wp-block-button__link {
	background: var(--wp--preset--color--ink-100) !important;
	color: var(--wp--preset--color--stage) !important;
}
.wp-block-button.is-style-solid-light .wp-block-button__link:hover {
	background: var(--wp--preset--color--gold-bright) !important;
}

/* Heading: underline-gold */
.wp-block-heading.is-style-underline-gold {
	border-bottom: 1px solid var(--wp--preset--color--gold);
	padding-bottom: 0.5rem;
	display: inline-block;
}

/* Quote: centered */
.wp-block-quote.is-style-centered {
	border: 0 !important;
	text-align: center;
	padding: var(--wp--preset--spacing--40) 0 !important;
	max-width: 720px;
	margin-inline: auto;
}

/* ===========================================================
   3. Floating contact buttons + WeChat QR modal
   =========================================================== */
.lm-floating {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	z-index: 9990;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	pointer-events: none;
}

.lm-floating__btn {
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.85rem 1.1rem;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--stage);
	border: 0;
	box-shadow: 0 12px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(201,169,110,0.4);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.lm-floating__btn:hover,
.lm-floating__btn:focus-visible {
	background: var(--wp--preset--color--gold-bright);
	transform: translateY(-2px);
	color: var(--wp--preset--color--stage);
	box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(232,201,134,0.6);
}

.lm-floating__top {
	align-self: flex-end;
	width: 44px;
	height: 44px;
	padding: 0;
	justify-content: center;
}
.lm-floating__top .lm-floating__label { display: none; }

.lm-floating__label {
	white-space: nowrap;
}

.lm-primary-nav .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--stage-soft);
	border: 1px solid var(--wp--preset--color--stage-line);
	box-shadow: 0 18px 44px rgba(0,0,0,0.45);
	color: var(--wp--preset--color--ink-100);
	min-width: 12rem;
}

.lm-primary-nav .wp-block-navigation__submenu-container a {
	color: var(--wp--preset--color--ink-100);
}

.lm-primary-nav .wp-block-navigation__submenu-container a:hover,
.lm-primary-nav .wp-block-navigation__submenu-container a:focus-visible {
	color: var(--wp--preset--color--gold-bright);
}

.lm-category-strip {
	gap: 0.7rem;
}

.lm-category-strip p {
	margin: 0;
}

.lm-category-strip a {
	display: inline-flex;
	align-items: center;
	min-height: 2.4rem;
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--wp--preset--color--stage-line);
	background: var(--wp--preset--color--stage-card);
	color: var(--wp--preset--color--ink-100);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0;
	text-decoration: none;
}

.lm-category-strip a:hover,
.lm-category-strip a:focus-visible {
	border-color: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--gold-bright);
}

@media (max-width: 600px) {
	.lm-floating { right: 1rem; bottom: 1rem; }
	.lm-floating__btn .lm-floating__label { display: none; }
	.lm-floating__btn {
		width: 48px;
		height: 48px;
		padding: 0;
		justify-content: center;
	}
}

@media (max-width: 781px) {
	.lm-site-header {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}

	.lm-display-brand__name {
		font-size: 1.08rem;
	}

	.lm-display-brand__tag {
		font-size: 0.78rem;
	}

	.lm-primary-nav {
		margin-left: auto;
	}

	.lm-floating {
		display: none;
	}

	.lm-hero {
		min-height: 720px !important;
		padding-left: 1.25rem !important;
		padding-right: 1.25rem !important;
	}

	.lm-hero .wp-block-cover__image-background {
		object-position: 58% center;
	}

	.lm-hero::after {
		background: linear-gradient(180deg, rgba(5,5,5,0.72) 0%, rgba(5,5,5,0.74) 52%, rgba(5,5,5,0.94) 100%);
	}

	.lm-hero-title {
		font-size: 2.85rem !important;
		line-height: 1.08 !important;
	}

	.lm-hero-actions {
		align-items: stretch;
		width: 100%;
	}

	.lm-hero-actions .wp-block-button,
	.lm-hero-actions .wp-block-button__link {
		width: 100%;
	}

	.lm-hero-proof {
		margin-top: var(--wp--preset--spacing--40);
	}
}

@media (min-width: 782px) and (max-width: 1100px) {
	.lm-hero-title {
		font-size: 4.5rem !important;
	}
}

/* WeChat QR modal */
.lm-wechat-qr {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.78);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
.lm-wechat-qr[hidden] { display: none; }
.lm-wechat-qr > * {
	background: var(--wp--preset--color--ink-100);
	color: var(--wp--preset--color--stage);
	padding: 1.5rem;
	max-width: 280px;
	text-align: center;
	box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.lm-wechat-qr img { display: block; max-width: 220px; height: auto; margin: 0 auto; }
.lm-wechat-qr__close {
	position: absolute;
	top: 1.25rem;
	right: 1.25rem;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wp--preset--color--ink-100);
	color: var(--wp--preset--color--stage);
	border: 0;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}
.lm-wechat-qr__placeholder p {
	font-size: 0.875rem;
	color: var(--wp--preset--color--stage-line);
	margin: 0 0 0.5rem;
	letter-spacing: 0;
	text-transform: uppercase;
}
.lm-wechat-qr__placeholder strong {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 0.75rem;
}
.lm-wechat-qr__placeholder small {
	display: block;
	font-size: 0.75rem;
	color: #666;
	line-height: 1.5;
}

/* ===========================================================
   4. Header / footer / showcase polish
   =========================================================== */
.lm-site-header {
	backdrop-filter: blur(12px) saturate(140%);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	background-color: rgba(10,10,10,0.86) !important;
}

.wp-site-blocks [style*="letter-spacing"] {
	letter-spacing: 0 !important;
}

.lm-site-header > .wp-block-group {
	gap: 1.25rem;
	min-width: 0;
}

.lm-display-brand {
	min-width: 0;
}

.lm-display-brand p {
	margin: 0;
}

.lm-display-brand__name {
	color: var(--wp--preset--color--ink-100);
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1.15;
	white-space: nowrap;
}

.lm-display-brand__tag {
	color: var(--wp--preset--color--gold);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.35;
	margin-top: 0.25rem !important;
	white-space: nowrap;
}

.lm-primary-nav {
	flex-shrink: 0;
}

.lm-primary-nav a {
	color: var(--wp--preset--color--ink-100);
}

.lm-primary-nav a:hover,
.lm-primary-nav a:focus-visible {
	color: var(--wp--preset--color--gold);
}

.lm-hero {
	background-color: var(--wp--preset--color--stage);
	overflow: hidden;
}

.lm-hero .wp-block-cover__image-background {
	filter: saturate(0.98) contrast(1.08);
	object-position: center center;
}

.lm-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(5,5,5,0.82) 0%, rgba(5,5,5,0.54) 43%, rgba(5,5,5,0.2) 100%),
		linear-gradient(180deg, rgba(5,5,5,0.08) 0%, rgba(5,5,5,0.55) 100%);
	pointer-events: none;
	z-index: 1;
}

.lm-hero .wp-block-cover__inner-container {
	position: relative;
	z-index: 4 !important;
}

.lm-hero .wp-block-cover__background {
	z-index: 1;
}

.lm-hero-panel {
	max-width: 660px;
}

.lm-hero-kicker {
	display: inline-flex;
	border: 1px solid rgba(201,169,110,0.48);
	background: rgba(10,10,10,0.42);
	padding: 0.42rem 0.72rem;
}

.lm-hero-title {
	color: #fff !important;
	font-size: 5.8rem !important;
	opacity: 1 !important;
	text-wrap: balance;
	text-shadow: 0 10px 42px rgba(0,0,0,0.72);
}

.lm-hero-lede {
	color: #fff !important;
	max-width: 560px;
	text-shadow: 0 4px 24px rgba(0,0,0,0.72);
}

.lm-hero-proof {
	gap: 0.7rem;
	margin-top: var(--wp--preset--spacing--60);
}

.lm-hero-proof p {
	border: 1px solid rgba(245,245,240,0.22);
	background: rgba(10,10,10,0.48);
	color: var(--wp--preset--color--ink-100);
	font-size: 0.9rem;
	font-weight: 650;
	margin: 0;
	padding: 0.55rem 0.78rem;
}

.lm-brand-text { gap: 0; }
.lm-brand-text .wp-block-site-title,
.lm-brand-text .wp-block-site-tagline {
	margin: 0;
}
.lm-brand-text .wp-block-site-tagline {
	color: var(--wp--preset--color--gold);
}

.lm-site-footer .wp-block-list.is-style-none {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}
.lm-site-footer .wp-block-list.is-style-none li::marker { content: ""; }

.lm-footer-phone .lm-phone-link,
.lm-footer-phone a {
	color: var(--wp--preset--color--ink-100) !important;
	text-decoration: none;
}
.lm-footer-phone:hover .lm-phone-link,
.lm-footer-phone a:hover {
	color: var(--wp--preset--color--gold) !important;
}

.lm-beian {
	display: inline-flex;
	gap: 0.5em;
	color: var(--wp--preset--color--ink-500);
}
.lm-beian a {
	color: var(--wp--preset--color--ink-500);
	text-decoration: none;
}
.lm-beian a:hover { color: var(--wp--preset--color--gold); }

.lm-showcase-card .wp-block-cover img,
.lm-showcase-card .wp-block-cover video {
	transition: transform 0.6s ease, filter 0.4s ease;
}
.lm-showcase-card:hover .wp-block-cover img,
.lm-showcase-card:hover .wp-block-cover video {
	transform: scale(1.04);
}
.lm-showcase-card { transition: border-color 0.3s ease; }
.lm-showcase-card:hover { border-color: var(--wp--preset--color--gold) !important; }

.lm-clients-row .lm-client-placeholder {
	border: 1px solid var(--wp--preset--color--stage-line);
	padding: 1.25rem 0.75rem;
	transition: border-color 0.3s ease, color 0.3s ease;
}
.lm-clients-row .lm-client-placeholder:hover {
	border-color: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--gold) !important;
}

.lmd-page-kicker,
.lmd-cat-directory__kicker {
	color: var(--wp--preset--color--gold);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 800;
	letter-spacing: 0;
	margin: 0 0 0.75rem;
	text-transform: uppercase;
}

.lmd-page-lede {
	color: var(--wp--preset--color--ink-300);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.85;
	max-width: 760px;
}

.lmd-panel {
	background: var(--wp--preset--color--stage-card);
	border: 1px solid var(--wp--preset--color--stage-line);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.lmd-panel h3,
.lmd-panel h4 {
	margin-top: 0;
}

.lmd-panel p:last-child,
.lmd-panel ul:last-child {
	margin-bottom: 0;
}

.lmd-cat-directory {
	display: grid;
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

.lmd-cat-directory__section {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
	gap: clamp(1rem, 3vw, 2rem);
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid var(--wp--preset--color--stage-line);
	background: linear-gradient(135deg, rgba(201,169,110,0.08), rgba(26,26,26,0.96));
}

.lmd-cat-directory__intro h2 {
	margin: 0 0 0.75rem;
}

.lmd-cat-directory__intro p {
	color: var(--wp--preset--color--ink-300);
	margin: 0 0 1rem;
}

.lmd-cat-directory__intro a {
	color: var(--wp--preset--color--gold-bright);
	font-weight: 700;
	text-decoration: none;
}

.lmd-cat-directory__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem;
}

.lmd-cat-card {
	display: grid;
	gap: 0.45rem;
	min-height: 9.5rem;
	padding: 1.15rem;
	border: 1px solid rgba(201,169,110,0.24);
	background: rgba(10,10,10,0.38);
	color: var(--wp--preset--color--ink-100);
	text-decoration: none;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.lmd-cat-card:hover,
.lmd-cat-card:focus-visible {
	border-color: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink-100);
	transform: translateY(-2px);
}

.lmd-cat-card span {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.25;
}

.lmd-cat-card small {
	color: var(--wp--preset--color--gold);
	font-weight: 800;
}

.lmd-cat-card em {
	color: var(--wp--preset--color--ink-300);
	font-style: normal;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.65;
}

@media (max-width: 781px) {
	.lmd-cat-directory__section,
	.lmd-cat-directory__grid {
		grid-template-columns: 1fr;
	}

	.lmd-cat-card {
		min-height: 0;
	}
}

/* ===========================================================
   5. Reduced motion
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
