/**
 * Goedert Cookie Consent — banner, preferences panel, floating tab, embed placeholder.
 * Brand: black (#1a1a1a) + safety yellow (#f1de58).
 */

.gcc-banner,
.gcc-panel-overlay,
.gcc-tab,
.gcc-embed,
.gcc-toast,
.gcc-open-link {
	--gcc-yellow: #f1de58;
	--gcc-ink: #1a1a1a;
	--gcc-surface: #ffffff;
	--gcc-muted: #6b6b6b;
	--gcc-border: #e6e6e6;
	--gcc-radius: 10px;
	--gcc-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
	box-sizing: border-box;
	font-family: inherit;
}

.gcc-banner *,
.gcc-banner *::before,
.gcc-banner *::after,
.gcc-panel-overlay *,
.gcc-panel-overlay *::before,
.gcc-panel-overlay *::after,
.gcc-embed *,
.gcc-tab * {
	box-sizing: border-box;
}

[data-gcc-ui][hidden] {
	display: none !important;
}

/* ----------------------------------------------------------------- Buttons */
.gcc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 20px;
	margin: 0;
	border: 2px solid transparent;
	border-radius: var(--gcc-radius);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
	-webkit-appearance: none;
	appearance: none;
}

.gcc-btn:active {
	transform: translateY(1px);
}

/* Accept all + Reject all are equal weight (CNPD/EDPB: reject as easy as accept). */
.gcc-btn--primary {
	background: var(--gcc-yellow);
	border-color: var(--gcc-yellow);
	color: var(--gcc-ink);
}

.gcc-btn--primary:hover {
	background: #ffcf2e;
	border-color: #ffcf2e;
}

.gcc-btn--secondary {
	background: var(--gcc-ink);
	border-color: var(--gcc-ink);
	color: #fff;
}

.gcc-btn--secondary:hover {
	background: #000;
	border-color: #000;
}

.gcc-btn--text {
	background: transparent;
	border-color: transparent;
	color: var(--gcc-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 600;
	padding-left: 12px;
	padding-right: 12px;
}

.gcc-btn--text:hover {
	color: #000;
	text-decoration-thickness: 2px;
}

.gcc-btn:focus-visible,
.gcc-tab:focus-visible,
.gcc-link:focus-visible,
.gcc-cat__disclose:focus-visible,
.gcc-panel__close:focus-visible {
	outline: 3px solid var(--gcc-yellow);
	outline-offset: 2px;
	border-radius: 6px;
}

.gcc-link {
	color: var(--gcc-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 600;
}

/* ------------------------------------------------------------------ Banner */
.gcc-banner {
	position: fixed;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%) translateY(8px);
	width: min(1120px, calc(100vw - 32px));
	max-height: calc(100vh - 36px);
	max-height: calc(100dvh - 36px);
	overflow: auto;
	background: var(--gcc-surface);
	color: var(--gcc-ink);
	border: 1px solid var(--gcc-border);
	border-radius: var(--gcc-radius);
	/* Yellow brand accent as an inset shadow so it follows the rounded corners. */
	box-shadow: inset 0 4px 0 0 var(--gcc-yellow), var(--gcc-shadow);
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.28s ease, transform 0.28s ease;
}

.gcc-banner.is-open {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.gcc-banner__inner {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 18px 22px;
}

.gcc-banner__title {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--gcc-ink);
}

.gcc-banner__glyph svg {
	width: 22px;
	height: 22px;
	color: var(--gcc-ink);
}

.gcc-banner__desc {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--gcc-muted);
	max-width: 70ch;
}

.gcc-banner__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	flex-shrink: 0;
	flex-wrap: wrap;
	justify-content: flex-end;
}

/* Banner only: "Personnaliser" first, then "Tout refuser", then "Tout accepter" (all
   widths). The panel keeps its natural order (Tout refuser → Enregistrer mes choix →
   Tout accepter), which mirrors the banner's subtle → dark → yellow button flow. */
.gcc-banner__actions [data-gcc-action="customize"] { order: -1; }

/* ------------------------------------------------------------------- Panel */
.gcc-panel-overlay {
	position: fixed;
	inset: 0;
	z-index: 100010;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.gcc-panel__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.gcc-panel-overlay.is-open .gcc-panel__scrim {
	opacity: 1;
}

.gcc-panel {
	position: relative;
	width: min(640px, 100%);
	max-height: min(86vh, 760px);
	max-height: min(86dvh, 760px);
	display: flex;
	flex-direction: column;
	background: var(--gcc-surface);
	color: var(--gcc-ink);
	border-radius: var(--gcc-radius);
	box-shadow: var(--gcc-shadow);
	overflow: hidden;
	transform: translateY(14px) scale(0.98);
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.gcc-panel-overlay.is-open .gcc-panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.gcc-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--gcc-border);
}

.gcc-panel__title {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
}

.gcc-panel__close {
	display: inline-flex;
	padding: 6px;
	border: 0;
	background: transparent;
	color: var(--gcc-ink);
	cursor: pointer;
	border-radius: 6px;
}

.gcc-panel__close svg {
	width: 22px;
	height: 22px;
}

.gcc-panel__intro {
	margin: 0;
	padding: 16px 22px 4px;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--gcc-muted);
}

.gcc-panel__form {
	overflow: auto;
	padding: 8px 22px 0;
}

/* ---------------------------------------------------------------- Category */
.gcc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var(--gcc-border);
}

.gcc-cat__row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.gcc-cat__icon {
	flex-shrink: 0;
	display: inline-flex;
	width: 34px;
	height: 34px;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #faf7ec;
	color: var(--gcc-ink);
}

.gcc-cat__icon svg {
	width: 19px;
	height: 19px;
}

