/*
 * AtlasLaunch Kit cookie consent. Colours and fonts come from the theme (AtlasLaunch's tokens, then
 * theme.json presets, then plain fallbacks), so any theme and its dark mode work. The banner is
 * fixed to the screen: it never moves the page (no layout shift).
 */
.atl-cc {
	--atl-cc-bg: var(--surface, var(--wp--preset--color--surface, var(--wp--preset--color--base, #fff)));
	--atl-cc-ink: var(--ink, var(--wp--preset--color--contrast, #111));
	--atl-cc-text: var(--text, var(--wp--preset--color--body, var(--wp--preset--color--contrast, #333)));
	--atl-cc-muted: var(--muted, var(--wp--preset--color--muted, #595959));
	--atl-cc-line: var(--line, var(--wp--preset--color--line, #d6d6d6));
	--atl-cc-line-strong: var(--line-strong, var(--wp--preset--color--line-strong, #767676));
	--atl-cc-brand: var(--brand, var(--wp--preset--color--brand, var(--wp--preset--color--primary, #1e1e1e)));
	--atl-cc-brand-ink: var(--brand-ink, var(--wp--preset--color--brand-ink, var(--atl-cc-brand)));
	--atl-cc-sunken: var(--surface-sunken, var(--wp--preset--color--surface-sunken, rgba(127, 127, 127, .08)));
	--atl-cc-ok: var(--success, var(--wp--preset--color--success, #0a7a35));
	--atl-cc-ok-soft: var(--success-soft, var(--wp--preset--color--success-soft, rgba(10, 122, 53, .12)));
	--atl-cc-focus: var(--focus, var(--wp--custom--focus, currentColor));
	--atl-cc-radius: var(--radius-lg, var(--wp--custom--radius--lg, 16px));
	--atl-cc-font: var(--font-body, var(--wp--preset--font-family--body, inherit));
	--atl-cc-font-title: var(--font-display, var(--wp--preset--font-family--display, var(--atl-cc-font)));
	font-family: var(--atl-cc-font);
	color: var(--atl-cc-text);
}
.atl-cc *, .atl-cc *::before, .atl-cc *::after { box-sizing: border-box; }
.atl-cc [hidden] { display: none !important; }
.atl-cc :focus-visible { outline: 2px solid var(--atl-cc-focus); outline-offset: 2px; }
.atl-cc p { margin: 0; }
.atl-cc a { color: var(--atl-cc-brand-ink); text-decoration: underline; }

/* The banner */
.atl-cc__banner {
	position: fixed;
	z-index: 99990;
	background: var(--atl-cc-bg);
	color: var(--atl-cc-text);
	border: 1px solid var(--atl-cc-line);
	box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
}
.atl-cc--bar {
	left: 0;
	right: 0;
	bottom: 0;
	border-width: 1px 0 0;
	padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.atl-cc--box {
	right: calc(16px + env(safe-area-inset-right, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	width: min(400px, calc(100vw - 32px));
	border-radius: var(--atl-cc-radius);
	padding: 20px;
}
.atl-cc__text { flex: 1 1 380px; min-width: 0; display: grid; gap: 4px; }
.atl-cc__title { font-family: var(--atl-cc-font-title); font-weight: 700; font-size: 1rem; color: var(--atl-cc-ink); }
.atl-cc__message { font-size: .9375rem; line-height: 1.55; }
.atl-cc__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Buttons: Accept and Reject use the theme's button look and are identical. */
.atl-cc .atl-cc__btn { min-height: 44px; margin: 0; cursor: pointer; white-space: nowrap; }
.atl-cc .atl-cc__btn--text,
.atl-cc .atl-cc__btn--text:hover,
.atl-cc .atl-cc__btn--text:focus {
	background: transparent;
	color: var(--atl-cc-brand-ink);
	border: 1.5px solid var(--atl-cc-line-strong);
	box-shadow: none;
}
.atl-cc .atl-cc__btn--text:hover { border-color: var(--atl-cc-brand); background: var(--atl-cc-sunken); }

/* Phones: full-width buttons, Accept and Reject side by side. */
@media (max-width: 600px) {
	.atl-cc__actions { width: 100%; }
	.atl-cc__actions .atl-cc__btn { flex: 1 1 0; }
	.atl-cc__actions .atl-cc__btn--text { flex-basis: 100%; }
	.atl-cc--box { left: calc(16px + env(safe-area-inset-left, 0px)); width: auto; }
}

/* The settings panel */
.atl-cc__overlay {
	position: fixed;
	inset: 0;
	z-index: 99991;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(15, 23, 42, .5);
}
.atl-cc__dialog {
	width: min(520px, 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	background: var(--atl-cc-bg);
	color: var(--atl-cc-text);
	border: 1px solid var(--atl-cc-line);
	border-radius: var(--atl-cc-radius);
	box-shadow: 0 24px 48px rgba(15, 23, 42, .3);
}
.atl-cc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 20px 8px; }
.atl-cc__heading { margin: 0; font-family: var(--atl-cc-font-title); font-size: 1.125rem; line-height: 1.3; color: var(--atl-cc-ink); }
.atl-cc__close { width: 44px; height: 44px; margin: -10px -10px 0 0; border: 0; border-radius: 10px; background: transparent; color: var(--atl-cc-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.atl-cc__close:hover { background: var(--atl-cc-sunken); color: var(--atl-cc-ink); }
.atl-cc__intro { padding: 0 20px 12px; font-size: .9375rem; line-height: 1.55; }
.atl-cc__cats { border-top: 1px solid var(--atl-cc-line); }
.atl-cc__cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--atl-cc-line); }
.atl-cc__cat-name { font-weight: 600; color: var(--atl-cc-ink); }
.atl-cc__cat-text { grid-column: 1; font-size: .875rem; line-height: 1.5; color: var(--atl-cc-muted); }
.atl-cc__always, .atl-cc__switch { grid-column: 2; grid-row: 1 / 3; }
.atl-cc__always { font-size: .75rem; font-weight: 600; padding: 4px 8px; border-radius: 99px; color: var(--atl-cc-ok); background: var(--atl-cc-ok-soft); white-space: nowrap; }
.atl-cc__switch { position: relative; width: 44px; height: 26px; }
.atl-cc__switch input { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.atl-cc__switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--atl-cc-line-strong); transition: background .15s; }
.atl-cc__switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.atl-cc__switch input:checked + span { background: var(--atl-cc-brand); }
.atl-cc__switch input:checked + span::after { transform: translateX(18px); }
.atl-cc__switch input:focus-visible + span { outline: 2px solid var(--atl-cc-focus); outline-offset: 2px; }
.atl-cc__foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px 20px; }
.atl-cc__foot .atl-cc__btn { flex: 1 1 140px; }
.atl-cc__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The "Cookie settings" link (footer and shortcode): looks like a link. */
.atl-cc-open { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.atl-cc-footer-link { margin: 0; padding-block: 8px; text-align: center; font-size: .875rem; }

@media (prefers-reduced-motion: reduce) {
	.atl-cc__switch span, .atl-cc__switch span::after { transition: none; }
}
@media print {
	.atl-cc, .atl-cc-footer-link { display: none !important; }
}
