/*
 * Conditional Content — Gutenberg block styles.
 *
 * Loaded by `BlockRenderer::enqueue_editor_assets()` in the block
 * editor and by `BlockRenderer::enqueue_frontend_assets()` on the
 * front end. Editor-only rules sit under `.gc-cc-block-editor` /
 * `.gc-cc-variant`; frontend rules sit under `.gc-cc-block`.
 *
 * Light + dark are paired in the same block per the project rule
 * (CLAUDE.md › Theming — light & dark mode). Light = bare selector;
 * dark = `body.gc-dark-mode <selector>`.
 */

.gc-cc-block-editor .gc-cc-block__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: -2px 0 10px;
	padding: 0 4px;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #64748b;
}
.gc-cc-block-editor .gc-cc-block__title {
	font-weight: 600;
	color: #1d2327;
}
.gc-cc-block-editor .gc-cc-block__count {
	color: #64748b;
}
.gc-cc-block-editor .gc-cc-block__warn {
	margin: 0 0 10px;
}
/* The merged warning notice carries a bulleted list of issues
 * instead of stacking multiple Notice components. Tight list:
 * compact rhythm, no extra left padding beyond the standard
 * list-bullet indent. */
.gc-cc-block-editor .gc-cc-block__warn-list {
	margin: 6px 0 0;
	padding-left: 18px;
	font-size: 13px;
	line-height: 1.45;
}
.gc-cc-block-editor .gc-cc-block__warn-list li + li {
	margin-top: 4px;
}

/* ─── Preview-as banner ─────────────────────────────────────── */

.gc-cc-block-editor .gc-cc-block__preview-banner {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin: 0 0 10px;
	padding: 8px 12px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 4px;
	color: #1e3a8a;
	font-size: 12px;
}
.gc-cc-block__preview-winner em {
	font-style: normal;
	font-weight: 600;
}

.gc-cc-block__preview-clear {
	margin-left: auto;
}

.gc-cc-preview-list {
	min-width: 240px;
	max-height: 360px;
	overflow-y: auto;
	padding: 4px 0;
}

.gc-cc-preview-list__item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 6px 14px;
	border-radius: 0;
}

.gc-cc-preview-list__item.is-active {
	background: #2271b1;
	color: #fff;
}
/* ─── Editor: variant card ──────────────────────────────────── */

.gc-cc-variant {
	border: 1px solid #ccd0d4;
	border-radius: 5px;
	background: #fff;
	margin: 8px 0;
}
.gc-cc-variant--default {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px rgba( 34, 113, 177, 0.15 );
}
/* ─── Preview-as: winner highlight + loser fade ─────────────── */

.gc-cc-variant--preview-winner {
	border-color: #16a34a;
	box-shadow: 0 0 0 2px rgba( 22, 163, 74, 0.25 );
}
.gc-cc-variant--preview-loser {
	opacity: 0.45;
	filter: grayscale( 0.4 );
}

.gc-cc-variant__preview-badge {
	display: inline-block;
	margin-left: auto;
	padding: 2px 8px;
	background: #16a34a;
	color: #fff;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
}
.gc-cc-variant__head {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 12px;
	border-bottom: 1px solid #e5e7eb;
	background: #f9fafb;
	border-radius: 5px 5px 0 0;
	font-size: 12px;
}
.gc-cc-variant__head-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.gc-cc-variant__tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	background: #e2e8f0;
	color: #475569;
}
.gc-cc-variant--default .gc-cc-variant__tag {
	background: #2271b1;
	color: #fff;
}
.gc-cc-variant__label {
	font-weight: 600;
	color: #1d2327;
	cursor: text;
	padding: 2px 6px;
	border-radius: 3px;
	border: 1px solid transparent;
}
.gc-cc-variant__label:hover {
	background: rgba( 0, 0, 0, 0.04 );
	border-color: rgba( 0, 0, 0, 0.08 );
}
.gc-cc-variant__label--editing {
	background: #fff;
	color: #1d2327;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	font: inherit;
	font-weight: 600;
	min-width: 200px;
	outline: none;
}
.gc-cc-variant__rule {
	padding: 4px 8px;
	background: #f1f5f9;
	border-radius: 3px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	color: #334155;
	line-height: 1.5;
	word-break: break-word;
	white-space: normal;
}
.gc-cc-variant__rule--missing {
	color: #b54708;
	background: #fef3c7;
	font-family: inherit;
	font-style: italic;
}
/* ─── Add-variant appender (parent block) ───────────────────── */

.gc-cc-block__appender {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin: 12px 0 4px;
	padding: 10px 12px;
	background: #f1f5f9;
	border: 1px dashed #cbd5e1;
	border-radius: 4px;
}
/* The secondary "Or: set what's shown to everyone else" button
 * sits inside the same appender row but reads as tertiary —
 * smaller, less prominent than the primary "Add variant" action.
 * Visually de-prioritised because most authors add their main
 * variants first and only think about the everyone-else case
 * once. */
.gc-cc-block__appender-secondary.components-button {
	font-size: 12px;
	color: #50575e;
}
.gc-cc-variant__body {
	padding: 12px;
}

/* ─── Editor: sidebar rule builder ──────────────────────────── */

.gc-cc-condition {
	padding: 10px;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	margin-bottom: 10px;
	background: #f9fafb;
}
.gc-cc-condition .components-base-control {
	margin-bottom: 8px;
}

.gc-cc-checkbox-group__list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 6px 0;
}
.gc-cc-checkbox-group__list .components-base-control {
	margin-bottom: 0;
}

/* hour_local dual control — Hour 1–12 + AM/PM picker. Used only
   when the WP time-format is 12-hour. */
.gc-cc-hour-local {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.gc-cc-hour-local .components-base-control {
	margin-bottom: 0;
}

/* between / not_between — paired Min/Max inputs, stacked. The
   --hour variant nests two HourLocal12Picker pairs so the layout
   inherits the same single-line cells. */
.gc-cc-range {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.gc-cc-range > .components-base-control {
	margin-bottom: 0;
}
.gc-cc-range--hour {
	grid-template-columns: 1fr;
	gap: 12px;
}
.gc-cc-range--hour > .gc-cc-hour-local {
	margin: 0;
}

.gc-cc-condition__signal-warn {
	margin: 0 0 10px;
	font-size: 12px;
}
.gc-cc-condition__signal-warn-action {
	margin: 6px 0 0;
}
.gc-cc-condition__signal-warn-action a {
	font-weight: 600;
}

.gc-cc-block__rendermode-warn {
	margin: 10px 0 6px;
	font-size: 12px;
}
.gc-cc-block__rendermode-hint {
	margin: 6px 0 0;
	padding: 8px 10px;
	background: #f1f5f9;
	border-left: 3px solid #94a3b8;
	font-size: 12px;
	color: #475569;
	border-radius: 0 3px 3px 0;
}
.gc-cc-block__rule-divider {
	margin: 16px 0 12px;
	border: 0;
	border-top: 1px solid #e5e7eb;
}
.gc-cc-add-condition {
	margin-top: 4px;
}

.gc-cc-no-rule-hint {
	margin: 8px 0 0;
	padding: 8px 10px;
	background: #fef3c7;
	border-left: 3px solid #f59e0b;
	color: #78350f;
	font-size: 12px;
	border-radius: 0 3px 3px 0;
}
/* ─── Frontend output ───────────────────────────────────────── */

.gc-cc-block {
	/* Intentionally minimal — the winning variant's content owns
	   its own typography. The wrapper exists only as a hook for
	   theme overrides and Phase 5's client-render mode. */
}
