/**
 * Heimdall Cookies — habillage public.
 *
 * Aucune police distante n'est chargée : appeler Google Fonts depuis le
 * navigateur du visiteur transmet son adresse IP à un tiers avant tout
 * consentement, ce qui a déjà valu des condamnations en Europe.
 *
 * @package HeimdallCookies
 */

/* ---------------------------------------------------------------------
 * Jetons de thème
 * ------------------------------------------------------------------ */

.hc-root {
	--hc-bg: #14202b;
	--hc-bg-soft: #1d2d3c;
	--hc-fg: #ece5d6;
	--hc-muted: #a8b6c2;
	--hc-accent: #d4af37;
	--hc-accent-fg: #15202b;
	--hc-stone: #2f4356;
	--hc-stone-fg: #ece5d6;
	--hc-line: rgba(212, 175, 55, 0.28);
	--hc-focus: #ffd970;
	--hc-veil: rgba(8, 14, 20, 0.66);
	--hc-shadow: 0 18px 44px -14px rgba(0, 0, 0, 0.7), 0 2px 0 rgba(255, 255, 255, 0.05) inset;

	--hc-radius: 6px;
	--hc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	font-family: var(--hc-font);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.hc-theme--bois-runes {
	--hc-bg: #2a1f17;
	--hc-bg-soft: #372a1f;
	--hc-fg: #efe2cd;
	--hc-muted: #bdab92;
	--hc-accent: #cf9440;
	--hc-accent-fg: #251b13;
	--hc-stone: #46362a;
	--hc-stone-fg: #efe2cd;
	--hc-line: rgba(207, 148, 64, 0.3);
	--hc-focus: #f0b968;
	--hc-veil: rgba(20, 13, 8, 0.66);
}

.hc-theme--clair {
	--hc-bg: #f6f0e3;
	--hc-bg-soft: #efe7d5;
	--hc-fg: #2c2519;
	--hc-muted: #61594a;
	--hc-accent: #7a5c22;
	--hc-accent-fg: #fdf9f0;
	--hc-stone: #4a4436;
	--hc-stone-fg: #f6f0e3;
	--hc-line: rgba(122, 92, 34, 0.3);
	--hc-focus: #8a6a28;
	--hc-veil: rgba(44, 37, 25, 0.5);
	--hc-shadow: 0 18px 40px -16px rgba(44, 37, 25, 0.45), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

/* ---------------------------------------------------------------------
 * Bases partagées
 * ------------------------------------------------------------------ */

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

.hc-root [hidden] {
	display: none !important;
}

.hc-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.hc-root :focus-visible {
	outline: 3px solid var(--hc-focus);
	outline-offset: 2px;
	border-radius: 3px;
}

.hc-rune {
	display: block;
	color: var(--hc-accent);
}

.hc-rune--lg {
	width: 26px;
	height: 26px;
}

.hc-horn {
	display: block;
	color: var(--hc-accent);
}

/* ---------------------------------------------------------------------
 * Boutons
 * ------------------------------------------------------------------ */

.hc-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 11px 18px;
	border: 1px solid transparent;
	border-radius: var(--hc-radius);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

/*
 * « Tout refuser » et « Tout accepter » héritent de la même classe .hc-btn :
 * même taille, même graisse, même relief, même nombre de clics. Seule la
 * teinte diffère, et les deux restent pleins et fortement contrastés —
 * aucun n'est estompé ni relégué. Refuser doit être aussi simple
 * qu'accepter (art. 82 LIL, lignes directrices CNIL du 17 septembre 2020).
 * Ne repassez pas « Tout refuser » en bouton fantôme.
 */
.hc-btn--reject {
	background: var(--hc-stone);
	color: var(--hc-stone-fg);
	border-color: var(--hc-line);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.hc-btn--accept {
	background: var(--hc-accent);
	color: var(--hc-accent-fg);
	border-color: var(--hc-accent);
}

.hc-btn--ghost {
	background: transparent;
	color: var(--hc-fg);
	border-color: var(--hc-line);
}

.hc-btn--accent {
	background: var(--hc-accent);
	color: var(--hc-accent-fg);
	border-color: var(--hc-accent);
}

.hc-btn:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.hc-btn:active {
	transform: translateY(0);
	filter: brightness(0.96);
}

.hc-textlink {
	display: inline-block;
	margin: 0;
	padding: 6px 2px;
	background: none;
	border: 0;
	color: var(--hc-muted);
	font-family: inherit;
	font-size: 13.5px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.hc-textlink:hover {
	color: var(--hc-accent);
}

.hc-links {
	margin: 0 0 14px;
	font-size: 13px;
}

.hc-links__a {
	color: var(--hc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hc-links__sep {
	margin: 0 8px;
	color: var(--hc-muted);
}

/* ---------------------------------------------------------------------
 * Bannière — discrète, elle ne bloque jamais la page
 * ------------------------------------------------------------------ */

.hc-banner {
	position: fixed;
	z-index: 999998;
	bottom: 20px;
	width: 384px;
	max-width: calc(100vw - 32px);
	overflow: hidden;
	background: var(--hc-bg);
	border: 1px solid var(--hc-line);
	border-radius: var(--hc-radius);
	box-shadow: var(--hc-shadow);
	color: var(--hc-fg);
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.26s ease, transform 0.26s ease;
}

.hc-banner.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.hc-pos--bottom-left .hc-banner {
	left: 20px;
}

.hc-pos--bottom-right .hc-banner {
	right: 20px;
}

/* Bandeau pleine largeur. */
.hc-pos--bottom-bar .hc-banner {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: none;
	border-width: 1px 0 0;
	border-radius: 0;
}

/*
 * Galon gravé en tête de carte : une hachure oblique régulière, comme
 * l'entaille au ciseau sur un montant de porte. Deux hachures croisées
 * donnaient une rangée de « x » trop lisible comme des caractères.
 */
.hc-banner__frame {
	height: 7px;
	background: repeating-linear-gradient(
		135deg,
		var(--hc-accent) 0 2px,
		transparent 2px 7px
	);
	border-bottom: 1px solid var(--hc-line);
	opacity: 0.5;
}

.hc-banner__inner {
	padding: 18px 22px 20px;
}

.hc-banner__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.hc-banner__sigil {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	background: var(--hc-bg-soft);
	border: 1px solid var(--hc-line);
	border-radius: 50%;
}

.hc-banner__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--hc-fg);
}

.hc-banner__body {
	margin: 0 0 14px;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--hc-muted);
}

.hc-banner__actions {
	display: flex;
	gap: 10px;
	margin-bottom: 4px;
}

/* Le bandeau range tout sur une ligne sur grand écran. */
@media (min-width: 900px) {
	.hc-pos--bottom-bar .hc-banner__inner {
		display: flex;
		align-items: center;
		gap: 28px;
		max-width: 1180px;
		margin: 0 auto;
		padding: 16px 24px;
	}

	.hc-pos--bottom-bar .hc-banner__head {
		margin-bottom: 4px;
	}

	.hc-pos--bottom-bar .hc-banner__text {
		flex: 1 1 auto;
		min-width: 0;
	}

	.hc-pos--bottom-bar .hc-banner__body,
	.hc-pos--bottom-bar .hc-links {
		margin-bottom: 0;
	}

	.hc-pos--bottom-bar .hc-banner__cta {
		display: flex;
		flex: 0 0 auto;
		flex-direction: column;
		align-items: center;
		gap: 2px;
	}

	.hc-pos--bottom-bar .hc-banner__actions {
		margin-bottom: 0;
	}

	.hc-pos--bottom-bar .hc-btn {
		flex: 0 0 auto;
		min-width: 150px;
	}
}

@media (max-width: 560px) {
	.hc-banner {
		bottom: 12px;
		width: auto;
		max-width: none;
	}

	.hc-pos--bottom-left .hc-banner,
	.hc-pos--bottom-right .hc-banner {
		left: 12px;
		right: 12px;
	}

	.hc-banner__actions {
		flex-direction: column;
	}
}

/* ---------------------------------------------------------------------
 * Médaillon de réouverture (Gjallarhorn)
 * ------------------------------------------------------------------ */

.hc-reopen {
	position: fixed;
	z-index: 999997;
	bottom: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	background: var(--hc-bg);
	border: 1px solid var(--hc-line);
	border-radius: 50%;
	box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.6);
	cursor: pointer;
	opacity: 0.72;
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.hc-reopen:hover,
.hc-reopen:focus-visible {
	opacity: 1;
	transform: scale(1.06);
}

.hc-reopen-pos--bottom-left .hc-reopen {
	left: 18px;
}

.hc-reopen-pos--bottom-right .hc-reopen {
	right: 18px;
}

/* ---------------------------------------------------------------------
 * Modale de réglages
 * ------------------------------------------------------------------ */

body.hc-modal-open {
	overflow: hidden;
}

.hc-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.hc-modal.is-visible {
	opacity: 1;
}

.hc-modal__veil {
	position: absolute;
	inset: 0;
	background: var(--hc-veil);
	border: 0;
}

.hc-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(680px, 100%);
	max-height: min(86vh, 780px);
	overflow: hidden;
	background: var(--hc-bg);
	border: 1px solid var(--hc-line);
	border-radius: var(--hc-radius);
	box-shadow: var(--hc-shadow);
	color: var(--hc-fg);
	transform: translateY(10px);
	transition: transform 0.2s ease;
}

.hc-modal.is-visible .hc-modal__dialog {
	transform: translateY(0);
}

.hc-modal__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--hc-line);
	background: var(--hc-bg-soft);
}

