/**
 * JV Projecten – structurele styling voor grid, filterbalk, galerij en projectgegevens.
 * Kleuren en typografie komen uit de Elementor-widgetcontrols; hier staan alleen
 * neutrale fallbacks. Kolommen en tussenruimte via CSS custom properties:
 *   --jv-cols-desktop / --jv-cols-tablet / --jv-cols-mobile / --jv-gap
 * Elementor zet --jv-cols en --jv-gap direct per breakpoint (hogere specificiteit).
 */

/* ------------------------------------------------------------------
 * Basis en responsive kolommen
 * ---------------------------------------------------------------- */
.jv-grid,
.jv-galerij {
	--jv-cols-desktop: 3;
	--jv-cols-tablet: 2;
	--jv-cols-mobile: 1;
	--jv-gap: 24px;
	--jv-row-height: 280px;
	--jv-cols: var(--jv-cols-desktop);
	display: block;
	width: 100%;
	box-sizing: border-box;
}

.jv-galerij {
	--jv-cols-mobile: 2;
	--jv-gap: 16px;
}

@media (max-width: 1024px) {
	.jv-grid,
	.jv-galerij {
		--jv-cols: var(--jv-cols-tablet);
	}
}

@media (max-width: 767px) {
	.jv-grid,
	.jv-galerij {
		--jv-cols: var(--jv-cols-mobile);
	}
}

.jv-grid *,
.jv-galerij *,
.jv-gegevens * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------
 * Grid en masonry
 * ---------------------------------------------------------------- */
