/**
 * CA RSS Feeds — news card styles.
 *
 * UK motorway-sign theme. The card is a flex row: a solid blue LEFT RAIL
 * (a real column, not a CSS border — far more robust against theme clipping)
 * holding a small white road sign + vertical road name, then the content with
 * a blue title band (white capitals) and the labelled detail lines.
 *
 * Scoped under .tf-feed so it won't bleed into the rest of the Divi page.
 */

.tf-feed {
	--tf-gap: 16px;
	--tf-radius: 10px;
	--tf-blue: #0b4ea2;          /* UK motorway sign blue (border + rail) */
	--tf-blue-title: #1565c0;    /* slightly different blue for the title band */
	--tf-rail-width: 58px;
	--tf-bg: #ffffff;
	--tf-text: #1d2327;
	--tf-muted: #5b6b7b;

	--tf-badge-text: #e2670c;    /* planned: orange text */
	--tf-badge-bg: #dbe9fb;      /* planned: light motorway blue */
	--tf-badge-active-text: #ffffff;  /* active: white text */
	--tf-badge-active-bg: #c62828;    /* active: urgent red */

	display: flex;
	flex-direction: column;
	gap: var(--tf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Card is a flex ROW: [ blue rail ][ content ] */
.tf-card {
	display: flex;
	align-items: stretch;
	border: 2px solid var(--tf-blue);
	border-radius: var(--tf-radius);
	background: var(--tf-bg);
	color: var(--tf-text);
	overflow: hidden;
}

/* Solid blue left rail — a real column, holds the sign + vertical name */
.tf-card__rail {
	flex: 0 0 var(--tf-rail-width);
	width: var(--tf-rail-width);
	background: var(--tf-blue);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
}
.tf-card__sign {
	width: 40px;
	height: 32px;
	border-radius: 5px;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tf-blue);
	font-weight: 800;
	font-size: 0.82rem;
	line-height: 1;
}
.tf-card__rail-text {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tf-card__rail-text span {
	writing-mode: vertical-rl;
	color: #ffffff;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Content column */
.tf-card__main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* Title band: its own blue bar, white capitals */
.tf-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	background: var(--tf-blue-title);
	padding: 10px 16px;
}
.tf-card__title {
	font-weight: 700;
	font-size: 1.0rem;
	line-height: 1.3;
	margin: 0;
	text-transform: uppercase;
}
.tf-card__title a {
	color: #ffffff;
	text-decoration: none;
}
.tf-card__title a:hover { text-decoration: underline; }

.tf-card__body {
	padding: 14px 16px 16px;
}

/* Status keyword — larger; planned is calm, active is urgent */
.tf-badge {
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 4px 12px;
	border-radius: 999px;
	white-space: nowrap;
}
.tf-badge--planned { color: var(--tf-badge-text); background: var(--tf-badge-bg); }
.tf-badge--active  { color: var(--tf-badge-active-text); background: var(--tf-badge-active-bg); }

/* Active cards also get a subtle red cue on the rail sign for at-a-glance urgency */
.tf-card--active .tf-card__rail { background: #a51f1f; }

.tf-card__time {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}
/* Black rounded timestamp pill, time emphasised, date quieter */
.tf-stamp {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	background: #14181f;
	color: #ffffff;
	padding: 5px 12px;
	border-radius: 999px;
	line-height: 1;
}
.tf-stamp__clock { color: #ffffff; align-self: center; opacity: 0.85; }
.tf-stamp__time {
	font-size: 1.02rem;
	font-weight: 800;
	letter-spacing: 0.01em;
}
.tf-stamp__date {
	font-size: 0.78rem;
	font-weight: 600;
	color: #c4ccd6;
}
.tf-card__cat {
	font-size: 0.74rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tf-blue);
	background: #eaf1fb;
	padding: 2px 8px;
	border-radius: 4px;
}

.tf-fields {
	margin: 0;
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 14px;
	font-size: 0.94rem;
}
.tf-fields dt { color: var(--tf-blue); font-weight: 700; }
.tf-fields dd { margin: 0; color: var(--tf-text); }

.tf-card__desc {
	margin: 4px 0 0;
	font-size: 0.94rem;
	color: var(--tf-text);
	line-height: 1.5;
}

.tf-empty {
	color: var(--tf-muted);
	font-style: italic;
	padding: 12px 0;
}

@media (max-width: 600px) {
	.tf-feed { --tf-rail-width: 46px; }
	.tf-card__sign { width: 32px; height: 26px; font-size: 0.7rem; }
	.tf-card__rail-text span { font-size: 0.72rem; letter-spacing: 0.06em; }
}
@media (max-width: 480px) {
	.tf-fields { grid-template-columns: 1fr; gap: 0; }
	.tf-fields dt { margin-top: 8px; }
}

/* ---- Search page ---- */
.tf-search { margin: 0; }
.tf-search__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	background: #f0f4f9;
	border: 1px solid #d4def0;
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 16px;
}
.tf-filter { display: flex; flex-direction: column; gap: 4px; }
.tf-filter label {
	font-size: 0.78rem;
	font-weight: 700;
	color: #0b4ea2;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.tf-filter select {
	font-size: 0.92rem;
	padding: 7px 10px;
	border: 1px solid #b9c6dd;
	border-radius: 7px;
	background: #fff;
	color: #1d2327;
	min-width: 150px;
}
.tf-filter--reset { margin-left: auto; }
.tf-reset {
	font-size: 0.88rem;
	font-weight: 700;
	padding: 8px 16px;
	border: 1px solid #0b4ea2;
	border-radius: 7px;
	background: #fff;
	color: #0b4ea2;
	cursor: pointer;
}
.tf-reset:hover { background: #0b4ea2; color: #fff; }
.tf-search__count {
	display: inline-block;
	font-size: 0.92rem;
	font-weight: 700;
	color: #ffffff;
	background: #1e8e3e;
	padding: 7px 14px;
	border-radius: 7px;
	margin: 0 0 14px;
}
.tf-search__count:empty { display: none; }

@media (max-width: 600px) {
	.tf-filter select { min-width: 0; width: 100%; }
	.tf-filter { flex: 1 1 45%; }
	.tf-filter--reset { flex: 1 1 100%; margin-left: 0; }
	.tf-reset { width: 100%; }
}

/* ---- Search pagination ---- */
.tf-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin-top: 20px;
}
.tf-page {
	min-width: 40px;
	padding: 8px 12px;
	font-size: 0.9rem;
	font-weight: 700;
	border: 1px solid #b9c6dd;
	border-radius: 7px;
	background: #fff;
	color: #0b4ea2;
	cursor: pointer;
	line-height: 1;
}
.tf-page:hover:not(:disabled) { background: #eaf1fb; }
.tf-page--active {
	background: #0b4ea2;
	border-color: #0b4ea2;
	color: #fff;
	cursor: default;
}
.tf-page--nav { color: #0b4ea2; }
.tf-page:disabled { opacity: 0.4; cursor: default; }
