/* ==========================================================================
   Pioneers Plugins – front end
   ========================================================================== */

:root {
	--pp-primary: #1d4f91;
	--pp-on-primary: #ffffff;
	--pp-cc-bg: #ffffff;
	--pp-cc-text: #212121;
	--pp-radius: 8px;
	--pp-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
	--pp-z: 2147483000;
}

.pp-cc-banner *,
.pp-cc-modal *,
.pp-dock * {
	box-sizing: border-box;
}

.pp-cc-banner [hidden],
.pp-cc-modal [hidden],
.pp-dock [hidden],
.pp-cc-banner[hidden],
.pp-cc-modal[hidden] {
	display: none !important;
}

/* Buttons ------------------------------------------------------------------ */
.pp-cc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65em 1.2em;
	border: 2px solid var(--pp-primary);
	border-radius: 4px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}
.pp-cc-btn:hover { opacity: 0.88; }
.pp-cc-btn:focus-visible { outline: 3px solid var(--pp-primary); outline-offset: 2px; }
.pp-cc-btn-primary { background: var(--pp-primary); color: var(--pp-on-primary); }
.pp-cc-btn-outline { background: transparent; color: var(--pp-primary); }

/* Banner ------------------------------------------------------------------- */
.pp-cc-banner {
	position: fixed;
	z-index: var(--pp-z);
	background: var(--pp-cc-bg);
	color: var(--pp-cc-text);
	box-shadow: var(--pp-shadow);
	font-size: 14px;
	line-height: 1.5;
	animation: pp-slide-up 0.3s ease;
}
.pp-cc-title { margin: 0 0 0.4em; font-size: 17px; font-weight: 700; }
.pp-cc-text p { margin: 0 0 0.6em; }
.pp-cc-text p:last-child { margin-bottom: 0; }
.pp-cc-policy-link { color: var(--pp-primary); text-decoration: underline; }
.pp-cc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pp-cc-layout-box {
	bottom: 20px;
	width: 440px;
	max-width: calc(100vw - 40px);
	border-radius: var(--pp-radius);
	padding: 22px;
}
.pp-cc-layout-box.pp-cc-pos-bottom-left { left: 20px; }
.pp-cc-layout-box.pp-cc-pos-bottom-right { right: 20px; }
.pp-cc-layout-box .pp-cc-actions { margin-top: 16px; }
.pp-cc-layout-box .pp-cc-btn { flex: 1 1 auto; }

.pp-cc-layout-bar {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 24px;
}
.pp-cc-layout-bar .pp-cc-banner-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1280px;
	margin: 0 auto;
}
.pp-cc-layout-bar .pp-cc-banner-content { flex: 1; }
.pp-cc-layout-bar .pp-cc-actions { flex-shrink: 0; }

.pp-cc-layout-popup {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 520px;
	max-width: calc(100vw - 32px);
	border-radius: var(--pp-radius);
	padding: 28px;
	animation: pp-fade 0.3s ease;
}
.pp-cc-layout-popup .pp-cc-actions { margin-top: 18px; justify-content: flex-end; }
.pp-cc-layout-popup { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45), var(--pp-shadow); }

@media (max-width: 782px) {
	.pp-cc-layout-bar .pp-cc-banner-inner { flex-direction: column; align-items: stretch; gap: 14px; }
	.pp-cc-layout-box { left: 12px !important; right: 12px !important; bottom: 12px; width: auto; max-width: none; }
	.pp-cc-actions .pp-cc-btn { flex: 1 1 100%; }
}

/* Preference centre -------------------------------------------------------- */
html.pp-cc-modal-open { overflow: hidden; }

.pp-cc-modal {
	position: fixed;
	inset: 0;
	z-index: calc(var(--pp-z) + 10);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-size: 14px;
	line-height: 1.5;
}
.pp-cc-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.pp-cc-modal-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 760px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	background: var(--pp-cc-bg);
	color: var(--pp-cc-text);
	border-radius: var(--pp-radius);
	box-shadow: var(--pp-shadow);
	animation: pp-fade 0.2s ease;
	outline: none;
}
.pp-cc-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.pp-cc-modal-header h2 { margin: 0; font-size: 18px; line-height: 1.3; color: inherit; }
.pp-cc-close {
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	padding: 0 4px;
}
.pp-cc-modal-body { padding: 18px 22px; overflow-y: auto; }
.pp-cc-modal-body > .pp-cc-text { margin-bottom: 14px; }
.pp-cc-modal-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 22px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}
@media (max-width: 600px) {
	.pp-cc-modal-footer .pp-cc-btn { flex: 1 1 100%; }
}

