/**
 * Calendanse — identité visuelle V5 (header premium + uniformisation globale)
 * Charte : bleu nuit #0B1F4D, violet #6A3FB5, magenta #C04BA5, orange #F08A4B, or #FFD166
 *
 * Zones exclues : MEC, wpForo, Jeux, Musique, Bibliothèque culturelle.
 */

:root {
	--cd-brand-night: #0b1f4d;
	--cd-brand-violet: #6a3fb5;
	--cd-brand-magenta: #c04ba5;
	--cd-brand-orange: #f08a4b;
	--cd-brand-gold: #ffd166;
	--cd-brand-bg: #ffffff;
	--cd-brand-bg-soft: #f4f6f8;
	--cd-brand-header-border: rgba(11, 31, 77, 0.08);
	--cd-brand-link: var(--cd-brand-violet);
	--cd-brand-link-hover: var(--cd-brand-magenta);
	--cd-brand-btn: var(--cd-brand-night);
	--cd-brand-btn-hover: var(--cd-brand-violet);
	--cd-brand-btn-accent: var(--cd-brand-orange);
	--cd-brand-focus: var(--cd-brand-violet);
	--cd-brand-focus-ring: rgba(106, 63, 181, 0.35);

	/* Pont legacy + Astra (renforcé aussi en inline head) */
	--ast-global-color-0: var(--cd-brand-violet);
	--ast-global-color-1: var(--cd-brand-magenta);
	--cd-blue: var(--cd-brand-night);
	--cd-pink: var(--cd-brand-magenta);
	--cd-orange: var(--cd-brand-orange);
	--cd-violet: var(--cd-brand-violet);
	--cd-border: rgba(11, 31, 77, 0.14);
	--cd-shadow: 0 18px 40px rgba(11, 31, 77, 0.12);
}

/* —— Rétablir les tokens natifs dans les zones protégées —— */
#wpforo-wrap,
#wpforo,
.mec-wrap,
body.page-id-3078,
body.page-id-2424,
body.post-type-archive-cd_cultural_entry,
body.single-cd_cultural_entry,
.cdl-cultural-archive,
.cdl-cultural-single {
	--ast-global-color-0: #046bd2;
	--ast-global-color-1: #045cb4;
}

#wpforo-wrap,
#wpforo {
	--ast-global-color-0: #5c9bd5;
	--ast-global-color-1: #4a8bc2;
}

/* —— Liens globaux (hors header menu, logo, zones exclues) —— */
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	#page
	:where(
		.entry-content,
		.site-content,
		.ast-footer,
		.comments-area,
		.cin-wrap,
		.cd-page,
		.cd-contact,
		.cd-fiche,
		.cd-thanks,
		.cd-changelog
	)
	a:where(
		:not(.menu-link):not(.custom-logo-link):not(.wp-block-button__link):not(.ast-button):not(.ast-custom-button-link):not(.button):not([class*="cdm-btn"]):not([class*="-btn"]):not([class*="_btn"]):not([class*="-chip"]):not([class*="-pill"]):not([class*="-filter"]):not([class*="-cta"]):not([class*="_cta"]):not([class*="-tab"]):not([class*="-toggle"]):not(.cd-btn-primary):not(.cd-guided-btn):not(.cin-chip):not(.cd-route-btn):not(.cd-mvs__period-btn):not(.cdl-style-chip):not(.cdl-config-chip):not(.cdl-level-chip):not(.cdl-explorer-presets__link):not(.cdl-archive__filter-chip):not(.cdl-btn):not(.cdl-filters__reset):not(.cdl-progress-premium__cta):not(.cdl-dancer-nav-v41b__link):not(.cdl-orisha-filter-btn):not(.cdl-instrument-filter-btn):not(.cdl-rhythm-filter-btn):not(.cdl-concept-filter-btn):not(.cdl-cultural-universe-filter__btn):not(.cdm-hub-btn):not(.cdsp-btn):not(.ces-btn):not(.cd-compare-btn):not(.cd-follow-btn):not(.cd-fav-btn):not(.cdm-composer-panel__variant-chip)
	) {
	color: var(--cd-brand-link);
	text-underline-offset: 0.15em;
	transition: color 0.15s ease;
}

