/* ==========================================================================
   Strate Transition Status

   Every colour below was sampled directly from the approved design, not
   estimated. All tokens live in the block at the top: to restyle, override
   these in the theme stylesheet rather than editing this file, so a plugin
   update doesn't overwrite the change.

   Sharp-cornered house style: set --sts-radius and --sts-radius-sm to 0.
   ========================================================================== */

.sts {
	/* Brand */
	--sts-purple: #5d2575;          /* table header, Overall row text */
	--sts-purple-deep: #541d82;     /* combined pill */
	--sts-ink: #2f2a33;
	--sts-muted: #6b6470;

	/* Surfaces */
	--sts-surface: #f9faf9;
	--sts-overall-bg: #f2eff5;
	--sts-line: #e9e9ec;
	--sts-card-line: #eef0ef;

	/* Accent families: pill background, big-number text, icon disc */
	--sts-rust: #be3f21;
	--sts-rust-text: #c14225;
	--sts-rust-tint: #f4e4d9;

	--sts-teal: #367b7d;
	--sts-teal-text: #387d88;
	--sts-teal-tint: #e2ecec;

	--sts-gold: #c88c31;
	--sts-gold-text: #a67626;
	--sts-gold-tint: #f5eee1;

	--sts-plum-text: #612475;
	--sts-plum-tint: #e5e3e8;

	--sts-combined-text: #602572;
	--sts-combined-tint: #f4edf8;

	/* Shape */
	--sts-radius: 14px;
	--sts-radius-sm: 10px;

	/* Type. Defaults to the surrounding page so the component always sits
	   naturally in the theme. To pin it to the brand face instead, set:
	   --sts-font: "Source Sans Pro", sans-serif; */
	--sts-font: inherit;

	font-family: var(--sts-font);
	color: var(--sts-ink);
	line-height: 1.4;
	container-type: inline-size;
}

.sts *,
.sts *::before,
.sts *::after {
	box-sizing: border-box;
}

/* --- Date and status lines ------------------------------------------------ */

.sts .sts__date {
	margin: 0 0 1.25rem;
	font-size: 1.375rem;
	font-weight: 400;
	color: var(--sts-ink);
}

.sts .sts__stale {
	margin: 0 0 1.25rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--sts-gold);
	background: var(--sts-gold-tint);
	border-radius: var(--sts-radius-sm);
	font-size: 0.9375rem;
	color: #6d5313;
}

/* --- Table ----------------------------------------------------------------
   Selectors are doubled up (.sts .sts__table th) and the commonly themed
   properties are all set explicitly, so an existing theme's table styles
   can't leak in and shift the design.
   -------------------------------------------------------------------------- */

.sts .sts__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--sts-radius);
}

.sts .sts__caption {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.sts .sts__table {
	width: 100%;
	min-width: 760px;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--sts-surface);
	border-radius: var(--sts-radius);
	overflow: hidden;
	font-size: 1rem;
	table-layout: auto;
}

/* Header: flat purple across the full width — the design has no gradient. */

.sts .sts__table thead th {
	background: var(--sts-purple);
	color: #fff;
	font-weight: 600;
	font-size: 1rem;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	padding: 1.125rem 1.25rem;
	vertical-align: middle;
	border: 0;
}

.sts .sts__th {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

.sts .sts__th > span {
	min-width: 0;
}

/* Body: uniform row colour, separated only by a hairline divider.
   The design has no zebra striping. */

.sts .sts__table tbody th,
.sts .sts__table tbody td {
	padding: 1.0625rem 1.25rem;
	border: 0;
	border-bottom: 1px solid var(--sts-line);
	background: var(--sts-surface);
	color: var(--sts-ink);
	font-size: 1rem;
	font-weight: 400;
	text-align: left;
	text-transform: none;
	vertical-align: middle;
}

.sts .sts__rowhead {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 500;
	color: var(--sts-ink);
}

.sts .sts__rowicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--sts-combined-tint);
	color: var(--sts-purple);
}

.sts .sts__count {
	font-variant-numeric: tabular-nums;
}

.sts .sts__pct {
	color: var(--sts-muted);
	font-variant-numeric: tabular-nums;
}

.sts .sts__nil {
	color: var(--sts-muted);
}

/* Overall row */

.sts .sts__table tfoot th,
.sts .sts__table tfoot td {
	padding: 1.0625rem 1.25rem;
	border: 0;
	background: var(--sts-overall-bg);
	color: var(--sts-purple);
	font-weight: 700;
	font-size: 1.0625rem;
	text-align: left;
	vertical-align: middle;
}

.sts .sts__overall .sts__rowhead {
	color: var(--sts-purple);
	font-weight: 700;
}

.sts .sts__overall .sts__rowicon {
	background: #e3d9ea;
}

.sts .sts__overall .sts__pct {
	color: var(--sts-purple);
	font-weight: 700;
}

