/**
 * Cookie Consent — dialog and placeholder styles.
 *
 * A neutral base that works in any theme. Themes restyle it by declaring
 * custom properties on :root (or on #prc-cookie-consent / .prc-cc-placeholder):
 *
 *   :root {
 *       --prc-cc-accent: #b40000;        primary buttons, switches, links, focus rings
 *       --prc-cc-button-text: #fff;      text on primary buttons
 *       --prc-cc-bg: #fff;               dialog background
 *       --prc-cc-text: #222;             dialog and placeholder text
 *       --prc-cc-muted: #666;            provider lines, footer links, descriptions
 *       --prc-cc-radius: 0.25rem;        dialog, buttons, placeholders
 *       --prc-cc-font: inherit;          font family of dialog and placeholders
 *       --prc-cc-z: 100000;              z-index of the dialog
 *   }
 *
 * The base deliberately does NOT declare these properties, it only reads them
 * with a fallback. A theme's declaration would otherwise land on the same
 * selector at the same specificity, leaving the winner down to stylesheet
 * order — which the plugin cannot control. Reading with a fallback means the
 * theme's value wins, whichever stylesheet loads first. The settings screen's
 * accent colour is printed as an inline --prc-cc-accent on the dialog root,
 * so it overrides a theme's :root value for the dialog (not for placeholders).
 *
 * Anything beyond these hooks can be overridden with normal theme CSS; use a
 * slightly higher specificity (e.g. `body .prc-cc__dialog`) so the override
 * does not depend on load order either.
 *
 * Layouts: .prc-cc--modal centres the dialog over a backdrop; .prc-cc--bar
 * shows the entrance view as a bottom bar over the same backdrop, so the page
 * behind is dimmed and blocked in both. consent.js adds .prc-cc--settings
 * while the settings view is open and .prc-cc--prompt while a service prompt
 * is (a click on a trigger without consent), both always the centred modal, and
 * .prc-cc-open on <html> to lock body scrolling while the dialog is open.
 */

/* ------------------------------------------------------------------------
 * Dialog root
 * --------------------------------------------------------------------- */

.prc-cc {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--prc-cc-z, 100000);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 1rem;
	font-family: var(--prc-cc-font, inherit);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--prc-cc-text, #222);
}

/* Author styles beat the UA's [hidden] rule, so it has to be restated. */
.prc-cc[hidden],
.prc-cc [hidden] {
	display: none !important;
}

.prc-cc *,
.prc-cc *::before,
.prc-cc *::after {
	box-sizing: border-box;
}

.prc-cc__backdrop {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(0, 0, 0, 0.5);
}

