/*
 * The sites' consent banner and preference centre (ConsentBanner.astro),
 * written out from its Tailwind classes with the sites' theme: background
 * white, foreground and primary hsl(220.9 39.3% 11%), muted hsl(240 4.8%
 * 95.9%), muted foreground hsl(240 3.8% 46.1%), border hsl(240 5.9% 90%),
 * Tailwind's sm (640px) and lg (1024px) breakpoints. "Accept" is the dark
 * primary, not the neon call to action: the banner reads as its own consent
 * system (Oğuz, 2026-11-27). Keep in step with the sites' banner.
 *
 * The ids are prefixed, and the SDR's global button, label, input and h2
 * rules are reset here, so neither stylesheet leaks into the other.
 */
#dcy-consent,
#dcy-consent-prefs {
	--dcy-fg: hsl(220.9 39.3% 11%);
	--dcy-primary: hsl(220.9 39.3% 11%);
	--dcy-primary-fg: hsl(0 0% 98%);
	--dcy-muted: hsl(240 4.8% 95.9%);
	--dcy-muted-fg: hsl(240 3.8% 46.1%);
	--dcy-border: hsl(240 5.9% 90%);
	--dcy-ring: hsl(220.9 39.3% 11% / 0.5);
	font-family: var(--sans);
	color: var(--dcy-fg);
	letter-spacing: normal;
}
#dcy-consent.hidden,
#dcy-consent-prefs.hidden {
	display: none;
}

/* Banner: full-bleed panel on the bottom edge. */
#dcy-consent {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 999;
	max-height: 85dvh;
	overflow-y: auto;
	border-top: 1px solid var(--dcy-border);
	border-radius: 1rem 1rem 0 0;
	background: #fff;
	padding: 24px 20px 28px;
	box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.18);
}
.dcy-banner-inner {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	min-height: calc(50dvh - 3.25rem);
}
.dcy-banner-title {
	margin: 0;
	font-size: 20px;
	line-height: 28px;
	font-weight: 600;
	color: var(--dcy-fg);
}
.dcy-banner-body {
	margin: 12px 0 0;
	font-size: 16px;
	line-height: 26px;
	color: var(--dcy-muted-fg);
}
.dcy-link {
	font-weight: 500;
	color: var(--dcy-fg);
	text-decoration: underline;
	text-underline-offset: 4px;
}
.dcy-banner-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Buttons. */
#dcy-consent .dcy-button,
#dcy-consent-prefs .dcy-button {
	display: inline-flex;
	min-height: 44px;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	gap: 0;
	border-radius: 0.5rem;
	border: 1px solid var(--dcy-border);
	background: #fff;
	color: var(--dcy-fg);
	padding: 10px 16px;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color 150ms, border-color 150ms;
}
#dcy-consent .dcy-secondary:hover,
#dcy-consent-prefs .dcy-secondary:hover {
	background: var(--dcy-muted);
	border-color: var(--dcy-border);
}
#dcy-consent .dcy-primary,
#dcy-consent-prefs .dcy-primary {
	border-color: transparent;
	background: var(--dcy-primary);
	color: var(--dcy-primary-fg);
}
#dcy-consent .dcy-primary:hover,
#dcy-consent-prefs .dcy-primary:hover {
	background: hsl(220.9 39.3% 11% / 0.8);
	border-color: transparent;
}
#dcy-consent .dcy-button:focus-visible,
#dcy-consent-prefs .dcy-button:focus-visible,
#dcy-consent-prefs .dcy-close:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--dcy-ring);
}
#dcy-consent .dcy-panel-button {
	width: 100%;
	padding: 16px 24px;
	font-size: 16px;
	line-height: 24px;
}

