/* Thisismadeira Consent — banner UI
   ---------------------------------------------------------------------------
   The palette is inherited from the thisismadeiraisland theme: the banner reads
   the theme's CSS variables (--main_color, --title_color, --bg_color…) and only
   supplies its own values as a fallback. So rebranding the theme carries the
   banner along, and on any other site the banner still works.

   To override something specific, redeclare the --tmc-* variables after this
   file. A dark variant is commented out at the end.
   ------------------------------------------------------------------------ */

:root {
	/* --- surfaces --- */
	--tmc-bg: #ffffff;
	--tmc-surface: var(--bg_color, #f4f6f8);
	--tmc-border: #d2dbe9;
	--tmc-scrim: rgba(20, 38, 32, .55);

	/* --- text --- */
	--tmc-title: var(--title_color, #3f4e5d);
	--tmc-text: var(--text_color, #2e2e2e);
	--tmc-muted: #8194ad;

	/* --- brand --- */
	--tmc-accent: var(--main_color, #107049);
	--tmc-accent-hover: #0c5a3a;
	--tmc-accent-soft: #e2f3ed;
	--tmc-on-accent: #ffffff;

	/* A neutral action carrying the same weight as accept, so that "Reject all"
	   is not visually weaker than "Accept all" (EDPB/CNIL requirement). */
	--tmc-neutral: var(--title_color, #3f4e5d);
	--tmc-neutral-hover: #33404d;
	--tmc-on-neutral: #ffffff;

	/* --- shape --- */
	--tmc-radius: 5px;
	--tmc-shadow: 0 8px 18px rgba(63, 78, 93, .08), 0 -4px 44px rgba(63, 78, 93, .16);
	--tmc-font: var(--font, 'Plus Jakarta Sans'), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--tmc-z: 2147483000;
}

.tmc[hidden],
.tmc-templates[hidden],
.tmc [hidden] { display: none !important; }

/* Page scrolling behind the backdrop is locked while the banner is open. */
html.tmc-open { overflow: hidden; }

/* ---------------------------------------------------------------- backdrop */

.tmc-backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--tmc-z);
	background: var(--tmc-scrim);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

/* ------------------------------------------------------------------- panel */

.tmc-panel {
	position: fixed;
	z-index: calc(var(--tmc-z) + 1);
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%);
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - 56px);
	overflow-y: auto;
	overscroll-behavior: contain;
	box-sizing: border-box;
	padding: 28px 30px;

	background: var(--tmc-bg);
	color: var(--tmc-text);
	border: 1px solid var(--tmc-border);
	/* Green bar — the same accent as the site footer. */
	border-top: 4px solid var(--tmc-accent);
	border-radius: var(--tmc-radius);
	box-shadow: var(--tmc-shadow);

	font: 400 15px/1.55 var(--tmc-font);
}

.tmc-title {
	margin: 0 0 10px;
	font-family: var(--tmc-font);
	font-size: clamp(20px, 1.6vw, 24px);
	font-weight: 800;
	line-height: 1.25;
	color: var(--tmc-title);
}

.tmc-desc {
	margin: 0 0 22px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--tmc-text);
}

.tmc-desc a {
	color: var(--tmc-accent);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tmc-desc a:hover { color: var(--tmc-accent-hover); }

/* The "preferences" state. A hook for theme-level tweaks; by default it only
   tightens the description, since the category list follows right below it. */
.tmc-panel.is-prefs .tmc-desc { margin-bottom: 14px; }

/* -------------------------------------------------------------- categories */

.tmc-rows[hidden] { display: none; }

.tmc-rows { margin-bottom: 4px; }

.tmc-row {
	padding: 16px 0;
	border-top: 1px solid var(--tmc-border);
}

.tmc-row:first-child { border-top: 0; padding-top: 6px; }

.tmc-row__head {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}

.tmc-row__head:has(input[disabled]) { cursor: default; }

.tmc-row__name {
	font-family: var(--tmc-font);
	font-size: 15px;
	font-weight: 700;
	color: var(--tmc-title);
}

.tmc-row__badge {
	margin-left: auto;
	padding: 4px 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--tmc-accent);
	background: var(--tmc-accent-soft);
	border-radius: 999px;
}

.tmc-row__desc {
	margin: 8px 0 0 54px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--tmc-muted);
}

/* ---- toggle (checkbox → switch, no markup change) ---- */

.tmc-toggle {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	position: relative;
	flex: 0 0 auto;
	margin: 0;
	width: 42px;
	height: 24px;
	border: 1px solid var(--tmc-border);
	border-radius: 999px;
	background: var(--tmc-surface);
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease;
}

.tmc-toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transform: translateY(-50%);
	box-shadow: 0 1px 2px rgba(63, 78, 93, .35);
	transition: left .18s ease;
}

.tmc-toggle:checked {
	background: var(--tmc-accent);
	border-color: var(--tmc-accent);
}

.tmc-toggle:checked::after { left: 21px; }

.tmc-toggle:disabled { cursor: default; opacity: .55; }

.tmc-toggle:focus-visible {
	outline: 2px solid var(--tmc-accent);
	outline-offset: 2px;
}

@media (forced-colors: active) {
	.tmc-toggle { border: 1px solid ButtonBorder; }
	.tmc-toggle:checked { background: Highlight; }
}

