/* Bicikl Galerija – matches the site's Elementor styles (Montserrat, #303133, #45BC94, #F5D042). */

.bg-page {
	--bg-text: #303133;
	--bg-muted: #6b6d72;
	--bg-green: #45bc94;
	--bg-green-dark: #34a07c;
	--bg-yellow: #f5d042;
	--bg-bg: #f5f5f5;
	--bg-card: #ffffff;
	--bg-radius: 10px;
	--bg-gap: 12px;
	--bg-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

	background: var(--bg-bg);
	color: var(--bg-text);
	font-family: var(--bg-font);
	padding: 48px 0 80px;
}

/* The site header is transparent + absolute (made to sit on the homepage hero video).
   On gallery pages put it in the normal flow with a dark background so the white menu is readable. */
@media (min-width: 1025px) {
	.bicikl-galerija-view .elementor-location-header > .e-con.e-parent {
		--position: relative;
		position: relative;
		background-color: #303133;
		padding-bottom: 24px;
	}
}

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

.bg-container {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Headings & text ---------- */

.bg-head {
	margin-bottom: 28px;
}

.bg-head--center,
.bg-intro--center {
	text-align: center;
}

.bg-title {
	font-family: var(--bg-font);
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 700;
	line-height: 1.1;
	color: var(--bg-text);
	margin: 0 0 10px;
}

.bg-meta {
	margin: 0;
	font-size: 1rem;
	color: var(--bg-muted);
}

.bg-intro {
	max-width: 760px;
	margin: 0 0 32px;
	font-size: 1.125rem;
	line-height: 1.6;
}

.bg-intro--center {
	margin-left: auto;
	margin-right: auto;
}

.bg-intro a,
.bg-page .bg-credit a {
	color: var(--bg-text);
	text-decoration: underline;
	text-decoration-color: var(--bg-green);
	text-underline-offset: 3px;
}

.bg-empty {
	text-align: center;
	color: var(--bg-muted);
	padding: 40px 0;
}

/* ---------- Chips (year switch + filters) ---------- */

.bg-topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 32px;
}

.bg-page .bg-back {
	color: var(--bg-text);
	font-weight: 600;
	text-decoration: none;
}

.bg-page .bg-back:hover {
	color: var(--bg-green-dark);
}

.bg-years,
.bg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.bg-filters {
	margin-bottom: 20px;
}

.bg-page .bg-chip {
	display: inline-block;
	padding: 8px 16px;
	border: 1.5px solid #d9dadc;
	border-radius: 999px;
	background: var(--bg-card);
	color: var(--bg-text);
	font: 600 0.9375rem/1.2 var(--bg-font);
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.bg-page .bg-chip:hover {
	border-color: var(--bg-green);
	background: var(--bg-card);
	color: var(--bg-text);
}

.bg-page .bg-chip.is-active {
	border-color: var(--bg-green);
	background: var(--bg-green);
	color: #fff;
}

/* ---------- Year cards (overview) ---------- */

.bg-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	list-style: none;
	margin: 40px 0 0;
	padding: 0;
}

.bg-page .bg-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--bg-card);
	border-radius: var(--bg-radius);
	overflow: hidden;
	color: var(--bg-text);
	text-decoration: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s, transform 0.2s;
}

.bg-page .bg-card__link:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.bg-card__media {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #e4e5e7;
}

.bg-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s;
}

.bg-card__link:hover .bg-card__media img {
	transform: scale(1.04);
}

.bg-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 20px 22px 22px;
}

.bg-card__year {
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
}

.bg-card__title {
	font-weight: 600;
}

.bg-card__meta {
	font-size: 0.9375rem;
	color: var(--bg-muted);
}

.bg-card__cta {
	margin-top: 12px;
	font-weight: 600;
	color: var(--bg-green-dark);
}

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

.bg-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: var(--bg-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Before JS runs, show only the first batch (BICIKL_GALERIJA_BATCH = 40). */
.bg-grid:not(.is-ready) .bg-item:nth-child(n+41),
.bg-item[hidden] {
	display: none;
}

.bg-item__link {
	display: block;
	aspect-ratio: 3 / 2;
	border-radius: 8px;
	overflow: hidden;
	background: #e4e5e7;
}

.bg-item__link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s, opacity 0.2s;
}

.bg-item__link:hover img {
	transform: scale(1.05);
}

.bg-item__link:focus-visible,
.bg-page a:focus-visible,
.bg-page button:focus-visible {
	outline: 3px solid var(--bg-yellow);
	outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.bg-more,
.bg-foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 32px;
	text-align: center;
}

.bg-progress {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--bg-muted);
}

.bg-page .bg-btn {
	display: inline-block;
	padding: 14px 28px;
	border: 2px solid var(--bg-green);
	border-radius: 999px;
	background: var(--bg-green);
	color: #fff;
	font: 600 1rem/1.2 var(--bg-font);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.bg-page .bg-btn:hover {
	background: var(--bg-green-dark);
	border-color: var(--bg-green-dark);
	color: #fff;
}

.bg-page .bg-btn--outline {
	background: transparent;
	color: var(--bg-green-dark);
}

.bg-page .bg-btn--outline:hover {
	background: var(--bg-green);
	border-color: var(--bg-green);
	color: #fff;
}

.bg-page .bg-btn[hidden] {
	display: none;
}

.bg-credit {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--bg-muted);
}