body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	#page
	:where(.entry-content, .site-content, .ast-footer, .comments-area, .cin-wrap, .cd-page, .cd-contact, .cd-fiche, .cd-thanks, .cd-changelog)
	a:where(
		:not(.menu-link):not(.custom-logo-link):not(.wp-block-button__link):not(.ast-button):not(.ast-custom-button-link):not(.button):not([class*="cdm-btn"]):not([class*="-btn"]):not([class*="_btn"]):not([class*="-chip"]):not([class*="-pill"]):not([class*="-filter"]):not([class*="-cta"]):not([class*="_cta"]):not([class*="-tab"]):not([class*="-toggle"]):not(.cd-btn-primary):not(.cd-guided-btn):not(.cin-chip):not(.cd-route-btn):not(.cd-mvs__period-btn):not(.cdl-style-chip):not(.cdl-config-chip):not(.cdl-level-chip):not(.cdl-explorer-presets__link):not(.cdl-archive__filter-chip):not(.cdl-btn):not(.cdl-filters__reset):not(.cdl-progress-premium__cta):not(.cdl-dancer-nav-v41b__link):not(.cdl-orisha-filter-btn):not(.cdl-instrument-filter-btn):not(.cdl-rhythm-filter-btn):not(.cdl-concept-filter-btn):not(.cdl-cultural-universe-filter__btn):not(.cdm-hub-btn):not(.cdsp-btn):not(.ces-btn):not(.cd-compare-btn):not(.cd-follow-btn):not(.cd-fav-btn):not(.cdm-composer-panel__variant-chip)
	):hover,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	#page
	:where(.entry-content, .site-content, .ast-footer, .comments-area, .cin-wrap, .cd-page, .cd-contact, .cd-fiche, .cd-thanks, .cd-changelog)
	a:where(
		:not(.menu-link):not(.custom-logo-link):not(.wp-block-button__link):not(.ast-button):not(.ast-custom-button-link):not(.button):not([class*="cdm-btn"]):not([class*="-btn"]):not([class*="_btn"]):not([class*="-chip"]):not([class*="-pill"]):not([class*="-filter"]):not([class*="-cta"]):not([class*="_cta"]):not([class*="-tab"]):not([class*="-toggle"]):not(.cd-btn-primary):not(.cd-guided-btn):not(.cin-chip):not(.cd-route-btn):not(.cd-mvs__period-btn):not(.cdl-style-chip):not(.cdl-config-chip):not(.cdl-level-chip):not(.cdl-explorer-presets__link):not(.cdl-archive__filter-chip):not(.cdl-btn):not(.cdl-filters__reset):not(.cdl-progress-premium__cta):not(.cdl-dancer-nav-v41b__link):not(.cdl-orisha-filter-btn):not(.cdl-instrument-filter-btn):not(.cdl-rhythm-filter-btn):not(.cdl-concept-filter-btn):not(.cdl-cultural-universe-filter__btn):not(.cdm-hub-btn):not(.cdsp-btn):not(.ces-btn):not(.cd-compare-btn):not(.cd-follow-btn):not(.cd-fav-btn):not(.cdm-composer-panel__variant-chip)
	):focus-visible {
	color: var(--cd-brand-magenta) !important;
}

/* —— Boutons Astra / Gutenberg (hors zones exclues, hors landing premium) —— */
body:not(.page-id-3078):not(.page-id-2424):not(.page-id-2327):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	:where(
		.ast-button,
		.ast-custom-button-link,
		.button,
		.menu-toggle,
		input[type="submit"],
		input[type="button"],
		input#submit,
		.wp-block-button:not(.is-style-outline) .wp-block-button__link,
		.wp-block-search__button,
		.wp-block-file__button
	) {
	background-color: var(--cd-brand-btn);
	border-color: var(--cd-brand-btn);
	color: #fff;
	border-radius: 999px;
	font-weight: 600;
	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		transform 0.15s ease;
}

body:not(.page-id-3078):not(.page-id-2424):not(.page-id-2327):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	:where(
		.ast-button,
		.ast-custom-button-link,
		.button,
		.menu-toggle,
		input[type="submit"],
		input[type="button"],
		input#submit,
		.wp-block-button:not(.is-style-outline) .wp-block-button__link,
		.wp-block-search__button,
		.wp-block-file__button
	):hover,
body:not(.page-id-3078):not(.page-id-2424):not(.page-id-2327):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	:where(
		.ast-button,
		.ast-custom-button-link,
		.button,
		.menu-toggle,
		input[type="submit"],
		input[type="button"],
		input#submit,
		.wp-block-button:not(.is-style-outline) .wp-block-button__link,
		.wp-block-search__button,
		.wp-block-file__button
	):focus-visible {
	background-color: var(--cd-brand-btn-hover);
	border-color: var(--cd-brand-btn-hover);
	color: #fff;
}

body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.wp-block-button.is-style-outline .wp-block-button__link,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.ast-outline-button {
	color: var(--cd-brand-violet);
	border-color: var(--cd-brand-violet);
	background-color: transparent;
}

