/*
 * Base styles + default CSS custom properties (the shared skeleton).
 * Each color scheme overrides these variables in its own scope
 * (body.scheme-{slug}); each layout overrides structure (body.layout-{slug}).
 */

:root {
	--site-bg: #ffffff;
	--site-text: #1f2937;
	--site-muted: #6b7280;
	--site-accent: #c9a84c;
	--site-accent-2: #c9a84c;
	--site-surface: #f4f6f9;
	--site-border: rgba(0, 0, 0, 0.08);

	--header-bg: #0d0d0d;
	--header-text: #ffffff;
	--header-link: #ffffff;
	--header-link-hover: var(--site-accent);
	--header-trust-bg: #000000;
	--header-trust-text: var(--site-accent);

	--footer-bg: #0d0d0d;
	--footer-text: #d1d5db;
	--footer-heading: #ffffff;
	--footer-link: #d1d5db;
	--footer-divider: rgba(255, 255, 255, 0.08);

	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: var(--font-body);

	--container-width: 1200px;
	--container-pad: clamp(1rem, 4vw, 2rem);
	--mobile-drawer-w: min(85vw, 340px);
	--card-radius: 10px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--site-bg);
	color: var(--site-text);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Default heading scale — templates override per-scope. */
h1 {
	font-size: clamp(1.9rem, 3.5vw, 2.8rem);
	line-height: 1.15;
	margin: 0 0 0.75em;
}

h2 {
	font-size: clamp(1.4rem, 2.4vw, 1.9rem);
	line-height: 1.2;
	margin: 0 0 0.65em;
}

h3 {
	font-size: clamp(1.1rem, 1.6vw, 1.3rem);
	line-height: 1.3;
	margin: 0 0 0.5em;
}

h4 {
	font-size: 1.05rem;
	line-height: 1.35;
	margin: 0 0 0.5em;
}

h5,
h6 {
	font-size: 0.95rem;
	line-height: 1.35;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1.25em;
}

/* Nicer headline wrapping (progressive enhancement). */
h1,
h2,
h3,
h4 {
	text-wrap: balance;
}

a {
	color: var(--site-accent);
	text-decoration: none;
}

/* Consistent keyboard-focus ring across schemes (zero-specificity, so component
   styles still win where they set their own). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--site-accent);
	outline-offset: 2px;
}

a:hover,
a:focus {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

button {
	font: inherit;
	cursor: pointer;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.skip-link {
	left: -9999px;
	position: absolute;
	top: 0;
}

.skip-link:focus {
	left: 6px;
	top: 6px;
}

/* Universal header / footer skeleton — templates restyle, never re-layout. */

.site-header {
	background: var(--header-bg);
	color: var(--header-text);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 1rem var(--container-pad);
}

