/*
 * Shared article component library.
 *
 * The migrated posts each carried their own copy of these components inside a
 * per-post stylesheet, so a new article could not reuse them. This is the
 * curated, shared set — built from the same design tokens as the rest of the
 * site — that every article can draw on.
 *
 * Everything here is CSS-only: no charting library, no JS, no canvas. That
 * keeps articles inside the performance budget and, more importantly, keeps the
 * numbers as real text in the HTML where crawlers, screen readers and AI
 * assistants can read them — a chart drawn in canvas is invisible to all three.
 */

/* ═══════════════════════════ direct answer ═══════════════════════════ */

.tx-answer {
	background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
	border-radius: var(--radius-lg);
	padding: 24px 26px;
	margin: 0 0 30px;
}

.tx-answer-label {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .08em;
	color: var(--blue-200);
	margin-bottom: 10px;
}

.tx-answer p {
	font-size: 16px;
	line-height: 1.8;
	color: #fff;
	font-weight: 500;
	margin: 0;
}

.tx-answer strong {
	color: #fff;
	font-weight: 800;
}

/* ═══════════════════════════ callouts ═══════════════════════════ */

.tx-note,
.tx-warn,
.tx-tip {
	border-radius: var(--radius);
	padding: 16px 20px;
	margin: 24px 0;
	font-size: 14.5px;
	line-height: 1.85;
	border-inline-start: 4px solid;
}

.tx-note {
	background: var(--sky-50);
	border-color: var(--sky-500);
	color: var(--text-mid);
}

.tx-warn {
	background: #FFFBEB;
	border-color: #F59E0B;
	color: #78350F;
}

.tx-tip {
	background: #ECFDF5;
	border-color: #10B981;
	color: #065F46;
}

.tx-note-title,
.tx-warn-title,
.tx-tip-title {
	font-weight: 800;
	margin-bottom: 4px;
	display: block;
}

/* ═══════════════════════════ data table ═══════════════════════════ */

.tx-table-wrap {
	margin: 26px 0;
	overflow-x: auto; /* wide tables scroll themselves; the page never does */
	border-radius: var(--radius);
	border: 1px solid var(--blue-100);
}

.tx-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	min-width: 520px;
	background: #fff;
}

.tx-table caption {
	caption-side: top;
	text-align: start;
	padding: 12px 16px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--text-light);
	background: var(--sky-50);
}

.tx-table th {
	background: var(--blue-700);
	color: #fff;
	font-weight: 800;
	font-size: 13px;
	padding: 12px 14px;
	text-align: start;
	white-space: nowrap;
}

.tx-table td {
	padding: 12px 14px;
	border-top: 1px solid var(--blue-50);
	color: var(--text-mid);
	line-height: 1.7;
	vertical-align: top;
}

.tx-table tbody tr:nth-child(even) {
	background: #FAFCFF;
}

.tx-table td:first-child {
	font-weight: 700;
	color: var(--text-dark);
}

/* Priority chips for SLA tables. */
.tx-pr {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 800;
	white-space: nowrap;
}

.tx-pr-urgent { background: #FEE2E2; color: #991B1B; }
.tx-pr-high   { background: #FFEDD5; color: #9A3412; }
.tx-pr-med    { background: #FEF3C7; color: #854D0E; }
.tx-pr-low    { background: #DCFCE7; color: #166534; }

/* ═══════════════════════════ bar comparison ═══════════════════════════ */
/*
 * A labelled bar row. The value is text inside the DOM and the bar is a
 * background width, so the figure survives with CSS disabled.
 */

.tx-bars {
	margin: 26px 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tx-bar-row {
	display: grid;
	grid-template-columns: minmax(90px, 190px) 1fr auto;
	align-items: center;
	gap: 12px;
}

.tx-bar-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--text-dark);
	line-height: 1.4;
}

.tx-bar-track {
	background: var(--blue-50);
	border-radius: 999px;
	height: 22px;
	overflow: hidden;
}

.tx-bar-fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--blue-600), var(--sky-500));
	min-width: 3px;
}

.tx-bar-fill.is-muted {
	background: linear-gradient(90deg, #94A3B8, #CBD5E1);
}

.tx-bar-value {
	font-size: 13px;
	font-weight: 800;
	color: var(--blue-700);
	min-width: 54px;
	text-align: start;
}

/* ═══════════════════════════ process flow ═══════════════════════════ */

.tx-flow {
	margin: 26px 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.tx-flow-step {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 16px;
	position: relative;
	padding-bottom: 22px;
}

.tx-flow-step:not(:last-child)::before {
	content: "";
	position: absolute;
	inset-inline-start: 21px;
	top: 44px;
	bottom: 0;
	width: 2px;
	background: var(--blue-100);
}

.tx-flow-num {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--blue-600), var(--sky-500));
	color: #fff;
	font-weight: 900;
	font-size: 16px;
	z-index: 1;
}

