/**
 * EHRG News Clippings grid styles.
 * Scoped under .ehrg-clippings so they will not leak into the rest of the theme.
 */

.ehrg-clippings {
	--ehrg-gap: 20px;
	--ehrg-radius: 10px;
	--ehrg-border: #e2e5e9;
	--ehrg-ink: #1f2937;
	--ehrg-muted: #6b7280;
	--ehrg-accent: #16603a; /* Muted green, in keeping with an environmental group. */
	--ehrg-accent-ink: #ffffff;
	margin: 1.5rem 0;
}

/* Filter bar */
.ehrg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 16px;
}
.ehrg-filters .ehrg-search {
	flex: 1 1 220px;
	min-width: 180px;
	min-height: 44px;          /* accessible tap target */
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid var(--ehrg-border);
	border-radius: 8px;
	font-size: 15px;
}
.ehrg-filters select {
	min-height: 44px;          /* accessible tap target */
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid var(--ehrg-border);
	border-radius: 8px;
	font-size: 15px;
	background: #fff;
}
.ehrg-reset {
	min-height: 44px;          /* accessible tap target */
	padding: 9px 16px;
	border: 1px solid var(--ehrg-border);
	border-radius: 8px;
	background: #f3f4f6;
	cursor: pointer;
	font-size: 14px;
}
.ehrg-reset:hover { background: #e5e7eb; }

.ehrg-count {
	margin: 0 0 14px;
	color: var(--ehrg-muted);
	font-size: 14px;
}

/* Grid */
.ehrg-grid {
	display: grid;
	gap: var(--ehrg-gap);
	grid-template-columns: repeat(3, 1fr);
}
.ehrg-clippings[data-columns="2"] .ehrg-grid { grid-template-columns: repeat(2, 1fr); }
.ehrg-clippings[data-columns="4"] .ehrg-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.ehrg-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
	.ehrg-grid { grid-template-columns: 1fr !important; }
}

/* Card */
.ehrg-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--ehrg-border);
	border-radius: var(--ehrg-radius);
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ehrg-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}
.ehrg-card.is-hidden { display: none; }

.ehrg-card-media {
	background: #f3f4f6;
	min-height: 180px;          /* floor so small logos still have presence */
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
/*
 * Show the whole image, never cropped. Large clippings (newspaper front pages)
 * scale down to fill the card's width and stay legible; smaller images such as
 * outlet logos display at their natural size, centered, without upscaling.
 */
.ehrg-card-media img {
	max-width: 100%;
	width: auto;
	height: auto;
	display: block;
}
.ehrg-card-media--empty::after {
	content: "";
	width: 46px;
	height: 46px;
	border: 3px solid #d1d5db;
	border-radius: 6px;
}

.ehrg-card-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
	flex: 1 1 auto;
}
.ehrg-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.ehrg-badge {
	display: inline-block;
	background: #eef2f0;
	color: var(--ehrg-accent);
	font-size: 12px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 999px;
}
.ehrg-date {
	color: var(--ehrg-muted);
	font-size: 12px;
}
.ehrg-card-title {
	margin: 0;
	font-size: 16px;
	line-height: 1.35;
	color: var(--ehrg-ink);
}
.ehrg-card-actions {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 6px;
}
.ehrg-btn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;          /* accessible tap target */
	box-sizing: border-box;
	padding: 8px 15px;
	border-radius: 8px;
	background: var(--ehrg-accent);
	color: var(--ehrg-accent-ink);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
}
.ehrg-btn:hover { opacity: 0.92; color: var(--ehrg-accent-ink); }
.ehrg-btn--secondary {
	background: #fff;
	color: var(--ehrg-accent);
	border: 1px solid var(--ehrg-accent);
}
.ehrg-btn--secondary:hover { background: #f3f6f4; color: var(--ehrg-accent); }

/* Visible keyboard focus (WCAG 2.4.7), in case the theme provides none. */
.ehrg-btn:focus-visible,
.ehrg-search:focus-visible,
.ehrg-filters select:focus-visible,
.ehrg-reset:focus-visible,
.ehrg-card a:focus-visible {
	outline: 3px solid var(--ehrg-accent);
	outline-offset: 2px;
}

.ehrg-empty {
	color: var(--ehrg-muted);
	font-style: italic;
}

.ehrg-no-results {
	color: var(--ehrg-muted);
	padding: 24px 0;
}
