/**
 * TerraHunt cookie consent v2.
 *
 * Značkové barvy vytažené z main.css (tmavá zelená #083331, tyrkysová
 * #39E7E1, Poppins). Prefix `th-cc` je vlastní, nekoliduje s ničím v motivu
 * ani se zbytky tříd `cookies-*` po staré liště.
 *
 * Rovnocennost tlačítek „Přijmout vše" a „Odmítnout vše" je právní požadavek,
 * ne estetické rozhodnutí: obě sdílejí třídu `th-cc__btn--primary` a nesmí se
 * od sebe odlišit velikostí, barvou ani kontrastem.
 */

.th-cc,
.th-cc-modal {
	--th-cc-bg: #083331;
	--th-cc-fg: #ffffff;
	--th-cc-accent: #39e7e1;
	--th-cc-accent-fg: #083331;
	--th-cc-muted: #cfe0df;
	--th-cc-panel: #ffffff;
	--th-cc-panel-fg: #25302f;
	font-family: "Poppins", sans-serif;
	box-sizing: border-box;
}

.th-cc *,
.th-cc-modal * {
	box-sizing: inherit;
}

/**
 * Obrana proti globálním pravidlům motivu (změřeno 24. 8. 2026 na dev).
 *
 * `main.css` stylizuje HOLÝ element `label` jako plovoucí popisek
 * formulářového pole: `.label-form, label { position:absolute; top:0;
 * left:1rem; background:#083331; color:#39E7E1; border-radius:1rem;
 * transform:translateY(-50%) }`. Bez tohohle resetu se popisky kategorií
 * vykreslily jako tmavá bublina vylétnutá nad modal.
 *
 * Totéž platí pro `h2`, kterému motiv dává `font-size: clamp(3rem…4rem)`
 * a `line-height: clamp(4rem…5.1rem)` -- na 20px nadpisu to dělá řádkování
 * přes 40 px. Vlastnosti, které si nenastavím sám, si motiv vezme.
 */
.th-cc label,
.th-cc-modal label {
	position: static;
	top: auto;
	left: auto;
	margin: 0;
	padding: 0;
	background: none;
	background-color: transparent;
	color: inherit;
	border-radius: 0;
	transform: none;
	font-size: inherit;
	line-height: inherit;
}

.th-cc__title,
.th-cc-modal__title {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/* ------------------------------------------------------------------ */
/* Lišta -- první úroveň                                              */
/* ------------------------------------------------------------------ */

.th-cc {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 9998;
	padding: 20px;
	background: var(--th-cc-bg);
	color: var(--th-cc-fg);
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
	transform: translateY(100%);
	transition: transform 0.25s ease-out;
}

.th-cc.is-open {
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.th-cc,
	.th-cc-modal,
	.th-cc-modal__dialog {
		transition: none;
	}
}

.th-cc__inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 1200px;
	margin: 0 auto;
}

.th-cc__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--th-cc-fg);
}

.th-cc__body {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--th-cc-muted);
}

.th-cc__body a,
.th-cc-modal__intro a {
	color: var(--th-cc-accent);
	text-decoration: underline;
}

.th-cc__error {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 6px;
	background: #ee3900;
	color: #ffffff;
	font-size: 14px;
	line-height: 1.5;
}

.th-cc__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

/* ------------------------------------------------------------------ */
/* Tlačítka                                                           */
/* ------------------------------------------------------------------ */

.th-cc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 11px 26px;
	border: 2px solid transparent;
	border-radius: 4px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: opacity 0.15s ease-out;
}

.th-cc__btn:hover {
	opacity: 0.88;
}

.th-cc__btn:focus-visible {
	outline: 3px solid var(--th-cc-accent);
	outline-offset: 2px;
}

/* Přijmout i Odmítnout. Shodná plocha, barva i váha písma -- ZÁMĚRNĚ. */
.th-cc__btn--primary {
	background: var(--th-cc-accent);
	color: var(--th-cc-accent-fg);
}

.th-cc__btn--link {
	background: transparent;
	color: var(--th-cc-fg);
	text-decoration: underline;
	padding-left: 12px;
	padding-right: 12px;
}

.th-cc__btn--ghost {
	background: transparent;
	border-color: currentColor;
	color: var(--th-cc-panel-fg);
}

@media (min-width: 900px) {
	.th-cc__inner {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 32px;
	}

	.th-cc__actions {
		flex-shrink: 0;
		flex-wrap: nowrap;
	}
}

@media (max-width: 560px) {
	.th-cc__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.th-cc__btn {
		width: 100%;
	}
}

/* ------------------------------------------------------------------ */
/* Modal -- podrobné nastavení                                        */
/* ------------------------------------------------------------------ */

.th-cc-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(8, 51, 49, 0.72);
	opacity: 0;
	transition: opacity 0.2s ease-out;
}

.th-cc-modal.is-open {
	opacity: 1;
}

body.th-cc-locked {
	overflow: hidden;
}

.th-cc-modal__dialog {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 620px;
	max-height: 90vh;
	background: var(--th-cc-panel);
	color: var(--th-cc-panel-fg);
	border-radius: 8px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
	transform: translateY(12px);
	transition: transform 0.2s ease-out;
}

.th-cc-modal.is-open .th-cc-modal__dialog {
	transform: translateY(0);
}

.th-cc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 12px;
}

.th-cc-modal__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--th-cc-panel-fg);
}

.th-cc-modal__close {
	position: relative;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
}

.th-cc-modal__close::before,
.th-cc-modal__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	background: var(--th-cc-panel-fg);
}

.th-cc-modal__close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.th-cc-modal__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.th-cc-modal__close:focus-visible {
	outline: 3px solid var(--th-cc-bg);
	outline-offset: 2px;
}

.th-cc-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 24px 8px;
}

.th-cc-modal__intro {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.6;
	color: #4a5a59;
}

.th-cc-modal__intro a {
	color: #00695c;
}

.th-cc-opt {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 0;
	border-top: 1px solid #e5eaea;
}

.th-cc-opt__input {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	margin: 2px 0 0;
	accent-color: #00695c;
	cursor: pointer;
}

.th-cc-opt__input:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.th-cc-opt__label {
	cursor: pointer;
}

.th-cc-opt__input:disabled + .th-cc-opt__label {
	cursor: default;
}

.th-cc-opt__title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--th-cc-panel-fg);
}

.th-cc-opt__desc {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	line-height: 1.55;
	color: #5c6a69;
}

.th-cc-modal__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px 24px 22px;
	border-top: 1px solid #e5eaea;
}

.th-cc-modal__foot .th-cc__btn {
	flex: 1 1 auto;
}

@media (max-width: 560px) {
	.th-cc-modal__foot {
		flex-direction: column;
	}

	.th-cc-modal__foot .th-cc__btn {
		width: 100%;
	}
}

/**
 * Nouzová varianta odkazu na nastavení, když se v patičce nenajde seznam
 * s odkazem na zpracování osobních údajů (modul si ho doplňuje sám, protože
 * patička jede z DB konfigurace). Drží se vlevo dole, aby nepřekrývala obsah.
 */
.th-cc-trigger {
	display: inline-block;
	margin: 12px 20px;
	color: inherit;
	font-size: 14px;
	text-decoration: underline;
}
