/**
 * SquidSpark WP Consent — front-end styles.
 *
 * Everything is driven by --ssc-* custom properties so presets and custom themes can restyle the
 * banner by overriding a handful of variables. Preset skins set the variables; layout classes place
 * the window; the markup is shared across every layout.
 */

/* ----------------------------------------------------------------- tokens */
.ssconsent-root {
	--ssc-bg: #ffffff;
	--ssc-color: #1e1e1e;
	--ssc-accent: #2563eb;
	--ssc-accent-text: #ffffff;
	--ssc-secondary: #eef2f7;
	--ssc-secondary-text: #1e1e1e;
	--ssc-border: #d9dee5;
	--ssc-link: #2563eb;
	--ssc-overlay: rgba(15, 23, 42, .55);
	--ssc-radius: 10px;
	--ssc-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--ssc-shadow: 0 10px 40px rgba(0, 0, 0, .18);

	position: fixed;
	z-index: 2147483000;
	color: var(--ssc-color);
	font-family: var(--ssc-font);
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}
.ssconsent-root *,
.ssconsent-root *::before,
.ssconsent-root *::after { box-sizing: border-box; }

.ssconsent-root[hidden] { display: none; }

/* ---------------------------------------------------------------- presets */
.ssconsent-style-dark {
	--ssc-bg: #1e2530;
	--ssc-color: #e5e9f0;
	--ssc-accent: #5b8cff;
	--ssc-accent-text: #0b1020;
	--ssc-secondary: #2a3340;
	--ssc-secondary-text: #e5e9f0;
	--ssc-border: #39434f;
	--ssc-link: #8fb4ff;
	--ssc-overlay: rgba(0, 0, 0, .6);
}
.ssconsent-style-minimal {
	--ssc-accent: #111111;
	--ssc-secondary: transparent;
	--ssc-secondary-text: #111111;
	--ssc-border: #e5e5e5;
	--ssc-link: #111111;
	--ssc-radius: 4px;
	--ssc-shadow: 0 2px 14px rgba(0, 0, 0, .10);
}
.ssconsent-style-rounded {
	--ssc-radius: 20px;
	--ssc-shadow: 0 16px 50px rgba(37, 99, 235, .18);
}
.ssconsent-style-high-contrast {
	--ssc-bg: #000000;
	--ssc-color: #ffffff;
	--ssc-accent: #ffff00;
	--ssc-accent-text: #000000;
	--ssc-secondary: #ffffff;
	--ssc-secondary-text: #000000;
	--ssc-border: #ffffff;
	--ssc-link: #ffff00;
	--ssc-overlay: rgba(0, 0, 0, .8);
	--ssc-radius: 0;
}

/* ------------------------------------------------------------ the window */
.ssconsent-window {
	background: var(--ssc-bg);
	color: var(--ssc-color);
	border: 1px solid var(--ssc-border);
	border-radius: var(--ssc-radius);
	box-shadow: var(--ssc-shadow);
	padding: 20px 22px;
	width: 100%;
}
.ssconsent-heading { margin: 0 0 8px; font-size: 1.15em; font-weight: 700; color: var(--ssc-color); }
.ssconsent-body { margin: 0 0 10px; color: var(--ssc-color); }
.ssconsent-notice { margin: 0 0 10px; font-size: .85em; opacity: .85; }
.ssconsent-privacy-link, .ssconsent-declaration a { color: var(--ssc-link); }

/* buttons */
.ssconsent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.ssconsent-btn {
	appearance: none;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border-radius: calc(var(--ssc-radius) - 2px);
	border: 1px solid transparent;
	padding: 10px 18px;
	line-height: 1.2;
}
.ssconsent-btn-accept { background: var(--ssc-accent); color: var(--ssc-accent-text); border-color: var(--ssc-accent); }
.ssconsent-btn-reject { background: var(--ssc-secondary); color: var(--ssc-secondary-text); border-color: var(--ssc-border); }
.ssconsent-btn-save   { background: var(--ssc-secondary); color: var(--ssc-secondary-text); border-color: var(--ssc-border); }
.ssconsent-btn-manage {
	background: transparent;
	color: var(--ssc-color);
	border-color: transparent;
	text-decoration: underline;
	padding-left: 4px;
	padding-right: 4px;
}
/* Accept and Reject must read as equally prominent (GDPR). */
.ssconsent-btn-accept, .ssconsent-btn-reject { min-width: 130px; text-align: center; }
.ssconsent-btn:hover { filter: brightness(.96); }

.ssconsent-dnsmpi {
	display: inline-block;
	margin-top: 12px;
	background: none;
	border: none;
	padding: 0;
	color: var(--ssc-link);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
	font-size: .9em;
}

