/**
 * Real Estate Data Pro — Snapshot card.
 *
 * The whole point of [rep_data_snapshot] is a single self-contained card meant
 * to be posted, emailed or embedded on its own — so unlike the full report
 * (where a KPI card is one of many sections), here the card *is* the embed:
 * one elevated surface, generous spacing, nothing else competing for
 * attention. Builds on .rep-data-report's base tokens (loaded first via the
 * rep-data-public dependency) rather than redeclaring them.
 *
 * Outer/inner background follows the exact same convention
 * .rep-data-report uses for its own outer wrapper vs. its .rep-data-kpi
 * tiles (see that rule's comment): the outer shell is the fixed, neutral
 * --rep-data-page-bg "canvas," and inner tiles sit on --rep-data-surface,
 * the template's actual surface treatment (flat/gradient/glass/dark-
 * gradient, tinted with the selected brand colors). Snapshot and the full
 * report used to invert this — Snapshot's outer card read --rep-data-
 * surface directly while its tiles read the neutral panel shade — so a
 * Customize surface pick (e.g. glass or dark-gradient) painted Snapshot's
 * whole outer card while leaving the report's outer wrapper looking
 * unchanged, and vice versa for the inner tiles. Same tokens, same
 * assignment, both places now — they render identically for the same
 * Design settings.
 */

.rep-data-snapshot {
	width: 100%;
	max-width: var(--rep-data-snapshot-max-width, 720px);
	margin: var(--rep-data-snapshot-margin-y, 0) auto;
	background: var(--rep-data-page-bg);
	border: 1px solid var(--rep-data-border);
	border-radius: var(--rep-data-radius);
	box-shadow: var(--rep-data-shadow);
	padding: var(--rep-data-snapshot-padding, clamp(16px, 4vw, var(--rep-card-padding, 32px)));
}

/* Centred is the default (margin: auto auto above); these adjust it. */
.rep-data-snapshot--align-left {
	margin-left: 0;
}

.rep-data-snapshot--align-right {
	margin-right: 0;
}

/* Explicit no-op (an --align="center" attribute is the same as the
   default above) — kept for symmetry with every other product's own
   --align-* classes (Tools/Forms Pro, .rep-data-report), since an
   Elementor/WPBakery "Alignment" control always emits one of the four. */
.rep-data-snapshot--align-center {
	margin-left: auto;
	margin-right: auto;
}

.rep-data-snapshot--align-full {
	max-width: none;
}

.rep-data-snapshot__header {
	text-align: center;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--rep-data-brand);
}

.rep-data-snapshot__eyebrow {
	margin: 0 0 6px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rep-data-brand-dark);
}

.rep-data-snapshot__title {
	margin: 0;
	font-size: clamp(1.35rem, 3vw, 1.85rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--rep-data-text);
}

.rep-data-snapshot__period {
	margin: 4px 0 0;
	font-size: 0.85rem;
	color: var(--rep-data-muted);
}

/* -------------------------------------------------------------------
 * Geography groups: several independent cards shown at once (the
 * "separate cards" alternative to the geography tabs below), one per
 * county/city — see SnapshotShortcode's separateCards / snapshot.php's
 * $rep_data_separate branch. Deliberately not width-capped by
 * --rep-data-snapshot-max-width the way a single card is: that variable
 * describes one card's own comfortable reading width, not a multi-card
 * group's, so the group instead just fills its container (typically
 * already width-bounded by the theme's own content column) and lets the
 * grid below size each card.
 * ------------------------------------------------------------------- */

.rep-data-snapshot-group {
	width: 100%;
	margin: var(--rep-data-snapshot-margin-y, 0) auto;
}

.rep-data-snapshot-group__title {
	margin: 0 0 16px;
	text-align: center;
	font-size: clamp(1.35rem, 3vw, 1.85rem);
	font-weight: 700;
	color: var(--rep-data-text);
}

.rep-data-snapshot-group__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	align-items: start;
}

/* Reset the single-card sizing rules (max-width/centering margin) that
   would otherwise apply here too, since each card in the group is still
   a plain .rep-data-snapshot underneath — higher specificity than the
   bare .rep-data-snapshot rule above wins regardless of source order. */
.rep-data-snapshot-group__item .rep-data-snapshot {
	max-width: none;
	margin: 0;
	width: 100%;
}

/* -------------------------------------------------------------------
 * Geography tabs
 *
 * Pure CSS: a hidden radio-button group drives which panel shows, so a
 * multi-geography snapshot stays a fixed, server-rendered card rather than
 * something that queries on interaction. Up to Snapshot::MAX_GEO_TABS
 * (6) tab/panel pairs are wired up below; unused ones are simply absent
 * from the markup.
 * ------------------------------------------------------------------- */

