/* Apartment Cats Cookie Consent 1.0.2: a floating card in the site's own colors (theme tokens, so dark mode follows).
   Bader, 16 Oct 2026: "stylise the cookie banner too". The card is a small drafting sheet with the logo's cat head
   peeking over its top edge; it slides up from the bottom left on wide screens and spans the width on phones.
   Accept and Reject are the same 3D key: saying no must be as easy as saying yes. 8px controls, 10px card.
   Layers: the banner itself is transparent; ::after draws the card and ::before the cat, both behind the text and
   buttons (negative z-index inside the banner's own stacking context), with the cat under the card's edge. */

#ac-cc-banner {
	--ac-cc-accent: var(--wp--preset--color--accent, #1f45c6);
	--ac-cc-ink: var(--wp--preset--color--ink, #15181e);
	--ac-cc-ink-2: var(--wp--preset--color--ink-2, #454c5a);
	--ac-cc-surface: var(--wp--preset--color--surface, #fff);
	--ac-cc-line: var(--wp--preset--color--line, #d5dae3);
	--ac-cc-grid: rgba(31, 69, 198, 0.06);
	position: fixed;
	left: max(20px, env(safe-area-inset-left));
	bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
	z-index: 9999;
	box-sizing: border-box;
	display: grid;
	gap: 0.9rem;
	width: min(460px, calc(100vw - 40px));
	padding: 1.25rem 1.25rem 1.2rem;
	color: var(--ac-cc-ink);
	font-size: 0.9375rem;
	line-height: 1.5;
	isolation: isolate;
	transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

:root[data-theme="dark"] #ac-cc-banner {
	--ac-cc-grid: rgba(143, 168, 255, 0.07);
}

/* The card. */
#ac-cc-banner::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border: 1px solid var(--ac-cc-line);
	border-radius: 10px;
	background:
		linear-gradient(var(--ac-cc-accent), var(--ac-cc-accent)) 0 0 / 100% 4px no-repeat,
		linear-gradient(var(--ac-cc-grid) 1px, transparent 1px) -1px -1px / 24px 24px,
		linear-gradient(90deg, var(--ac-cc-grid) 1px, transparent 1px) -1px -1px / 24px 24px,
		var(--ac-cc-surface);
	box-shadow: 0 2px 6px rgba(20, 48, 127, 0.1), 0 30px 60px -24px rgba(20, 48, 127, 0.55);
}

:root[data-theme="dark"] #ac-cc-banner::after {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 60px -24px rgba(0, 0, 0, 0.9);
}

/* The cat head from the logo, window eyes and all, peeking over the card's top edge. */
#ac-cc-banner::before {
	content: "";
	position: absolute;
	top: -33px;
	right: 28px;
	z-index: -2;
	width: 42px;
	height: 45px;
	background: var(--ac-cc-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='20 12 160 172'%3E%3Cpath fill-rule='evenodd' d='M 30 104 L 40 22 L 82 56 C 94 52 106 52 118 56 L 160 22 L 170 104 C 170 146 138 174 100 174 C 62 174 30 146 30 104 Z M 54 92 L 54 105 L 67 105 L 67 92 Z M 71 92 L 71 105 L 84 105 L 84 92 Z M 54 109 L 54 122 L 67 122 L 67 109 Z M 71 109 L 71 122 L 84 122 L 84 109 Z M 116 92 L 116 105 L 129 105 L 129 92 Z M 133 92 L 133 105 L 146 105 L 146 92 Z M 116 109 L 116 122 L 129 122 L 129 109 Z M 133 109 L 133 122 L 146 122 L 146 109 Z M 93 138 L 100 147 L 107 138 Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='20 12 160 172'%3E%3Cpath fill-rule='evenodd' d='M 30 104 L 40 22 L 82 56 C 94 52 106 52 118 56 L 160 22 L 170 104 C 170 146 138 174 100 174 C 62 174 30 146 30 104 Z M 54 92 L 54 105 L 67 105 L 67 92 Z M 71 92 L 71 105 L 84 105 L 84 92 Z M 54 109 L 54 122 L 67 122 L 67 109 Z M 71 109 L 71 122 L 84 122 L 84 109 Z M 116 92 L 116 105 L 129 105 L 129 92 Z M 133 92 L 133 105 L 146 105 L 146 92 Z M 116 109 L 116 122 L 129 122 L 129 109 Z M 133 109 L 133 122 L 146 122 L 146 109 Z M 93 138 L 100 147 L 107 138 Z'/%3E%3C/svg%3E") center / contain no-repeat;
	transform: translateY(0);
	transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s;
}

#ac-cc-banner.ac-cc-hidden {
	transform: translateY(calc(100% + 48px));
	opacity: 0;
	pointer-events: none;
}

/* The cat ducks while the card is away and pops up once it has arrived. */
#ac-cc-banner.ac-cc-hidden::before {
	transform: translateY(26px);
	transition-delay: 0s;
}

