/**
 * Simple Vanilla Cookie Consent — Frontend Styles
 *
 * The banner uses a minimal, neutral light-theme that blends into any site.
 * All colors and the font are exposed as CSS custom properties so you can
 * override them in your theme's stylesheet without touching plugin files.
 *
 * ─── Developer CSS Hooks ────────────────────────────────────────────────────
 *
 * CSS custom properties. These defaults are NOT set on :root anywhere in this
 * stylesheet — each one is only a fallback argument inside var(), e.g.
 * background: var(--svcc-banner-bg, #ffffff). That means this file never
 * competes with your override for the same property on the same selector, so
 * it applies no matter whether your stylesheet loads before or after this
 * one. Set any of these on :root in your theme's style.css, in
 * Appearance → Customize → Additional CSS, or via a code snippet plugin —
 * all three work identically here.
 *   --svcc-font-family           default: inherit   (uses your theme's font)
 *   --svcc-banner-bg             default: #ffffff
 *   --svcc-banner-text           default: #1a1a1a
 *   --svcc-btn-primary-bg        default: #0073aa
 *   --svcc-btn-primary-text      default: #ffffff
 *   --svcc-btn-secondary-text    default: #333333
 *   --svcc-btn-secondary-border  default: #aaaaaa
 *   --svcc-btn-secondary-hover-bg   default: rgba(0, 0, 0, 0.04)      (Reject button hover)
 *   --svcc-btn-secondary-hover-text default: --svcc-btn-secondary-text (Reject button hover text)
 *   --svcc-panel-bg              default: #ffffff
 *   --svcc-panel-text            default: #1a1a1a
 *   --svcc-toggle-active         default: #0073aa
 *   --svcc-link-color            default: #0073aa
 *
 * Example dark-banner override in your theme:
 *   :root {
 *     --svcc-banner-bg:    #1a1a1a;
 *     --svcc-banner-text:  #f5f5f5;
 *     --svcc-link-color:   #a0c4ff;
 *     --svcc-btn-secondary-text:   #e5e5e5;
 *     --svcc-btn-secondary-border: #555555;
 *   }
 *
 * HTML class reference
 *   Banner
 *     .svcc-banner                  fixed bar container
 *     .svcc-banner--bottom          position modifier (also --bottom-left, --bottom-right)
 *     .svcc-banner__inner           max-width centered inner wrapper
 *     .svcc-banner__content         text content area
 *     .svcc-banner__message         message <p>
 *     .svcc-banner__privacy-link    Privacy Policy link
 *     .svcc-banner__actions         button group wrapper
 *
 *   Buttons
 *     .svcc-btn                     base class on every button
 *     .svcc-btn--primary            Accept All (filled)
 *     .svcc-btn--secondary          Reject Non-Essential (bordered)
 *     .svcc-btn--ghost              Customize (text-link style)
 *     .svcc-btn--full               full-width modifier
 *     .svcc-btn-icon                icon-only close button
 *     .svcc-open-prefs-btn          shortcode / inline "Cookie Preferences" trigger
 *     .svcc-do-not-sell-btn         shortcode / inline "Do Not Sell" trigger
 *
 *   Preferences panel
 *     .svcc-overlay                 modal backdrop
 *     .svcc-preferences             dialog panel
 *     .svcc-preferences__header     header row (title + close)
 *     .svcc-preferences__title      <h2> title
 *     .svcc-preferences__body       scrollable body with category rows
 *     .svcc-preferences__footer     footer with Save button
 *
 *   Category rows
 *     .svcc-category                one consent-category row
 *     .svcc-category--do-not-sell   modifier: the Do Not Sell row (set apart from tracking categories)
 *     .svcc-category__header        row header (name + toggle)
 *     .svcc-category__name          category name label
 *     .svcc-category__desc          description <p>
 *     .svcc-category__gpc-note      "GPC signal detected" note under Do Not Sell
 *
 *   Toggle switch
 *     .svcc-toggle                  <label> wrapper
 *     .svcc-toggle__input           visually hidden checkbox
 *     .svcc-toggle__slider          visible track/knob
 *     .svcc-toggle--always-on       "Always On" badge (Necessary)
 * ────────────────────────────────────────────────────────────────────────────
 */

/* ============================================================
   CSS Custom Properties
   No :root defaults declared here on purpose — see the file header.
   Each var() below carries its own fallback instead.
   ============================================================ */

/* ============================================================
   Screen-reader only utility
   ============================================================ */
