/* ============================================================
   TEDBG Cookies - theme for CookieConsent v3
   Accent color comes from --tedbg-accent (set inline by the module)
   ============================================================ */

#cc-main {
	/* palette */
	--cc-bg: #ffffff;
	--cc-primary-color: #1c2430;
	--cc-secondary-color: #5b6570;
	--cc-link-color: var(--tedbg-accent, #28a35c);

	/* primary button = green "Accept" */
	--cc-btn-primary-bg: var(--tedbg-accent, #28a35c);
	--cc-btn-primary-border-color: var(--tedbg-accent, #28a35c);
	--cc-btn-primary-color: #ffffff;
	--cc-btn-primary-hover-bg: var(--tedbg-accent-hover, #1f8c4d);
	--cc-btn-primary-hover-border-color: var(--tedbg-accent-hover, #1f8c4d);
	--cc-btn-primary-hover-color: #ffffff;

	/* secondary buttons = quiet gray */
	--cc-btn-secondary-bg: #f1f3f5;
	--cc-btn-secondary-border-color: #f1f3f5;
	--cc-btn-secondary-color: #39414a;
	--cc-btn-secondary-hover-bg: #e4e8ec;
	--cc-btn-secondary-hover-border-color: #e4e8ec;
	--cc-btn-secondary-hover-color: #1c2430;

	/* toggles */
	--cc-toggle-on-bg: var(--tedbg-accent, #28a35c);
	--cc-toggle-off-bg: #c3ccd4;
	--cc-toggle-on-knob-bg: #ffffff;
	--cc-toggle-off-knob-bg: #ffffff;
	--cc-toggle-readonly-bg: var(--tedbg-accent-soft, rgba(40, 163, 92, 0.12));
	--cc-toggle-readonly-knob-bg: #ffffff;
	--cc-toggle-readonly-knob-icon-color: var(--tedbg-accent, #28a35c);

	/* category blocks */
	--cc-cookie-category-block-bg: #f7f9fa;
	--cc-cookie-category-block-border: #edf0f2;
	--cc-cookie-category-block-hover-bg: #eef4f0;
	--cc-cookie-category-block-hover-border: #e0ebe4;
	--cc-cookie-category-expanded-block-bg: transparent;
	--cc-cookie-category-expanded-block-hover-bg: #f2f6f3;

	/* shape & motion */
	--cc-modal-border-radius: 16px;
	--cc-btn-border-radius: 10px;
	--cc-pm-toggle-border-radius: 999px;
	--cc-modal-transition-duration: 0.25s;
	--cc-modal-margin: 1rem;
	--cc-overlay-bg: rgba(16, 24, 32, 0.5);
	--cc-separator-border-color: #eceff1;
	--cc-footer-bg: #f7f9fa;
	--cc-footer-border-color: #eceff1;
	--cc-footer-color: #5b6570;
	--cc-z-index: 2147483600;
}

/* ---- consent box: plain card, no accent rule on top ---- */
#cc-main .cm {
	box-shadow: 0 10px 40px rgba(10, 25, 41, 0.18), 0 2px 8px rgba(10, 25, 41, 0.08);
	max-width: 38rem;
}

/* no dismiss-by-X anywhere: the visitor picks Accept or opens Settings */
#cc-main .cm__btn--close {
	display: none !important;
}

#cc-main .cm--wide,
#cc-main .cm--bar {
	max-width: none;
}

#cc-main .cm__title {
	font-size: 1.05em;
	font-weight: 700;
	letter-spacing: 0.1px;
}

#cc-main .cm__desc {
	font-size: 0.9em;
	line-height: 1.55;
	color: var(--cc-secondary-color);
}

/* ---- buttons: big touch targets, accept visually dominant ---- */
#cc-main .cm__btn,
#cc-main .pm__btn {
	min-height: 46px;
	font-weight: 600;
	transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

#cc-main .cm__btn--primary,
#cc-main button[data-role="all"] {
	box-shadow: 0 4px 14px var(--tedbg-accent-soft, rgba(40, 163, 92, 0.25));
}

#cc-main .cm__btn:hover,
#cc-main .pm__btn:hover {
	transform: translateY(-1px);
}

#cc-main .cm__btn:active,
#cc-main .pm__btn:active {
	transform: translateY(0);
}

/* keyboard accessibility - clear focus ring */
#cc-main .cm__btn:focus-visible,
#cc-main .pm__btn:focus-visible,
#cc-main .cm__btn--close:focus-visible,
#cc-main .pm__close-btn:focus-visible,
#cc-main .section__toggle:focus-visible + .toggle__label {
	outline: 3px solid var(--tedbg-accent-soft, rgba(40, 163, 92, 0.35));
	outline-offset: 2px;
}

/* ---- preferences modal ---- */
#cc-main .pm {
	box-shadow: 0 14px 48px rgba(10, 25, 41, 0.22);
}

