/**
 * CookieNet front-end styles.
 *
 * Every visual decision reads from a custom property declared on :root by
 * CookieNet\Frontend\Banner::print_variables(). The design editor in session 4
 * changes those values and never this file. The fallbacks after each var()
 * keep the banner presentable even if the inline block fails to print.
 */

/* -------------------------------------------------------------------- */

/* Shared                                                               */

/* -------------------------------------------------------------------- */

.cookienet-root {
	--cookienet-z: 999990;
}

.cookienet-root *,
.cookienet-root *::before,
.cookienet-root *::after {
	box-sizing: border-box;
}

.cookienet-root [hidden] {
	display: none !important;
}

/* Visually hidden but still announced. */
.cookienet-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cookienet-root :focus-visible,
.cookienet-placeholder :focus-visible {
	outline: 2px solid var(--cookienet-link, #2563eb);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------- */

/* Buttons                                                              */

/* -------------------------------------------------------------------- */

.cookienet-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 18px;
	font-family: inherit;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	border: 1px solid transparent;
	border-radius: var(--cookienet-button-radius, 8px);
	cursor: pointer;
	transition: filter 0.15s ease;
}

.cookienet-button:hover {
	filter: brightness(0.94);
}

.cookienet-button--accept {
	color: var(--cookienet-accept-text, #fff);
	background: var(--cookienet-accept-bg, #2563eb);
}

/*
 * Refusing must be exactly as easy, and as visible, as accepting. These two
 * rules are intentionally interchangeable: if the reject button ever ends up
 * looking quieter than the accept button, the consent collected is worth
 * nothing.
 */
.cookienet-button--reject {
	color: var(--cookienet-reject-text, #fff);
	background: var(--cookienet-reject-bg, #2563eb);
}

/* Secondary actions: not part of the accept/refuse pair. */
.cookienet-button--settings,
.cookienet-button--save {
	color: var(--cookienet-settings-text, #2563eb);
	background: var(--cookienet-settings-bg, transparent);
	border-color: currentcolor;
}

/* -------------------------------------------------------------------- */

/* Banner                                                               */

/* -------------------------------------------------------------------- */

.cookienet-overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--cookienet-z) - 1);
	background: rgba(0, 0, 0, 0.5);
}

.cookienet-banner {
	position: fixed;
	z-index: var(--cookienet-z);
	max-width: var(--cookienet-max-width, 420px);
	color: var(--cookienet-text, #1e1e2e);
	font-family: var(--cookienet-font-family, inherit);
	font-size: var(--cookienet-font-size, 14px);
	line-height: 1.55;
	background: var(--cookienet-bg, #fff);
	border-radius: var(--cookienet-radius, 12px);
	box-shadow: var(--cookienet-shadow, 0 10px 40px rgba(0, 0, 0, 0.18));
	animation: cookienet-in 0.25s ease both;
}

.cookienet-banner__inner {
	position: relative;
	padding: 24px;
}

.cookienet-banner__logo {
	display: block;
	width: auto;
	max-width: 140px;
	height: auto;
	margin-bottom: 14px;
}

.cookienet-banner__title {
	margin: 0 0 8px;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.cookienet-banner__body p {
	margin: 0 0 8px;
	color: inherit;
}

.cookienet-banner__body a,
.cookienet-banner__policy a {
	color: var(--cookienet-link, #2563eb);
	text-decoration: underline;
}

.cookienet-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

/*
 * Equal buttons is the default and the compliant option: accept and reject
 * must be equally easy to find and to press, so neither reads as the answer
 * the site is hoping for.
 *
 * The basis is 0, not auto: with auto the buttons would be sized from their
 * own label, so "Accept all" and "Reject all" would end up a few pixels apart
 * and a longer translation could make the difference obvious. Zero basis makes
 * them exactly identical whatever the wording.
 */
.cookienet-banner--equal .cookienet-banner__actions .cookienet-button {
	flex: 1 1 0;
	min-width: 140px;
}

.cookienet-banner__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	font-size: 22px;
	line-height: 1;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.6;
}

.cookienet-banner__close:hover {
	opacity: 1;
}

/* --- Positions ------------------------------------------------------- */

.cookienet-banner--bottom-left {
	bottom: 20px;
	left: 20px;
}

.cookienet-banner--bottom-right {
	bottom: 20px;
	right: 20px;
}

.cookienet-banner--top-left {
	top: 20px;
	left: 20px;
}

.cookienet-banner--top-right {
	top: 20px;
	right: 20px;
}

/* --- Bar ------------------------------------------------------------- */

.cookienet-banner--bar {
	right: 0;
	left: 0;
	max-width: none;
	border-radius: 0;
}

.cookienet-banner--bar.cookienet-banner--bottom-left,
.cookienet-banner--bar.cookienet-banner--bottom-right {
	bottom: 0;
}

.cookienet-banner--bar.cookienet-banner--top-left,
.cookienet-banner--bar.cookienet-banner--top-right {
	top: 0;
}

.cookienet-banner--bar .cookienet-banner__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	align-items: center;
	justify-content: space-between;
	max-width: 1200px;
	margin: 0 auto;
}

.cookienet-banner--bar .cookienet-banner__body {
	flex: 1 1 380px;
}

.cookienet-banner--bar .cookienet-banner__title {
	flex-basis: 100%;
	margin-bottom: 0;
}

.cookienet-banner--bar .cookienet-banner__actions {
	margin-top: 0;
}

/* --- Popup ----------------------------------------------------------- */

.cookienet-banner--popup {
	top: 50%;
	left: 50%;
	width: calc(100vw - 40px);
	transform: translate(-50%, -50%);

	/* Centred layouts need their own keyframes: the shared one would fight
	   with the translate that positions them. */
	animation-name: cookienet-in-center;
}

/* -------------------------------------------------------------------- */

/* Preferences panel                                                    */

/* -------------------------------------------------------------------- */

.cookienet-modal {
	position: fixed;
	inset: 0;
	z-index: calc(var(--cookienet-z) + 10);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cookienet-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.cookienet-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 40px);
	color: var(--cookienet-text, #1e1e2e);
	font-family: var(--cookienet-font-family, inherit);
	font-size: var(--cookienet-font-size, 14px);
	line-height: 1.55;
	background: var(--cookienet-bg, #fff);
	border-radius: var(--cookienet-radius, 12px);
	box-shadow: var(--cookienet-shadow, 0 10px 40px rgba(0, 0, 0, 0.18));
	animation: cookienet-in 0.2s ease both;
}

.cookienet-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.cookienet-modal__title {
	margin: 0;
	font-size: 1.2em;
	font-weight: 700;
	color: inherit;
}

.cookienet-modal__close {
	width: 32px;
	height: 32px;
	font-size: 22px;
	line-height: 1;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.6;
}

.cookienet-modal__close:hover {
	opacity: 1;
}

.cookienet-modal__body {
	flex: 1 1 auto;
	padding: 8px 24px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cookienet-modal__intro {
	margin: 12px 0 4px;
}

.cookienet-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 16px 24px;
	border-top: 1px solid rgba(128, 128, 128, 0.25);
}

/* Scoped through .cookienet-modal so its specificity matches the equal-buttons
   rule above rather than falling below it. */
.cookienet-modal .cookienet-modal__footer .cookienet-button {
	flex: 1 1 0;
	min-width: 140px;
}

/* --- Category rows --------------------------------------------------- */

.cookienet-category {
	padding: 16px 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.cookienet-category:last-child {
	border-bottom: 0;
}

.cookienet-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.cookienet-category__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font: inherit;
	font-weight: 600;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	text-align: left;
}

.cookienet-category__chevron {
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 6px solid currentcolor;
	transition: transform 0.15s ease;
}

.cookienet-category__toggle[aria-expanded="true"] .cookienet-category__chevron {
	transform: rotate(90deg);
}

.cookienet-category__name--static {
	font-weight: 600;
}

.cookienet-category__always {
	font-size: 0.86em;
	font-weight: 600;
	opacity: 0.7;
	white-space: nowrap;
}

.cookienet-category__description {
	margin: 6px 0 0;
	font-size: 0.93em;
	opacity: 0.85;
}

.cookienet-category__detail {
	margin-top: 14px;
}

/* --- Switch ---------------------------------------------------------- */

.cookienet-switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.cookienet-switch__input {
	position: absolute;
	width: 44px;
	height: 24px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.cookienet-switch__track {
	position: relative;
	display: block;
	width: 44px;
	height: 24px;
	background: rgba(128, 128, 128, 0.45);
	border-radius: 999px;
	transition: background 0.15s ease;
}

.cookienet-switch__track::after {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	content: "";
	transition: transform 0.15s ease;
}

.cookienet-switch__input:checked + .cookienet-switch__track {
	background: var(--cookienet-accept-bg, #2563eb);
}

.cookienet-switch__input:checked + .cookienet-switch__track::after {
	transform: translateX(20px);
}

.cookienet-switch__input:focus-visible + .cookienet-switch__track {
	outline: 2px solid var(--cookienet-link, #2563eb);
	outline-offset: 2px;
}

/* --- Cookie tables --------------------------------------------------- */

.cookienet-service-detail {
	padding: 12px 0;
}

.cookienet-service-detail__name {
	margin: 0 0 8px;
	font-size: 0.95em;
	font-weight: 700;
	color: inherit;
}

.cookienet-service-detail__provider {
	font-weight: 400;
	opacity: 0.7;
}

.cookienet-service-detail__link {
	margin: 8px 0 0;
	font-size: 0.86em;
}

.cookienet-service-detail__link a {
	color: var(--cookienet-link, #2563eb);
}

.cookienet-cookies {
	width: 100%;
	font-size: 0.85em;
	border-collapse: collapse;
	table-layout: fixed;
}

.cookienet-cookies th,
.cookienet-cookies td {
	padding: 6px 8px;
	text-align: left;
	vertical-align: top;
	word-break: break-word;
	border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.cookienet-cookies th {
	font-weight: 600;
	opacity: 0.75;
}

.cookienet-cookies code {
	font-size: 0.95em;
	word-break: break-all;
}

/* -------------------------------------------------------------------- */

/* Reopen badge                                                         */

/* -------------------------------------------------------------------- */

.cookienet-badge {
	position: fixed;
	z-index: calc(var(--cookienet-z) - 2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--cookienet-accept-text, #fff);
	background: var(--cookienet-accept-bg, #2563eb);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.cookienet-badge:hover {
	filter: brightness(0.94);
}

.cookienet-badge--bottom-left {
	bottom: 18px;
	left: 18px;
}

.cookienet-badge--bottom-right {
	bottom: 18px;
	right: 18px;
}

.cookienet-badge--top-left {
	top: 18px;
	left: 18px;
}

.cookienet-badge--top-right {
	top: 18px;
	right: 18px;
}

/* Inline trigger produced by the [cookienet_preferences] shortcode. */
.cookienet-open-preferences {
	font: inherit;
	color: var(--cookienet-link, #2563eb);
	background: none;
	border: 0;
	padding: 0;
	text-decoration: underline;
	cursor: pointer;
}

/* -------------------------------------------------------------------- */

/* Placeholder for a blocked embed                                      */

/* -------------------------------------------------------------------- */

/* A blocked iframe has no src, so it would render as an empty box. */
.cookienet-blocked-iframe {
	display: none !important;
}

.cookienet-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 180px;
	padding: 24px;
	text-align: center;
	color: var(--cookienet-text, #27272a);
	font-family: var(--cookienet-font-family, inherit);
	background: var(--cookienet-bg, #f4f4f5);
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-radius: var(--cookienet-radius, 12px);
	box-sizing: border-box;
}

.cookienet-placeholder__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
}

.cookienet-placeholder__notice {
	max-width: 46ch;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	opacity: 0.8;
}

.cookienet-placeholder__button {
	margin-top: 4px;
	padding: 10px 18px;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--cookienet-accept-text, #fff);
	background: var(--cookienet-accept-bg, #2563eb);
	border: 0;
	border-radius: var(--cookienet-button-radius, 6px);
	cursor: pointer;
}

.cookienet-placeholder__button:hover {
	filter: brightness(0.94);
}

/* -------------------------------------------------------------------- */

/* Cookie table inside the generated policy                             */

/* -------------------------------------------------------------------- */

.cookienet-policy__table-wrap {
	margin: 0 0 28px;
	overflow-x: auto;
}

.cookienet-policy__table {
	width: 100%;
	font-size: 0.9em;
	border-collapse: collapse;
}

.cookienet-policy__table th,
.cookienet-policy__table td {
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid rgba(128, 128, 128, 0.3);
}

.cookienet-policy__table th {
	font-weight: 600;
}

.cookienet-policy__table code {
	word-break: break-all;
}

.cookienet-policy__description {
	margin: 0 0 12px;
	opacity: 0.85;
}

.cookienet-policy__updated {
	font-size: 0.85em;
	opacity: 0.7;
}

/* -------------------------------------------------------------------- */

/* Motion and small screens                                             */

/* -------------------------------------------------------------------- */

@keyframes cookienet-in {

	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cookienet-in-center {

	from {
		opacity: 0;
		transform: translate(-50%, calc(-50% + 8px));
	}

	to {
		opacity: 1;
		transform: translate(-50%, -50%);
	}
}

/* Animation switched off in the settings. */
.cookienet-banner--static {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {

	.cookienet-banner,
	.cookienet-modal__dialog,
	.cookienet-button,
	.cookienet-switch__track,
	.cookienet-switch__track::after,
	.cookienet-category__chevron {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 600px) {

	.cookienet-banner:not(.cookienet-banner--popup) {
		right: 12px;
		bottom: 12px;
		left: 12px;
		top: auto;
		max-width: none;
	}

	.cookienet-banner--bar {
		right: 0;
		bottom: 0;
		left: 0;
	}

	.cookienet-banner__inner {
		padding: 20px;
	}

	.cookienet-banner__actions .cookienet-button,
	.cookienet-modal__footer .cookienet-button {
		flex-basis: 100%;
	}

	.cookienet-modal {
		padding: 0;
	}

	.cookienet-modal__dialog {
		max-height: 100vh;
		border-radius: 0;
	}
}