.hc-modal__sigil {
	display: flex;
	flex: 0 0 auto;
}

.hc-modal__title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.hc-modal__close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 0;
	background: none;
	border: 1px solid transparent;
	border-radius: 50%;
	color: var(--hc-muted);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.hc-modal__close:hover {
	color: var(--hc-fg);
	border-color: var(--hc-line);
}

.hc-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 18px 20px;
	overscroll-behavior: contain;
}

.hc-modal__intro {
	margin: 0 0 14px;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--hc-muted);
}

.hc-modal__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px 20px;
	border-top: 1px solid var(--hc-line);
	background: var(--hc-bg-soft);
}

/* ---------------------------------------------------------------------
 * Catégories
 * ------------------------------------------------------------------ */

.hc-cats {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hc-cat {
	padding: 14px 0;
	border-top: 1px solid var(--hc-line);
}

.hc-cat:first-child {
	border-top: 0;
	padding-top: 4px;
}

.hc-cat__row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.hc-cat__rune {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	background: var(--hc-bg-soft);
	border: 1px solid var(--hc-line);
	border-radius: var(--hc-radius);
}

.hc-cat__head {
	flex: 1 1 auto;
	min-width: 0;
}

.hc-cat__label {
	display: block;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.hc-cat__tagline {
	display: block;
	font-size: 12px;
	font-style: italic;
	letter-spacing: 0.03em;
	color: var(--hc-accent);
}

.hc-cat__always {
	flex: 0 0 auto;
	padding: 4px 10px;
	background: var(--hc-bg-soft);
	border: 1px solid var(--hc-line);
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--hc-muted);
	text-transform: uppercase;
}

.hc-cat__desc {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--hc-muted);
}