/* Preference centre: a drawer from the right. */
#dcy-consent-prefs {
	position: fixed;
	inset: 0;
	z-index: 1000;
}
.dcy-backdrop {
	position: absolute;
	inset: 0;
	background: rgb(2 6 23 / 0.5);
}
#dcy-consent-panel {
	position: absolute;
	inset: 0 0 0 auto;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	max-width: 32rem;
	border-left: 1px solid var(--dcy-border);
	background: #fff;
	box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
	transition: transform 300ms ease-out;
}
#dcy-consent-panel.translate-x-full {
	transform: translateX(100%);
}
.dcy-prefs-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	border-bottom: 1px solid var(--dcy-border);
	padding: 20px 24px;
}
#dcy-consent-prefs h2 {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	font-weight: 600;
	letter-spacing: normal;
	color: var(--dcy-fg);
}
.dcy-prefs-body {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 24px;
	color: var(--dcy-muted-fg);
}
#dcy-consent-prefs .dcy-close {
	margin-right: -8px;
	flex-shrink: 0;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	padding: 8px;
	color: var(--dcy-muted-fg);
	line-height: 0;
	transition: background-color 150ms, color 150ms;
}
#dcy-consent-prefs .dcy-close:hover {
	background: var(--dcy-muted);
	color: var(--dcy-fg);
}
.dcy-close svg {
	width: 20px;
	height: 20px;
}
.dcy-prefs-list {
	flex: 1;
	overflow-y: auto;
	padding: 20px 24px;
}
.dcy-prefs-list > * + * {
	margin-top: 16px;
}
#dcy-consent-prefs .dcy-cat {
	display: block;
	border: 1px solid var(--dcy-border);
	border-radius: 0.5rem;
	padding: 16px;
	font-size: 14px;
	font-weight: 400;
}
#dcy-consent-prefs .dcy-cat-toggle {
	cursor: pointer;
	transition: background-color 150ms;
}
#dcy-consent-prefs .dcy-cat-toggle:hover {
	background: var(--dcy-muted);
}
.dcy-cat-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}
.dcy-cat-name {
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	color: var(--dcy-fg);
}
.dcy-always {
	flex-shrink: 0;
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	color: var(--dcy-muted-fg);
}
.dcy-cat-desc {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	line-height: 24px;
	color: var(--dcy-muted-fg);
}
#dcy-consent-prefs input[type="checkbox"] {
	width: 16px;
	min-width: 16px;
	height: 16px;
	margin: 2px 0 0;
	padding: 0;
	flex-shrink: 0;
	accent-color: var(--dcy-primary);
}
.dcy-prefs-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-top: 1px solid var(--dcy-border);
	padding: 16px 24px;
}

@media (min-width: 640px) {
	#dcy-consent {
		padding-inline: 24px;
	}
	.dcy-banner-inner {
		min-height: calc(33dvh - 3.25rem);
	}
	.dcy-banner-actions {
		flex-direction: row;
	}
	#dcy-consent .dcy-panel-button {
		flex: 1;
	}
	.dcy-prefs-actions {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-end;
	}
}
@media (min-width: 1024px) {
	#dcy-consent {
		border-radius: 0;
		padding: 32px 56px;
	}
	.dcy-banner-inner {
		flex-direction: row;
		align-items: center;
		gap: 56px;
		min-height: calc(25dvh - 4rem);
	}
	.dcy-banner-copy {
		flex: 1;
		max-width: 48rem;
	}
	.dcy-banner-title {
		font-size: 24px;
		line-height: 32px;
	}
	.dcy-banner-body {
		font-size: 17px;
		line-height: 28px;
	}
	.dcy-banner-actions {
		flex-direction: column;
		flex-shrink: 0;
		width: 18rem;
	}
	#dcy-consent .dcy-panel-button {
		flex: none;
	}
}
@media (prefers-reduced-motion: reduce) {
	#dcy-consent-panel {
		transition: none;
	}
}
@media print {
	#dcy-consent,
	#dcy-consent-prefs,
	[data-consent-preferences] {
		display: none !important;
	}
}

/* The lead page's own pieces: the links back into the preferences (small at
   the bottom of the left menu; in the top bar only on phones, where the menu
   is hidden) and the privacy notice under the lead form. */
.rail-prefs {
	margin-top: 6px;
	padding: 0 0 0 16px;
	border: 0;
	background: transparent;
	color: var(--muted);
	font-size: 11px;
	font-weight: 400;
	line-height: 1.4;
}
.rail-prefs:hover {
	color: var(--blue-hover);
	text-decoration: underline;
}
.top-links .prefs-mobile {
	display: none;
}
.top-links {
	display: flex;
	align-items: center;
	gap: 18px;
}
.top-links .prefs-link {
	padding: 0;
	border: 0;
	background: transparent;
	font-weight: 400;
	line-height: inherit;
}
.privacy-notice {
	max-width: 70ch;
	margin-top: 10px;
}
.privacy-notice a {
	color: inherit;
}
.top-links .admin-link {
	white-space: nowrap;
}

