/*
 * Indicator list block (template-parts/blocks/indicator-list.php)
 *
 * Loaded wherever the block is used, in the editor as well as on the site.
 * Card look of the dashboard panels (public/css/dashboard.css), with the
 * teal top border.
 */

.indicator-list {
	position: relative;
	background: #fff;
	border-top: 3px solid #1d97a8;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	color: #1d1d1b;
	padding: 18px 18px 12px;
}

.indicator-list__icon {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.indicator-list__label {
	color: #1a98a8;
	font-size: 0.75rem;
	line-height: 1.3;
	margin: 0 0 2px;
	padding-right: 32px; /* room for the icon */
}

.indicator-list__title {
	color: #000;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.25;
	text-transform: uppercase;
	margin: 0 0 12px;
	padding-right: 32px;
}

/*
 * Indicator lists side by side in Columns sit closer together than other
 * columns (e.g. text and image, see public/css/topic.css).
 */
.wp-block-columns:has(> .wp-block-column > .indicator-list) {
	gap: 16px;
}

/* Rows ------------------------------------------------------------------ */

/*
 * A table-like grid shared by all rows: titles (left-aligned, taking the
 * free space) | metrics (right-aligned, as wide as the widest one, at most
 * 45%) | chevrons. Each row is a link spanning the three columns (subgrid),
 * so the columns line up across rows.
 */
.indicator-list__rows {
	display: grid;
	grid-template-columns: minmax(0, 1fr) fit-content(45%) 14px;
	column-gap: 16px;
	list-style: none;
	margin: 0 -8px;
	padding: 0;
}

.indicator-list__rows li {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	margin: 0;
	padding: 0;
}

.indicator-list__rows li::before {
	content: none; /* no theme bullets */
}

/* Thin lines between the rows */
.indicator-list__rows li + li {
	border-top: 1px solid #ebebeb;
}

/* .indicator-list prefix: beats the theme's ".site-main li a" underline */
.indicator-list .indicator-list__row {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	align-items: center;
	padding: 7px 8px;
	color: #1d1d1b;
	font-size: 0.875rem;
	line-height: 1.35;
	text-decoration: none;
}

.indicator-list .indicator-list__row:hover,
.indicator-list .indicator-list__row:focus-visible {
	background: #e8f4f6;
	color: #1d1d1b;
	text-decoration: none;
}

/* Title: cut off with … when too long */
.indicator-list__name {
	grid-column: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.indicator-list__row:hover .indicator-list__name,
.indicator-list__row:focus-visible .indicator-list__name {
	color: #1a98a8;
}

/* Key metric: right-aligned, cut off with … when too long */
.indicator-list__metric {
	grid-column: 2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 700;
	text-align: right;
}
.indicator-list__chevron {
	grid-column: 3;
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.indicator-list__placeholder {
	margin: 0;
	padding: 24px 16px;
	background: #f2f2f2;
	color: #666;
	font-size: 0.875rem;
	text-align: center;
}