.pp-cc-category { border-bottom: 1px solid rgba(0, 0, 0, 0.08); padding: 12px 0; }
.pp-cc-category:last-child { border-bottom: 0; }
.pp-cc-category-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pp-cc-accordion {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	padding: 4px 0;
	background: none;
	border: 0;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: inherit;
	cursor: pointer;
	text-align: left;
}
.pp-cc-chevron {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.2s ease;
}
.pp-cc-accordion[aria-expanded="true"] .pp-cc-chevron { transform: rotate(45deg); }
.pp-cc-always { color: #1a7f37; font-weight: 700; font-size: 13px; white-space: nowrap; }
.pp-cc-category-desc { margin: 6px 0 0 18px; font-size: 13px; opacity: 0.85; }
.pp-cc-category-cookies { margin: 10px 0 0 18px; }
.pp-cc-empty { font-size: 13px; opacity: 0.7; margin: 0; }

.pp-cc-cookie {
	margin: 0 0 8px;
	padding: 10px 12px;
	background: rgba(0, 0, 0, 0.04);
	border-radius: 6px;
	font-size: 13px;
}
.pp-cc-cookie > div { display: flex; gap: 10px; padding: 2px 0; }
.pp-cc-cookie dt { flex: 0 0 90px; font-weight: 600; margin: 0; }
.pp-cc-cookie dd { margin: 0; flex: 1; word-break: break-word; }

/* Toggle switch */
.pp-cc-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.pp-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.pp-cc-slider {
	position: absolute;
	inset: 0;
	background: #b0b0b0;
	border-radius: 24px;
	transition: background 0.2s ease;
}
.pp-cc-slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}
.pp-cc-switch input:checked + .pp-cc-slider { background: var(--pp-primary); }
.pp-cc-switch input:checked + .pp-cc-slider::before { transform: translateX(18px); }
.pp-cc-switch input:focus-visible + .pp-cc-slider { outline: 3px solid var(--pp-primary); outline-offset: 2px; }

.pp-cc-modal .screen-reader-text,
.pp-cc-banner .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Floating dock (cookie + alert buttons) ---------------------------------- */
.pp-dock {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: calc(var(--pp-z) - 2);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	pointer-events: none;
}
.pp-dock > * { pointer-events: auto; }

.pp-dock-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pp-primary);
	color: var(--pp-on-primary);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	animation: pp-pop 0.3s ease;
}
.pp-dock-btn:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.pp-dock-btn:focus-visible { outline: 3px solid var(--pp-primary); outline-offset: 3px; }
.pp-dock-btn svg { display: block; }

.pp-cc-revisit { width: 44px; height: 44px; }
.pp-cc-revisit svg { width: 24px; height: 24px; }

@media (max-width: 600px) {
	.pp-dock { right: 12px; bottom: 12px; }
}

/* Alert centre ------------------------------------------------------------- */
.pp-alerts {
	--pp-alert-color: var(--pp-primary);
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-size: 14px;
	line-height: 1.5;
}
.pp-alerts-btn { background: var(--pp-alert-color); width: 58px; height: 58px; }
.pp-alerts-btn.has-unread:not([aria-expanded="true"]) { animation: pp-pop 0.3s ease, pp-pulse 2s ease-in-out 1s 3; }
.pp-alerts-icon { display: inline-flex; }
.pp-alerts-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #d63638;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
}
.pp-alerts-badge[hidden] { display: none; }