.prc-cc__dialog {
	position: relative;
	width: 100%;
	max-width: 40rem;
	max-height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 1.5rem;
	background: var(--prc-cc-bg, #fff);
	border-radius: var(--prc-cc-radius, 0.25rem);
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

@media (min-width: 40em) {
	.prc-cc__dialog {
		padding: 2rem;
	}
}

html.prc-cc-open {
	overflow: hidden;
}

/*
 * Bar layout: entrance view pinned to the bottom over the dimmed backdrop,
 * like the settings view — the page behind cannot be used until a choice
 * is made (Philip, 2026-09-24).
 */
.prc-cc--bar:not(.prc-cc--settings):not(.prc-cc--prompt) {
	align-items: flex-end;
	padding: 0;
}

.prc-cc--bar:not(.prc-cc--settings):not(.prc-cc--prompt) .prc-cc__dialog {
	max-width: none;
	max-height: 90vh;
	border-radius: 0;
	box-shadow: 0 -0.25rem 1.5rem rgba(0, 0, 0, 0.2);
}

.prc-cc--bar:not(.prc-cc--settings):not(.prc-cc--prompt) .prc-cc__view {
	max-width: 72rem;
	margin: 0 auto;
}

/* ------------------------------------------------------------------------
 * Dialog content
 * --------------------------------------------------------------------- */

.prc-cc__headline {
	margin: 0 0 0.75rem;
	padding: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.prc-cc__description {
	margin: 0;
	font-size: 0.9375rem;
}

.prc-cc__description p {
	margin: 0 0 0.75em;
}

.prc-cc__description p:last-child {
	margin-bottom: 0;
}

.prc-cc__description a,
.prc-cc__links a,
.prc-cc-service__meta a,
.prc-cc-placeholder__provider a {
	color: var(--prc-cc-accent, #2c3e50);
	text-decoration: underline;
}

.prc-cc__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
}

.prc-cc__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 1rem 0 0;
	font-size: 0.875rem;
}

.prc-cc__links a {
	color: var(--prc-cc-muted, #666);
}

/* ------------------------------------------------------------------------
 * Buttons (dialog and placeholders)
 * --------------------------------------------------------------------- */

/*
 * Every button keeps a 1px border in every state, and hover/focus restate its
 * colour: themes style bare `button:hover` / `button:focus` with a border of
 * their own (epi-zentrum-hamburg.de's Beaver Builder skin: 1px #1c3864),
 * which would otherwise show up — or, on a borderless button, shift the
 * layout by a pixel on hover.
 */

.prc-cc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.75em 1.25em;
	border: 1px solid transparent;
	border-radius: var(--prc-cc-radius, 0.25rem);
	background: none;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.prc-cc-button--primary {
	border-color: var(--prc-cc-accent, #2c3e50);
	background-color: var(--prc-cc-accent, #2c3e50);
	color: var(--prc-cc-button-text, #fff);
}

.prc-cc-button--primary:hover,
.prc-cc-button--primary:focus {
	border-color: var(--prc-cc-accent, #2c3e50);
	background-color: var(--prc-cc-accent, #2c3e50);
	color: var(--prc-cc-button-text, #fff);
	opacity: 0.9;
}

.prc-cc-button--secondary {
	border-color: var(--prc-cc-accent, #2c3e50);
	background-color: transparent;
	color: var(--prc-cc-accent, #2c3e50);
}

.prc-cc-button--secondary:hover,
.prc-cc-button--secondary:focus {
	border-color: var(--prc-cc-accent, #2c3e50);
	background-color: rgba(0, 0, 0, 0.05);
	color: var(--prc-cc-accent, #2c3e50);
}

.prc-cc-button--link {
	padding-right: 0.5em;
	padding-left: 0.5em;
	border-color: transparent;
	color: var(--prc-cc-accent, #2c3e50);
	text-decoration: underline;
}

.prc-cc-button--link:hover,
.prc-cc-button--link:focus {
	border-color: transparent;
	background-color: transparent;
	color: var(--prc-cc-accent, #2c3e50);
	text-decoration: none;
}

.prc-cc-button:focus-visible,
.prc-cc-switch input:focus-visible {
	outline: 2px solid var(--prc-cc-accent, #2c3e50);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------------
 * Settings view: groups and switches
 * --------------------------------------------------------------------- */

/*
 * One card per group: switch, one-line description, and the service list
 * collapsed behind a disclosure button. The legend floats so it sits inside
 * the card instead of on its top border.
 */
.prc-cc-group {
	min-width: 0;
	margin: 0.75rem 0 0;
	padding: 0.875rem 1rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: var(--prc-cc-radius, 0.25rem);
}

.prc-cc-group:first-of-type {
	margin-top: 1.25rem;
}

.prc-cc-group__legend {
	float: left;
	width: 100%;
	margin: 0;
	padding: 0;
	font-size: 1rem;
	font-weight: 700;
}

.prc-cc-group__description {
	clear: both;
	margin: 0;
	padding: 0.375rem 0 0 3rem;
	font-size: 0.875rem;
	color: var(--prc-cc-muted, #666);
}

.prc-cc-group__more {
	clear: both;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0.375rem 0 0 2.5rem;
	padding: calc(0.25rem - 1px) calc(0.5rem - 1px);
	border: 1px solid transparent;
	border-radius: var(--prc-cc-radius, 0.25rem);
	background: none;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--prc-cc-accent, #2c3e50);
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.prc-cc-group__more:hover,
.prc-cc-group__more:focus {
	border-color: transparent;
	background: rgba(0, 0, 0, 0.05);
	color: var(--prc-cc-accent, #2c3e50);
}

.prc-cc-group__more:focus-visible {
	outline: 2px solid var(--prc-cc-accent, #2c3e50);
	outline-offset: 2px;
}

/* Chevron: points right while collapsed, down while open. */
.prc-cc-group__more::before {
	content: "";
	flex: none;
	width: 0.4375rem;
	height: 0.4375rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.15s ease;
}

.prc-cc-group__more[aria-expanded="true"]::before {
	transform: rotate(45deg);
}

/* Phones: no indent under the switch, the text needs the width. */
@media (max-width: 30em) {
	.prc-cc-group {
		padding: 0.75rem;
	}

	.prc-cc-group__description {
		padding-left: 0;
	}

	.prc-cc-group__more {
		margin-left: -0.5rem;
	}
}

.prc-cc-group__services {
	clear: both;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.prc-cc-group__services .prc-cc-service:last-child {
	margin-bottom: 0;
}

.prc-cc-service {
	margin: 0 0 0.5rem;
	padding: 0.625rem 0.75rem;
	border-radius: var(--prc-cc-radius, 0.25rem);
	background: rgba(0, 0, 0, 0.04);
}

.prc-cc-service__details {
	margin: 0.25rem 0 0 3rem;
	font-size: 0.8125rem;
	color: var(--prc-cc-muted, #666);
}

/* In a trigger prompt there is no switch to indent under. */
.prc-cc-prompt .prc-cc-service__details {
	margin: 0.75rem 0 0;
}

.prc-cc-service__description,
.prc-cc-service__meta {
	margin: 0 0 0.25em;
}

.prc-cc-service__meta {
	margin-bottom: 0;
}

/*
 * Switches are real checkboxes (the label is the click target and the
 * screen-reader name); appearance: none lets the box itself be drawn as a
 * toggle, with the knob as a pseudo-element.
 */
.prc-cc-switch {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-weight: inherit;
	cursor: pointer;
}

.prc-cc-switch input {
	position: relative;
	flex: none;
	width: 2.5rem;
	height: 1.375rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 1rem;
	background: #bbb;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.prc-cc-switch input::before {
	content: "";
	position: absolute;
	top: 0.125rem;
	left: 0.125rem;
	width: 1.125rem;
	height: 1.125rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}

.prc-cc-switch input:checked {
	background: var(--prc-cc-accent, #2c3e50);
}

.prc-cc-switch input:checked::before {
	transform: translateX(1.125rem);
}

/* Some services of the group are on: knob in the middle. */
.prc-cc-switch input:indeterminate {
	background: var(--prc-cc-accent, #2c3e50);
}

.prc-cc-switch input:indeterminate::before {
	transform: translateX(0.5625rem);
}

.prc-cc-switch input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.prc-cc-switch input:disabled + span {
	cursor: default;
}

/* ------------------------------------------------------------------------
 * Placeholders for blocked embeds
 * --------------------------------------------------------------------- */

.prc-cc-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 12rem;
	margin: 0 auto;
	padding: 1.5rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--prc-cc-radius, 0.25rem);
	background: rgba(0, 0, 0, 0.04);
	font-family: var(--prc-cc-font, inherit);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--prc-cc-text, #222);
	text-align: center;
}

/*
 * With an inline aspect-ratio the placeholder must be allowed to grow past
 * the ratio when the text needs more room (a 16:9 box at phone width is
 * shorter than three sentences and two buttons); an explicit min-height
 * would switch that automatic minimum off.
 */
.prc-cc-placeholder[style*="aspect-ratio"] {
	min-height: auto;
}

/* A slot notice (captcha box of a form): compact, left-aligned, in the form's flow. */
.prc-cc-placeholder--slot {
	justify-content: flex-start;
	min-height: 0;
	margin: 0.5rem 0;
	padding: 1rem;
	text-align: left;
}

.prc-cc-placeholder--slot .prc-cc-placeholder__buttons {
	justify-content: flex-start;
}

.prc-cc-placeholder *,
.prc-cc-placeholder *::before,
.prc-cc-placeholder *::after {
	box-sizing: border-box;
}

.prc-cc-placeholder__inner {
	max-width: 32rem;
}

.prc-cc-placeholder__text {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
}

.prc-cc-placeholder__provider {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--prc-cc-muted, #666);
}

.prc-cc-placeholder__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin: 0;
}

/* ------------------------------------------------------------------------
 * Motion
 * --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.prc-cc-button,
	.prc-cc-group__more::before,
	.prc-cc-switch input,
	.prc-cc-switch input::before {
		transition: none;
	}
}