/* ---------- Homepage block [bicikl_galerija_pocetna] ---------- */

.bg-home {
	padding: 80px 0;
	background: transparent; /* use the homepage section's own background */
}

.bg-eyebrow {
	margin: 0 0 8px;
	color: var(--bg-green-dark);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.bg-home .bg-intro {
	margin-bottom: 0;
}

.bg-page .bg-link {
	color: var(--bg-green-dark);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bg-page .bg-link:hover {
	color: var(--bg-text);
}

.bg-home .bg-head {
	margin-bottom: 40px;
}

/* One-row slider: native swipe with scroll-snap; arrows + bullets added by JS. */
.bg-slider {
	--bg-per-view: 4;
	--bg-slide-gap: 12px;

	position: relative;
}

.bg-slider__track {
	display: flex;
	gap: var(--bg-slide-gap);
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.bg-slider__track::-webkit-scrollbar {
	display: none;
}

.bg-slider__track .bg-item {
	flex: 0 0 calc((100% - (var(--bg-per-view) - 1) * var(--bg-slide-gap)) / var(--bg-per-view));
	scroll-snap-align: start;
}

/* Soft lift. The track scrolls (clips overflow), so padding gives the shadow room and negative margin keeps the layout unchanged. */
.bg-slider__track {
	padding: 8px 0 24px;
	margin: -8px 0 -24px;
}

.bg-slider__track .bg-item__link {
	border-radius: 12px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.25s;
}

.bg-slider__track .bg-item__link:hover {
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.bg-page .bg-slider__arrow {
	position: absolute;
	top: calc(50% - 20px); /* centred on the photos, above the bullets */
	transform: translateY(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0 0 3px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--bg-text);
	font: 400 1.75rem/1 var(--bg-font);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: opacity 0.2s, background-color 0.15s, color 0.15s;
}

.bg-page .bg-slider__arrow:hover {
	background: var(--bg-green);
	color: #fff;
}

.bg-page .bg-slider__arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

.bg-page .bg-slider__arrow[hidden] {
	display: none;
}

.bg-slider__arrow--prev {
	left: 12px;
}

.bg-slider__arrow--next {
	right: 12px;
}

.bg-slider__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	min-height: 8px;
	margin-top: 24px;
}

.bg-page .bg-slider__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #cfd1d4;
	cursor: pointer;
	transition: width 0.25s, background-color 0.25s;
}

.bg-page .bg-slider__dot:hover {
	background: #a9acb1;
}

.bg-page .bg-slider__dot.is-active {
	width: 24px;
	background: var(--bg-green);
}

.bg-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 16px;
	margin-top: 40px;
}

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

.bg-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(12, 13, 15, 0.95);
	color: #fff;
	font-family: "Montserrat", system-ui, sans-serif;
	touch-action: pan-y;
}

.bg-lb[hidden] {
	display: none;
}

.bg-lb__img {
	max-width: calc(100vw - 140px);
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	object-fit: contain;
	user-select: none;
	transition: opacity 0.2s;
}

.bg-lb__img.is-loading {
	opacity: 0.35;
}

.bg-lb__bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
}

.bg-lb__count {
	font-size: 0.9375rem;
	font-weight: 500;
	opacity: 0.85;
}

.bg-lb__actions {
	display: flex;
	gap: 8px;
}

.bg-lb button,
.bg-lb a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font: 600 0.9375rem/1 "Montserrat", system-ui, sans-serif;
	text-decoration: none;
	cursor: pointer;
}

.bg-lb button:hover,
.bg-lb a:hover {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
}

.bg-lb button:focus-visible,
.bg-lb a:focus-visible {
	outline: 3px solid #f5d042;
	outline-offset: 2px;
}

.bg-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px !important;
	font-size: 1.5rem !important;
}

.bg-lb__nav--prev {
	left: 12px;
}

.bg-lb__nav--next {
	right: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.bg-grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.bg-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.bg-slider {
		--bg-per-view: 3;
	}
}

@media (max-width: 767px) {
	.bg-page {
		padding: 32px 0 56px;
	}

	.bg-container {
		padding: 0 16px;
	}

	.bg-grid {
		grid-template-columns: repeat(2, 1fr);
		--bg-gap: 8px;
	}

	.bg-cards {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.bg-home {
		padding: 56px 0;
	}

	/* Phones: 2 photos per view, swipe to move; arrows hidden, bullets stay. */
	.bg-slider {
		--bg-per-view: 2;
		--bg-slide-gap: 8px;
	}

	.bg-page .bg-slider__arrow {
		display: none;
	}

	.bg-actions {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.bg-topbar {
		flex-direction: column;
		align-items: flex-start;
	}

	/* Chips scroll sideways instead of wrapping into many rows. */
	.bg-years,
	.bg-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		max-width: 100%;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.bg-page .bg-chip {
		flex: 0 0 auto;
	}

	.bg-lb__img {
		max-width: 100vw;
		max-height: calc(100dvh - 140px);
	}

	.bg-lb__nav {
		top: auto;
		bottom: 16px;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bg-page *,
	.bg-lb * {
		transition: none !important;
	}

	.bg-slider__track {
		scroll-behavior: auto;
	}
}
