/* Vrtec – zaščitene galerije. Barve in pisavo prevzame od teme (Fairy FSE ipd.). */
.vg {
	--vg-line: color-mix(in srgb, currentColor 18%, transparent);
	--vg-soft: color-mix(in srgb, currentColor 6%, transparent);
	--vg-muted: color-mix(in srgb, currentColor 65%, transparent);
	--vg-radius: 14px;
	--vg-accent: var(--wp--preset--color--primary, var(--wp--preset--color--accent-1, #2f6f5e));
	--vg-error: #b42318;
	box-sizing: border-box;
}
.vg *, .vg *::before, .vg *::after { box-sizing: inherit; }

/* ---------- Prijava ---------- */
.vg-login {
	max-width: 440px;
	margin: 2rem auto;
	padding: 2rem 1.5rem 1.75rem;
	border: 1px solid var(--vg-line);
	border-radius: var(--vg-radius);
	background: var(--vg-soft);
	text-align: center;
}
.vg-login--compact {
	margin: 1rem 0 0;
	padding: 1.25rem 1rem;
	text-align: left;
	background: transparent;
}
.vg-lock { color: var(--vg-muted); margin-bottom: .5rem; }
.vg-login__title { margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.3; }
.vg-login--compact .vg-login__title { font-size: 1.05rem; }
.vg-login__text { margin: 0 0 1.25rem; color: var(--vg-muted); font-size: .95rem; }
.vg-login__label {
	display: block;
	text-align: left;
	font-size: .875rem;
	font-weight: 600;
	margin-bottom: .35rem;
}
.vg-login__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.vg-login__input {
	flex: 1 1 200px;
	min-width: 0;
	font: inherit;
	font-size: 16px; /* iOS ne poveča strani ob vnosu */
	padding: .7rem .85rem;
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
	border-radius: 10px;
	background: var(--wp--preset--color--base, #fff);
	color: inherit;
}
.vg-login__input:focus-visible {
	outline: 2px solid var(--vg-accent);
	outline-offset: 1px;
}
.vg-login__btn { flex: 0 0 auto; cursor: pointer; }
.vg-login__error {
	margin: 0 0 1rem;
	padding: .6rem .8rem;
	border-radius: 8px;
	background: color-mix(in srgb, var(--vg-error) 10%, transparent);
	color: var(--vg-error);
	font-size: .9rem;
	text-align: left;
}
@media (max-width: 420px) {
	.vg-login__btn { flex: 1 1 100%; }
}

/* ---------- Vrstica s skupino / odjavo ---------- */
.vg-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: .75rem;
	margin-bottom: 1.25rem;
	border-bottom: 1px solid var(--vg-line);
	font-size: .9rem;
}
.vg-bar__group { font-weight: 600; }
.vg-logout { margin: 0; }
.vg-link {
	font: inherit;
	background: none;
	border: 0;
	padding: .25rem 0;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.vg-note {
	padding: .6rem .8rem;
	border-radius: 8px;
	background: var(--vg-soft);
	font-size: .875rem;
	color: var(--vg-muted);
}
.vg-empty { color: var(--vg-muted); }

/* ---------- Seznam galerij ---------- */
.vg-index {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
	gap: 1.25rem;
}
.vg-index__link {
	display: flex;
	flex-direction: column;
	gap: .2rem;
	color: inherit;
	text-decoration: none;
}
.vg-index__cover {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--vg-radius);
	background: var(--vg-soft);
	margin-bottom: .5rem;
}
.vg-index__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}
.vg-index__link:hover img, .vg-index__link:focus-visible img { transform: scale(1.03); }
.vg-index__title { font-weight: 600; line-height: 1.3; }
.vg-index__meta { font-size: .85rem; color: var(--vg-muted); }
.vg-more { margin-top: 2rem; font-size: .95rem; }
.vg-more summary { cursor: pointer; color: var(--vg-muted); }

/* ---------- Galerija ---------- */
.vg-back {
	display: inline-block;
	margin-bottom: .75rem;
	font-size: .9rem;
	color: inherit;
}
.vg-gallery__title { margin: 0 0 .25rem; }
.vg-gallery__meta { margin: 0 0 1.25rem; color: var(--vg-muted); font-size: .9rem; }
.vg-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 6px;
}
.vg-grid__item { margin: 0; }
.vg-grid__link {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 6px;
	background: var(--vg-soft);
}
.vg-grid__link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.vg-grid__link:focus-visible { outline: 3px solid var(--vg-accent); outline-offset: 2px; }
@media (max-width: 600px) {
	.vg-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
	.vg-grid__link { border-radius: 2px; }
}

/* ---------- Pregledovalnik (lightbox) ---------- */
.vg-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: #0b0b0d;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y pinch-zoom;
	-webkit-user-select: none;
	user-select: none;
}
.vg-lb[hidden] { display: none; }
.vg-lb__img {
	max-width: 100vw;
	max-height: 100vh;
	max-height: 100dvh;
	object-fit: contain;
	transition: opacity .15s ease;
}
@media (min-width: 700px) {
	.vg-lb { padding: 64px 80px; }
	.vg-lb__img { max-width: 100%; max-height: 100%; }
}
.vg-lb__img.is-loading { opacity: .25; }
.vg-lb__top {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: max(8px, env(safe-area-inset-top)) 8px 8px 16px;
	background: linear-gradient(rgba(0, 0, 0, .55), transparent);
	font-size: .9rem;
	font-variant-numeric: tabular-nums;
}
.vg-lb__actions { display: flex; gap: 4px; }
.vg-lb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	text-decoration: none;
}
.vg-lb__btn:hover, .vg-lb__btn:focus-visible { background: rgba(255, 255, 255, .14); outline: none; }
.vg-lb__btn svg { width: 24px; height: 24px; }
.vg-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	background: rgba(0, 0, 0, .35);
}
.vg-lb__nav--prev { left: 12px; }
.vg-lb__nav--next { right: 12px; }
.vg-lb__nav[disabled] { opacity: .25; cursor: default; }
@media (max-width: 699px) {
	.vg-lb__nav { display: none; }
}
html.vg-lb-open, html.vg-lb-open body { overflow: hidden; }
.vg-note--locked { text-align: center; padding: 1.25rem 1rem; font-size: 1rem; }
