/* ============================================================
   TEDBG Cookies - theme for CookieConsent v3
   Accent color comes from --tedbg-accent (set inline by the module).
   Sizes are in px on purpose: Journal 3 sets the root font size to 10px, so rem is not safe.
   ============================================================ */

#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 all" */
	--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 = light gray with dark text */
	--cc-btn-secondary-bg: #e9edf0;
	--cc-btn-secondary-border-color: #e9edf0;
	--cc-btn-secondary-color: #1c2430;
	--cc-btn-secondary-hover-bg: #d6dce1;
	--cc-btn-secondary-hover-border-color: #d6dce1;
	--cc-btn-secondary-hover-color: #000000;

	/* 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: 6px;
	--cc-btn-border-radius: 4px;
	--cc-pm-toggle-border-radius: 999px;
	--cc-modal-transition-duration: 0.25s;
	--cc-modal-margin: 16px;
	--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;
}

/* no dismiss-by-X on the banner: the visitor picks one of the two buttons or opens the settings */
#cc-main .cm__btn--close {
	display: none !important;
}

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

/* other layouts (cloud, bar) keep the plain look */
#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);
}

#cc-main .cm__btn,
#cc-main .pm__btn {
	min-height: 46px;
	font-weight: 600;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

/* ---- consent banner (1.5, by the mockup of 25.11.2026) ----
   Compact white card: cookie icon and title, on the right the "Settings" link (only when the second
   button is "Necessary only" - with "Settings" as button the link would repeat it), short text and
   two buttons of equal width in ONE row: gray on the left, green "Accept all" on the right.
   Computer: card up to 520px wide, where the position setting puts it (bottom center by default).
   Phone (up to 640px): sheet at the bottom on the full width, the buttons still side by side.
   CookieConsent puts both buttons in one .cm__btn-group (accept first in the markup) - the order
   is set here with "order".
   The rules are stronger than theme rules left from TK Cookies, for example on semena.bg:
   "#cc-main .cm__btn-group:nth-child(1) .cm__btn { background: green !important; margin-bottom: 14px }"
   and "#cc-main .cm--box.cm--flip .cm__btns { flex-direction: column !important }". */
#cc-main .cm.cm--box {
	width: auto;
	max-width: 520px;
	border-radius: 6px;
	box-shadow: 0 4px 18px rgba(16, 24, 32, 0.16), 0 0 0 1px rgba(16, 24, 32, 0.05);
}

#cc-main .cm.cm--box .cm__body {
	padding: 0 !important;
}

#cc-main .cm.cm--box .cm__texts {
	padding: 20px 24px 0 !important;
}

#cc-main .cm.cm--box .cm__title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0 !important;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: normal;
	text-transform: none;
	color: var(--cc-primary-color);
}

#cc-main .cm .tedbg-cc__icon {
	display: inline-flex;
	flex: none;
	width: 30px;
	height: 30px;
	color: #3a4148;
}

#cc-main .cm .tedbg-cc__icon svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	overflow: visible;
}

#cc-main .cm .tedbg-cc__icon svg .tedbg-cc__dot {
	fill: currentColor;
	stroke: none;
}

#cc-main .cm .tedbg-cc__name {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word;
}

#cc-main .cm .cm__title a.tedbg-cc__settings,
#cc-main .cm .cm__title a.tedbg-cc__settings:visited {
	display: inline-block;
	flex: none;
	margin-left: auto;
	padding: 4px 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--cc-primary-color);
	text-decoration: underline;
	text-underline-offset: 3px;
	background-image: none;
	white-space: nowrap;
	cursor: pointer;
}

#cc-main .cm .cm__title a.tedbg-cc__settings:hover {
	color: var(--tedbg-accent, #28a35c);
}

#cc-main .cm.cm--box .cm__title + .cm__desc {
	margin-top: 10px;
}

#cc-main .cm.cm--box .cm__desc {
	padding: 0 !important;
	font-size: 15px;
	line-height: 1.5;
	color: #2f363d;
}

#cc-main .cm.cm--box .cm__btns {
	display: flex !important;
	flex-direction: row !important;
	padding: 18px 24px 20px !important;
	border-top: 0 !important;
}

/* a grid with equal columns, not flex: a theme rule like "border: #3fa24f !important" takes the border
   off the green button only, and flex would then give the two buttons different widths */
#cc-main .cm.cm--box .cm__btns .cm__btn-group {
	display: grid !important;
	grid-template-columns: none !important;
	grid-auto-flow: column !important;
	grid-auto-columns: minmax(0, 1fr) !important;
	flex: 1 1 auto;
	gap: 12px;
	width: 100%;
	min-width: 0 !important;
	margin: 0 !important;
}

#cc-main .cm.cm--box .cm__btns .cm__btn-group .cm__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto !important;
	min-width: 0 !important;
	min-height: 48px;
	margin: 0 !important;
	padding: 8px 12px;
	font-size: 15px !important;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	white-space: normal;
	border-radius: 4px;
	box-shadow: none;
}

#cc-main .cm.cm--box .cm__btns .cm__btn[data-role="all"] {
	order: 2;
}

