/**
 * Agence Zen — cookie consent banner (markup: inc/tracking.php, behaviour:
 * assets/js/consent.js). « Grand Large » identity: opaque abyss panel, sharp
 * corners, Archivo / JetBrains Mono, Balise focus. Accepter / Refuser /
 * Personnaliser share ONE button style (same visual level, CNIL).
 * No transparency at any time: the entry animation only moves the panel.
 */

.az-consent {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 9990;
	display: flex;
	justify-content: flex-end;
	padding: 0;
	pointer-events: none;
}

.az-consent[hidden] {
	display: none;
}

.az-consent__box {
	--fg: #fff;
	--fg-2: rgba(233, 238, 242, .86);
	--fg-3: #9fb1c2;
	--bd: rgba(233, 238, 242, .18);
	position: relative;
	width: 100%;
	max-height: 60vh;
	max-height: 60dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: grid;
	gap: 1rem;
	padding: 1.4rem var(--pad-x, 1.25rem) calc(1.25rem + env(safe-area-inset-bottom));
	border: 1px solid rgba(233, 238, 242, .22);
	border-top: 3px solid var(--c-balise, #ff4f1f);
	border-radius: 0;
	background: var(--c-abysse, #071526);
	box-shadow: 0 -18px 40px -18px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .35);
	color: var(--fg-2);
	font-family: var(--f-body, system-ui, sans-serif);
	font-size: .9375rem;
	line-height: 1.55;
	opacity: 1;
	pointer-events: auto;
}

@media (min-width: 760px) {
	.az-consent {
		padding: 0 1.25rem 1.25rem;
	}
	.az-consent__box {
		max-width: 560px;
		padding: 1.6rem 1.6rem 1.4rem;
		border-top-width: 4px;
		box-shadow: 10px 10px 0 rgba(7, 21, 38, .22), 0 24px 48px -20px rgba(0, 0, 0, .55);
	}
}

.az-consent.is-visible .az-consent__box {
	animation: az-consent-in .4s var(--ease-out, cubic-bezier(.16, 1, .3, 1)) both;
}

@keyframes az-consent-in {
	from { transform: translateY(24px); }
	to { transform: none; }
}

.az-consent__title {
	margin: 0;
	font: 850 1.125rem/1.15 var(--f-body, system-ui, sans-serif);
	font-stretch: 112%;
	letter-spacing: .01em;
	text-transform: none;
	color: #fff;
}

.az-consent__title::before {
	content: "";
	display: inline-block;
	width: .55em;
	height: .55em;
	margin-right: .6em;
	background: var(--c-balise, #ff4f1f);
	vertical-align: .1em;
}

.az-consent__title:focus {
	outline: none;
}

.az-consent__text {
	margin: 0;
	font-size: .9375rem;
	line-height: 1.55;
	color: var(--fg-2);
}

.az-consent__text a {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: var(--c-balise, #ff4f1f);
	text-decoration-thickness: 2px;
	text-underline-offset: .2em;
}

.az-consent__text a:hover {
	color: var(--c-balise, #ff4f1f);
}

.az-consent__panel {
	display: grid;
	gap: 0;
	border-top: 1px solid var(--bd);
}

.az-consent__panel[hidden] {
	display: none;
}

.az-consent__purpose {
	display: grid;
	gap: .3rem;
	padding: .85rem 0;
	border-bottom: 1px solid var(--bd);
}

.az-consent__purpose-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.az-consent__purpose-title {
	margin: 0;
	font: 700 .9375rem/1.3 var(--f-body, system-ui, sans-serif);
	color: #fff;
}

.az-consent__purpose-text {
	margin: 0;
	font-size: .875rem;
	line-height: 1.5;
	color: var(--fg-3);
}

.az-consent__always {
	flex: none;
	font: 500 .75rem/1.3 var(--f-mono, ui-monospace, monospace);
	letter-spacing: .06em;
	text-transform: none;
	color: var(--fg-3);
}

.az-consent__switch {
	position: relative;
	flex: none;
	width: 3rem;
	height: 1.6rem;
	margin: 0;
	border: 1.5px solid rgba(233, 238, 242, .5);
	border-radius: 0;
	background: transparent;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: background-color .2s, border-color .2s;
}

.az-consent__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: calc(1.6rem - 9px);
	height: calc(1.6rem - 9px);
	background: rgba(233, 238, 242, .75);
	transition: transform .25s var(--ease-out, ease), background-color .2s;
}

.az-consent__switch:checked {
	border-color: var(--c-balise, #ff4f1f);
	background: var(--c-balise, #ff4f1f);
}

.az-consent__switch:checked::after {
	transform: translateX(1.4rem);
	background: var(--c-abysse, #071526);
}

.az-consent__switch:focus-visible {
	outline: 2px solid var(--c-balise, #ff4f1f);
	outline-offset: 3px;
}

.az-consent__actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: .6rem;
}

@media (min-width: 520px) {
	.az-consent__actions {
		grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	}
}

/* One style for every choice (Accepter, Refuser, Personnaliser): same weight. */
.az-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: .7rem 1rem;
	border: 1.5px solid #fff;
	border-radius: 0;
	background: #fff;
	color: var(--c-abysse, #071526);
	font: 700 .9375rem/1.15 var(--f-body, system-ui, sans-serif);
	font-stretch: 80%;
	letter-spacing: .06em;
	text-transform: none;
	text-align: center;
	cursor: pointer;
	transition: background-color .2s, border-color .2s, color .2s;
}

.az-consent__btn:hover {
	border-color: var(--c-balise, #ff4f1f);
	background: var(--c-balise, #ff4f1f);
	color: var(--c-abysse, #071526);
}

.az-consent__btn:focus-visible {
	outline: 2px solid var(--c-balise, #ff4f1f);
	outline-offset: 3px;
}

.az-consent__btn[hidden] {
	display: none;
}

.az-consent__status:empty {
	display: none;
}

.az-consent__status {
	margin: 0;
	font: 500 .8125rem/1.4 var(--f-mono, ui-monospace, monospace);
	color: var(--c-balise, #ff4f1f);
}

/* "Gérer les cookies" link rendered by az_consent_link() */
.az-consent-link {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: .2em;
	cursor: pointer;
}

.az-consent-link:hover {
	color: var(--c-balise, #ff4f1f);
}

@media (prefers-reduced-motion: reduce) {
	.az-consent.is-visible .az-consent__box {
		animation: none;
	}
}

/* UX.md: sentence case, 8 px corners, readable buttons. */
.az-consent__panel,.az-consent__box,.az-consent .btn,.az-consent button{border-radius:var(--radius-sm,6px)}
.az-consent button{letter-spacing:0;font-stretch:100%;font-weight:600}

/* « L'Horizon » (design v2) — stable geometry: the banner layer covers the
 * viewport (it never moves) and, on phones, the panel has a fixed height
 * with its own scroll, so a late web font can never shift it (CLS 0). */
.az-consent{top:0;align-items:flex-end}
@media (max-width:759px){.az-consent__box{height:min(60vh,31rem);height:min(60dvh,31rem);max-height:none}}
.az-consent__title{font-family:var(--f-archivo);font-weight:760;font-stretch:108%;color:#fff}
.az-consent__title::before{background:var(--c-balise,#ff4f1f)}
/* Phones: compact (≤ 45 % of the screen), the three choices side by side. */
@media (max-width:759px){
	.az-consent__box{height:min(45vh,20rem);height:min(45dvh,20rem);max-height:none;gap:.7rem;align-content:start;padding:1rem var(--pad-x,1.25rem) calc(.9rem + env(safe-area-inset-bottom))}
	.az-consent__title{font-size:1rem}
	.az-consent__text{font-size:.875rem;line-height:1.45}
	.az-consent__actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}
	.az-consent__btn{min-height:2.875rem;padding:.5rem .35rem;font-size:.875rem;white-space:nowrap}
	.az-consent.is-custom .az-consent__box{height:min(80vh,40rem);height:min(80dvh,40rem)}
}
@media (max-width:759px){
	.az-consent:not(.is-custom) .az-consent__box{display:flex;flex-direction:column;height:min(34vh,17rem);height:min(34dvh,17rem);overflow:hidden}
	.az-consent:not(.is-custom) .az-consent__text{flex:1 1 auto;min-height:0;overflow-y:auto;padding-right:.25rem}
	.az-consent:not(.is-custom) .az-consent__actions{flex:none}
}

/* v8 — small phones: the short notice and the three choices fit in about
 * 120 px (the hero call to action stays visible at 375 × 667), no hidden
 * inner scroll. « Personnaliser »: the choices scroll, the buttons stay. */
.az-consent__intro{margin:0;padding:.85rem 0;border-bottom:1px solid var(--bd);font-size:.875rem;line-height:1.5;color:var(--fg-3)}
@media (max-width:759px){
	.az-consent:not(.is-custom) .az-consent__box{display:flex;flex-direction:column;justify-content:flex-end;gap:.55rem;height:calc(6.875rem + env(safe-area-inset-bottom));gap:.5rem;padding:.6rem var(--pad-x,1.25rem) calc(.6rem + env(safe-area-inset-bottom));overflow:hidden}
	.az-consent:not(.is-custom) .az-consent__btn{min-height:2.75rem}
	.az-consent:not(.is-custom) .az-consent__title{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
	.az-consent:not(.is-custom) .az-consent__text{flex:none;overflow:visible;padding:0;font-size:.875rem;line-height:1.4}
	.az-consent__text a{display:inline-block;padding-block:.15rem}
	.az-consent.is-custom .az-consent__box{display:flex;flex-direction:column;gap:.7rem;height:min(80vh,36rem);height:min(80dvh,36rem);overflow:hidden}
	.az-consent.is-custom .az-consent__title,.az-consent.is-custom .az-consent__text{flex:none}
	.az-consent.is-custom .az-consent__panel{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
	.az-consent.is-custom .az-consent__actions{flex:none;grid-template-columns:repeat(2,minmax(0,1fr));padding-top:.7rem;border-top:1px solid var(--bd)}
	.az-consent.is-custom [data-az-consent-action="save"]{grid-column:1/-1;order:-1}
	.az-consent.is-custom .az-consent__btn{white-space:normal}
}