.hc-cat__toggle {
	margin-top: 4px;
	font-size: 12.5px;
}

.hc-cat__panel {
	margin-top: 10px;
}

.hc-cat__empty {
	margin: 0;
	font-size: 13px;
	font-style: italic;
	color: var(--hc-muted);
}

/* Interrupteur : case à cocher native, habillage dessiné. */
.hc-switch {
	position: relative;
	flex: 0 0 auto;
	width: 48px;
	height: 27px;
}

.hc-switch__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.hc-switch__track {
	display: block;
	width: 48px;
	height: 27px;
	background: var(--hc-stone);
	border: 1px solid var(--hc-line);
	border-radius: 999px;
	transition: background 0.16s ease;
}

.hc-switch__thumb {
	display: block;
	width: 19px;
	height: 19px;
	margin: 3px;
	background: var(--hc-muted);
	border-radius: 50%;
	transition: transform 0.16s ease, background 0.16s ease;
}

.hc-switch__input:checked ~ .hc-switch__track {
	background: var(--hc-accent);
}

.hc-switch__input:checked ~ .hc-switch__track .hc-switch__thumb {
	background: var(--hc-accent-fg);
	transform: translateX(21px);
}

.hc-switch__input:focus-visible ~ .hc-switch__track {
	outline: 3px solid var(--hc-focus);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------
 * Tableau de déclaration des cookies
 * ------------------------------------------------------------------ */

.hc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
}