#cc-main .cm.cm--box .cm__btns .cm__btn[data-role="show"],
#cc-main .cm.cm--box .cm__btns .cm__btn[data-role="necessary"] {
	order: 1;
}

/* the gray button ("Settings" or "Necessary only"), on every layout */
#cc-main .cm .cm__btns .cm__btn-group .cm__btn.cm__btn--secondary,
#cc-main .cm .cm__btns .cm__btn-group .cm__btn[data-role="necessary"] {
	background: var(--cc-btn-secondary-bg) !important;
	border: 1px solid var(--cc-btn-secondary-border-color) !important;
	color: var(--cc-btn-secondary-color) !important;
	box-shadow: none !important;
}

#cc-main .cm .cm__btns .cm__btn-group .cm__btn.cm__btn--secondary:hover,
#cc-main .cm .cm__btns .cm__btn-group .cm__btn[data-role="necessary"]:hover {
	background: var(--cc-btn-secondary-hover-bg) !important;
	border-color: var(--cc-btn-secondary-hover-border-color) !important;
	color: var(--cc-btn-secondary-hover-color) !important;
}

/* privacy policy / terms links (set in the admin): small gray text under the buttons, no own background */
#cc-main .cm.cm--box .cm__footer {
	margin-top: -6px;
	padding: 0 24px 16px !important;
	background: transparent !important;
	border-top: 0 !important;
	color: #6b737b;
}

#cc-main .cm.cm--box .cm__links {
	padding: 0 !important;
}

#cc-main .cm.cm--box .cm__link-group {
	display: flex;
	flex-wrap: wrap;
	justify-content: center !important;
	gap: 4px 16px;
	font-size: 12px;
	line-height: 1.4;
}

#cc-main .cm.cm--box .cm__link-group > * + * {
	margin-left: 0 !important;
}

#cc-main .cm.cm--box .cm__link-group a,
#cc-main .cm.cm--box .cm__link-group a:visited {
	color: #6b737b;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
	background-image: none;
}

#cc-main .cm.cm--box .cm__link-group a:hover {
	color: var(--cc-primary-color);
}

/* 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 .cm .cm__title a.tedbg-cc__settings: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 8px 28px rgba(10, 25, 41, 0.2);
}

#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 all" group on the right.
   Here we only make the green one visually heavier. */
@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;
	}

	#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 (1.3) ----
   The script first puts the link inside the theme footer, after the privacy policy link (it then
   takes the look of the footer links). This section is the fallback and stays hidden until the
   script decides it is needed. */
.tedbg-cookie-bar.tedbg-cookie-bar--wait {
	display: none !important;
}

/* ---- fallback: 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;
}

/* ---- phone ---- */
@media (max-width: 640px) {
	#cc-main {
		--cc-modal-margin: 4px;
	}

	/* banner: sheet at the bottom on the full width (any position setting) */
	#cc-main .cm.cm--box {
		top: auto !important;
		right: 0 !important;
		bottom: 0 !important;
		left: 0 !important;
		width: auto !important;
		max-width: none !important;
		max-height: 100vh;
		max-height: 100dvh;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		transform: none !important;
		border-radius: 6px 6px 0 0;
		box-shadow: 0 -2px 14px rgba(16, 24, 32, 0.16), 0 0 0 1px rgba(16, 24, 32, 0.05);
	}

	/* keep the whole card on screen and scroll the text, never clip the title */
	#cc-main .cm.cm--box .cm__body {
		flex: 1 1 auto;
		min-height: 0;
		overflow-y: auto;
	}

	#cc-main .cm.cm--box .cm__texts {
		padding: 16px 16px 0 !important;
	}

	#cc-main .cm.cm--box .cm__title {
		gap: 10px;
		font-size: 18px;
	}

	#cc-main .cm.cm--box .tedbg-cc__icon {
		width: 26px;
		height: 26px;
	}

	#cc-main .cm.cm--box .cm__title a.tedbg-cc__settings {
		font-size: 14px;
	}

	#cc-main .cm.cm--box .cm__desc {
		max-height: none;
		overflow-y: visible;
		font-size: 15px;
	}

	#cc-main .cm.cm--box .cm__btns {
		padding: 14px 16px 16px !important;
	}

	#cc-main .cm.cm--box .cm__btns .cm__btn-group {
		gap: 10px;
	}

	#cc-main .cm.cm--box .cm__btns .cm__btn-group .cm__btn {
		min-height: 46px;
		padding: 6px 8px;
	}

	#cc-main .cm.cm--box .cm__footer {
		padding: 0 16px 14px !important;
	}

	/* other layouts: full-width buttons one under the other, as before */
	#cc-main .cm:not(.cm--box) .cm__btns {
		flex-direction: column;
	}

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

	#cc-main .cm:not(.cm--box) {
		max-height: calc(100vh - 8px);
		max-height: calc(100dvh - 8px);
	}

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

@media (max-width: 360px) {
	#cc-main .cm.cm--box .cm__btns .cm__btn-group .cm__btn {
		font-size: 14px !important;
	}

	#cc-main .cm.cm--box .cm__title {
		font-size: 17px;
	}
}

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