/* ZukaGalerija – frontend
 *
 * Palette: black / white / gray only.
 * Layout: a FIXED-SIZE frame (constant aspect ratio, independent of the photo),
 * centred on every device. The photo is letterboxed inside the frame, so
 * switching between portrait/landscape images never resizes the gallery and the
 * arrows never move.
 *
 * No crop / no blur:
 *  - Image: max-width/height = min(100%, natural size). 100% keeps it inside the
 *    frame (scaled DOWN, never cropped); the natural-size cap (via the --zuka-w /
 *    --zuka-h custom props) stops it ever scaling UP past real pixels (never blurry).
 */

.zuka-gallery {
	box-sizing: border-box;
	width: 100%;
	max-width: 820px;          /* fixed gallery width, centred */
	margin: 1.5em auto;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.zuka-gallery * {
	box-sizing: border-box;
}

/* ---- Fixed main frame ---- */
.zuka-gallery__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 2;       /* fixed shape -> fixed size, arrows stay put */
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #efefef;        /* gray letterbox */
	border: 1px solid #cccccc;  /* gray frame */
	border-radius: 4px;
}

.zuka-gallery__img {
	display: block;
	margin: auto;
	max-width: min( 100%, var( --zuka-w, 100% ) );
	max-height: min( 100%, var( --zuka-h, 100% ) );
	width: auto;
	height: auto;
}

/* ---- Prev / next arrows: white button, black icon, gray border ---- */
.zuka-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid #999999;       /* gray */
	border-radius: 50%;
	background: #ffffff;             /* white */
	color: #000000;                 /* black icon */
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.3 );
	transition: background 0.15s ease, border-color 0.15s ease;
	z-index: 2;
}

.zuka-gallery__nav:hover,
.zuka-gallery__nav:focus-visible {
	background: #d9d9d9;            /* gray on hover */
	border-color: #000000;
	outline: none;
}

.zuka-gallery__nav--prev { left: 10px; }
.zuka-gallery__nav--next { right: 10px; }

.zuka-gallery__nav span {
	display: block;
	margin-top: -2px;              /* optical centring of the chevron */
}

/* ---- Filmstrip slider: smaller full photos, centred, scrolls if many ---- */
.zuka-gallery__filmstrip {
	display: flex;
	gap: 8px;
	margin: 12px auto 0;
	max-width: 100%;
	padding: 4px 2px;
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	justify-content: safe center;  /* centre when few, scrollable when many */
}

.zuka-gallery__thumb {
	flex: 0 0 auto;
	height: 70px;
	padding: 0;
	border: 2px solid #cccccc;     /* gray idle border */
	border-radius: 4px;
	background: #ffffff;
	cursor: pointer;
	overflow: hidden;
	opacity: 0.7;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.zuka-gallery__thumb img {
	display: block;
	height: 100%;
	width: auto;                   /* full photo, scaled down — not cropped */
	object-fit: contain;
}

.zuka-gallery__thumb:hover { opacity: 1; }

.zuka-gallery__thumb.is-active {
	opacity: 1;
	border-color: #000000;         /* black border = active */
}

/* ---- Mobile ---- */
@media ( max-width: 600px ) {
	.zuka-gallery__nav { width: 40px; height: 40px; font-size: 24px; }
	.zuka-gallery__nav--prev { left: 6px; }
	.zuka-gallery__nav--next { right: 6px; }
	.zuka-gallery__thumb { height: 58px; }
}