.svcc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ============================================================
   Banner
   ============================================================ */
.svcc-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	box-sizing: border-box;
	padding: 16px;
	background: var(--svcc-banner-bg, #ffffff);
	color: var(--svcc-banner-text, #1a1a1a);
	font-family: var(--svcc-font-family, inherit);
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.10);
}

/* Positions */
.svcc-banner--bottom {
	bottom: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.svcc-banner--bottom-left {
	bottom: 16px;
	left: 16px;
	right: auto;
	max-width: 420px;
	border-radius: 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.svcc-banner--bottom-right {
	bottom: 16px;
	right: 16px;
	left: auto;
	max-width: 420px;
	border-radius: 8px;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.svcc-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	max-width: 1200px;
	margin: 0 auto;
}

.svcc-banner--bottom-left .svcc-banner__inner,
.svcc-banner--bottom-right .svcc-banner__inner {
	flex-direction: column;
	align-items: flex-start;
}

.svcc-banner__content {
	flex: 1;
	min-width: 0;
}

.svcc-banner__message {
	margin: 0 0 4px;
	padding: 0;
}

.svcc-banner__privacy-link {
	color: var(--svcc-link-color, #0073aa);
	font-size: 13px;
	text-decoration: underline;
}

.svcc-banner__privacy-link:hover {
	opacity: 0.8;
}

.svcc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.svcc-btn {
	display: inline-block;
	padding: 8px 16px;
	border: 2px solid transparent;
	border-radius: 4px;
	font-family: var(--svcc-font-family, inherit);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	text-align: center;
	transition: filter 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.svcc-btn:focus-visible {
	outline: 3px solid var(--svcc-btn-primary-bg, #0073aa);
	outline-offset: 2px;
}

/* Primary — Accept All */
.svcc-btn--primary {
	background: var(--svcc-btn-primary-bg, #0073aa);
	color: var(--svcc-btn-primary-text, #ffffff);
	border-color: var(--svcc-btn-primary-bg, #0073aa);
}

.svcc-btn--primary:hover {
	filter: brightness(0.88);
}

/* Secondary — Reject */
.svcc-btn--secondary {
	background: transparent;
	color: var(--svcc-btn-secondary-text, #333333);
	border-color: var(--svcc-btn-secondary-border, #aaaaaa);
}

.svcc-btn--secondary:hover {
	background: var(--svcc-btn-secondary-hover-bg, rgba(0, 0, 0, 0.04));
	color: var(--svcc-btn-secondary-hover-text, var(--svcc-btn-secondary-text, #333333));
}

/* Ghost — Customize */
.svcc-btn--ghost {
	background: transparent;
	color: var(--svcc-banner-text, #1a1a1a);
	border-color: transparent;
	text-decoration: underline;
	padding: 8px 10px;
	opacity: 0.65;
}

.svcc-btn--ghost:hover {
	opacity: 1;
}

/* Full-width modifier (used in panel footer) */
.svcc-btn--full {
	width: 100%;
}

/* Icon close button */
.svcc-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 6px;
	background: none;
	border: none;
	border-radius: 4px;
	color: rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.svcc-btn-icon:hover {
	background: rgba(0, 0, 0, 0.06);
	color: rgba(0, 0, 0, 0.75);
}

.svcc-btn-icon:focus-visible {
	outline: 3px solid var(--svcc-btn-primary-bg, #0073aa);
	outline-offset: 2px;
}

/* Cookie preferences shortcode / theme button */
.svcc-open-prefs-btn {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.svcc-open-prefs-btn:hover {
	opacity: 0.8;
}

/* Do Not Sell shortcode / theme button */
.svcc-do-not-sell-btn {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.svcc-do-not-sell-btn:hover {
	opacity: 0.8;
}

/* ============================================================
   Overlay + Preferences panel
   ============================================================ */
.svcc-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

/* display: flex above always beats the browser's built-in [hidden] rule
   (author CSS outranks the user-agent stylesheet regardless of specificity),
   so the hidden attribute needs an explicit override here or the overlay
   stays visible — and un-closable — on every page load. */
.svcc-overlay[hidden] {
	display: none;
}

.svcc-preferences {
	background: var(--svcc-panel-bg, #ffffff);
	color: var(--svcc-panel-text, #1a1a1a);
	font-family: var(--svcc-font-family, inherit);
	font-size: 14px;
	line-height: 1.5;
	border-radius: 8px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
}

.svcc-preferences:focus {
	outline: none;
}

.svcc-preferences__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px 0;
}

.svcc-preferences__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--svcc-panel-text, #1a1a1a);
}

.svcc-preferences__body {
	padding: 12px 24px;
}

.svcc-preferences__footer {
	padding: 0 24px 20px;
}

/* ============================================================
   Category rows
   ============================================================ */
.svcc-category {
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.svcc-category:last-child {
	border-bottom: none;
}

.svcc-category__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 3px;
}

.svcc-category__name {
	font-weight: 600;
	font-size: 14px;
	color: var(--svcc-panel-text, #1a1a1a);
	cursor: default;
}

label.svcc-category__name {
	cursor: pointer;
}

.svcc-category__desc {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.4;
	opacity: 0.65;
}

/* Do Not Sell is a legal right, not a tracking category — set it apart */
.svcc-category--do-not-sell {
	margin-top: 2px;
	padding-top: 14px;
	border-top: 2px solid rgba(0, 0, 0, 0.08);
}

.svcc-category__gpc-note {
	margin: 4px 0 0;
	font-size: 11.5px;
	line-height: 1.4;
	font-style: italic;
	opacity: 0.65;
}

/* ============================================================
   Toggle switch
   ============================================================ */
.svcc-toggle {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	flex-shrink: 0;
}

.svcc-toggle__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.svcc-toggle__slider {
	display: inline-block;
	position: relative;
	width: 44px;
	height: 24px;
	background: #ccc;
	border-radius: 12px;
	transition: background 0.2s;
	flex-shrink: 0;
}

.svcc-toggle__slider::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.svcc-toggle__input:checked + .svcc-toggle__slider {
	background: var(--svcc-toggle-active, #0073aa);
}

.svcc-toggle__input:checked + .svcc-toggle__slider::after {
	transform: translateX(20px);
}

.svcc-toggle__input:focus-visible + .svcc-toggle__slider {
	outline: 3px solid var(--svcc-toggle-active, #0073aa);
	outline-offset: 2px;
}

.svcc-toggle__input:disabled + .svcc-toggle__slider {
	opacity: 0.5;
	cursor: not-allowed;
}

.svcc-toggle__input:disabled ~ .svcc-sr-only {
	cursor: not-allowed;
}

/* "Always On" badge for Necessary */
.svcc-toggle--always-on {
	cursor: default;
	font-size: 12px;
	font-weight: 600;
	color: #059669;
	background: #d1fae5;
	padding: 3px 8px;
	border-radius: 12px;
}

/* ============================================================
   Debug Panel (admin-only — proves consent-gated scripts fired,
   since view-source never shows what JS injects after page load)
   ============================================================ */
.svcc-debug-toggle {
	position: fixed;
	bottom: 12px;
	right: 12px;
	z-index: 999998;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.25 );
}

.svcc-debug-panel {
	position: fixed;
	bottom: 52px;
	right: 12px;
	z-index: 999999;
	width: 360px;
	max-width: calc( 100vw - 24px );
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid #ccc;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.3 );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 12px;
	line-height: 1.4;
	padding: 12px;
}

.svcc-debug-panel[hidden] {
	display: none;
}

.svcc-debug-panel h4 {
	margin: 12px 0 6px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #666;
}

.svcc-debug-panel h4:first-child {
	margin-top: 0;
}

.svcc-debug-panel table {
	width: 100%;
	border-collapse: collapse;
}

.svcc-debug-panel td {
	padding: 3px 4px 3px 0;
	border-bottom: 1px solid #eee;
	vertical-align: top;
	word-break: break-all;
}

.svcc-debug-panel code {
	font-size: 11px;
	word-break: break-all;
}

.svcc-debug-status--yes {
	color: #059669;
	font-weight: 600;
	white-space: nowrap;
}

.svcc-debug-status--no {
	color: #dc2626;
	font-weight: 600;
	white-space: nowrap;
}

.svcc-debug-status--pending {
	color: #d97706;
	font-weight: 600;
	white-space: nowrap;
}

.svcc-debug-empty {
	color: #888;
	font-style: italic;
	margin: 0 0 6px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media ( max-width: 600px ) {
	.svcc-banner__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.svcc-banner--bottom-left,
	.svcc-banner--bottom-right {
		left: 0;
		right: 0;
		bottom: 0;
		max-width: none;
		border-radius: 0;
		border-left: none;
		border-right: none;
		border-bottom: none;
	}

	.svcc-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.svcc-preferences {
		max-height: 95vh;
		border-radius: 12px 12px 0 0;
	}
}
