/**
 * Parameter — Shared widget library
 * Loaded only on /compare/* pages and the two Miami support pages.
 * See PARAMETER.md §2 for the component contract.
 */

/* ── Tokens (additive — only declare what style.css doesn't already own) ── */
:root {
	--p-brand-700: #6B46F2;
	--p-odoo: #714B67;
	--p-surface: #FFFFFF;
	--p-surface-soft: #F8FAFC;
	--p-ink-soft: #1E293B;
	--p-radius-sm: 12px;
	--p-radius-lg: 22px;
	--p-shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.06);
	--p-grad: linear-gradient(135deg, #4E2DE3 0%, #7A5AF8 100%);
	--p-grad-accent: linear-gradient(120deg, #00C2A8 0%, #7A5AF8 100%);
	--p-font: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

/* ── Feather icon helper ── */
.pi {
	display: inline-flex;
	width: 1.15em;
	height: 1.15em;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 1;
}
.pi svg { width: 100%; height: 100%; }
.pi.sm { width: 18px; height: 18px; }
.pi.lg { width: 28px; height: 28px; }
.pi.xl { width: 40px; height: 40px; }

/* ── Reveal on scroll ── */
.reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-revealed {
	opacity: 1;
	transform: none;
}
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; transition: none; }
}

/* ──────────────────────────────────────────────────────────────
   2.1 vs-pair — compare hero workhorse
   ────────────────────────────────────────────────────────────── */
.vs-pair {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: stretch;
	gap: 14px;
	font-family: var(--p-font);
}
.vs-card {
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	border-radius: var(--p-radius);
	padding: 20px 20px 18px;
	box-shadow: var(--p-shadow);
	min-width: 0;
}
.vs-card--us {
	border-color: transparent;
	box-shadow: 0 0 0 1.5px var(--p-brand), var(--p-shadow);
}
.vs-card-hd h3 {
	margin: 6px 0 12px;
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--p-text);
}
.vs-chip {
	display: inline-block;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--p-muted);
	border: 1px solid var(--p-border);
	padding: 3px 8px;
	border-radius: 999px;
}
.vs-chip--us {
	color: var(--p-brand-900);
	border-color: transparent;
	background: rgba(122, 90, 248, 0.08);
}
.vs-attrs { margin: 0; display: grid; gap: 10px; }
.vs-attrs div {
	display: grid;
	grid-template-columns: 92px 1fr;
	gap: 10px;
	align-items: baseline;
}
.vs-attrs dt {
	font-size: 0.78rem;
	color: var(--p-muted);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.vs-attrs dd {
	margin: 0;
	font-size: 0.95rem;
	color: var(--p-text);
	line-height: 1.4;
}
.vs-split {
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--p-font);
	font-weight: 700;
	color: var(--p-muted);
	font-size: 0.9rem;
}
.vs-split span {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--p-shadow-sm);
}
@media (max-width: 720px) {
	.vs-pair { grid-template-columns: 1fr; gap: 10px; }
	.vs-split { transform: rotate(90deg); margin: -4px auto; }
}

/* ──────────────────────────────────────────────────────────────
   2.2 dot-scale — 0–7 attribute indicator
   ────────────────────────────────────────────────────────────── */
