/* Podcast Grid — frontend
   Alles gescoped onder .pg, zodat het thema niets merkt en andersom.
   Kleuren via CSS-variabelen: overschrijf ze in Extra CSS. */

.pg {
	--pg-accent: #1db954;
	--pg-columns: 3;
	--pg-card-bg: #ffffff;
	--pg-border: rgba(0, 0, 0, 0.1);
	--pg-muted: rgba(0, 0, 0, 0.55);
	--pg-radius: 12px;
	--pg-gap: 24px;

	margin: 0 0 2em;
}

.pg *,
.pg *::before,
.pg *::after {
	box-sizing: border-box;
}

.pg .pg-heading {
	margin: 0 0 0.8em;
}

/* ---------- Zoeken ---------- */

.pg .pg-zoekbalk {
	margin: 0 0 1.5em;
	max-width: 480px;
}

.pg .pg-zoekbalk[hidden] {
	display: none;
}

.pg .pg-zoek-label {
	display: block;
	margin-bottom: 0.35em;
	font-weight: 600;
}

.pg .pg-zoek-veld {
	position: relative;
}

.pg .pg-zoek-invoer {
	width: 100%;
	padding: 0.7em 2.4em 0.7em 1em;
	font: inherit;
	color: inherit;
	background: var(--pg-card-bg);
	border: 1px solid var(--pg-border);
	border-radius: 999px;
	-webkit-appearance: none;
	appearance: none;
}

.pg .pg-zoek-invoer:focus {
	outline: 2px solid var(--pg-accent);
	outline-offset: 1px;
	border-color: var(--pg-accent);
}

/* Het eigen kruisje van de browser weg; we hebben een eigen knop. */
.pg .pg-zoek-invoer::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.pg .pg-zoek-wis {
	position: absolute;
	top: 50%;
	right: 0.5em;
	transform: translateY(-50%);
	width: 1.8em;
	height: 1.8em;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pg-muted);
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
}

.pg .pg-zoek-wis:hover,
.pg .pg-zoek-wis:focus {
	background: var(--pg-border);
	color: inherit;
}

.pg .pg-zoek-wis[hidden] {
	display: none;
}

.pg .pg-zoek-telling {
	margin: 0.5em 0 0;
	min-height: 1.4em;
	font-size: 0.9em;
	color: var(--pg-muted);
}

.pg .pg-geen-resultaat {
	margin: 1.5em 0 0;
	padding: 1em 1.2em;
	border: 1px dashed var(--pg-border);
	border-radius: var(--pg-radius);
	color: var(--pg-muted);
	text-align: center;
}

.pg .pg-geen-resultaat[hidden] {
	display: none;
}

/* Een verborgen kaart mag geen lege plek in het raster achterlaten. */
.pg .pg-card[hidden] {
	display: none;
}

.pg .pg-grid {
	display: grid;
	grid-template-columns: repeat(var(--pg-columns), minmax(0, 1fr));
	gap: var(--pg-gap);
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pg .pg-card {
	display: flex;
	flex-direction: column;
	background: var(--pg-card-bg);
	border: 1px solid var(--pg-border);
	border-radius: var(--pg-radius);
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.pg .pg-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.pg .pg-media {
	margin: 0;
	line-height: 0;
	background: rgba(0, 0, 0, 0.04);
}

.pg .pg-media a {
	display: block;
}

/* Podcast-artwork is vierkant; zo blijft het hele plaatje heel. */
.pg .pg-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

.pg .pg-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 18px 20px 20px;
}

.pg .pg-title {
	margin: 0 0 0.35em;
	font-size: 1.05em;
	line-height: 1.35;
}

.pg .pg-title a {
	color: inherit;
	text-decoration: none;
}

.pg .pg-title a:hover,
.pg .pg-title a:focus {
	text-decoration: underline;
}

.pg .pg-meta {
	margin: 0 0 0.6em;
	font-size: 0.85em;
	line-height: 1.4;
	color: var(--pg-muted);
}

.pg .pg-sep {
	margin: 0 0.4em;
}

.pg .pg-text {
	flex: 1 1 auto;
	margin: 0;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.pg .pg-more {
	margin: 1em 0 0;
}

.pg .pg-link,
.pg .pg-all-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
}

.pg .pg-link {
	color: var(--pg-accent);
}

.pg .pg-link:hover,
.pg .pg-link:focus {
	text-decoration: underline;
}

.pg .pg-icon {
	flex: 0 0 auto;
}

.pg .pg-all {
	margin: 1.5em 0 0;
	text-align: center;
}

.pg .pg-all-link {
	padding: 0.65em 1.3em;
	border-radius: 999px;
	background: var(--pg-accent);
	color: #fff;
	line-height: 1.2;
}

.pg .pg-all-link:hover,
.pg .pg-all-link:focus {
	filter: brightness(0.92);
	color: #fff;
}

.pg .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pg-hint {
	padding: 12px 16px;
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 8px;
	color: rgba(0, 0, 0, 0.6);
	font-size: 0.9em;
}

/* Responsief */
@media (max-width: 900px) {
	.pg .pg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pg-cols-1 .pg-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.pg .pg-grid {
		grid-template-columns: 1fr;
	}
}

/* Donkere weergave, als het besturingssysteem daarom vraagt. */
@media (prefers-color-scheme: dark) {
	.pg:not(.pg-force-light) {
		--pg-card-bg: #1e1f22;
		--pg-border: rgba(255, 255, 255, 0.14);
		--pg-muted: rgba(255, 255, 255, 0.6);
	}

	.pg:not(.pg-force-light) .pg-media {
		background: rgba(255, 255, 255, 0.06);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pg .pg-card {
		transition: none;
	}
}