body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.wp-block-button.is-style-outline .wp-block-button__link:hover,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.ast-outline-button:hover {
	color: #fff;
	background-color: var(--cd-brand-violet);
	border-color: var(--cd-brand-violet);
}

/* CTA Premium global — blocs Gutenberg inline legacy #e84a7f (accueil, vues agenda, etc.) */
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[href*="/compte-premium"],
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[href*="/premium/"],
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[style*="#e84a7f"],
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[style*="#E84A7F"] {
	background-color: var(--cd-brand-orange) !important;
	border-color: var(--cd-brand-orange) !important;
	color: #fff !important;
	filter: none;
}

body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[href*="/compte-premium"]:hover,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[href*="/premium/"]:hover,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[style*="#e84a7f"]:hover,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry):not(.page-id-2327)
	#page
	.entry-content
	.wp-block-button:not(.is-style-outline)
	.wp-block-button__link[style*="#E84A7F"]:hover {
	background-color: var(--cd-brand-violet) !important;
	border-color: var(--cd-brand-violet) !important;
	color: #fff !important;
}

/* CTA orange éditoriaux directs (Customizer, enfant direct) */
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.entry-content
	> .wp-block-button
	.wp-block-button__link {
	background: var(--cd-brand-orange);
	border-color: var(--cd-brand-orange);
}

body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.entry-content
	> .wp-block-button
	.wp-block-button__link:hover {
	background: var(--cd-brand-violet);
	border-color: var(--cd-brand-violet);
	filter: none;
}

/* Landing premium dédiée : ne pas écraser les CTA or/nuit propres */
body.page-id-2327 .cd-prem-hero-actions .wp-block-button__link,
body.page-id-2327 .cd-prem-section .wp-block-button__link {
	background-color: revert-layer;
	border-color: revert-layer;
	color: revert-layer;
}

/* —— Focus / hover cohérents —— */
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	:where(input, select, textarea):focus {
	border-color: var(--cd-brand-focus);
	box-shadow: 0 0 0 3px var(--cd-brand-focus-ring);
	outline: none;
}

a:focus-visible,
button:focus-visible,
.ast-button:focus-visible,
.menu-toggle:focus-visible {
	outline: 2px solid var(--cd-brand-focus);
	outline-offset: 2px;
}

/* —— CTA connexion / inscription —— */
body.page-id-408 .cdm-hero--locked .cdm-btn--pink,
.wp-block-loginout .button-primary,
.login #wp-submit {
	background: var(--cd-brand-night) !important;
	border-color: var(--cd-brand-night) !important;
	color: #fff !important;
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 14px 28px rgba(11, 31, 77, 0.18) !important;
	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		transform 0.15s ease,
		box-shadow 0.15s ease;
}

body.page-id-408 .cdm-hero--locked .cdm-btn--ghost {
	background: #fff !important;
	color: var(--cd-brand-night) !important;
	border: 2px solid rgba(11, 31, 77, 0.22) !important;
	box-shadow: none !important;
}

body.page-id-408 .cdm-hero--locked .cdm-btn--pink:hover,
body.page-id-408 .cdm-hero--locked .cdm-btn--pink:focus-visible,
.wp-block-loginout .button-primary:hover,
.login #wp-submit:hover {
	background: var(--cd-brand-violet) !important;
	border-color: var(--cd-brand-violet) !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 14px 28px rgba(106, 63, 181, 0.22) !important;
}

body.page-id-408 .cdm-hero--locked .cdm-btn--ghost:hover,
body.page-id-408 .cdm-hero--locked .cdm-btn--ghost:focus-visible {
	border-color: var(--cd-brand-violet) !important;
	color: var(--cd-brand-violet) !important;
}

/* Boutons auth dans le header builder Astra */
body:not(.page-id-2424):not(.page-id-3078):not(.wpforo):not(.is_wpforo_page-1)
	.ast-header-button-1
	.ast-custom-button-link,
body:not(.page-id-2424):not(.page-id-3078):not(.wpforo):not(.is_wpforo_page-1)
	.ast-builder-button-wrap
	.ast-custom-button-link {
	background: var(--cd-brand-night);
	border-color: var(--cd-brand-night);
	color: #fff;
	border-radius: 999px;
	font-weight: 600;
}

body:not(.page-id-2424):not(.page-id-3078):not(.wpforo):not(.is_wpforo_page-1)
	.ast-header-button-1
	.ast-custom-button-link:hover,
