.rp-articles-widget {
	position: relative;
	width: 100%;
	max-width: 100%;
	isolation: isolate;
	display: flow-root;
}

.rp-articles-toolbar {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 24px;
	width: 100%;
}

.rp-articles-body {
	display: flex;
	align-items: flex-start;
	gap: 40px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.rp-articles-results {
	flex: 1 1 0%;
	min-width: 0;
	width: 100%;
}

.rp-articles-row {
	width: 100%;
}

.rp-articles-count {
	margin-left: auto;
	font-family: Ubuntu, sans-serif;
	font-size: 15px;
	color: #1f2937;
}

.rp-count-number {
	font-weight: 700;
}

.rp-open-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #38B44A;
	color: #fff;
	border: none;
	padding: 12px 20px;
	font-family: Ubuntu, sans-serif;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s ease;
}

.rp-open-filter-btn:hover,
.rp-open-filter-btn:focus {
	background: linear-gradient(265.11deg, #3AAA35 -25.64%, #00ADEE 56.75%, #3AAA35 133.04%);
}

.rp-clear-filters {
	display: none;
	align-items: center;
	align-self: center;
	gap: 6px;
	background: none;
	border: none;
	color: rgba(69, 111, 130, 1);
	font-family: Ubuntu, sans-serif;
	font-size: 15px;
	text-decoration: underline;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	margin: 0;
}

/* Clear Filters + Results count only appear once the filter panel is open */
.rp-articles-widget.filters-open .rp-clear-filters {
	display: inline-flex;
	align-items: center;
}

/* Inline filter sidebar (not an overlay) — hidden until "Open Filter" is clicked */
.rp-filter-panel {
	display: none;
	flex: 0 0 280px;
	border-right: 1px solid #ebebeb;
	padding-right: 30px;
}

.rp-articles-widget.filters-open .rp-filter-panel {
	display: block;
}

.rp-filter-group {
	margin-bottom: 28px;
}

.rp-filter-group h4 {
	font-family: Ubuntu, sans-serif;
	font-size: 20px;
	font-weight: 500;
	color: #1f2937;
	margin: 0 0 14px;
}

.rp-filter-options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.rp-filter-chip {
	position: relative;
}

.rp-filter-chip input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.rp-filter-chip span {
	display: inline-block;
	padding: 10px 18px;
	border: 1px solid #d1d5db;
	font-family: Ubuntu, sans-serif;
	font-size: 14px;
	color: #1f2937;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rp-filter-chip input:checked + span {
	background: #38B44A;
	border-color: #38B44A;
	color: #fff;
}

/* Year grouping */
.rp-articles-year-heading {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 30px 0 16px;
}

.rp-articles-year-heading span {
	font-family: Ubuntu, sans-serif;
	font-size: 16px;
	color: #9ca3af;
	white-space: nowrap;
}

.rp-articles-year-heading::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #e5e7eb;
}

.rp-articles-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.rp-article-card {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	text-decoration: none;
	background: #ebebeb;
}

.rp-article-image {
	position: relative;
	width: 100%;
	height: 100%;
}

.rp-article-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.25s ease;
}

/* On hover the photo fades out, revealing the plain grey card background behind it */
.rp-article-card:hover .rp-article-image img {
	opacity: 0;
}

.rp-article-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 16px;
	background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0.35) 100%);
}

.rp-article-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.rp-article-label {
	font-family: Ubuntu, sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #fff;
}

.rp-article-date {
	font-family: Ubuntu, sans-serif;
	font-size: 12px;
	color: rgba(255,255,255,0.8);
}

.rp-article-bottom {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rp-article-title {
	font-family: Ubuntu, sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: #fff;
	margin: 0;
	line-height: 1.35;
}

.rp-article-overlay {
	transition: background 0.25s ease;
}

.rp-article-label,
.rp-article-date,
.rp-article-title {
	transition: color 0.25s ease;
}

.rp-article-readmore {
	display: inline-flex;
	align-self: flex-start;
	background: #38B44A;
	color: #fff;
	font-family: Ubuntu, sans-serif;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 14px;
}

/* Once the photo fades out on hover, switch overlay + text to dark
   so the badge/title/date stay readable against the plain grey card */
.rp-article-card:hover .rp-article-overlay {
	background: none;
}

.rp-article-card:hover .rp-article-label,
.rp-article-card:hover .rp-article-date,
.rp-article-card:hover .rp-article-title {
	color: #1f2937;
}

.rp-articles-empty {
	font-family: Ubuntu, sans-serif;
	color: #6b7280;
}

@media (max-width: 1024px) {
	.rp-articles-row {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 782px) {
	.rp-articles-body {
		flex-direction: column;
	}
	.rp-filter-panel {
		flex: none;
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #ebebeb;
		padding-right: 0;
		padding-bottom: 20px;
		margin-bottom: 20px;
	}
}

@media (max-width: 600px) {
	.rp-articles-row {
		grid-template-columns: 1fr;
	}
	.rp-articles-toolbar {
		flex-wrap: wrap;
	}
	.rp-articles-count {
		margin-left: 0;
		width: 100%;
	}
}
