/* ==========================================================================
   SUT Fotogaléria – front-end
   Dizajn podľa hlavnej stránky: ostré rohy, koralová #fb9d80 s modrým textom
   #2267a6, biele pozadie, písmo sa dedí z témy (Albert Sans).
   ========================================================================== */

.sutg,
.sutg * {
	box-sizing: border-box;
}

.sutg {
	--sutg-gap: 10px;
	font-family: inherit;
	color: var(--sutg-blue, #2267a6);
	margin: 0;
}

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

.sutg-notice {
	padding: 14px 18px;
	border: 1px solid var(--sutg-coral, #fb9d80);
	background: #fff6f2;
	color: #8a5a44;
	font-size: 15px;
}

/* --------------------------------------------------------------- toolbar */

.sutg-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	margin: 0 0 18px;
}

.sutg-toolbar:empty {
	display: none;
}

.sutg-toolbar--right {
	justify-content: flex-end;
}

.sutg-filters {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	min-width: 0;
	flex: 1 1 auto;
}

.sutg-chip {
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: var(--sutg-blue, #2267a6);
	background: transparent;
	border: 1px solid var(--sutg-line, rgba(34, 103, 166, .22));
	border-radius: 0;
	padding: 11px 20px;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
	white-space: nowrap;
}

.sutg-chip:hover {
	border-color: var(--sutg-coral, #fb9d80);
}

.sutg-chip.is-active {
	background: var(--sutg-coral, #fb9d80);
	border-color: var(--sutg-coral, #fb9d80);
	color: var(--sutg-blue, #2267a6);
}

/* prepínač zobrazenia – tri ploché ikony, bez rámu */

.sutg-views {
	display: inline-flex;
	gap: 2px;
	flex: 0 0 auto;
}

.sutg-view {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: rgba(34, 103, 166, .38);
	cursor: pointer;
	transition: color .15s ease;
	padding: 0;
}

.sutg-view:hover {
	color: var(--sutg-blue, #2267a6);
}

.sutg-view.is-active {
	color: var(--sutg-coral-dark, #f07a55);
}

.sutg-chip:focus-visible,
.sutg-view:focus-visible,
.sutg-btn:focus-visible,
.sutg-item:focus-visible {
	outline: 2px solid var(--sutg-coral, #fb9d80);
	outline-offset: 2px;
}

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

.sutg-grid {
	display: grid;
	gap: var(--sutg-gap);
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.sutg-grid[data-view="velke"] {
	grid-template-columns: repeat(auto-fill, minmax(470px, 1fr));
}

.sutg-grid[data-view="mozaika"] {
	display: block;
	column-width: 310px;
	column-gap: var(--sutg-gap);
}

.sutg-grid[data-view="mozaika"] .sutg-item {
	break-inside: avoid;
	margin-bottom: var(--sutg-gap);
	display: block;
	width: 100%;
}

/* ------------------------------------------------------------------ item */

.sutg-item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 0;
	background: #efe9e2;
	text-decoration: none;
	box-shadow: none;
}

.sutg-item__media {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.sutg-grid[data-view="velke"] .sutg-item__media {
	aspect-ratio: 3 / 2;
}

.sutg-grid[data-view="mozaika"] .sutg-item__media {
	aspect-ratio: var(--sutg-ar, 1.5);
}

.sutg-item__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
	transition: transform .45s cubic-bezier(.2, .7, .3, 1), opacity .2s ease;
}

.sutg-item:hover .sutg-item__img {
	transform: scale(1.04);
	opacity: .92;
}

/* zvyšky zo starej verzie – nech sa nikde nezobrazia */
.sutg-item__zoom,
.sutg-item__veil {
	display: none;
}

/* popisy sú predvolene vypnuté – zapnú sa parametrom popisy="ano" */
.sutg-item__cap {
	display: none;
}

.sutg--caps .sutg-item__cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: block;
	padding: 24px 12px 10px;
	color: #fff;
	font-size: 13.5px;
	line-height: 1.35;
	background: linear-gradient(to top, rgba(16, 26, 38, .62), rgba(16, 26, 38, 0));
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.sutg--caps .sutg-item:hover .sutg-item__cap {
	opacity: 1;
}

/* ---------------------------------------------------------- stavy, more */

.sutg-empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--sutg-muted, #7b8794);
	font-size: 15px;
	background: var(--sutg-sand, #f6f1ea);
	margin: 0;
}

.sutg-more {
	display: flex;
	justify-content: center;
	margin: 26px 0 0;
}

.sutg-more[hidden],
.sutg-empty[hidden] {
	display: none;
}

/* automatické dopĺňanie pri scrollovaní – tlačidlo sa skryje,
   ostáva len nenápadný indikátor načítavania */
.sutg-more--auto {
	min-height: 46px;
	margin: 18px 0 0;
	align-items: center;
}

.sutg-more--auto .sutg-btn {
	display: none;
}

.sutg-more--auto::after {
	content: '';
	width: 22px;
	height: 22px;
	border: 2px solid rgba(34, 103, 166, .2);
	border-top-color: var(--sutg-coral, #fb9d80);
	border-radius: 50%;
	opacity: 0;
	transition: opacity .2s ease;
}

.sutg-more--auto.is-loading::after {
	opacity: 1;
	animation: sutg-spin .7s linear infinite;
}

.sutg-btn {
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--sutg-blue, #2267a6);
	background: var(--sutg-coral, #fb9d80);
	border: 0;
	border-radius: 0;
	padding: 15px 38px;
	cursor: pointer;
	transition: background-color .15s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.sutg-btn:hover {
	background: var(--sutg-coral-dark, #f07a55);
	color: var(--sutg-blue, #2267a6);
}

.sutg-btn[disabled] {
	opacity: .6;
	cursor: default;
}

.sutg-btn__spinner {
	display: none;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(34, 103, 166, .35);
	border-top-color: var(--sutg-blue, #2267a6);
	border-radius: 50%;
	animation: sutg-spin .7s linear infinite;
}

.sutg-btn.is-loading .sutg-btn__spinner {
	display: inline-block;
}

@keyframes sutg-spin {
	to {
		transform: rotate(360deg);
	}
}

.sutg-skeleton {
	background: #efe9e2;
	aspect-ratio: 1 / 1;
	animation: sutg-fade 1.1s ease-in-out infinite alternate;
}

.sutg-grid[data-view="velke"] .sutg-skeleton {
	aspect-ratio: 3 / 2;
}

@keyframes sutg-fade {
	from {
		opacity: .55;
	}

	to {
		opacity: 1;
	}
}

/* -------------------------------------------------------------- lightbox */

.sutg-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .97);
	opacity: 0;
	transition: opacity .18s ease;
	padding: 58px 16px;
}

.sutg-lb.is-open {
	opacity: 1;
}

/* DÔLEŽITÉ: bez tohto by zatvorený lightbox ostal roztiahnutý cez celú
   stránku (display:flex prebíja atribút hidden) a blokoval by všetky kliky. */
.sutg-lb[hidden] {
	display: none !important;
}

.sutg-lb__stage {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sutg-lb__img {
	max-width: min(1500px, 92vw);
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	display: block;
	border-radius: 0;
	opacity: 0;
	transition: opacity .2s ease;
}

.sutg-lb__img.is-ready {
	opacity: 1;
}

.sutg-lb__spinner {
	position: absolute;
	width: 30px;
	height: 30px;
	border: 2px solid rgba(34, 103, 166, .2);
	border-top-color: var(--sutg-coral, #fb9d80);
	border-radius: 50%;
	animation: sutg-spin .8s linear infinite;
}

.sutg-lb__bar {
	position: absolute;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	padding: 14px 18px;
	color: var(--sutg-blue, #2267a6);
}

.sutg-lb__bar--top {
	top: 0;
	justify-content: space-between;
}

.sutg-lb__bar--bottom {
	display: none;
}

.sutg-lb__count {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .12em;
	color: rgba(34, 103, 166, .55);
	font-variant-numeric: tabular-nums;
}

.sutg-lb__cap {
	display: none;
}

.sutg-lb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--sutg-blue, #2267a6);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
	padding: 0;
}

.sutg-lb__btn:hover {
	background: var(--sutg-coral, #fb9d80);
	color: var(--sutg-blue, #2267a6);
}

.sutg-lb__btn:focus-visible {
	outline: 2px solid var(--sutg-coral, #fb9d80);
	outline-offset: 2px;
}

.sutg-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
}

.sutg-lb__nav--prev {
	left: 10px;
}

.sutg-lb__nav--next {
	right: 10px;
}

.sutg-lb__nav[hidden] {
	display: none;
}

body.sutg-lock {
	overflow: hidden;
}

/* -------------------------------------------------------------- mobil */

@media (max-width: 782px) {
	.sutg-toolbar {
		gap: 10px;
		margin-bottom: 12px;
	}

	.sutg-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.sutg-filters::-webkit-scrollbar {
		display: none;
	}

	.sutg-chip {
		font-size: 14px;
		padding: 10px 15px;
	}

	.sutg-views {
		margin-left: auto;
	}

	.sutg-grid {
		--sutg-gap: 6px;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.sutg-grid[data-view="velke"] {
		grid-template-columns: 1fr;
	}

	.sutg-grid[data-view="mozaika"] {
		column-width: 165px;
	}

	.sutg-lb {
		padding: 54px 0;
	}

	.sutg-lb__nav {
		top: auto;
		bottom: 12px;
		transform: none;
		width: 48px;
		height: 48px;
	}

	.sutg-lb__nav--prev {
		left: calc(50% - 58px);
	}

	.sutg-lb__nav--next {
		right: calc(50% - 58px);
	}

	.sutg-lb__img {
		max-width: 100vw;
		max-height: calc(100vh - 150px);
	}
}

@media (prefers-reduced-motion: reduce) {

	.sutg *,
	.sutg-lb * {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}