body:not(.page-id-2424):not(.page-id-3078):not(.wpforo):not(.is_wpforo_page-1)
	.ast-builder-button-wrap
	.ast-custom-button-link:hover {
	background: var(--cd-brand-violet);
	border-color: var(--cd-brand-violet);
	color: #fff;
}

/* Nav utilisateur connecté (header) */
.cd-front-user-nav .cd-fun-menu a:hover,
.cd-front-user-nav .cd-fun-menu a:focus,
.cd-front-user-nav .cd-fun-menu__link:hover {
	color: var(--cd-brand-violet);
}

.cd-front-user-nav .cd-fun-menu__link:focus-visible,
.cd-front-user-nav .cd-fun-menu a:focus-visible {
	outline-color: var(--cd-brand-violet);
	box-shadow: 0 0 0 2px var(--cd-brand-focus-ring);
}

/* Intro Nav — titres alignés V5 */
.cin-hook {
	color: var(--cd-brand-night);
}

.cin-variant-card {
	border-color: rgba(11, 31, 77, 0.1);
	box-shadow: 0 10px 24px rgba(11, 31, 77, 0.05);
}

.cin-chip:hover {
	box-shadow: 0 6px 14px rgba(106, 63, 181, 0.14);
}

/* Titres éditoriaux */
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.entry-content
	:where(h2, h3) {
	color: var(--cd-brand-night);
}

body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	.entry-content
	:where(h2, h3)::after {
	background: var(--cd-brand-orange);
}

/* MEC — liens internes : conserver les couleurs plugin (priorité sur la charte globale) */
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	#page
	.entry-content
	.mec-wrap
	a,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	#page
	.entry-content
	.mec-wrap
	a:hover,
body:not(.page-id-3078):not(.page-id-2424):not(.wpforo):not(.is_wpforo_page-1):not(.post-type-archive-cd_cultural_entry):not(.single-cd_cultural_entry)
	#page
	.entry-content
	.mec-wrap
	a:focus-visible {
	color: revert !important;
}

/* —— Header principal —— */
.ast-primary-header-bar,
.site-primary-header-wrap,
#ast-mobile-header .ast-primary-header-bar {
	background-color: var(--cd-brand-bg);
	border-bottom: 1px solid var(--cd-brand-header-border);
}

/* Logo : proportions premium, alignement vertical menu */
.ast-site-identity .custom-logo-link {
	display: inline-flex;
	align-items: center;
	line-height: 1;
	padding: 0.35rem 0;
}

.ast-site-identity .custom-logo-link .custom-logo,
.ast-site-identity .site-logo-img img {
	width: auto;
	max-width: 200px;
	height: auto;
	max-height: 52px;
	object-fit: contain;
	object-position: left center;
}

/* Masquer le titre texte si le logo est actif (filet de sécurité CSS) */
body.custom-logo .ast-site-identity .site-title,
body.custom-logo .ast-site-identity .site-description {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Navigation desktop */
.ast-builder-menu-1 .menu-item > .menu-link {
	color: var(--cd-brand-night);
	font-weight: 500;
	letter-spacing: 0.01em;
}

.ast-builder-menu-1 .menu-item:hover > .menu-link,
.ast-builder-menu-1 .menu-item.current-menu-item > .menu-link,
.ast-builder-menu-1 .menu-item.current-menu-ancestor > .menu-link {
	color: var(--cd-brand-violet);
}

.ast-builder-menu-1 .sub-menu {
	border-top-color: var(--cd-brand-violet);
}

/* Burger mobile */
[data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {
	fill: var(--cd-brand-night);
}

[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-minimal {
	color: var(--cd-brand-night);
}

/* Liens globaux discrets (hors contenus éditoriaux déjà stylés) */
a:focus-visible {
	outline-color: var(--cd-brand-violet);
}

/* Tablette */
@media (max-width: 921px) {
	.ast-site-identity .custom-logo-link .custom-logo,
	.ast-site-identity .site-logo-img img {
		max-width: 168px;
		max-height: 46px;
	}

	.ast-primary-header-bar,
	#ast-mobile-header .ast-primary-header-bar {
		min-height: 64px;
	}
}

/* Mobile compact */
@media (max-width: 544px) {
	.ast-site-identity .custom-logo-link {
		padding: 0.2rem 0;
	}

	.ast-site-identity .custom-logo-link .custom-logo,
	.ast-site-identity .site-logo-img img {
		max-width: 132px;
		max-height: 40px;
	}

	.ast-header-break-point #masthead .ast-mobile-header-wrap .ast-primary-header-bar {
		padding-left: 14px;
		padding-right: 14px;
	}
}
