/*
 * CB Disclaimer — dialog styles
 *
 * The native <dialog> element handles the modal stacking context.
 * Bootstrap 5 utility classes handle the interior layout.
 * This file only needs to size/position the dialog itself and style the backdrop.
 */

/* ── Backdrop ────────────────────────────────────────────────────────────── */
#cbp-disclaimer-dialog::backdrop {
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(2px);
}

/* ── Dialog box ──────────────────────────────────────────────────────────── */
#cbp-disclaimer-dialog {
	border: none;
	border-radius: 0.5rem;
	padding: 0;
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
	width: min(640px, 92vw);
	max-height: 80vh;
	overflow: hidden;
	overscroll-behavior: contain;

	/* centre on older browsers that don't auto-centre modal dialogs */
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	margin: 0;
}

/* ── Inner wrapper (Bootstrap utilities used in PHP template) ────────────── */
.cbp-disclaimer-inner {
	padding: 2rem;
}

/* ── Content area ────────────────────────────────────────────────────────── */
.cbp-disclaimer-content {
	line-height: 1.6;
	max-height: 40vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* ── Opt-in checkbox ──────────────────────────────────────────────────────── */
.cbp-disclaimer-opt-in {
	border-top: 1px solid #dee2e6;
	padding-top: 1rem;
}

.cbp-disclaimer-opt-in-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.9rem;
	cursor: pointer;
	line-height: 1.4;
}

.cbp-disclaimer-opt-in-input {
	margin-top: 0.15rem;
	flex-shrink: 0;
}

/* Prevent background page scroll while the modal is open. */
html.cbp-disclaimer-open,
body.cbp-disclaimer-open {
	overflow: hidden;
}

/* ── Ensure dialog is hidden before JS calls showModal() ────────────────── */
#cbp-disclaimer-dialog:not([open]) {
	display: none;
}
