/* WTS Post Grid. Matches the previous Spectra card styling; override the variables in Customizer > Additional CSS. */
.wts-grid {
	--wts-gap: 20px;
	--wts-pad: 20px;
	--wts-border: #ffffff;
	--wts-radius: 0px;
	--wts-title: 24px;
	--wts-title-lh: 36px;
	--wts-title-color: #e5e054;
	--wts-meta: 14px;
	--wts-meta-color: #ffffff;
	--wts-text: 17px;
	--wts-text-lh: 1.5;
	--wts-text-color: #ffffff;
	--wts-cta-bg: #0d8cfa;
	--wts-cta-color: #ffffff;
	--wts-cta-radius: 30px;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wts-gap);
	margin: 0 0 1.5em;
}
.wts-grid--cols-1 { grid-template-columns: minmax(0, 1fr); }
.wts-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wts-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.wts-grid--cols-3,
	.wts-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.wts-grid--cols-2,
	.wts-grid--cols-3,
	.wts-grid--cols-4 { grid-template-columns: minmax(0, 1fr); }
}

.wts-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--wts-pad);
	border: 1px solid var(--wts-border);
	border-radius: var(--wts-radius);
	background: transparent;
	color: var(--wts-text-color);
}

/* Image sits flush with the card edges, at its natural aspect ratio */
.wts-card__media {
	display: block;
	margin: calc(-1 * var(--wts-pad)) calc(-1 * var(--wts-pad)) 15px;
	overflow: hidden;
	background: rgba(127, 127, 127, 0.12);
}
.wts-card__img {
	display: block;
	width: 100%;
	height: auto;
}

.wts-card__title {
	font-size: var(--wts-title);
	line-height: var(--wts-title-lh);
	font-weight: 400;
	margin: 0;
	padding: 0 0 15px;
	color: var(--wts-title-color);
}
.wts-card__title a {
	color: inherit;
	text-decoration: none;
}
.wts-card__title a:hover,
.wts-card__title a:focus { text-decoration: underline; }

.wts-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 10px;
	padding: 0 0 15px;
	font-size: var(--wts-meta);
	font-weight: 500;
	color: var(--wts-meta-color);
}
.wts-card__meta a {
	color: inherit;
	text-decoration: none;
}
.wts-card__meta a:hover { text-decoration: underline; }
.wts-card__author,
.wts-card__date {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.wts-icon { flex: none; }

.wts-card__excerpt {
	margin: 0;
	padding: 0 0 15px;
	font-size: var(--wts-text);
	line-height: var(--wts-text-lh);
	color: var(--wts-text-color);
}

.wts-card__cta { margin-top: auto; }
.wts-grid .wts-card__more,
.wts-grid .wts-card__more:visited {
	display: inline-block;
	padding: 10px 20px;
	background: var(--wts-cta-bg);
	color: var(--wts-cta-color);
	border-radius: var(--wts-cta-radius);
	font-size: var(--wts-text);
	font-weight: 700;
	text-decoration: none;
}
.wts-grid .wts-card__more:hover,
.wts-grid .wts-card__more:focus {
	color: var(--wts-cta-color);
	filter: brightness(1.1);
	text-decoration: none;
}

.wts-grid__more {
	margin: -0.5em 0 2em;
	font-weight: 600;
}

/* Filter bar: buttons and region selector in one centred row, styled like the tab buttons */
.wts-filter {
	--wts-btn-bg: #b8323c;
	--wts-btn-color: #ffffff;
	--wts-btn-active-bg: #0d8cfa;
	--wts-btn-active-color: #ffffff;
	--wts-btn-radius: 6px;
	--wts-btn-size: 1rem;
	--wts-btn-pad: 12px 22px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 0 1.5em;
}
.wts-filter__types {
	display: contents;
}
.wts-filter .wts-filter__type,
.wts-filter .wts-filter__type:visited {
	display: inline-block;
	padding: var(--wts-btn-pad);
	background: var(--wts-btn-bg);
	color: var(--wts-btn-color);
	border: 0;
	border-radius: var(--wts-btn-radius);
	font-size: var(--wts-btn-size);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: filter 0.15s ease;
}
.wts-filter .wts-filter__type:hover,
.wts-filter .wts-filter__type:focus {
	color: var(--wts-btn-color);
	filter: brightness(1.12);
	text-decoration: none;
}
.wts-filter .wts-filter__type.is-active,
.wts-filter .wts-filter__type.is-active:hover {
	background: var(--wts-btn-active-bg);
	color: var(--wts-btn-active-color);
}

/* Region selector: a styled span shows the current choice; the real select is invisible on top */
.wts-filter__region {
	position: relative;
	display: inline-block;
}
.wts-filter__fake {
	display: inline-block;
	padding: var(--wts-btn-pad);
	padding-right: 44px;
	background-color: var(--wts-btn-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff'%3E%3Cpath d='M5 7.5l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px 16px;
	color: var(--wts-btn-color);
	border-radius: var(--wts-btn-radius);
	font-size: var(--wts-btn-size);
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}
.wts-filter__region.has-region .wts-filter__fake { background-color: var(--wts-btn-active-bg); }
.wts-filter__region:hover .wts-filter__fake { filter: brightness(1.12); }
.wts-filter__select {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	font: inherit;
}
.wts-filter__select:focus-visible + .wts-filter__fake,
.wts-filter__region:focus-within .wts-filter__fake { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 640px) {
	.wts-filter { gap: 8px; }
	.wts-filter__type { padding: 10px 14px; font-size: 0.92rem; }
	.wts-filter__region { width: 100%; }
	.wts-filter__fake { display: block; width: 100%; text-align: center; }
}

/* Pagination */
.wts-pages {
	--wts-btn-bg: #b8323c;
	--wts-btn-color: #ffffff;
	--wts-btn-active-bg: #0d8cfa;
	--wts-btn-radius: 6px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin: 0 0 2em;
	font-size: 1rem;
}
.wts-pages__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.wts-pages .wts-pages__num,
.wts-pages .wts-pages__num:visited {
	display: inline-block;
	min-width: 42px;
	padding: 9px 12px;
	background: var(--wts-btn-bg, #b8323c);
	color: var(--wts-btn-color, #fff);
	border-radius: var(--wts-btn-radius, 6px);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	line-height: 1.2;
}
.wts-pages .wts-pages__num:hover { filter: brightness(1.12); color: var(--wts-btn-color, #fff); }
.wts-pages .wts-pages__num.is-current { background: var(--wts-btn-active-bg, #0d8cfa); }
.wts-pages .wts-pages__num.is-disabled { opacity: 0.35; pointer-events: none; }
.wts-pages__prev,
.wts-pages__next { padding-left: 18px !important; padding-right: 18px !important; }
.wts-pages__gap { padding: 0 4px; opacity: 0.7; }
.wts-pages__jump {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}
.wts-pages__jump input {
	width: 4.5em;
	padding: 8px 10px;
	border: 1px solid rgba(127, 127, 127, 0.5);
	border-radius: var(--wts-btn-radius, 6px);
	font: inherit;
	text-align: center;
}
.wts-pages__jump button {
	padding: 9px 16px;
	background: var(--wts-btn-active-bg, #0d8cfa);
	color: #fff;
	border: 0;
	border-radius: var(--wts-btn-radius, 6px);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.wts-grid__empty { margin: 1em 0 2em; }
@media (max-width: 640px) {
	.wts-pages { justify-content: center; }
}

/* Region / section banner */
.wts-banner { margin: 0 0 1.5em; }
.wts-banner img { max-width: 100%; height: auto; }