/* --- Cards ---------------------------------------------------------------- */

.sts .sts__cards {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.sts .sts__cards > li::before,
.sts .sts__cards > li::marker {
	content: none;
}

.sts .sts__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.5rem;
	margin: 0;
	padding: 1.5rem 1rem 1.25rem;
	background: var(--sts-surface);
	border: 1px solid var(--sts-card-line);
	border-radius: var(--sts-radius);
}

.sts .sts__cardicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	margin-bottom: 0.25rem;
}

.sts .sts__value {
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
}

.sts .sts__label {
	font-size: 0.9375rem;
	color: var(--sts-ink);
	max-width: 12rem;
	flex: 1 1 auto;
}

.sts .sts__pill {
	display: inline-block;
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	color: #fff;
	font-weight: 700;
	font-size: 1.0625rem;
	font-variant-numeric: tabular-nums;
}

/* Card tones */

.sts .sts__card--rust .sts__cardicon { background: var(--sts-rust-tint); color: var(--sts-rust); }
.sts .sts__card--rust .sts__value    { color: var(--sts-rust-text); }
.sts .sts__card--rust .sts__pill     { background: var(--sts-rust); }

.sts .sts__card--teal .sts__cardicon { background: var(--sts-teal-tint); color: var(--sts-teal); }
.sts .sts__card--teal .sts__value    { color: var(--sts-teal-text); }
.sts .sts__card--teal .sts__pill     { background: var(--sts-teal); }

.sts .sts__card--gold .sts__cardicon { background: var(--sts-gold-tint); color: var(--sts-gold-text); }
.sts .sts__card--gold .sts__value    { color: var(--sts-gold-text); }
.sts .sts__card--gold .sts__pill     { background: var(--sts-gold); }

.sts .sts__card--plum .sts__cardicon { background: var(--sts-plum-tint); color: var(--sts-plum-text); }
.sts .sts__card--plum .sts__value    { color: var(--sts-plum-text); }

.sts .sts__card--purple .sts__cardicon { background: var(--sts-combined-tint); color: var(--sts-combined-text); }
.sts .sts__card--purple .sts__value    { color: var(--sts-combined-text); }
.sts .sts__card--purple .sts__pill     { background: var(--sts-purple-deep); }

/* --- Footnote ------------------------------------------------------------- */

.sts .sts__note {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1rem 0 0;
	padding: 1rem 1.25rem;
	background: var(--sts-surface);
	border: 1px solid var(--sts-card-line);
	border-radius: var(--sts-radius);
	font-size: 0.9375rem;
	color: var(--sts-ink);
}

.sts .sts__note .sts-icon {
	flex: 0 0 auto;
	color: var(--sts-purple);
}

/* --- Icons ---------------------------------------------------------------- */

.sts .sts-icon {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
	flex: 0 0 auto;
	max-width: none;
}

.sts .sts-icon--head { width: 1.625rem; height: 1.625rem; }
.sts .sts-icon--row  { width: 1.125rem; height: 1.125rem; }
.sts .sts-icon--card { width: 2rem; height: 2rem; }
.sts .sts-icon--note { width: 1.375rem; height: 1.375rem; }

/* --- Empty state ---------------------------------------------------------- */

.sts--empty p {
	margin: 0;
	padding: 1.25rem;
	background: var(--sts-surface);
	border: 1px dashed var(--sts-line);
	border-radius: var(--sts-radius);
	color: var(--sts-muted);
}

/* --- Admin screen --------------------------------------------------------- */

.sts-admin__field {
	margin: 0 0 1rem;
}

.sts-admin__field input[type="date"] {
	padding: 0.25rem 0.5rem;
	font-size: 14px;
}

.sts-admin__table {
	margin-bottom: 0.75rem;
}

.sts-admin__table input[type="number"] {
	width: 8rem;
	text-align: right;
}

.sts-admin__table th {
	font-weight: 600;
}

/* --- Responsive ----------------------------------------------------------- */

@container (max-width: 1080px) {
	.sts .sts__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container (max-width: 680px) {
	.sts .sts__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sts .sts__value { font-size: 2rem; }
}

@container (max-width: 420px) {
	.sts .sts__cards { grid-template-columns: minmax(0, 1fr); }
}

@supports not (container-type: inline-size) {
	@media (max-width: 1080px) {
		.sts .sts__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	}

	@media (max-width: 680px) {
		.sts .sts__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
		.sts .sts__value { font-size: 2rem; }
	}

	@media (max-width: 420px) {
		.sts .sts__cards { grid-template-columns: minmax(0, 1fr); }
	}
}

/* --- Print ---------------------------------------------------------------- */

@media print {
	.sts .sts__scroll { overflow: visible; }
	.sts .sts__table { min-width: 0; }
	.sts .sts__card { break-inside: avoid; }
}
