/* Bezva fotogalerie – uses the Bezva theme's colour variables. */

.bezva-fg-index,
.bezva-fg-event,
.bezva-fg-daypage {
	--fg-accent: var(--accent, #6f9a1f);
	--fg-text: var(--text, #23271f);
	--fg-muted: var(--text-muted, #666f5c);
	--fg-bg: var(--bg, #fff);
	--fg-bg-alt: var(--bg-alt, #f3f6ee);
	--fg-border: var(--border, #dfe6d3);
	--fg-radius: var(--radius, 14px);
	--fg-heading: var(--font-heading, inherit);
	--fg-nav-top: 0px;
}

.admin-bar .bezva-fg-event {
	--fg-nav-top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .bezva-fg-event {
		--fg-nav-top: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar .bezva-fg-event {
		--fg-nav-top: 0px;
	}
}

.bezva-fg-intro {
	margin-bottom: 1.5rem;
}

/* Photo grid ------------------------------------------------------------ */

.bezva-fg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 6px;
	margin: 1rem 0 1.5rem;
}

@media (max-width: 600px) {
	.bezva-fg-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 3px;
	}
}

.entry-content a.bezva-fg-item,
.bezva-fg-item {
	display: block;
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 8px;
	background: var(--fg-bg-alt, #f3f6ee);
	text-decoration: none;
	border: 0;
}

@media (max-width: 600px) {
	.entry-content a.bezva-fg-item,
	.bezva-fg-item {
		border-radius: 3px;
	}
}

.bezva-fg-item img.bezva-fg-thumb {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
	box-shadow: none;
	transition: transform 0.35s ease, opacity 0.2s ease;
}

.bezva-fg-item:hover img.bezva-fg-thumb {
	transform: scale(1.05);
}

.bezva-fg-item:focus-visible {
	outline: 3px solid var(--fg-accent, #6f9a1f);
	outline-offset: 2px;
}

/* Fotogalerie: event cards --------------------------------------------- */

.bezva-fg-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.25rem;
}

@media (max-width: 600px) {
	.bezva-fg-cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75rem;
	}

	.bezva-fg-card-body {
		padding: 0.6rem 0.7rem 0.7rem;
	}

	.bezva-fg-card-title {
		font-size: 1rem;
	}

	.bezva-fg-card-meta {
		font-size: 0.78rem;
	}
}

.entry-content a.bezva-fg-card,
.bezva-fg-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--fg-border);
	border-radius: var(--fg-radius);
	background: var(--fg-bg);
	box-shadow: var(--card-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
	color: var(--fg-text);
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bezva-fg-card:hover,
.bezva-fg-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(35, 39, 31, 0.14);
}

.bezva-fg-card-img {
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--fg-bg-alt);
	overflow: hidden;
}

.bezva-fg-card-img img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.bezva-fg-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.8rem 1rem 0.95rem;
}

.bezva-fg-card-title {
	font-family: var(--fg-heading);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.2;
}

.bezva-fg-card-meta {
	font-size: 0.875rem;
	color: var(--fg-muted);
}

/* Liquid glass navigation ----------------------------------------------------
   A translucent capsule that blurs and brightens what scrolls under it, with
   light edges; the active item is a tinted glass pill. */

.bezva-fg-index,
.bezva-fg-event {
	--fg-glass-bg: rgba(255, 255, 255, 0.55);
	--fg-glass-shadow:
		0 8px 24px -6px rgba(35, 39, 31, 0.18),
		0 2px 6px -2px rgba(35, 39, 31, 0.1);
	--fg-glass-blur: blur(18px) saturate(180%);
	--fg-glass-active:
		linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%),
		var(--fg-accent);
	--fg-glass-active-shadow:
		0 4px 12px -2px color-mix(in srgb, var(--fg-accent) 55%, transparent);
}

.bezva-fg-filter,
.bezva-fg-daynav-inner,
.bezva-fg-pager-up {
	background: var(--fg-glass-bg);
	border: 0;
	box-shadow: var(--fg-glass-shadow);
	-webkit-backdrop-filter: var(--fg-glass-blur);
	backdrop-filter: var(--fg-glass-blur);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.bezva-fg-index,
	.bezva-fg-event {
		--fg-glass-bg: rgba(255, 255, 255, 0.94);
	}
}

@media (prefers-reduced-transparency: reduce) {
	.bezva-fg-index,
	.bezva-fg-event {
		--fg-glass-bg: var(--fg-bg);
		--fg-glass-blur: none;
	}
}

/* Capsule of pills: shared by the type filter and the day navigation. */
.bezva-fg-filter,
.bezva-fg-daynav-inner {
	position: relative;
	display: flex;
	gap: 2px;
	max-width: 100%;
	padding: 4px;
	border-radius: 999px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.bezva-fg-filter::-webkit-scrollbar,
.bezva-fg-daynav-inner::-webkit-scrollbar {
	display: none;
}

.entry-content .bezva-fg-filter a,
.entry-content .bezva-fg-daynav a {
	position: relative;
	z-index: 1;
	flex: none;
	padding: 0.45em 1em;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--fg-text);
	font-size: 0.92rem;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
	transition: background 0.2s ease, color 0.25s ease, box-shadow 0.2s ease;
}

.entry-content .bezva-fg-filter a:hover,
.entry-content .bezva-fg-daynav a:hover {
	background: rgba(255, 255, 255, 0.7);
	box-shadow: none;
}

.entry-content .bezva-fg-filter a:focus-visible,
.entry-content .bezva-fg-daynav a:focus-visible {
	outline: 2px solid var(--fg-accent);
	outline-offset: 1px;
}

.entry-content .bezva-fg-filter a.is-active,
.entry-content .bezva-fg-daynav a.is-active {
	background: var(--fg-glass-active);
	box-shadow: var(--fg-glass-active-shadow);
	color: #fff;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* Fotogalerie: filter by event type ------------------------------------ */

.bezva-fg-filter {
	width: fit-content;
	margin: 0 0 1.25rem;
}

.bezva-fg-filter a span {
	margin-left: 0.2em;
	font-weight: 400;
	opacity: 0.6;
}

.bezva-fg-filter a.is-active span {
	opacity: 0.85;
}

/* Event page: day navigation and sections -------------------------------- */

.bezva-fg-daynav {
	position: sticky;
	top: calc(var(--fg-nav-top) + 10px);
	/* Above the photos, below the theme header (z-index 5) and its menus. */
	z-index: 4;
	display: flex;
	justify-content: center;
	margin: 0 0 1rem;
	pointer-events: none;
}

.bezva-fg-daynav-inner {
	pointer-events: auto;
	transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Floating over the photos: a bit more frosted and lifted. */
.bezva-fg-daynav.is-stuck .bezva-fg-daynav-inner {
	--fg-glass-bg: rgba(255, 255, 255, 0.5);
	box-shadow:
		0 14px 32px -8px rgba(35, 39, 31, 0.3),
		0 3px 8px -2px rgba(35, 39, 31, 0.12);
}

/* The active pill glides between days (added by the script). */
.bezva-fg-daynav-glow {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 0;
	width: 0;
	border-radius: 999px;
	background: var(--fg-glass-active);
	box-shadow: var(--fg-glass-active-shadow);
	opacity: 0;
	transition:
		transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
		width 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
		opacity 0.2s ease;
	pointer-events: none;
}

.bezva-fg-daynav.has-glow .bezva-fg-daynav-glow {
	opacity: 1;
}

.entry-content .bezva-fg-daynav.has-glow a.is-active {
	background: transparent;
	box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
	.bezva-fg-daynav-glow {
		transition: opacity 0.2s ease;
	}
}

.bezva-fg-day {
	scroll-margin-top: calc(var(--fg-nav-top) + 4.5rem);
}

.bezva-fg-day + .bezva-fg-day {
	margin-top: 2rem;
}

.entry-content .bezva-fg-day-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.75rem;
	margin: 0 0 0.25rem;
	font-family: var(--fg-heading);
	font-size: 1.45rem;
	text-align: left;
}

.bezva-fg-day-count {
	font-family: var(--font-sans, inherit);
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--fg-muted);
}

.bezva-fg-empty {
	color: var(--fg-muted);
}

/* Video tiles: after the photos, open in the lightbox ------------------------- */

.entry-content .bezva-fg-videos-title {
	margin: 1.25rem 0 0.5rem;
	font-family: var(--font-sans, inherit);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fg-muted);
	text-align: left;
}