.hc-table th,
.hc-table td {
	padding: 7px 9px;
	border: 1px solid var(--hc-line);
	text-align: left;
	vertical-align: top;
	color: var(--hc-muted);
}

.hc-table th {
	background: var(--hc-bg-soft);
	color: var(--hc-fg);
	font-weight: 700;
	letter-spacing: 0.03em;
}

.hc-table code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11.5px;
	color: var(--hc-accent);
	word-break: break-word;
}

@media (max-width: 620px) {
	.hc-table thead {
		display: none;
	}

	.hc-table tr {
		display: block;
		margin-bottom: 10px;
		border: 1px solid var(--hc-line);
	}

	.hc-table td {
		display: flex;
		gap: 10px;
		border: 0;
		border-bottom: 1px solid var(--hc-line);
	}

	.hc-table tr td:last-child {
		border-bottom: 0;
	}

	.hc-table td::before {
		content: attr(data-hc-th);
		flex: 0 0 34%;
		font-weight: 700;
		color: var(--hc-fg);
	}
}

/* ---------------------------------------------------------------------
 * Cartouche de contenu bloqué
 * ------------------------------------------------------------------ */

.hc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 200px;
	margin: 0 0 1.2em;
	padding: 28px 22px;
	background: var(--hc-bg);
	border: 1px dashed var(--hc-line);
	border-radius: var(--hc-radius);
	text-align: center;
	color: var(--hc-fg);
}

.hc-placeholder__rune {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	background: var(--hc-bg-soft);
	border: 1px solid var(--hc-line);
	border-radius: 50%;
}

.hc-placeholder__text {
	max-width: 46ch;
	margin: 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--hc-muted);
}

.hc-placeholder__cat {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.04em;
	color: var(--hc-accent);
}

.hc-placeholder__btn {
	flex: 0 0 auto;
	min-width: 220px;
}

/* L'iframe neutralisée ne doit pas occuper d'espace tant qu'elle est vide. */
iframe[data-hc-src][data-hc-category] {
	display: none !important;
}

/* ---------------------------------------------------------------------
 * Déclaration des cookies (shortcode)
 * ------------------------------------------------------------------ */

.hc-declaration {
	margin: 1.5em 0;
}

.hc-declaration__title {
	margin: 1.4em 0 0.3em;
	font-size: 17px;
	color: var(--hc-fg);
}

.hc-declaration__desc {
	margin: 0 0 0.8em;
	font-size: 14px;
	color: var(--hc-muted);
}

.hc-declaration .hc-table {
	margin-bottom: 1.4em;
}

.hc-inline-trigger {
	color: inherit;
}

/* ---------------------------------------------------------------------
 * Préférences système
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.hc-root *,
	.hc-banner,
	.hc-modal,
	.hc-modal__dialog,
	.hc-switch__track,
	.hc-switch__thumb {
		transition: none !important;
		animation: none !important;
	}

	.hc-banner {
		transform: none;
	}
}

@media (prefers-contrast: more) {
	.hc-root {
		--hc-line: var(--hc-accent);
		--hc-muted: var(--hc-fg);
	}
}

@media print {
	.hc-banner,
	.hc-modal,
	.hc-reopen {
		display: none !important;
	}
}