.dot-scale { display: grid; gap: 10px; font-family: var(--p-font); }
.dot-row {
	display: grid;
	grid-template-columns: 120px 1fr auto;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border: 1px solid var(--p-border);
	border-radius: 12px;
	background: var(--p-surface);
}
.dot-row.is-us {
	border-color: var(--p-brand);
	background: rgba(122, 90, 248, 0.04);
}
.dot-label {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--p-muted);
}
.dot-track { display: inline-flex; gap: 6px; }
.dot-track .dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #E2E8F0;
	display: inline-block;
}
.dot-row:not(.is-us) .dot.is-on { background: #F59E0B; }
.dot-row.is-us .dot.is-on { background: var(--p-accent); }
.dot-caption {
	font-size: 0.9rem;
	color: var(--p-text);
}
@media (max-width: 560px) {
	.dot-row { grid-template-columns: 1fr; }
	.dot-caption { justify-self: start; }
}

/* ──────────────────────────────────────────────────────────────
   2.3 feed — activity timeline
   ────────────────────────────────────────────────────────────── */
.feed {
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	border-radius: var(--p-radius);
	padding: 18px 20px;
	box-shadow: var(--p-shadow);
	font-family: var(--p-font);
}
.feed-hd { margin-bottom: 10px; }
.feed-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 6px;
}
.feed-row {
	display: grid;
	grid-template-columns: 14px 1fr auto;
	gap: 12px;
	align-items: start;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 0.92rem;
}
.feed-row--them { background: rgba(239, 68, 68, 0.06); }
.feed-row--us { background: rgba(0, 194, 168, 0.07); }
.feed-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-top: 6px;
}
.feed-row--them .feed-dot { background: #EF4444; }
.feed-row--us .feed-dot { background: var(--p-accent); }
.feed-row strong {
	color: var(--p-text);
	font-weight: 600;
}
.feed-detail {
	display: block;
	color: var(--p-muted);
	margin-top: 2px;
	font-size: 0.88rem;
	line-height: 1.4;
}
.feed-time {
	color: var(--p-muted);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	align-self: center;
	white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────
   2.4 ledger — scope comparison table
   ────────────────────────────────────────────────────────────── */
.ledger {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-family: var(--p-font);
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	border-radius: var(--p-radius);
	box-shadow: var(--p-shadow);
	overflow: hidden;
}
.ledger caption {
	text-align: left;
	padding: 14px 18px 6px;
	color: var(--p-muted);
}
.ledger th,
.ledger td {
	padding: 14px 18px;
	text-align: left;
	font-size: 0.95rem;
	border-top: 1px solid var(--p-border);
}
.ledger thead th {
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--p-muted);
	font-weight: 600;
	border-top: 0;
	background: var(--p-surface-soft);
}
.ledger .ledger-us {
	background: rgba(122, 90, 248, 0.04);
	color: var(--p-brand-900);
	font-weight: 600;
}
.ledger tbody th {
	font-weight: 500;
	color: var(--p-text);
	background: transparent;
}
.ledger td.y::before,
.ledger td.n::before,
.ledger td.p::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 8px;
	vertical-align: 1px;
}
.ledger td.y::before { background: var(--p-accent); }
.ledger td.n::before { background: #EF4444; }
.ledger td.p::before { background: #F59E0B; }

/* 3-column comparison variant */
.ledger--3 thead th:nth-child(3),
.ledger--3 tbody td:nth-child(3) { background: var(--p-surface-soft); }
.ledger--3 thead th:last-child,
.ledger--3 tbody td.ledger-us { background: rgba(122, 90, 248, 0.05); }

@media (max-width: 640px) {
	.ledger thead { display: none; }
	.ledger,
	.ledger tbody,
	.ledger tr,
	.ledger th,
	.ledger td { display: block; border: 0; }
	.ledger tr {
		border: 1px solid var(--p-border);
		border-radius: 12px;
		margin: 10px 14px;
		padding: 10px;
	}
	.ledger td { border: 0; padding: 4px 6px; }
	.ledger tbody th {
		padding: 10px 6px 4px;
		font-weight: 600;
	}
}

/* ──────────────────────────────────────────────────────────────
   2.5 stat-row — metric band (every value needs a .stat-sub)
   ────────────────────────────────────────────────────────────── */
.stat-row {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	font-family: var(--p-font);
}
.stat-row .stat-card {
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	border-radius: var(--p-radius);
	padding: 22px 22px 20px;
	box-shadow: var(--p-shadow-sm);
}
.stat-row .stat-value {
	font-family: var(--p-font);
	font-weight: 700;
	font-size: clamp(1.8rem, 3vw, 2.2rem);
	color: var(--p-text);
	margin-top: 10px;
	letter-spacing: -0.01em;
	line-height: 1.1;
}
.stat-row .stat-label {
	color: var(--p-text);
	font-size: 1rem;
	margin-top: 2px;
	line-height: 1.4;
}
.stat-row .stat-sub {
	color: var(--p-muted);
	font-size: 0.82rem;
	margin-top: 10px;
	line-height: 1.4;
}

/* ──────────────────────────────────────────────────────────────
   2.6 timeline-inline — horizontal ops cadence
   ────────────────────────────────────────────────────────────── */
.timeline-inline {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	font-family: var(--p-font);
}
.t-step {
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	border-radius: 14px;
	padding: 18px 16px;
	box-shadow: var(--p-shadow-sm);
	display: grid;
	gap: 4px;
	align-content: start;
}
.t-badge {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: rgba(122, 90, 248, 0.08);
	color: var(--p-brand-900);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 6px;
}
.t-step strong {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--p-text);
}
.t-step > span:not(.t-badge) {
	color: var(--p-muted);
	font-size: 0.9rem;
	line-height: 1.4;
}
@media (max-width: 780px) {
	.timeline-inline { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
	.timeline-inline { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────
   2.7 incident-strip — 4-tile severity grid
   (reuses .status-card / .status-head / .status-icon / .status-chip
    already declared on /odoo-reality/ — widgets partial only adds
    the grid wrapper + severity chip colors for pages that don't
    already own those base styles.)
   ────────────────────────────────────────────────────────────── */
.incident-strip {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	font-family: var(--p-font);
}
@media (max-width: 900px) {
	.incident-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
	.incident-strip { grid-template-columns: 1fr; }
}

.incident-strip .status-card {
	background: var(--p-surface);
	border: 1px solid var(--p-border);
	border-radius: var(--p-radius);
	padding: 18px 18px 16px;
	box-shadow: var(--p-shadow-sm);
	display: grid;
	gap: 6px;
	align-content: start;
}
.incident-strip .status-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}
.incident-strip .status-icon {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(122, 90, 248, 0.08);
	color: var(--p-brand-900);
}
.incident-strip .status-chip {
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
	font-weight: 600;
}
.incident-strip .status-card strong {
	color: var(--p-text);
	font-size: 0.98rem;
	font-weight: 600;
}
.incident-strip .status-detail {
	color: var(--p-muted);
	font-size: 0.88rem;
	line-height: 1.4;
}

.incident-strip .status-card.severity-critical .status-chip { background: #FEE2E2; color: #B91C1C; }
.incident-strip .status-card.severity-warning .status-chip { background: #FEF3C7; color: #B45309; }
.incident-strip .status-card.severity-info .status-chip { background: #E0E7FF; color: #3730A3; }
.incident-strip .status-card.severity-success .status-chip { background: #CCFBF1; color: #0F766E; }

.incident-strip .status-card.severity-critical .status-icon { background: #FEE2E2; color: #B91C1C; }
.incident-strip .status-card.severity-warning .status-icon { background: #FEF3C7; color: #B45309; }
.incident-strip .status-card.severity-info .status-icon { background: #E0E7FF; color: #3730A3; }
.incident-strip .status-card.severity-success .status-icon { background: #CCFBF1; color: #0F766E; }

/* ──────────────────────────────────────────────────────────────
   2.8 hero-blob — abstract gradient backdrop
   ────────────────────────────────────────────────────────────── */
.hero-blob {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
}
.hero-blob--drift g {
	transform-origin: 300px 300px;
	animation: blobDrift 20s ease-in-out infinite alternate;
}
@keyframes blobDrift {
	from { transform: translate(0, 0) scale(1); }
	to { transform: translate(20px, -12px) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
	.hero-blob--drift g { animation: none; }
}
