/* Copyright (c) 2026 Nova Heaven. All rights reserved. Proprietary and confidential. See LICENSE. */
/* Nova Sanctum front-end banner.
   Colour variables are injected inline (scoped to :root) by the plugin so the
   admin's choices win. var() fallbacks below keep things sane if that inline
   block is ever stripped by an aggressive optimiser. */

#nova-sanctum-root[hidden] { display: none; }

#nova-sanctum-root,
#nova-sanctum-root * { box-sizing: border-box; }

.cnt-root {
	position: fixed;
	inset: 0;
	z-index: 2147483600;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.cnt-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	opacity: 0;
	transition: opacity 0.2s ease;
}

/* Only show the dimming overlay for wall layout or when the modal is open. */
.cnt-layout-wall .cnt-overlay,
.cnt-root.cnt-modal-open .cnt-overlay { opacity: 1; }
.cnt-root[data-overlay="0"]:not(.cnt-modal-open) .cnt-overlay { display: none; }

/* ---------------------------------------------------------------- banner */

.cnt-banner {
	position: absolute;
	pointer-events: auto;
	background: var(--cnt-bg, #ffffff);
	color: var(--cnt-text, #1f2937);
	border-radius: var(--cnt-radius, 12px);
	box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
	max-width: 440px;
	width: calc(100% - 40px);
	padding: 22px 24px;
	margin: 20px;
}

.cnt-layout-bar .cnt-banner {
	max-width: none;
	width: 100%;
	margin: 0;
	border-radius: 0;
	left: 0;
	right: 0;
}

.cnt-layout-bar .cnt-banner-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1200px;
	margin: 0 auto;
}

.cnt-layout-bar .cnt-banner-text { flex: 1; }

.cnt-layout-wall .cnt-banner {
	position: relative;
	margin: auto;
	top: 50%;
	transform: translateY(-50%);
}

/* positions (box layout) */
.cnt-pos-bottom-left .cnt-banner { bottom: 0; left: 0; }
.cnt-pos-bottom-right .cnt-banner { bottom: 0; right: 0; }
.cnt-pos-bottom .cnt-banner { bottom: 0; left: 50%; transform: translateX(-50%); }
.cnt-pos-top .cnt-banner { top: 0; left: 50%; transform: translateX(-50%); }
.cnt-layout-bar.cnt-pos-bottom .cnt-banner,
.cnt-layout-bar.cnt-pos-bottom-left .cnt-banner,
.cnt-layout-bar.cnt-pos-bottom-right .cnt-banner { transform: none; bottom: 0; }
.cnt-layout-bar.cnt-pos-top .cnt-banner { transform: none; top: 0; }

.cnt-heading {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--cnt-heading);
}

.cnt-message { margin: 0 0 14px; }

.cnt-links { margin: 0 0 14px; font-size: 13px; }
.cnt-links a { color: var(--cnt-accent); margin-right: 14px; }

.cnt-banner-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.cnt-layout-bar .cnt-banner-actions { flex-wrap: nowrap; }

/* ---------------------------------------------------------------- buttons */

.cnt-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 11px 18px;
	border-radius: calc(var(--cnt-radius) * 0.6);
	transition: filter 0.15s ease, transform 0.05s ease;
}
.cnt-btn:hover { filter: brightness(0.95); }
.cnt-btn:active { transform: translateY(1px); }
.cnt-btn:focus-visible { outline: 3px solid var(--cnt-accent); outline-offset: 2px; }