.bezva-fg-videos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px;
	margin: 0.5rem 0 1.5rem;
}

@media (max-width: 600px) {
	.bezva-fg-videos {
		grid-template-columns: repeat(2, 1fr);
		gap: 4px;
	}
}

.entry-content a.bezva-fg-video,
.bezva-fg-video {
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: #1d2119;
}

@media (max-width: 600px) {
	.entry-content a.bezva-fg-video,
	.bezva-fg-video {
		border-radius: 4px;
	}
}

.bezva-fg-video video.bezva-fg-thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	transition: transform 0.35s ease;
}

.bezva-fg-video:hover .bezva-fg-thumb {
	transform: scale(1.05);
}

/* Glass play button. */
.bezva-fg-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.28);
	-webkit-backdrop-filter: blur(10px) saturate(160%);
	backdrop-filter: blur(10px) saturate(160%);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease, background 0.2s ease;
}

.bezva-fg-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -9px 0 0 -6px;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.bezva-fg-video:hover .bezva-fg-play {
	transform: scale(1.1);
	background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 600px) {
	.bezva-fg-play {
		width: 36px;
		height: 36px;
		margin: -18px 0 0 -18px;
	}

	.bezva-fg-play::after {
		margin: -7px 0 0 -4px;
		border-width: 7px 0 7px 12px;
	}
}