#cc-main .pm__title {
	font-weight: 700;
}

#cc-main .pm__badge {
	background: var(--tedbg-accent-soft, rgba(40, 163, 92, 0.12));
	color: var(--tedbg-accent, #28a35c);
	font-weight: 600;
}

/* ---- preferences modal footer ----
   Order comes from guiOptions.preferencesModal.flipButtons = true, which adds
   .pm--flip and makes .pm--box.pm--flip .pm__footer row-reverse: the grey
   "Save choice" group lands on the left, the green "Accept" group on the right.
   Here we only make the green one visually heavier. The consent banner buttons
   (.cm__btn) are deliberately not touched. */
@media (min-width: 641px) {
	#cc-main .pm__btn[data-role="all"] {
		font-size: 0.95em;
		min-height: 52px;
		padding-left: 2.6em;
		padding-right: 2.6em;
		min-width: 150px;
		box-shadow: 0 4px 14px var(--tedbg-accent-soft, rgba(40, 163, 92, 0.25));
	}

	#cc-main .pm__btn[data-role="save"],
	#cc-main .pm__btn[data-role="necessary"] {
		font-size: 0.82em;
		min-height: 42px;
		padding-left: 1.3em;
		padding-right: 1.3em;
	}

	#cc-main .pm__footer {
		align-items: center;
	}
}

/* cookieconsent.css carries a patched rule that paints the second button of a
   flipped group in the secondary HOVER colours at rest - put it back */
#cc-main .pm--flip .pm__btn + .pm__btn.pm__btn--secondary {
	background: var(--cc-btn-secondary-bg);
	border-color: var(--cc-btn-secondary-border-color);
	color: var(--cc-btn-secondary-color);
}

#cc-main .pm--flip .pm__btn + .pm__btn.pm__btn--secondary:hover {
	background: var(--cc-btn-secondary-hover-bg);
	border-color: var(--cc-btn-secondary-hover-border-color);
	color: var(--cc-btn-secondary-hover-color);
}

/* ---- "Cookie settings" link: its own section at the very bottom of the page ----
   Printed right before </body>, so it always sits under the theme footer. The colors
   are copied by the module script from the bottom of the footer (--tedbg-bar-bg,
   --tedbg-bar-color, --tedbg-bar-line). A site can set them itself in its custom CSS:
   .tedbg-cookie-bar { --tedbg-bar-bg: #000; --tedbg-bar-color: #ccc; } - then the
   script leaves them alone. */
.tedbg-cookie-bar {
	display: block;
	clear: both;
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 2px 16px 4px;
	background: var(--tedbg-bar-bg, #1c2430);
	border-top: 1px solid var(--tedbg-bar-line, rgba(255, 255, 255, 0.1));
	text-align: center;
	font-size: 13px;
	line-height: 1.4;
}

.tedbg-cookie-bar a.tedbg-cookie-bar__link,
.tedbg-cookie-bar a.tedbg-cookie-bar__link:visited {
	display: inline-block;
	padding: 12px 8px;
	color: var(--tedbg-bar-color, #c9d1d9);
	font-size: 13px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	background: none;
	border: 0;
	box-shadow: none;
	opacity: 0.85;
	cursor: pointer;
}

.tedbg-cookie-bar a.tedbg-cookie-bar__link:hover,
.tedbg-cookie-bar a.tedbg-cookie-bar__link:focus {
	color: var(--tedbg-bar-color, #c9d1d9);
	opacity: 1;
	text-decoration: underline;
}

.tedbg-cookie-bar a.tedbg-cookie-bar__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---- mobile: bottom-sheet feel, stacked full-width buttons ---- */
@media (max-width: 640px) {
	#cc-main {
		--cc-modal-margin: 0.3rem;
	}

	#cc-main .cm--box {
		max-width: none;
		left: 0.3rem;
		right: 0.3rem;
		bottom: 0.3rem;
		top: auto;
		transform: none;
		border-radius: 14px;
	}

	/* keep the whole card on screen and scroll the text, never clip the title */
	#cc-main .cm {
		max-height: calc(100vh - 0.6rem);
		max-height: calc(100dvh - 0.6rem);
	}

	#cc-main .cm__body {
		overflow-y: auto;
	}

	#cc-main .cm__desc {
		max-height: none;
		overflow-y: visible;
	}

	#cc-main .cm__title {
		padding-top: 1rem !important;
	}

	#cc-main .cm__btns {
		flex-direction: column;
	}

	#cc-main .cm__btn,
	#cc-main .pm__btn {
		width: 100%;
		min-height: 48px;
		font-size: 0.95em;
	}

	#cc-main .pm--box {
		max-height: 88vh;
	}
}

/* respect users who prefer no animations */
@media (prefers-reduced-motion: reduce) {
	#cc-main .cm__btn,
	#cc-main .pm__btn {
		transition: none;
	}
}