/* ----------------------------------------------------------------- actions
   "Accept all" and "Reject all" share shape, weight, size and width.
   Equal choice: the only difference is hue, never prominence. */

.tmc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 24px;
	padding-top: 22px;
	border-top: 1px solid var(--tmc-border);
}

.tmc-btn {
	box-sizing: border-box;
	padding: 13px 20px;
	border: 1px solid transparent;
	border-radius: var(--tmc-radius);
	font-family: var(--tmc-font);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .02em;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.tmc-actions .tmc-btn {
	flex: 1 1 0;
	min-width: 160px;
	text-transform: uppercase;
}

.tmc-btn:focus-visible {
	outline: 2px solid var(--tmc-accent);
	outline-offset: 2px;
}

.tmc-btn--primary {
	background: var(--tmc-accent);
	color: var(--tmc-on-accent);
}

.tmc-btn--primary:hover { background: var(--tmc-accent-hover); }

.tmc-btn--secondary {
	background: var(--tmc-neutral);
	color: var(--tmc-on-neutral);
}

.tmc-btn--secondary:hover { background: var(--tmc-neutral-hover); }

/* Tertiary action — not a path to refusal, so deliberately lighter. */
.tmc-actions .tmc-btn--ghost {
	flex: 0 0 auto;
	min-width: 0;
	padding: 13px 4px;
	margin-right: auto;
	background: transparent;
	color: var(--tmc-accent);
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tmc-actions .tmc-btn--ghost:hover {
	background: transparent;
	color: var(--tmc-accent-hover);
}

/* ------------------------------------------------------------------ credit */

.tmc-credit {
	margin: 16px 0 0;
	text-align: right;
	font-size: 11px;
	line-height: 1;
	letter-spacing: .02em;
	color: var(--tmc-muted);
}

.tmc-credit a {
	color: inherit;
	text-decoration: none;
}

.tmc-credit a:hover {
	color: var(--tmc-accent);
	text-decoration: underline;
}

/* --------------------------------------------------------- blocked embeds */

.tmc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 220px;
	padding: 28px 24px;
	text-align: center;
	background: var(--tmc-surface);
	border: 1px dashed var(--tmc-border);
	border-radius: var(--tmc-radius);
	color: var(--tmc-muted);
	font: 400 14px/1.55 var(--tmc-font);
}

.tmc-placeholder p {
	margin: 0;
	max-width: 46ch;
}

.tmc-placeholder strong {
	color: var(--tmc-title);
	font-weight: 700;
}

.tmc-placeholder .tmc-btn { flex: 0 0 auto; }

.tmc-placeholder .tmc-btn--ghost {
	background: transparent;
	color: var(--tmc-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 640px) {
	.tmc-panel {
		left: 0;
		bottom: 0;
		transform: none;
		width: 100%;
		max-height: 88vh;
		padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
		border-radius: var(--tmc-radius) var(--tmc-radius) 0 0;
	}

	.tmc-actions {
		gap: 10px;
		margin-top: 20px;
		padding-top: 18px;
	}

	.tmc-actions .tmc-btn { flex: 1 1 100%; }

	/* Preferences drops below the main buttons but stays on screen. */
	.tmc-actions .tmc-btn--ghost {
		order: 3;
		flex: 1 1 100%;
		margin-right: 0;
		padding: 6px 0 0;
	}

	.tmc-row__desc { margin-left: 0; }
}

/* The markup is printed by the server once, so the entrance animation is
   driven by the .is-in class, which the JS re-applies on every open. */

.tmc.is-in .tmc-backdrop { animation: tmc-fade .2s ease both; }
.tmc.is-in .tmc-panel    { animation: tmc-rise .26s cubic-bezier(.22, .68, .36, 1) both; }

/* ------------------------------------------------------------------ motion */

@keyframes tmc-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes tmc-rise {
	from { opacity: 0; transform: translate(-50%, 16px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 640px) {
	@keyframes tmc-rise {
		from { opacity: 0; transform: translateY(20px); }
		to   { opacity: 1; transform: translateY(0); }
	}
}

@media (prefers-reduced-motion: reduce) {
	.tmc.is-in .tmc-panel,
	.tmc.is-in .tmc-backdrop { animation: none; }

	.tmc-btn,
	.tmc-toggle,
	.tmc-toggle::after { transition: none; }
}

/* ---------------------------------------------------------------------------
   Dark variant — uncomment if the banner should be dark.

:root {
	--tmc-bg: #14211c;
	--tmc-surface: #1b2b25;
	--tmc-border: #2c4238;
	--tmc-scrim: rgba(3, 23, 15, .66);
	--tmc-title: #eef3f0;
	--tmc-text: #d6e0da;
	--tmc-muted: #93a99f;
	--tmc-accent: #2f9e6b;
	--tmc-accent-hover: #38b77c;
	--tmc-accent-soft: #123024;
	--tmc-on-accent: #03170f;
	--tmc-neutral: #33453c;
	--tmc-neutral-hover: #3f554a;
	--tmc-on-neutral: #eef3f0;
	--tmc-shadow: 0 8px 18px rgba(0, 0, 0, .3), 0 -4px 44px rgba(0, 0, 0, .45);
}
--------------------------------------------------------------------------- */