.rep-data-snapshot__tab-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rep-data-snapshot__tabnav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: -8px 0 20px;
}

.rep-data-snapshot__tabnav-item {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--rep-data-muted);
	background: var(--rep-data-panel-bg);
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.rep-data-snapshot__tabnav-item:hover {
	color: var(--rep-data-brand-dark);
}

.rep-data-snapshot__tab-input:focus-visible + .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:first-child {
	outline: 2px solid var(--rep-data-brand);
	outline-offset: 2px;
}

.rep-data-snapshot__panel {
	display: none;
}

.rep-data-snapshot__tab-input:nth-of-type(1):checked ~ .rep-data-snapshot__panels .rep-data-snapshot__panel:nth-of-type(1),
.rep-data-snapshot__tab-input:nth-of-type(2):checked ~ .rep-data-snapshot__panels .rep-data-snapshot__panel:nth-of-type(2),
.rep-data-snapshot__tab-input:nth-of-type(3):checked ~ .rep-data-snapshot__panels .rep-data-snapshot__panel:nth-of-type(3),
.rep-data-snapshot__tab-input:nth-of-type(4):checked ~ .rep-data-snapshot__panels .rep-data-snapshot__panel:nth-of-type(4),
.rep-data-snapshot__tab-input:nth-of-type(5):checked ~ .rep-data-snapshot__panels .rep-data-snapshot__panel:nth-of-type(5),
.rep-data-snapshot__tab-input:nth-of-type(6):checked ~ .rep-data-snapshot__panels .rep-data-snapshot__panel:nth-of-type(6) {
	display: block;
}

.rep-data-snapshot__tab-input:nth-of-type(1):checked ~ .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:nth-of-type(1),
.rep-data-snapshot__tab-input:nth-of-type(2):checked ~ .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:nth-of-type(2),
.rep-data-snapshot__tab-input:nth-of-type(3):checked ~ .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:nth-of-type(3),
.rep-data-snapshot__tab-input:nth-of-type(4):checked ~ .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:nth-of-type(4),
.rep-data-snapshot__tab-input:nth-of-type(5):checked ~ .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:nth-of-type(5),
.rep-data-snapshot__tab-input:nth-of-type(6):checked ~ .rep-data-snapshot__tabnav .rep-data-snapshot__tabnav-item:nth-of-type(6) {
	background: var(--rep-data-brand);
	color: var(--rep-data-on-brand);
}

.rep-data-snapshot__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}

.rep-data-snapshot__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
	/* Same variable, same fallback chain as .rep-data-kpi in the full
	   report (data.css) — see the class docblock above. --rep-data-kpi-bg
	   is what the per-report "visual style" skins (gradient/bold) set to
	   tint their own KPI cards; reading it here too, not just
	   --rep-data-surface directly, means a visual-style skin's own KPI
	   treatment reaches Snapshot's tiles exactly the way it reaches the
	   report's KPI cards, not just Design's own surface treatment. */
	background: var(--rep-data-kpi-bg, var(--rep-data-surface, var(--rep-data-brand-wash)));
	border-radius: calc(var(--rep-data-radius) - 2px);
	padding: 16px 10px;
}

.rep-data-snapshot__tile-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--rep-data-muted);
}

.rep-data-snapshot__tile-value {
	font-size: clamp(1.3rem, 3vw, 1.7rem);
	font-weight: 800;
	line-height: 1.1;
	color: var(--rep-data-text);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.rep-data-snapshot__tile-delta {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.6;
	padding: 0 8px;
	border-radius: 999px;
}

.rep-data-snapshot__tile-delta.is-up {
	color: #1f7a4d;
	background: rgba(31, 122, 77, 0.12);
}

.rep-data-snapshot__tile-delta.is-down {
	color: #b03030;
	background: rgba(176, 48, 48, 0.12);
}

.rep-data-snapshot__tile-delta.is-flat {
	color: var(--rep-data-muted);
	background: rgba(0, 0, 0, 0.05);
}

.rep-data-snapshot__foot-note {
	margin: 16px 0 0;
	font-size: 0.75rem;
	color: var(--rep-data-muted);
	text-align: center;
}

.rep-data-snapshot__generated {
	margin: 16px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--rep-data-border);
	font-size: 0.72rem;
	color: var(--rep-data-muted);
	text-align: center;
}

.rep-data-snapshot .rep-data-empty {
	text-align: center;
	color: var(--rep-data-muted);
	margin: 0;
}

@media (max-width: 480px) {
	.rep-data-snapshot__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media print {
	.rep-data-snapshot {
		box-shadow: none;
		border-width: 2px;
	}
}