.ac-cc-text {
	min-width: 0;
}

.ac-cc-text strong {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-bottom: 0.3rem;
	color: var(--ac-cc-ink);
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
}

/* A short drafting tick before the title, as on the page headers. */
.ac-cc-text strong::before {
	content: "";
	flex: none;
	width: 22px;
	height: 9px;
	background:
		linear-gradient(var(--ac-cc-accent), var(--ac-cc-accent)) 0 50% / 100% 2px no-repeat,
		linear-gradient(var(--ac-cc-accent), var(--ac-cc-accent)) 0 0 / 2px 100% no-repeat,
		linear-gradient(var(--ac-cc-accent), var(--ac-cc-accent)) 100% 0 / 2px 100% no-repeat;
}

.ac-cc-text p {
	margin: 0;
	color: var(--ac-cc-ink-2);
}

.ac-cc-text a {
	color: var(--ac-cc-accent);
	font-weight: 650;
	text-underline-offset: 0.2em;
}

.ac-cc-status {
	display: block;
	margin-top: 0.45rem;
	padding: 0.35rem 0.6rem;
	border-radius: 8px;
	background: var(--wp--preset--color--accent-tint, #e8eeff);
	color: var(--ac-cc-ink);
	font-weight: 600;
}

.ac-cc-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
}

/* Both choices: the same 3D key (a lit top edge, a darker edge under the face, a lift and a light sweep on hover,
   a press that sinks into the edge). */
.ac-cc-btn {
	--k-depth: 3px;
	position: relative;
	overflow: hidden;
	min-height: 46px;
	padding: 0 1.1rem;
	border: 1px solid #1a3cad;
	border-radius: 8px;
	background: linear-gradient(180deg, #3a62e6 0%, var(--ac-cc-accent) 100%);
	color: var(--wp--preset--color--accent-ink, #fff);
	font: inherit;
	font-weight: 650;
	cursor: pointer;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		0 var(--k-depth) 0 #112a7c,
		0 calc(var(--k-depth) + 10px) 20px -12px rgba(31, 69, 198, 0.55);
	transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.26s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.ac-cc-btn::after {
	content: "";
	position: absolute;
	top: -2px;
	bottom: -2px;
	left: -85%;
	width: 55%;
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
	transform: skewX(-20deg);
	pointer-events: none;
}

@media (hover: hover) {
	.ac-cc-btn:hover {
		--k-depth: 5px;
		transform: translateY(-2px);
		filter: saturate(1.1) brightness(1.05);
	}

	.ac-cc-btn:hover::after {
		animation: ac-cc-shine 0.85s cubic-bezier(0.16, 1, 0.3, 1);
	}
}

.ac-cc-btn:active {
	--k-depth: 1px;
	transform: translateY(2px);
	transition-duration: 0.07s;
}

@keyframes ac-cc-shine {
	from { left: -85%; }
	to { left: 135%; }
}

:root[data-theme="dark"] .ac-cc-btn {
	border-color: #9fb5ff;
	background: linear-gradient(180deg, #b4c5ff 0%, var(--ac-cc-accent) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.6),
		0 var(--k-depth) 0 #4c66c4,
		0 calc(var(--k-depth) + 10px) 20px -12px rgba(143, 168, 255, 0.35);
}

.ac-cc-btn:focus-visible,
.ac-cc-close:focus-visible {
	outline: 3px solid var(--ac-cc-accent);
	outline-offset: 2px;
}

.ac-cc-close {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	display: none;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ac-cc-ink-2);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.ac-cc-close:hover {
	background: var(--wp--preset--color--surface-2, #eef1f6);
	color: var(--ac-cc-ink);
}

#ac-cc-banner.ac-cc-reopened .ac-cc-close {
	display: block;
}

#ac-cc-banner.ac-cc-reopened .ac-cc-text {
	padding-right: 2.25rem;
}

/* Phones: the card spans the screen with a small margin; the buttons stay side by side, each half the width. */
@media (max-width: 640px) {
	#ac-cc-banner {
		left: 12px;
		right: 12px;
		bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
		width: auto;
		padding: 1.1rem 1rem 1rem;
	}

	/* On the left, so it never sits under the back-to-top button, which rises above the card on phones. */
	#ac-cc-banner::before {
		right: auto;
		left: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#ac-cc-banner,
	#ac-cc-banner::before,
	.ac-cc-btn {
		transition: none;
	}

	.ac-cc-btn:hover,
	.ac-cc-btn:active {
		transform: none;
	}

	.ac-cc-btn::after {
		display: none;
	}
}

@media print {
	#ac-cc-banner {
		display: none !important;
	}
}