.gcc-cat__meta {
	flex: 1 1 auto;
	min-width: 0;
}

.gcc-cat__name {
	display: block;
	font-size: 15px;
	font-weight: 700;
}

.gcc-cat__desc {
	margin: 3px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--gcc-muted);
}

.gcc-cat__control {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.gcc-cat__always {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--gcc-muted);
}

.gcc-cat__disclose {
	margin: 10px 0 0 46px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gcc-ink);
	font: inherit;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.gcc-cat__services {
	list-style: none;
	margin: 10px 0 0 46px;
	padding: 12px 14px;
	background: #f7f7f7;
	border-radius: 8px;
}

.gcc-cat__empty {
	margin: 8px 0 0 46px;
	font-size: 12.5px;
	font-style: italic;
	color: var(--gcc-muted);
}

.gcc-service {
	padding: 6px 0;
}

.gcc-service + .gcc-service {
	border-top: 1px solid var(--gcc-border);
}

.gcc-service__name {
	display: block;
	font-size: 13px;
	font-weight: 700;
}

.gcc-service__purpose {
	display: block;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--gcc-muted);
	margin-top: 2px;
}

.gcc-service__cookies {
	display: inline-block;
	margin-top: 4px;
	font-size: 11px;
	color: #8a8a8a;
	word-break: break-word;
}

/* --------------------------------------------------------------- Switch UI */
.gcc-switch-wrap {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.gcc-switch-wrap--locked {
	cursor: not-allowed;
	opacity: 0.55;
}

.gcc-switch {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.gcc-switch__track {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	border-radius: 999px;
	background: #c9c9c9;
	transition: background 0.2s ease;
}

.gcc-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease;
}

.gcc-switch:checked + .gcc-switch__track {
	background: var(--gcc-ink);
}

.gcc-switch:checked + .gcc-switch__track .gcc-switch__thumb {
	transform: translateX(20px);
}

.gcc-switch:focus-visible + .gcc-switch__track {
	outline: 3px solid var(--gcc-yellow);
	outline-offset: 2px;
}

/* ------------------------------------------------------------- Panel foot */
.gcc-panel__foot {
	position: sticky;
	bottom: 0;
	/* Opaque so the categories scrolling behind this sticky footer don't show through.
	   Negative margins + padding let the solid bar span the full panel width (past the
	   form's 22px gutters), matching the ::before divider. */
	background: var(--gcc-surface);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 4px -22px 0;
	padding: 16px 22px 14px;
}

.gcc-panel__links {
	display: flex;
	gap: 16px;
	font-size: 12.5px;
	flex: 1 1 auto;
}

.gcc-panel__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.gcc-panel__foot::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	border-top: 1px solid var(--gcc-border);
}

.gcc-panel__status {
	padding: 10px 22px;
	font-size: 12.5px;
	color: var(--gcc-muted);
	background: #faf7ec;
	min-height: 0;
}

.gcc-panel__status:empty {
	display: none;
}

/* -------------------------------------------------------------- Floating tab */
.gcc-tab {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--gcc-border);
	border-radius: 999px;
	background: var(--gcc-surface);
	color: var(--gcc-ink);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.gcc-tab:hover {
	border-color: var(--gcc-yellow);
}

.gcc-tab__icon svg {
	width: 20px;
	height: 20px;
	color: var(--gcc-ink);
}

/* ------------------------------------------------------------------- Toast */
.gcc-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(12px);
	z-index: 100020;
	max-width: calc(100vw - 32px);
	padding: 11px 18px;
	background: var(--gcc-ink);
	color: #fff;
	border-radius: 999px;
	white-space: nowrap;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
	font-size: 13px;
	font-weight: 600;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.gcc-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* -------------------------------------------------------- Embed placeholder */
.gcc-embed {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 240px;
	padding: 28px 20px;
	text-align: center;
	background: #f3f3f3;
	border: 1px dashed #cfcfcf;
	border-radius: var(--gcc-radius);
}

.gcc-embed__inner {
	max-width: 420px;
}

.gcc-embed__icon svg {
	width: 34px;
	height: 34px;
	color: var(--gcc-muted);
}

.gcc-embed__title {
	margin: 10px 0 4px;
	font-size: 15px;
	font-weight: 800;
	color: var(--gcc-ink);
}

.gcc-embed__body {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--gcc-muted);
}

.gcc-embed__always {
	display: block;
	margin-top: 10px;
	font-size: 12px;
	color: var(--gcc-muted);
	cursor: pointer;
}

/* ----------------------------------------------------------------- Mobile */
@media (max-width: 860px) {
	.gcc-banner__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.gcc-banner__actions {
		margin-left: 0;
		justify-content: stretch;
	}

	.gcc-banner__actions .gcc-btn {
		flex: 1 1 auto;
	}
}

@media (max-width: 600px) {
	.gcc-banner {
		bottom: 0;
		width: 100vw;
		border-radius: var(--gcc-radius) var(--gcc-radius) 0 0;
		border-bottom: 0;
	}

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

	.gcc-panel__actions {
		width: 100%;
	}

	.gcc-panel__actions .gcc-btn {
		flex: 1 1 auto;
	}

	.gcc-tab__label {
		display: none;
	}

	.gcc-tab {
		padding: 12px;
	}
}

/* admin bar offset for logged-in editors */
body.admin-bar .gcc-panel-overlay {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .gcc-panel-overlay {
		top: 46px;
	}
}

/* ------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.gcc-banner,
	.gcc-panel,
	.gcc-panel__scrim,
	.gcc-switch__track,
	.gcc-switch__thumb,
	.gcc-btn {
		transition: none !important;
	}
}