.cnt-btn-primary { background: var(--cnt-accept-bg, #2563eb); color: var(--cnt-accept-text, #fff); }
.cnt-btn-secondary { background: var(--cnt-reject-bg, #e5e7eb); color: var(--cnt-reject-text, #1f2937); }
.cnt-btn-ghost {
	background: transparent;
	color: var(--cnt-accent, #2563eb);
	box-shadow: inset 0 0 0 1.5px var(--cnt-accent, #2563eb);
}

/* ---------------------------------------------------------------- modal */

.cnt-modal {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	padding: 20px;
}
.cnt-modal[hidden] { display: none; }

.cnt-modal-inner {
	background: var(--cnt-bg, #ffffff);
	color: var(--cnt-text, #1f2937);
	border-radius: var(--cnt-radius, 12px);
	max-width: 560px;
	width: 100%;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.4);
}

.cnt-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cnt-close {
	appearance: none;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--cnt-text);
}

.cnt-modal-body { padding: 8px 24px; overflow-y: auto; }

.cnt-cat { padding: 16px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.cnt-cat:last-child { border-bottom: 0; }
.cnt-cat-head { display: flex; align-items: center; gap: 12px; }
.cnt-cat-name { font-weight: 600; color: var(--cnt-heading); }
.cnt-required { font-style: normal; font-size: 12px; opacity: 0.6; margin-left: 6px; }
.cnt-cat-desc { margin: 8px 0 0 56px; font-size: 14px; opacity: 0.85; }

.cnt-modal-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	padding: 18px 24px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------------------------------------------------------------- switch */

.cnt-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.cnt-switch input { opacity: 0; width: 0; height: 0; }
.cnt-slider {
	position: absolute;
	inset: 0;
	background: #cbd5e1;
	border-radius: 999px;
	transition: background 0.2s ease;
}
.cnt-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}
.cnt-switch input:checked + .cnt-slider { background: var(--cnt-accent); }
.cnt-switch input:checked + .cnt-slider::before { transform: translateX(20px); }
.cnt-switch input:disabled + .cnt-slider { opacity: 0.55; }
.cnt-switch input:focus-visible + .cnt-slider { outline: 3px solid var(--cnt-accent); outline-offset: 2px; }

/* ---------------------------------------------------- blocked iframe block */

.cnt-iframe-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	text-align: center;
	padding: 24px;
	background: #f1f5f9;
	border: 1px dashed #94a3b8;
	border-radius: 8px;
	color: #334155;
}
.cnt-iframe-notice { margin: 0; max-width: 38ch; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 600px) {
	.cnt-layout-bar .cnt-banner-inner { flex-direction: column; align-items: stretch; gap: 14px; }
	.cnt-banner { width: calc(100% - 20px); margin: 10px; }
	.cnt-banner-actions, .cnt-layout-bar .cnt-banner-actions { flex-wrap: wrap; }
	.cnt-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.cnt-overlay, .cnt-slider, .cnt-slider::before, .cnt-btn { transition: none; }
}

/* ---- Wall blocking + modal scroll lock (the "blocking" layout must block) ---- */
body.cnt-noscroll { overflow: hidden; }
.cnt-root.cnt-visible.cnt-layout-wall .cnt-overlay,
.cnt-root.cnt-modal-open .cnt-overlay { pointer-events: auto; }

/* ---- Opt-out notice mode: slimmer, honest "tracking is on" notice ---- */
.cnt-root.cnt-mode-notice .cnt-banner { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18); }
.cnt-root.cnt-mode-notice .cnt-heading { font-size: 1rem; }
.cnt-root.cnt-mode-notice .cnt-message { font-size: 0.85rem; }

/* ---- Persistent footer Do Not Sell link (CCPA 1798.135(a)) ---- */
.cnt-footer-dnsl { text-align: center; padding: 10px 16px; font-size: 0.8rem; }
.cnt-footer-dnsl a { color: inherit; text-decoration: underline; opacity: 0.8; }
.cnt-footer-dnsl a:hover, .cnt-footer-dnsl a:focus { opacity: 1; }
/* Safety: [hidden] always wins, whatever theme CSS does to display. The footer
   link lives outside .cnt-root, so it is named explicitly here. */
.cnt-root[hidden], .cnt-root [hidden], .cnt-footer-dnsl[hidden] { display: none !important; }