.tx-flow-title {
	font-size: 15.5px;
	font-weight: 800;
	color: var(--text-dark);
	margin-bottom: 4px;
}

.tx-flow-desc {
	font-size: 14px;
	color: var(--text-mid);
	line-height: 1.8;
}

/* ═══════════════════════════ pros / cons ═══════════════════════════ */

.tx-proscons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 26px 0;
}

.tx-pros,
.tx-cons {
	border-radius: var(--radius);
	padding: 18px 20px;
	border: 1.5px solid;
}

.tx-pros { background: #F0FDF4; border-color: #BBF7D0; }
.tx-cons { background: #FEF2F2; border-color: #FECACA; }

.tx-pros-title,
.tx-cons-title {
	font-size: 14px;
	font-weight: 800;
	margin-bottom: 10px;
}

.tx-pros-title { color: #166534; }
.tx-cons-title { color: #991B1B; }

.tx-proscons ul {
	margin: 0;
	padding-inline-start: 18px;
}

.tx-proscons li {
	font-size: 13.5px;
	line-height: 1.85;
	margin-bottom: 6px;
	color: var(--text-mid);
}

/* ═══════════════════════════ checklist ═══════════════════════════ */

.tx-checklist {
	margin: 26px 0;
	padding: 20px 22px;
	background: var(--sky-50);
	border: 1px solid var(--blue-100);
	border-radius: var(--radius);
}

.tx-checklist-title {
	font-size: 15px;
	font-weight: 800;
	color: var(--text-dark);
	margin-bottom: 12px;
}

.tx-checklist ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tx-checklist li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 14px;
	color: var(--text-mid);
	line-height: 1.8;
	padding: 7px 0;
	border-bottom: 1px dashed var(--blue-100);
}

.tx-checklist li:last-child {
	border-bottom: none;
}

.tx-checklist li::before {
	content: "✓";
	color: var(--blue-600);
	font-weight: 900;
	flex-shrink: 0;
}

/* ═══════════════════════════ KPI cards ═══════════════════════════ */

.tx-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px;
	margin: 26px 0;
}

.tx-kpi {
	background: #fff;
	border: 1.5px solid var(--blue-100);
	border-radius: var(--radius);
	padding: 18px;
	text-align: center;
	box-shadow: var(--shadow-sm);
}

.tx-kpi-num {
	font-size: 26px;
	font-weight: 900;
	color: var(--blue-700);
	line-height: 1.1;
	margin-bottom: 6px;
}

.tx-kpi-label {
	font-size: 12.5px;
	color: var(--text-light);
	font-weight: 700;
	line-height: 1.5;
}

/* ═══════════════════════════ comparison grid ═══════════════════════════ */

.tx-compare {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 26px 0;
}

.tx-compare-col {
	border: 1.5px solid var(--blue-100);
	border-radius: var(--radius);
	padding: 18px 20px;
	background: #fff;
}

.tx-compare-col.is-best {
	border-color: var(--blue-600);
	box-shadow: var(--shadow-md);
}

.tx-compare-head {
	font-size: 15px;
	font-weight: 800;
	color: var(--text-dark);
	padding-bottom: 10px;
	margin-bottom: 10px;
	border-bottom: 1px solid var(--blue-50);
}

/* ═══════════════════════════ definition ═══════════════════════════ */

.tx-defs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	margin: 26px 0;
}

.tx-def {
	background: #fff;
	border: 1.5px solid var(--blue-100);
	border-radius: var(--radius);
	padding: 18px;
}

.tx-def-term {
	font-size: 14.5px;
	font-weight: 800;
	color: var(--blue-700);
	margin-bottom: 6px;
}

.tx-def-en {
	font-size: 11.5px;
	color: var(--text-light);
	font-weight: 600;
	direction: ltr;
	text-align: start;
	margin-bottom: 8px;
}

.tx-def-desc {
	font-size: 13.5px;
	color: var(--text-mid);
	line-height: 1.8;
}

/* ═══════════════════════════ responsive ═══════════════════════════ */

@media (max-width: 640px) {
	.tx-proscons,
	.tx-compare {
		grid-template-columns: 1fr;
	}

	.tx-bar-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.tx-bar-value {
		text-align: end;
	}
}