/* focus visibility (a11y) */
.ssconsent-root :focus-visible {
	outline: 3px solid var(--ssc-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ preferences */
.ssconsent-categories { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.ssconsent-category { border: 1px solid var(--ssc-border); border-radius: calc(var(--ssc-radius) - 2px); padding: 12px 14px; }
.ssconsent-category-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ssconsent-category-label { font-weight: 600; }
.ssconsent-category-desc { margin: 6px 0 0; font-size: .9em; opacity: .9; }
.ssconsent-always { font-size: .8em; opacity: .7; margin-left: auto; }

/* toggle switch */
.ssconsent-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.ssconsent-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ssconsent-switch-track {
	position: absolute; inset: 0;
	background: var(--ssc-secondary);
	border: 1px solid var(--ssc-border);
	border-radius: 999px;
	transition: background .15s ease;
}
.ssconsent-switch-track::after {
	content: ""; position: absolute; top: 2px; left: 2px;
	width: 20px; height: 20px; border-radius: 50%;
	background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	transition: transform .15s ease;
}
.ssconsent-switch input:checked + .ssconsent-switch-track { background: var(--ssc-accent); border-color: var(--ssc-accent); }
.ssconsent-switch input:checked + .ssconsent-switch-track::after { transform: translateX(20px); }
.ssconsent-switch input:focus-visible + .ssconsent-switch-track { outline: 3px solid var(--ssc-accent); outline-offset: 2px; }
.ssconsent-category input[disabled] { cursor: not-allowed; }

.ssconsent-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --------------------------------------------------------------- overlay */
.ssconsent-overlay { position: fixed; inset: 0; background: var(--ssc-overlay); z-index: -1; }
.ssconsent-overlay[hidden] { display: none; }
body.ssconsent-modal-open { overflow: hidden; }

/* ---------------------------------------------------------------- layouts */

/* bottom / top bars: full-width, window spans the viewport */
.ssconsent-layout-bottom-bar { left: 0; right: 0; bottom: 0; }
.ssconsent-layout-top-bar { left: 0; right: 0; top: 0; }
.ssconsent-layout-bottom-bar .ssconsent-window,
.ssconsent-layout-top-bar .ssconsent-window {
	border-radius: 0;
	border-left: 0; border-right: 0;
	max-width: none;
}
.ssconsent-layout-bottom-bar .ssconsent-window { border-bottom: 0; }
.ssconsent-layout-top-bar .ssconsent-window { border-top: 0; }
/* Put text and buttons on one row on wide screens for the bars. */
@media (min-width: 900px) {
	.ssconsent-layout-bottom-bar .ssconsent-banner,
	.ssconsent-layout-top-bar .ssconsent-banner {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
		gap: 18px;
	}
	.ssconsent-layout-bottom-bar .ssconsent-banner .ssconsent-actions,
	.ssconsent-layout-top-bar .ssconsent-banner .ssconsent-actions { margin-top: 0; justify-content: flex-end; }
	.ssconsent-layout-bottom-bar .ssconsent-banner .ssconsent-heading,
	.ssconsent-layout-top-bar .ssconsent-banner .ssconsent-heading { grid-column: 1 / -1; }
	.ssconsent-layout-bottom-bar .ssconsent-dnsmpi,
	.ssconsent-layout-top-bar .ssconsent-dnsmpi { grid-column: 1 / -1; }
}

/* floating boxes */
.ssconsent-layout-float-left,
.ssconsent-layout-float-right { bottom: 20px; width: min(420px, calc(100vw - 32px)); }
.ssconsent-layout-float-left { left: 20px; }
.ssconsent-layout-float-right { right: 20px; }

/* centered modal */
.ssconsent-layout-modal { inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ssconsent-layout-modal .ssconsent-window { max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; }

/* fullscreen wall */
.ssconsent-layout-fullscreen { inset: 0; display: flex; align-items: center; justify-content: center; }
.ssconsent-layout-fullscreen .ssconsent-window {
	max-width: 640px;
	max-height: 100vh;
	overflow: auto;
	border-radius: var(--ssc-radius);
	margin: 20px;
}

/* Reveal animation (respect reduced-motion) */
.ssconsent-root.is-visible .ssconsent-window { animation: ssconsent-in .22s ease both; }
@keyframes ssconsent-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------- reopen button */
.ssconsent-reopen {
	position: fixed;
	z-index: 2147482000;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--ssc-accent, #2563eb);
	color: var(--ssc-accent-text, #fff);
	border: none;
	border-radius: 999px;
	padding: 10px 16px;
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
.ssconsent-reopen:hover { filter: brightness(.96); }
.ssconsent-reopen-bottom-left { bottom: 18px; left: 18px; }
.ssconsent-reopen-bottom-right { bottom: 18px; right: 18px; }
.ssconsent-reopen-top-left { top: 18px; left: 18px; }
.ssconsent-reopen-top-right { top: 18px; right: 18px; }
.ssconsent-reopen-icon { display: inline-flex; }

/* Shortcode-triggered preferences links */
.ssconsent-open-preferences {
	background: none; border: none; padding: 0; margin: 0;
	color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}

/* ------------------------------------------------- cookie declaration table */
.ssconsent-declaration { margin: 1em 0; }
.ssconsent-decl-heading { margin: 1.2em 0 .2em; }
.ssconsent-decl-desc { margin: 0 0 .6em; opacity: .85; }
.ssconsent-decl-table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.ssconsent-decl-table th,
.ssconsent-decl-table td { border: 1px solid #d9dee5; padding: 8px 10px; text-align: left; vertical-align: top; font-size: .95em; }
.ssconsent-decl-table th { background: rgba(0, 0, 0, .04); font-weight: 600; }

@media (max-width: 600px) {
	.ssconsent-actions { flex-direction: column; align-items: stretch; }
	.ssconsent-btn { width: 100%; }
	.ssconsent-reopen-label { display: none; }
	.ssconsent-reopen { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.ssconsent-root.is-visible .ssconsent-window { animation: none; }
	.ssconsent-switch-track, .ssconsent-switch-track::after { transition: none; }
}