.bezva-fg-video-caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 1.2em 0.6em 0.45em;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Video playing in the lightbox. */
.bezva-fg-video-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 0 76px;
}

.bezva-fg-video-slide iframe {
	width: min(100%, calc((100vh - 136px) * 16 / 9));
	aspect-ratio: 16 / 9;
	border: 0;
	background: #000;
}

/* As wide as possible at the video's own shape, so its controls sit on the
   picture and the space around it stays free for swiping. */
.bezva-fg-video-slide video {
	display: block;
	width: 100%;
	height: auto;
	max-height: 100%;
	object-fit: contain;
	background: transparent;
}

/* Videos in day texts and the intro ------------------------------------------
   YouTube embeds come with a fixed 640×360 size; make them fit the column. */

.bezva-fg-event iframe,
.bezva-fg-event embed,
.bezva-fg-event object {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 12px;
}

.bezva-fg-event .wp-block-embed {
	margin: 1rem 0;
}

.bezva-fg-event .wp-block-embed__wrapper {
	position: static;
}

.bezva-fg-event .wp-block-embed__wrapper::before {
	content: none;
}

.bezva-fg-event .wp-video,
.bezva-fg-event video {
	max-width: 100%;
}

.bezva-fg-event .wp-video {
	margin: 1rem 0;
	border-radius: 12px;
	overflow: hidden;
}

/* Pager: previous / up / next ---------------------------------------------- */

.bezva-fg-pager {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.75rem;
	margin: 2rem 0;
	font-size: 0.95rem;
}

.bezva-fg-daypage > .bezva-fg-pager:first-child {
	margin-top: 0;
}

.entry-content .bezva-fg-pager a {
	color: var(--fg-accent);
	font-weight: 600;
	text-decoration: none;
}

.entry-content .bezva-fg-pager a:hover {
	text-decoration: underline;
}

.bezva-fg-pager-up {
	padding: 0.5em 1.2em;
	border-radius: 999px;
	text-align: center;
	transition: box-shadow 0.2s ease;
}

.entry-content .bezva-fg-pager a.bezva-fg-pager-up:hover {
	text-decoration: none;
	box-shadow: var(--fg-glass-shadow), 0 0 0 3px color-mix(in srgb, var(--fg-accent) 18%, transparent);
}

.bezva-fg-pager-next {
	text-align: right;
}

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

	.bezva-fg-pager-up {
		grid-column: 1 / -1;
		grid-row: 1;
	}
}

/* Lightbox caption --------------------------------------------------------- */

.pswp__bezva-caption {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: min(100%, 720px);
	padding: 0.75rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
	color: #fff;
	text-align: center;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
	pointer-events: none;
}

.pswp__bezva-caption span {
	display: block;
}

.pswp__bezva-caption-label {
	font-size: 0.85rem;
	opacity: 0.8;
}

.pswp__bezva-caption-text {
	font-size: 0.95rem;
}

.pswp--ui-visible .pswp__bezva-caption {
	opacity: 1;
	transition: opacity 0.3s;
}

.pswp:not(.pswp--ui-visible) .pswp__bezva-caption,
.pswp--zoomed-in .pswp__bezva-caption {
	opacity: 0;
}