.jv-grid__items,
.jv-galerij__items {
	display: grid;
	grid-template-columns: repeat(var(--jv-cols), minmax(0, 1fr));
	gap: var(--jv-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Masonry: pas actief nadat het script de spans heeft berekend. */
.jv-grid--masonry.is-layout .jv-grid__items,
.jv-galerij--masonry.is-layout .jv-galerij__items {
	grid-auto-rows: 8px;
	row-gap: 0;
	align-items: start;
}

/* ------------------------------------------------------------------
 * Kaart
 * ---------------------------------------------------------------- */
.jv-item {
	margin: 0;
	min-width: 0;
	transition: opacity 0.25s ease;
}

.jv-item.is-hidden {
	display: none;
}

.jv-item.is-leaving,
.jv-item.is-entering,
.jv-galerij__item.is-entering {
	opacity: 0;
}

.jv-item__link {
	display: block;
	position: relative;
	color: inherit;
	text-decoration: none;
	outline-offset: 4px;
}

.jv-item__media {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.jv-item__img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.4s ease, opacity 0.4s ease;
	will-change: transform;
}

.jv-grid--grid .jv-item__media {
	aspect-ratio: 4 / 3;
}

.jv-grid--grid .jv-item__img {
	height: 100%;
	object-fit: cover;
}

.jv-item__media--leeg {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	background: rgba(127, 127, 127, 0.12);
}

.jv-item__leeg {
	font-size: 0.875em;
	opacity: 0.6;
}

.jv-item__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

.jv-item:hover .jv-item__overlay,
.jv-item:focus-within .jv-item__overlay {
	opacity: 1;
}

.jv-item__caption {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	padding-top: 0.75em;
}

.jv-item__title {
	margin: 0;
	font-size: 1.125em;
	line-height: 1.3;
}

.jv-item__cat {
	font-size: 0.875em;
	opacity: 0.7;
}

/* Titel als overlay op de foto, zichtbaar bij hover */
.jv-grid--titel-overlay .jv-item__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 1.25em;
	color: #fff;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}

.jv-grid--titel-overlay .jv-item:hover .jv-item__caption,
.jv-grid--titel-overlay .jv-item:focus-within .jv-item__caption {
	opacity: 1;
	transform: none;
}

.jv-grid--titel-overlay .jv-item__cat {
	opacity: 0.85;
}

.jv-item__lightbox-extra {
	display: none;
}

/* ------------------------------------------------------------------
 * Filterbalk
 * ---------------------------------------------------------------- */
.jv-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.5em 1.5em;
	margin: 0 0 1.5em;
	padding: 0;
}

.jv-filter--align-center {
	justify-content: center;
}

.jv-filter--align-right {
	justify-content: flex-end;
}

.jv-filter__btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-block;
	margin: 0;
	padding: 0;
	border: 0 solid transparent;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.jv-filter__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.jv-filter--links .jv-filter__btn.is-active {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.jv-filter--pills {
	gap: 0.5em 0.75em;
}

.jv-filter--pills .jv-filter__btn {
	padding: 0.5em 1.1em;
	border-width: 1px;
	border-color: currentColor;
	border-radius: 999px;
}

.jv-filter--pills .jv-filter__btn.is-active {
	box-shadow: inset 0 0 0 1px currentColor;
}

/* ------------------------------------------------------------------
 * Lege staat en "laad meer"
 * ---------------------------------------------------------------- */
.jv-grid__empty {
	margin: 1em 0;
	text-align: center;
	opacity: 0.7;
}

.jv-grid__empty[hidden] {
	display: none;
}

.jv-grid__more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 2em;
}

.jv-grid__more-wrap[hidden] {
	display: none;
}

.jv-grid__more {
	appearance: none;
	-webkit-appearance: none;
	display: inline-block;
	margin: 0;
	padding: 0.8em 1.8em;
	border: 1px solid currentColor;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.jv-grid__more:disabled,
.jv-grid__more.is-loading {
	opacity: 0.55;
	cursor: wait;
}

/* ------------------------------------------------------------------
 * Projectgalerij
 * ---------------------------------------------------------------- */
.jv-galerij__item {
	margin: 0;
	min-width: 0;
	transition: opacity 0.25s ease;
}

.jv-galerij__inner {
	display: block;
}

.jv-galerij__link {
	display: block;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.jv-galerij__img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.4s ease, opacity 0.4s ease;
}

.jv-galerij__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: rgba(0, 0, 0, 0.2);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.jv-galerij__item:hover .jv-galerij__overlay,
.jv-galerij__item:focus-within .jv-galerij__overlay {
	opacity: 1;
}

.jv-galerij__caption {
	padding-top: 0.5em;
	font-size: 0.875em;
	opacity: 0.75;
}

/* Vierkant raster */
.jv-galerij--grid .jv-galerij__link {
	aspect-ratio: 1 / 1;
}

.jv-galerij--grid .jv-galerij__img {
	height: 100%;
	object-fit: cover;
}

/* Justified: rijen met gelijke hoogte, breedte naar beeldverhouding */
.jv-galerij--justified .jv-galerij__items {
	display: flex;
	flex-wrap: wrap;
	gap: var(--jv-gap);
}

.jv-galerij--justified .jv-galerij__item {
	flex-grow: var(--jv-ratio, 1.5);
	flex-basis: calc(var(--jv-ratio, 1.5) * var(--jv-row-height));
	min-width: 0;
	max-width: 100%;
}

.jv-galerij--justified .jv-galerij__items::after {
	content: "";
	flex-grow: 1000000;
}

/* ------------------------------------------------------------------
 * Projectgegevens
 * ---------------------------------------------------------------- */
.jv-gegevens {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.jv-gegevens--inline {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0.6em 2em;
}

.jv-gegevens__item {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	margin: 0;
	padding: 0;
}

.jv-gegevens__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	line-height: 1;
}

.jv-gegevens__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.jv-gegevens__label {
	flex: 0 0 auto;
	font-weight: 600;
}

.jv-gegevens__value {
	min-width: 0;
	overflow-wrap: anywhere;
}

.jv-gegevens__value a {
	color: inherit;
}

/* ------------------------------------------------------------------
 * Editor-melding en fallback-template
 * ---------------------------------------------------------------- */
.jv-editor-notice {
	padding: 1em 1.25em;
	border: 1px dashed currentColor;
	font-size: 0.9em;
	opacity: 0.7;
}

.jv-single {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem 4rem;
}

.jv-single__header {
	margin-bottom: 1.5rem;
}

.jv-single__categorie {
	margin: 0 0 0.5rem;
	font-size: 0.875em;
	opacity: 0.7;
}

.jv-single__hero {
	margin-bottom: 1.5rem;
}

.jv-single__hero-img {
	display: block;
	width: 100%;
	height: auto;
}

.jv-single .jv-gegevens {
	margin-bottom: 1.5rem;
}

.jv-single__content {
	margin-bottom: 2rem;
}

.jv-single__video {
	position: relative;
	margin-bottom: 2rem;
}

.jv-single__video iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
}

.jv-single__footer {
	margin-top: 2rem;
}

/* ------------------------------------------------------------------
 * Minder beweging
 * ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.jv-item,
	.jv-item__img,
	.jv-item__overlay,
	.jv-item__caption,
	.jv-galerij__item,
	.jv-galerij__img,
	.jv-galerij__overlay,
	.jv-filter__btn,
	.jv-grid__more {
		transition: none !important;
	}

	.jv-item:hover .jv-item__img,
	.jv-galerij__item:hover .jv-galerij__img {
		transform: none !important;
	}
}