.site-trust-bar {
	background: var(--header-trust-bg);
	color: var(--header-trust-text);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.site-trust-bar__inner {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0.4rem var(--container-pad);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.site-trust-bar__badges {
	list-style: none;
	display: flex;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
}

.site-trust-bar__badge {
	font-weight: 600;
	letter-spacing: 0.06em;
}

.site-branding .site-title,
.site-branding .site-description {
	margin: 0;
	color: inherit;
}

.custom-logo-link {
	display: inline-block;
	line-height: 0;
	max-width: 100%;
}

.custom-logo {
	max-width: var(--logo-max-width, 180px);
	height: auto;
	width: auto;
}

.site-branding .site-title a {
	color: inherit;
	text-decoration: none;
}

.main-navigation ul {
	list-style: none;
	display: flex;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
}

.main-navigation a {
	color: var(--header-link);
	text-decoration: none;
	font-weight: 500;
}

.main-navigation a:hover,
.main-navigation a:focus {
	color: var(--header-link-hover);
	text-decoration: none;
}

/* Active menu item — reuse the hover color. The animated underline (::after)
   is added per-scheme; we also add the active item to the hover selectors in
   each scheme so the underline shows permanently on the current page. */
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_ancestor > a {
	color: var(--header-link-hover);
}

/*
 * Dropdown submenus. Defined once here using the header CSS variables, so every
 * template inherits identical behavior. Selectors are intentionally qualified
 * with `.menu-item-has-children .sub-menu` (3 classes) so they out-rank the
 * per-scheme `body.scheme-* .main-navigation a/ul` rules (which load after
 * base.css and would otherwise leak nav padding/gap into the dropdown). The
 * caret lives on ::before — templates' hover underline uses ::after, no clash.
 * Submenus open on hover, keyboard focus (:focus-within), and tap (.focus is
 * added by js/navigation.js).
 */
.main-navigation .menu-item-has-children {
	position: relative;
}

.main-navigation .menu-item-has-children > a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.main-navigation .menu-item-has-children > a::before {
	content: "";
	order: 2;
	flex: 0 0 auto;
	width: 0.42em;
	height: 0.42em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-0.12em) rotate(45deg);
	transition: transform 0.2s ease;
}

.main-navigation .menu-item-has-children .sub-menu {
	position: absolute;
	top: 100%;
	right: 0;
	left: auto;
	z-index: 60;
	min-width: 230px;
	max-width: calc(100vw - 2rem);
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0.4rem 0;
	background: var(--header-bg);
	border: 1px solid var(--footer-divider);
	border-radius: 6px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.main-navigation .menu-item-has-children:hover > .sub-menu,
.main-navigation .menu-item-has-children:focus-within > .sub-menu,
.main-navigation .menu-item-has-children.focus > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.main-navigation .menu-item-has-children:hover > a::before,
.main-navigation .menu-item-has-children:focus-within > a::before,
.main-navigation .menu-item-has-children.focus > a::before {
	transform: translateY(0.05em) rotate(225deg);
}

.main-navigation .menu-item-has-children .sub-menu li {
	width: 100%;
	margin: 0;
}

.main-navigation .menu-item-has-children .sub-menu a {
	display: block;
	width: 100%;
	padding: 0.5rem 1.15rem;
	font-size: 0.92rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-transform: none;
	white-space: nowrap;
	color: var(--header-link);
}

.main-navigation .menu-item-has-children .sub-menu a:hover,
.main-navigation .menu-item-has-children .sub-menu a:focus {
	color: var(--header-link-hover);
	background: color-mix(in srgb, var(--header-link) 12%, transparent);
}

/* Second level and deeper: open to the left (nav is right-aligned), so deeper
   levels stay on-screen. Caret points left. */
.main-navigation .menu-item-has-children .sub-menu .sub-menu {
	top: -0.4rem;
	right: 100%;
	left: auto;
	margin-right: 2px;
}

.main-navigation .sub-menu .menu-item-has-children > a::before,
.main-navigation .sub-menu .menu-item-has-children:hover > a::before,
.main-navigation .sub-menu .menu-item-has-children:focus-within > a::before,
.main-navigation .sub-menu .menu-item-has-children.focus > a::before {
	transform: translateY(-0.05em) rotate(135deg);
}

.menu-toggle {
	display: none;
	background: transparent;
	border: 0;
	color: inherit;
	padding: 0;
	width: 44px;
	height: 44px;
	cursor: pointer;
	position: relative;
	z-index: 60;
}

.menu-toggle__icon {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
	gap: 5px;
}

.menu-toggle__bar {
	display: block;
	width: 24px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.2s ease,
		width 0.3s ease;
}

.main-navigation.toggled .menu-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
	width: 26px;
}

.main-navigation.toggled .menu-toggle__bar:nth-child(2) {
	opacity: 0;
	transform: translateX(-10px);
}

.main-navigation.toggled .menu-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
	width: 26px;
}

.main-navigation__panel {
	display: contents;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.site-header__cta,
.site-header__top-bonus {
	display: inline-block;
	padding: 0.55rem 1rem;
	border-radius: 4px;
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

.site-header__lang-toggle {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
	padding: 0.35rem 0.7rem;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
}

#content,
.site-main {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: clamp(2rem, 5vw, 3.5rem) var(--container-pad);
}

/*
 * Sidebar (per-context, independent of header layout — see sonmieuxlivetheme_show_sidebar).
 * `.site-content` is opened in header.php and closed in footer.php; it only
 * becomes a two-column grid when the body carries `has-sidebar`. Position is set
 * by `sidebar-left` / `sidebar-right`.
 */
body.has-sidebar .site-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 2.5rem;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 var(--container-pad);
	align-items: start;
}

body.has-sidebar.sidebar-left .site-content {
	grid-template-columns: 300px minmax(0, 1fr);
}

body.has-sidebar.sidebar-left #secondary {
	order: -1;
}