.pp-alerts-panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 24px);
	max-height: min(560px, calc(100vh - 120px));
	background: #fff;
	color: #1e1e1e;
	border-radius: 14px;
	box-shadow: var(--pp-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.pp-alerts.is-open .pp-alerts-panel { opacity: 1; transform: none; }
.pp-alerts-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 18px 16px;
	background: var(--pp-alert-color);
	color: var(--pp-on-primary);
}
.pp-alerts-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.pp-alerts-subtitle { margin: 2px 0 0; font-size: 13px; opacity: 0.85; }
.pp-alerts-close { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; line-height: 0; }
.pp-alerts-list {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f4f5f7;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.pp-alerts-empty { text-align: center; margin: 24px 0; opacity: 0.7; }

.pp-alert {
	display: flex;
	gap: 10px;
	padding: 12px 14px;
	background: #fff;
	border-radius: 4px 12px 12px 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	border-left: 3px solid var(--pp-alert-accent, var(--pp-alert-color));
}
.pp-alert-info { --pp-alert-accent: #2271b1; }
.pp-alert-success { --pp-alert-accent: #1a7f37; }
.pp-alert-warning { --pp-alert-accent: #c88a00; }
.pp-alert-urgent { --pp-alert-accent: #d63638; }
.pp-alert-icon { color: var(--pp-alert-accent); flex-shrink: 0; padding-top: 2px; }
.pp-alert-body { flex: 1; min-width: 0; }
.pp-alert-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #757575; }
.pp-alert-meta:empty { display: none; }
.pp-alert-new {
	background: var(--pp-alert-accent);
	color: #fff;
	padding: 1px 7px;
	border-radius: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 10px;
}
.pp-alert-title { margin: 2px 0 4px; font-size: 15px; font-weight: 700; line-height: 1.3; color: inherit; }
.pp-alert-content { font-size: 14px; word-wrap: break-word; }
.pp-alert-content p { margin: 0 0 0.5em; }
.pp-alert-content p:last-child { margin-bottom: 0; }
.pp-alert-content img { max-width: 100%; height: auto; }
.pp-alert-link {
	display: inline-block;
	margin-top: 8px;
	padding: 6px 12px;
	border-radius: 4px;
	background: var(--pp-alert-accent);
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
}
.pp-alert-link:hover { opacity: 0.9; }

/* Linked alerts: the stretched link's ::after covers the whole card. */
.pp-alert.has-link { position: relative; cursor: pointer; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.pp-alert.has-link:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); transform: translateY(-1px); }
.pp-alert-stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pp-alert-stretched:focus { outline: none; }
.pp-alert-stretched:focus-visible::after { outline: 2px solid var(--pp-alert-accent, var(--pp-alert-color)); outline-offset: 2px; border-radius: 4px 12px 12px 12px; }
.pp-alert.has-link .pp-alert-content a { position: relative; z-index: 2; }
.pp-alert-title-link { color: inherit !important; text-decoration: none !important; }
.pp-alert.has-link:hover .pp-alert-title-link { text-decoration: underline !important; }
.pp-alerts .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Cookie policy (shortcodes) ---------------------------------------------- */
.pp-cookie-list { margin: 1em 0 1.5em; }
.pp-cookie-accordion {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	margin-bottom: 10px;
	overflow: hidden;
}
.pp-cookie-accordion summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	cursor: pointer;
	list-style: none;
	font-weight: 700;
	background: rgba(0, 0, 0, 0.03);
}
.pp-cookie-accordion summary::-webkit-details-marker { display: none; }
.pp-cookie-accordion summary::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-left: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.pp-cookie-accordion[open] summary::after { transform: rotate(-135deg); }
.pp-cookie-accordion-title { flex: 1; }
.pp-cookie-accordion-count { font-weight: 400; font-size: 0.9em; opacity: 0.75; }
.pp-cookie-accordion-body { padding: 14px 18px; }
.pp-cookie-table-wrap { overflow-x: auto; }
.pp-cookie-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.pp-cookie-table th,
.pp-cookie-table td { padding: 8px 10px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); text-align: left; vertical-align: top; }
.pp-cookie-table th { font-weight: 700; }
.pp-cookie-table code { white-space: nowrap; }
@media (max-width: 600px) {
	.pp-cookie-table thead { display: none; }
	.pp-cookie-table tr { display: block; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
	.pp-cookie-table td { display: flex; gap: 10px; border: 0; padding: 4px 0; }
	.pp-cookie-table td::before { content: attr(data-label); flex: 0 0 90px; font-weight: 700; }
}

/* Animations --------------------------------------------------------------- */
@keyframes pp-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pp-pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pp-pulse { 0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(214, 54, 56, 0.5); } 50% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 10px rgba(214, 54, 56, 0); } }

@media (prefers-reduced-motion: reduce) {
	.pp-cc-banner, .pp-cc-modal-dialog, .pp-dock-btn, .pp-alerts-panel, .pp-alert { animation: none !important; transition: none !important; }
	.pp-alert.has-link:hover { transform: none; }
}