body.has-sidebar .site-main {
	max-width: none;
	margin: 0;
	padding-left: 0;
	padding-right: 0;
}

body.has-sidebar #secondary {
	padding: clamp(2rem, 5vw, 3.5rem) 0;
}

/*
 * Sidebar widgets — card treatment driven entirely by the scheme variables, so
 * each color scheme themes the sidebar automatically (surface, border, accent,
 * fonts). Schemes can add their own flourishes / override --card-radius.
 */
body.has-sidebar #secondary .widget {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--card-radius);
	padding: 1.35rem 1.5rem;
}

body.has-sidebar #secondary .widget + .widget {
	margin-top: 1.5rem;
}

body.has-sidebar #secondary .widget-title {
	font-family: var(--font-display);
	font-size: 1.1rem;
	line-height: 1.2;
	margin: 0 0 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 2px solid var(--site-accent);
	color: var(--site-text);
}

body.has-sidebar #secondary .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

body.has-sidebar #secondary .widget li {
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--site-border);
}

body.has-sidebar #secondary .widget li:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

/* Nested lists (e.g. comment threads, sub-categories) shouldn't double-border. */
body.has-sidebar #secondary .widget li ul {
	margin-top: 0.5rem;
	padding-left: 1rem;
}

body.has-sidebar #secondary .widget li li {
	border-bottom: 0;
	padding: 0.35rem 0;
}

body.has-sidebar #secondary .widget a {
	color: var(--site-text);
	text-decoration: none;
	transition: color 0.15s ease;
}

body.has-sidebar #secondary .widget a:hover,
body.has-sidebar #secondary .widget a:focus {
	color: var(--site-accent);
	text-decoration: none;
}

/* Search form */
body.has-sidebar #secondary .search-form {
	display: flex;
	gap: 0.5rem;
}

body.has-sidebar #secondary .search-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.6rem 0.75rem;
	background: var(--site-bg);
	color: var(--site-text);
	border: 1px solid var(--site-border);
	border-radius: var(--card-radius);
}

body.has-sidebar #secondary .search-submit {
	flex: 0 0 auto;
	padding: 0.6rem 1.1rem;
	border: 0;
	border-radius: var(--card-radius);
	background: var(--site-accent);
	color: var(--site-bg);
	font-weight: 700;
	cursor: pointer;
}

body.has-sidebar #secondary .search-submit:hover {
	background: var(--site-accent-2);
}

@media (max-width: 900px) {
	body.has-sidebar .site-content {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	body.has-sidebar.sidebar-left #secondary {
		order: 0;
	}
}

/* Footer skeleton — columns laid out by base.css; templates restyle. */

.site-footer {
	background: var(--footer-bg);
	color: var(--footer-text);
	margin-top: 3rem;
}

.site-footer a {
	color: var(--footer-link);
}

/*
 * Footer columns auto-reflow to however many are enabled in the Customizer
 * (Footer → show/hide toggles). Visibility is controlled in PHP only — templates
 * must not hide columns via CSS, so the layout stays consistent across all templates.
 */
.site-footer__inner {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 3rem var(--container-pad) 2rem;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
	gap: 2rem;
}

/*
 * Exact column count, set by footer.php (footer-cols-N) from the number of
 * columns that actually render — so the grid never reserves an empty track.
 */
.site-footer__inner.footer-cols-1 {
	grid-template-columns: minmax(0, 1fr);
}

.site-footer__inner.footer-cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-footer__inner.footer-cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-footer__inner.footer-cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
	.site-footer__inner.footer-cols-2,
	.site-footer__inner.footer-cols-3,
	.site-footer__inner.footer-cols-4 {
		grid-template-columns: 1fr;
	}
}

.site-footer__heading {
	color: var(--footer-heading);
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin: 0 0 1rem;
}

.site-footer__menu,
.site-footer__rg-logos,
.site-footer__social {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer__menu li,
.site-footer__rg-logos li {
	margin-bottom: 0.5rem;
}

.site-footer__social {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

.site-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--footer-divider);
	color: var(--footer-link);
}

.site-footer__rg-logos {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.site-footer__rg-badge {
	border: 1px solid var(--footer-divider);
	padding: 0.3rem 0.6rem;
	border-radius: 3px;
	font-size: 0.75rem;
	font-weight: 700;
}

.site-footer__age-badge {
	display: inline-block;
	background: var(--site-accent);
	color: #ffffff;
	font-weight: 700;
	font-size: 0.85rem;
	padding: 0.25rem 0.55rem;
	border-radius: 4px;
	line-height: 1;
	margin-bottom: 0.6rem;
}

.site-footer__bottom {
	border-top: 1px solid var(--footer-divider);
	font-size: 0.85rem;
}

.site-footer__bottom-inner {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 1rem var(--container-pad);
	text-align: center;
}

.site-footer__copyright {
	margin: 0;
}

/* Stack multiple widgets within one footer column. */
.site-footer__widget + .site-footer__widget {
	margin-top: 1.5rem;
}

/* Footer logo strip (partner / regulator logos) above the copyright bar. */
.site-footer__logos {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 1.75rem var(--container-pad);
	border-top: 1px solid var(--footer-divider);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 2.75rem;
}

.site-footer__logo-item {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2.75rem;
}

.site-footer__logos img {
	max-height: 42px;
	width: auto;
	filter: grayscale(1);
	opacity: 0.65;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.site-footer__logos a:hover img,
.site-footer__logos img:hover {
	filter: grayscale(0);
	opacity: 1;
}

/* WordPress admin bar compatibility — shift sticky header + drawer below the bar. */
.admin-bar .site-header {
	top: 32px;
}

.admin-bar .main-navigation__panel {
	top: 32px;
}

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

	.admin-bar .main-navigation__panel {
		top: 46px;
	}
}

@media (max-width: 900px) {
	.site-header__inner {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
	}

	/* Stop the nav from absorbing remaining space — hamburger sits flush right. */
	.main-navigation {
		flex: 0 0 auto;
	}

	.site-branding {
		flex: 0 1 auto;
		min-width: 0;
	}

	.menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Backdrop overlay shown when drawer opens. */
	.main-navigation::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.55);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
		z-index: 49;
	}

	.main-navigation.toggled::before {
		opacity: 1;
		pointer-events: auto;
	}

	/* Off-canvas drawer panel (slides in from the right). */
	.main-navigation__panel {
		display: block;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: var(--mobile-drawer-w);
		background: var(--header-bg);
		color: var(--header-text);
		padding: 5rem 1.5rem 2rem;
		transform: translateX(100%);
		transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
		box-shadow: -16px 0 48px rgba(0, 0, 0, 0.35);
		z-index: 50;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.main-navigation.toggled .main-navigation__panel {
		transform: translateX(0);
	}

	.main-navigation ul {
		display: flex;
		flex-direction: column;
		gap: 0;
		align-items: stretch;
	}

	.main-navigation li {
		border-bottom: 1px solid var(--footer-divider);
	}

	.main-navigation a {
		display: block;
		padding: 1rem 0.25rem;
		font-size: 1.05rem;
		letter-spacing: 0.04em;
	}

	.main-navigation a::after {
		display: none;
	}

	/*
	 * Drawer submenus stay permanently open — just indented with a left padding.
	 * No tap-to-toggle. Caret is hidden (nothing to collapse). High-specificity
	 * selectors so they beat the per-template nav rules here too.
	 */
	.main-navigation .menu-item-has-children > a {
		display: block;
	}

	.main-navigation .menu-item-has-children > a::before {
		display: none;
	}

	.main-navigation .menu-item-has-children .sub-menu {
		position: static;
		width: 100%;
		min-width: 0;
		max-width: none;
		padding: 0;
		border: 0 !important;
		border-top: 0 !important;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.main-navigation .menu-item-has-children .sub-menu li {
		width: 100%;
	}

	.main-navigation .menu-item-has-children .sub-menu a {
		width: 100%;
		padding-left: 1.75rem;
		font-size: 1rem;
		white-space: normal;
		color: var(--header-text);
	}

	.main-navigation .menu-item-has-children .sub-menu .sub-menu {
		right: auto;
		left: auto;
		margin-left: 0;
		margin-right: 0;
	}

	.main-navigation .menu-item-has-children .sub-menu .sub-menu a {
		padding-left: 3rem;
	}

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

/* ---------- Native Table of Contents ([toc] shortcode) ---------- */

.sonmieuxlivetheme-toc {
	background: var(--site-surface);
	border: 1px solid var(--site-border);
	border-radius: var(--card-radius);
	padding: 1.1rem 1.4rem;
	margin: 0 0 1.75rem;
	font-size: 0.95rem;
}

.sonmieuxlivetheme-toc__title {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--site-text);
}

.sonmieuxlivetheme-toc__details > .sonmieuxlivetheme-toc__title {
	cursor: pointer;
}

.sonmieuxlivetheme-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sonmieuxlivetheme-toc.is-numbered .sonmieuxlivetheme-toc__list {
	list-style: decimal;
	padding-left: 1.4rem;
}

.sonmieuxlivetheme-toc__item {
	margin: 0.3rem 0;
	line-height: 1.4;
}

.sonmieuxlivetheme-toc__item--l1 { padding-left: 1rem; }
.sonmieuxlivetheme-toc__item--l2 { padding-left: 2rem; }
.sonmieuxlivetheme-toc__item--l3 { padding-left: 3rem; }
.sonmieuxlivetheme-toc__item--l4 { padding-left: 4rem; }

.sonmieuxlivetheme-toc__link,
.sonmieuxlivetheme-toc__link:visited {
	color: var(--site-text);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.sonmieuxlivetheme-toc__link:hover,
.sonmieuxlivetheme-toc__link:focus-visible {
	color: var(--site-accent);
	border-bottom-color: currentColor;
}

/* Smooth-scroll to anchors + offset so headings clear any sticky header. */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

:where(h2, h3, h4, h5, h6)[id] {
	scroll-margin-top: 90px;
}

/* -------------------------------------------------------------------------
 * Sticky CTA bar (inc/sticky-cta.php).
 *
 * Colour comes entirely from the active palette's CSS variables, so the bar
 * matches every scheme/colour automatically. Local `--cta-*` vars let a scheme
 * override individual pieces. The logo sits on a guaranteed-dark plate so
 * transparent / white SVG+PNG brand logos stay visible on light palettes too.
 * ---------------------------------------------------------------------- */
.sonmieuxlivetheme-sticky-cta {
	/* Accent (button, stars, bonus tint) always follows the active palette.
	   Surface / text / soft-border come from the --dark / --light modifier the
	   render adds; --cta-bg-alpha is set inline from the Customizer opacity. */
	--cta-accent: var(--site-accent);
	--cta-bg-alpha: 0.92;
	--cta-surface: rgba(17, 21, 28, var(--cta-bg-alpha));
	--cta-text: #f3f5f9;
	--cta-border-soft: rgba(255, 255, 255, 0.14);
	/* Logo plate background — preset (rgb + border) from the --logo-dark/--logo-light
	   modifier, opacity (--cta-logo-alpha) set inline from the Customizer. */
	--cta-logo-rgb: 17, 21, 28;
	--cta-logo-alpha: 1;
	--cta-logo-border: rgba(255, 255, 255, 0.10);

	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	background: var(--cta-surface);
	color: var(--cta-text);
	border-top: 3px solid var(--cta-accent);
	box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transform: translateY(110%);
	transition: transform 0.4s ease;
	will-change: transform;
}

/* Dark / light translucent background presets (Customizer → Sticky CTA Bar). */
.sonmieuxlivetheme-sticky-cta--dark {
	--cta-surface: rgba(17, 21, 28, var(--cta-bg-alpha));
	--cta-text: #f3f5f9;
	--cta-border-soft: rgba(255, 255, 255, 0.14);
}

.sonmieuxlivetheme-sticky-cta--light {
	--cta-surface: rgba(255, 255, 255, var(--cta-bg-alpha));
	--cta-text: #15171c;
	--cta-border-soft: rgba(0, 0, 0, 0.16);
}

/* Logo plate background presets (Customizer → Sticky CTA Bar → Logo background). */
.sonmieuxlivetheme-sticky-cta--logo-dark {
	--cta-logo-rgb: 17, 21, 28;
	--cta-logo-border: rgba(255, 255, 255, 0.10);
}

.sonmieuxlivetheme-sticky-cta--logo-light {
	--cta-logo-rgb: 255, 255, 255;
	--cta-logo-border: rgba(0, 0, 0, 0.12);
}

.sonmieuxlivetheme-sticky-cta.is-visible {
	transform: translateY(0);
}

.sonmieuxlivetheme-sticky-cta__inner {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0.6rem var(--container-pad);
	display: flex;
	align-items: center;
	gap: clamp(0.6rem, 2vw, 1.25rem);
	flex-wrap: wrap;
}

/* Logo plate — keeps transparent/white logos legible on any palette. */
.sonmieuxlivetheme-sticky-cta__logo-link {
	display: inline-flex;
	flex: 0 0 auto;
	text-decoration: none;
}

.sonmieuxlivetheme-sticky-cta__logo-plate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(var(--cta-logo-rgb, 17, 21, 28), var(--cta-logo-alpha, 1));
	border: 1px solid var(--cta-logo-border, rgba(255, 255, 255, 0.10));
	border-radius: 8px;
	padding: 5px 9px;
}

.sonmieuxlivetheme-sticky-cta__logo {
	display: block;
	width: auto;
	max-width: 130px;
	max-height: 44px;
	height: auto;
	object-fit: contain;
}

.sonmieuxlivetheme-sticky-cta__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sonmieuxlivetheme-sticky-cta__name {
	font-weight: 700;
	font-size: 1.02rem;
	line-height: 1.1;
}

.sonmieuxlivetheme-sticky-cta__rating {
	display: inline-flex;
	line-height: 1;
}

.sonmieuxlivetheme-sticky-cta__star {
	color: var(--cta-border-soft);
	font-size: 1.05rem;
	position: relative;
	display: inline-block;
	width: 1em;
	overflow: hidden;
}

.sonmieuxlivetheme-sticky-cta__star.is-full {
	color: var(--cta-accent);
}

.sonmieuxlivetheme-sticky-cta__star.is-half::before {
	content: "\2605";
	color: var(--cta-accent);
	position: absolute;
	left: 0;
	top: 0;
	width: 50%;
	overflow: hidden;
}

.sonmieuxlivetheme-sticky-cta__bonus {
	font-weight: 700;
	font-size: clamp(0.95rem, 0.55rem + 0.9vw, 1.15rem);
	padding: 0.5rem 1rem;
	border-radius: 8px;
	background: rgb(from var(--cta-accent) r g b / 0.16);
	border-left: 4px solid var(--cta-accent);
	line-height: 1.3;
}

/* Scoped under the bar class so the scheme's generic `body.scheme-X a {color}`
   rule (specificity 0,1,2) can't override the accent button text colour. */
.sonmieuxlivetheme-sticky-cta .sonmieuxlivetheme-sticky-cta__button {
	margin-left: auto;
	flex: 0 0 auto;
	background: var(--cta-accent);
	color: var(--site-on-accent, #fff);
	font-weight: 700;
	text-decoration: none;
	padding: 0.65rem 1.4rem;
	border-radius: 6px;
	white-space: nowrap;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.sonmieuxlivetheme-sticky-cta .sonmieuxlivetheme-sticky-cta__button:hover,
.sonmieuxlivetheme-sticky-cta .sonmieuxlivetheme-sticky-cta__button:focus-visible {
	filter: brightness(1.08);
	transform: translateY(-1px);
	color: var(--site-on-accent, #fff);
}

/* Stack breakpoint set wide enough to catch where the bar (logo + meta + the
   larger bonus chip + button) actually wraps — above the 900px content break —
   so the button goes full-width the moment the row breaks, never auto-width on
   its own line. */
@media (max-width: 1080px) {
	.sonmieuxlivetheme-sticky-cta__inner {
		gap: 0.6rem 0.9rem;
	}
	.sonmieuxlivetheme-sticky-cta__bonus {
		order: 4;
		width: 100%;
		text-align: center;
		font-size: 1.05rem;
		padding: 0.55rem 1rem;
	}
	.sonmieuxlivetheme-sticky-cta__button {
		order: 5;
		margin-left: 0;
		flex: 1 1 100%;
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sonmieuxlivetheme-sticky-cta {
		transition: none;
	}
}
