/* Atelier Gallery — frontend */

.ag-wrap {
	--ag-ink: #0b0c0e;
	--ag-bone: #e8e3da;
	--ag-hair: rgba(232, 227, 218, .22);
	--ag-height: 78vh;
	position: relative;
	margin: 0 0 2rem;
}

.ag-stage {
	position: relative;
	width: 100%;
	height: var(--ag-height);
	min-height: 380px;
	background: var(--ag-ink);
	overflow: hidden;
	color: var(--ag-bone);
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.ag-stage.is-full {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	min-height: 0;
	margin: 0;
	z-index: 2147483647;
	background: #060708;
}

/* När webbläsaren tar över med Fullscreen API */
.ag-stage:fullscreen,
.ag-stage:-webkit-full-screen {
	width: 100vw;
	height: 100vh;
	position: fixed;
	inset: 0;
}

.ag-stage:fullscreen .ag-canvas,
.ag-stage:-webkit-full-screen .ag-canvas {
	width: 100%;
	height: 100%;
}

/* Låt inte sidan rulla bakom helskärmen */
html:has(.ag-stage.is-full),
body:has(.ag-stage.is-full) {
	overflow: hidden;
}

.ag-wrap .ag-canvas,
.ag-wrap canvas.ag-canvas {
	display: block !important;
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	object-fit: fill !important;
	aspect-ratio: auto !important;
	transform: none !important;
	float: none !important;
	background: transparent !important;
}

/* Temat får inte heller flytta eller beskära scenen */
.ag-wrap {
	max-width: none;
	isolation: isolate;
}

.ag-wrap .ag-stage {
	box-sizing: border-box;
	max-width: none;
}

.ag-wrap .ag-stage *,
.ag-wrap .ag-stage *::before,
.ag-wrap .ag-stage *::after {
	box-sizing: border-box;
}

/* Vissa teman ger alla knappar egna färger och radier */
.ag-wrap .ag-stage button {
	border-radius: 0;
	text-transform: uppercase;
	box-shadow: none;
	min-height: 0;
	width: auto;
}

/* ---------- Skärmar över scenen ---------- */

.ag-veil {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 24px;
	background: radial-gradient(ellipse at 50% 45%, rgba(18, 20, 24, .82), rgba(6, 7, 8, .97));
	opacity: 0;
	pointer-events: none;
	transition: opacity .45s ease;
	z-index: 6;
}

.ag-veil.is-on {
	opacity: 1;
	pointer-events: auto;
}

.ag-veil.ag-enter.is-on {
	cursor: pointer;
}

.ag-title {
	font-size: clamp(30px, 5vw, 62px);
	line-height: 1.02;
	margin: 0 0 22px;
	font-weight: 400;
	letter-spacing: .02em;
	color: var(--ag-bone);
}

.ag-cta {
	margin: 0;
	font-size: 10px;
	letter-spacing: .42em;
	text-transform: uppercase;
	opacity: .78;
}

.ag-hint {
	margin: 18px 0 0;
	font-size: 10px;
	letter-spacing: .16em;
	text-transform: uppercase;
	opacity: .38;
	max-width: 30em;
}

.ag-progress {
	width: 180px;
	height: 1px;
	background: var(--ag-hair);
	margin: 22px auto 0;
}

.ag-progress i {
	display: block;
	height: 100%;
	width: 0;
	background: var(--ag-bone);
	transition: width .3s ease;
}

/* ---------- Hårkors och etikett ---------- */

.ag-reticle {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 5px;
	height: 5px;
	margin: -2.5px 0 0 -2.5px;
	z-index: 4;
	pointer-events: none;
	opacity: 0;
	transition: opacity .25s ease, transform .18s ease;
}

.ag-stage.is-live .ag-reticle {
	opacity: .5;
}

.ag-reticle i {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--ag-bone);
	box-shadow: 0 0 4px rgba(0, 0, 0, .8);
}

.ag-reticle.is-near {
	opacity: 1;
	transform: scale(2.1);
}

/* I närläget tittar man på verket, inte genom ett sikte. Det tonas ut
   och kommer tillbaka när man backar ut i rummet igen. */
.ag-stage.is-focus .ag-reticle {
	opacity: 0;
	transform: none;
}

.ag-label {
	position: absolute;
	left: 50%;
	top: calc(50% + 26px);
	transform: translateX(-50%);
	font-size: 10px;
	letter-spacing: .24em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
	z-index: 4;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}

.ag-label.is-on {
	opacity: .85;
}

/* ---------- Bildtext i närläge ---------- */

.ag-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 26px 30px calc(26px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, rgba(6, 7, 8, .92), rgba(6, 7, 8, 0));
	z-index: 5;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .35s ease, transform .35s ease;
	pointer-events: none;
}

.ag-caption.is-on {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.ag-caption h3 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 400;
	letter-spacing: .01em;
	color: var(--ag-bone);
}

.ag-caption .ag-meta {
	margin: 0 0 10px;
	font-size: 10px;
	letter-spacing: .26em;
	text-transform: uppercase;
	opacity: .5;
}

.ag-caption .ag-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.75;
	opacity: .72;
	max-width: 46em;
}

.ag-back {
	margin-top: 16px;
	background: none;
	border: 1px solid var(--ag-hair);
	color: var(--ag-bone);
	padding: 9px 20px;
	font: inherit;
	font-size: 10px;
	letter-spacing: .24em;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 0;
	transition: border-color .2s ease, background .2s ease;
}

.ag-back:hover,
.ag-back:focus-visible {
	border-color: rgba(232, 227, 218, .6);
	background: rgba(232, 227, 218, .07);
}

/* ---------- Touchstyrning ---------- */

.ag-touch {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	display: none;
}

.ag-stage.is-touch.is-live .ag-touch {
	display: block;
}

/* Ringarna ligger fast i nederkanten så att styrningen syns hela tiden.
   Fingret får ändå landa var som helst på sin halva — utgångsläget är
   där tummen sätts ned, och pricken visar riktningen. */

.ag-touch.is-hidden .ag-stick,
.ag-touch.is-hidden .ag-look {
	opacity: 0;
}

/* Vänster halva: gå. En tunn heldragen ring med en liten prick. */

.ag-stick {
	position: absolute;
	left: calc(30px + env(safe-area-inset-left));
	bottom: calc(104px + env(safe-area-inset-bottom));
	width: 112px;
	height: 112px;
	border: 1px solid rgba(232, 227, 218, .24);
	border-radius: 50%;
	opacity: .6;
	transition: opacity .3s ease, border-color .3s ease;
}

.ag-stick.is-active {
	opacity: 1;
	border-color: rgba(232, 227, 218, .42);
}

.ag-stick i {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border-radius: 50%;
	background: rgba(232, 227, 218, .14);
	border: 1px solid rgba(232, 227, 218, .5);
	transition: transform .06s linear;
}

.ag-stick.is-active i {
	transition: transform .04s linear;
}

/* Höger halva: sväng. Ringen är streckad — den greppar inget, den
   vrider — och två pilspetsar i sidled visar rörelsen. */

.ag-look {
	position: absolute;
	right: calc(30px + env(safe-area-inset-right));
	bottom: calc(104px + env(safe-area-inset-bottom));
	width: 112px;
	height: 112px;
	border: 1px dashed rgba(232, 227, 218, .22);
	border-radius: 50%;
	opacity: .6;
	transition: opacity .3s ease, border-color .3s ease;
}

.ag-look.is-active {
	opacity: 1;
	border-color: rgba(232, 227, 218, .4);
}

.ag-look::before,
.ag-look::after {
	content: '';
	position: absolute;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-top: 1px solid rgba(232, 227, 218, .5);
	border-right: 1px solid rgba(232, 227, 218, .5);
}

.ag-look::before {
	left: -14px;
	transform: rotate(-135deg);
}

.ag-look::after {
	right: -14px;
	transform: rotate(45deg);
}

.ag-look i {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 9px;
	height: 9px;
	margin: -4.5px 0 0 -4.5px;
	border-radius: 50%;
	background: rgba(232, 227, 218, .65);
	transition: transform .06s linear;
}

.ag-look.is-active i {
	background: rgba(232, 227, 218, .85);
	transition: transform .04s linear;
}

/* Låg skärm: dra ned ringarna så de inte krockar med verken */
@media (max-height: 620px) {
	.ag-stick,
	.ag-look {
		width: 92px;
		height: 92px;
		bottom: calc(86px + env(safe-area-inset-bottom));
	}
}

/* ---------- HTML-reserv ---------- */

.ag-fallback {
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ag-wrap.no-webgl .ag-fallback {
	position: static;
	width: auto;
	height: auto;
	overflow: visible;
	clip: auto;
	clip-path: none;
	white-space: normal;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 18px;
}

.ag-wrap.no-webgl .ag-stage {
	display: none;
}

.ag-fallback img {
	width: 100%;
	height: auto;
	display: block;
}

.ag-empty {
	padding: 20px;
	border: 1px dashed rgba(0, 0, 0, .2);
}

@media (prefers-reduced-motion: reduce) {
	.ag-veil,
	.ag-caption,
	.ag-label,
	.ag-reticle {
		transition: none;
	}

	.ag-stick,
	.ag-look,
	.ag-stick i,
	.ag-look i {
		transition: none;
	}
}

/* ---------- Rumsetikett ---------- */

.ag-room-tag {
	position: absolute;
	left: 50%;
	top: 34px;
	transform: translateX(-50%);
	font-size: 10px;
	letter-spacing: .42em;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity .6s ease;
	pointer-events: none;
	z-index: 4;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
}

.ag-room-tag.is-on { opacity: .8; }

/* ---------- Vägledning i närläge ---------- */

.ag-hint-back {
	position: absolute;
	left: 50%;
	top: 22px;
	transform: translateX(-50%);
	font-size: 10px;
	letter-spacing: .2em;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity .5s ease;
	pointer-events: none;
	z-index: 6;
	color: var(--ag-bone);
	text-shadow: 0 1px 8px rgba(0, 0, 0, .95);
}

.ag-hint-back.is-on { opacity: .62; }

/* ---------- Ljust galleri ---------- */

.ag-theme-white {
	--ag-ink: #e9e7e3;
	--ag-bone: #16171a;
	--ag-hair: rgba(22, 23, 26, .2);
}

.ag-theme-white .ag-stage { background: #e9e7e3; }

.ag-theme-white .ag-veil {
	background: radial-gradient(ellipse at 50% 45%, rgba(246, 245, 242, .88), rgba(226, 223, 218, .97));
}

.ag-theme-white .ag-reticle i { box-shadow: 0 0 4px rgba(255, 255, 255, .9); }
.ag-theme-white .ag-label,
.ag-theme-white .ag-room-tag { text-shadow: 0 1px 6px rgba(255, 255, 255, .85); }

.ag-theme-white .ag-stick,
.ag-theme-white .ag-look {
	border-color: rgba(22, 23, 26, .22);
}

.ag-theme-white .ag-stick.is-active,
.ag-theme-white .ag-look.is-active {
	border-color: rgba(22, 23, 26, .4);
}

.ag-theme-white .ag-stick i {
	background: rgba(22, 23, 26, .1);
	border-color: rgba(22, 23, 26, .35);
}

.ag-theme-white .ag-look::before,
.ag-theme-white .ag-look::after {
	border-top-color: rgba(22, 23, 26, .45);
	border-right-color: rgba(22, 23, 26, .45);
}

.ag-theme-white .ag-look i {
	background: rgba(22, 23, 26, .55);
}

/* Bildtexten ligger mot det mörklagda rummet — den förblir ljus i båda temana */
.ag-theme-white .ag-caption {
	background: linear-gradient(to top, rgba(6, 7, 8, .9), rgba(6, 7, 8, 0));
	color: #e8e3da;
}
.ag-theme-white .ag-caption h3 { color: #e8e3da; }
.ag-theme-white .ag-back {
	color: #e8e3da;
	border-color: rgba(232, 227, 218, .28);
}
.ag-theme-white .ag-hint-back {
	color: #e8e3da;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
}

/* ---------- Knappar i bildtexten ---------- */

.ag-caption-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 16px;
	flex-wrap: wrap;
}

.ag-caption-actions .ag-back { margin-top: 0; }

.ag-sound {
	background: none;
	border: 1px solid rgba(232, 227, 218, .28);
	color: #e8e3da;
	padding: 9px 20px;
	font: inherit;
	font-size: 10px;
	letter-spacing: .24em;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 0;
	transition: border-color .2s ease, background .2s ease;
}

.ag-sound:hover,
.ag-sound:focus-visible {
	border-color: rgba(232, 227, 218, .6);
	background: rgba(232, 227, 218, .07);
}

.ag-sound.is-on {
	background: rgba(232, 227, 218, .14);
	border-color: rgba(232, 227, 218, .65);
}

/* ---------- Planritning ---------- */

.ag-nav {
	position: absolute;
	left: calc(18px + env(safe-area-inset-left));
	bottom: calc(18px + env(safe-area-inset-bottom));
	z-index: 4;
	pointer-events: none;
	opacity: 0;
	transition: opacity .4s ease;
}

.ag-stage.is-live .ag-nav { opacity: 1; }

.ag-map {
	display: block;
	width: 170px;
	height: 75px;
	background: rgba(10, 11, 13, .38);
	backdrop-filter: blur(4px);
	border: 1px solid var(--ag-hair);
	border-radius: 2px;
}

.ag-theme-white .ag-map {
	background: rgba(250, 249, 247, .62);
}

.ag-nav-info {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-top: 7px;
	font-size: 9px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--ag-bone);
	text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}

.ag-theme-white .ag-nav-info { text-shadow: 0 1px 6px rgba(255, 255, 255, .8); }

.ag-nav-room { opacity: .82; }
.ag-nav-count { opacity: .45; margin-left: auto; }

/* Kartan viker undan när ett verk är förstorat */
.ag-nav.is-hidden { opacity: 0 !important; }

@media (max-width: 600px) {
	.ag-map { width: 128px; height: 56px; }
	.ag-nav-info { font-size: 8px; gap: 7px; }
}

.ag-scope {
	margin: 0 0 16px;
	font-size: 11px;
	letter-spacing: .28em;
	text-transform: uppercase;
	opacity: .45;
}

/* ---------- Scenen lyft ur sidan i helskärm ---------- */

.ag-placeholder {
	width: 100%;
	height: var(--ag-height, 78vh);
	min-height: 380px;
}

.ag-stage.ag-portal {
	--ag-ink: #0b0c0e;
	--ag-bone: #e8e3da;
	--ag-hair: rgba(232, 227, 218, .22);
}

.ag-stage.ag-portal.ag-theme-white {
	--ag-ink: #e9e7e3;
	--ag-bone: #16171a;
	--ag-hair: rgba(22, 23, 26, .2);
	background: #e9e7e3;
}

.ag-stage.ag-portal.ag-theme-white .ag-veil {
	background: radial-gradient(ellipse at 50% 45%, rgba(246, 245, 242, .88), rgba(226, 223, 218, .97));
}

.ag-stage.ag-portal.ag-theme-white .ag-caption {
	background: linear-gradient(to top, rgba(6, 7, 8, .9), rgba(6, 7, 8, 0));
	color: #e8e3da;
}

.ag-stage.ag-portal.ag-theme-white .ag-map {
	background: rgba(250, 249, 247, .62);
}


/* ---------- Knappar ska alltid kunna tryckas ---------- */

.ag-wrap .ag-stage button,
.ag-stage.ag-portal button {
	pointer-events: auto !important;
	touch-action: manipulation;
	position: relative;
	z-index: 8;
}

.ag-caption.is-on {
	pointer-events: auto;
	touch-action: manipulation;
}

.ag-close {
	touch-action: manipulation;
}

/* ---------- Bildtexten på liten skärm ---------- */

@media (max-width: 900px), (max-height: 560px) {
	.ag-caption {
		padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
		background: linear-gradient(to top, rgba(6, 7, 8, .92) 55%, rgba(6, 7, 8, 0));
		padding-left: calc(18px + env(safe-area-inset-left));
		padding-right: calc(18px + env(safe-area-inset-right));
	}

	.ag-caption h3 {
		font-size: 15px;
		margin-bottom: 3px;
	}

	.ag-caption .ag-meta {
		font-size: 9px;
		margin-bottom: 5px;
	}

	.ag-caption .ag-text {
		font-size: 12px;
		line-height: 1.55;
		max-height: 3.1em;
		overflow: hidden;
	}

	.ag-caption-actions {
		margin-top: 7px;
		gap: 8px;
	}

	.ag-caption-actions button {
		padding: 7px 14px;
		font-size: 9px;
		letter-spacing: .18em;
	}
}

/* Liggande telefon: minimalt, så verket får plats */
@media (max-height: 460px) {
	.ag-caption .ag-text { display: none; }
	.ag-caption { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
	.ag-caption h3 { font-size: 14px; }
	.ag-caption-actions { margin-top: 8px; }
}

/* Hörnen på telefoner med skärmutskärning */
.ag-stage.is-full .ag-nav {
	left: calc(18px + env(safe-area-inset-left));
}

.ag-stage.is-full .ag-close {
	right: calc(12px + env(safe-area-inset-right));
	top: calc(12px + env(safe-area-inset-top));
}

/* ---------- Albumet ---------- */

.ag-album {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(8, 9, 11, .93);
	backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity .35s ease;
	color: #e8e3da;
}

.ag-album.is-on { opacity: 1; }
.ag-album[hidden] { display: none; }

.ag-album-inner {
	width: 100%;
	max-width: 1180px;
	height: 100%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
	position: relative;
}

.ag-album-close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	width: 40px;
	height: 40px;
	background: none;
	border: 1px solid rgba(232, 227, 218, .25);
	color: #e8e3da;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.ag-album-stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
}

.ag-album-media {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ag-album-media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	object-fit: contain;
	display: block;
	margin: auto;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

/* Meta och miniatyrer krymper aldrig bort bilden */
.ag-album-meta,
.ag-album-strip {
	flex: 0 0 auto;
}

.ag-album-blank {
	width: 220px;
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(232, 227, 218, .08);
	font-size: 28px;
	opacity: .5;
}

.ag-album-prev,
.ag-album-next {
	flex: 0 0 auto;
	width: 46px;
	height: 76px;
	background: none;
	border: 1px solid rgba(232, 227, 218, .18);
	color: #e8e3da;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease;
}

.ag-album-prev:hover,
.ag-album-next:hover {
	border-color: rgba(232, 227, 218, .55);
	background: rgba(232, 227, 218, .07);
}

.ag-album-meta { text-align: center; }

.ag-album-meta h3 {
	margin: 0 0 5px;
	font-size: 20px;
	font-weight: 400;
	color: #e8e3da;
}

.ag-album-sub {
	margin: 0 0 8px;
	font-size: 10px;
	letter-spacing: .26em;
	text-transform: uppercase;
	opacity: .5;
}

.ag-album-text {
	margin: 0 auto;
	font-size: 13px;
	line-height: 1.7;
	opacity: .72;
	max-width: 52em;
	max-height: 4.4em;
	overflow: hidden;
}

.ag-album-actions {
	margin-top: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.ag-album-goto {
	background: none;
	border: 1px solid rgba(232, 227, 218, .3);
	color: #e8e3da;
	padding: 9px 20px;
	font: inherit;
	font-size: 10px;
	letter-spacing: .24em;
	text-transform: uppercase;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease;
}

.ag-album-goto:hover {
	border-color: rgba(232, 227, 218, .65);
	background: rgba(232, 227, 218, .1);
}

.ag-album-count {
	font-size: 10px;
	letter-spacing: .22em;
	opacity: .45;
}

.ag-album-strip {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 4px 0 8px;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.ag-thumb {
	flex: 0 0 auto;
	width: 62px;
	height: 62px;
	padding: 0;
	border: 1px solid transparent;
	background: rgba(232, 227, 218, .07);
	cursor: pointer;
	opacity: .45;
	transition: opacity .2s ease, border-color .2s ease;
	overflow: hidden;
	color: #e8e3da;
}

.ag-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ag-thumb:hover { opacity: .85; }

.ag-thumb.is-on {
	opacity: 1;
	border-color: rgba(232, 227, 218, .8);
}

@media (max-width: 700px), (max-height: 560px) {
	.ag-album { padding: 14px; }
	.ag-album-inner { gap: 10px; }
	.ag-album-close { width: 34px; height: 34px; font-size: 19px; }
	.ag-album-prev, .ag-album-next {
		width: 34px;
		height: 58px;
		font-size: 20px;
		flex: 0 0 auto;
	}
	.ag-album-meta h3 { font-size: 15px; }
	.ag-album-text { display: none; }
	.ag-album-actions { margin-top: 8px; gap: 10px; }
	.ag-thumb { width: 44px; height: 44px; }
	.ag-album-strip { gap: 5px; }
}

@media (max-height: 430px) {
	.ag-album-strip { display: none; }
	.ag-album-sub { margin-bottom: 4px; }
}

.ag-progress-count {
	margin: 12px 0 0;
	font-size: 9px;
	letter-spacing: .28em;
	opacity: .32;
}

/* Albumet i helskärm: räkna mot rutans verkliga höjd */
.ag-stage.is-full .ag-album {
	height: 100%;
	padding-top: calc(14px + env(safe-area-inset-top));
	padding-bottom: calc(14px + env(safe-area-inset-bottom));
	padding-left: calc(14px + env(safe-area-inset-left));
	padding-right: calc(14px + env(safe-area-inset-right));
}

.ag-album-close {
	flex: 0 0 auto;
}

/* Hårkorset markerar tydligare när något är i siktet */
.ag-reticle.is-near i {
	background: transparent;
	border: 1.5px solid var(--ag-bone);
	box-shadow: 0 0 6px rgba(0, 0, 0, .7), 0 0 10px rgba(255, 255, 255, .35);
}

.ag-reticle.is-near {
	transform: scale(2.6);
}

/* ---------- Lås: grind, lösenordsruta och låst verk ---------- */

.ag-gated {
	display: block;
}

.ag-gate {
	min-height: min(52vh, 460px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 48px 24px;
	text-align: center;
	background: var(--ag-ink, #0d0f12);
	color: var(--ag-bone, #e8e3da);
}

.ag-theme-white .ag-gate {
	background: #e9e7e3;
	color: #22242a;
}

.ag-gate-title {
	margin: 0;
	font-size: 22px;
	font-weight: 400;
	letter-spacing: .04em;
}

.ag-gate-lead {
	margin: 0;
	font-size: 13px;
	opacity: .68;
	max-width: 34em;
}

.ag-gate-form {
	margin: 6px 0 0;
	width: 100%;
	max-width: 340px;
}

.ag-gate-note {
	margin: 0 0 10px;
	font-size: 12px;
	opacity: .62;
	line-height: 1.6;
}

.ag-gate-row {
	display: flex;
	gap: 8px;
}

.ag-gate-form input[type="password"] {
	flex: 1 1 auto;
	min-width: 0;
	background: none;
	border: 1px solid currentColor;
	border-radius: 0;
	color: inherit;
	font: inherit;
	font-size: 13px;
	padding: 9px 12px;
	opacity: .85;
}

.ag-gate-form input[type="password"]:focus {
	outline: none;
	opacity: 1;
}

.ag-gate-form button {
	background: none;
	border: 1px solid currentColor;
	border-radius: 0;
	color: inherit;
	font: inherit;
	font-size: 10px;
	letter-spacing: .22em;
	text-transform: uppercase;
	padding: 9px 18px;
	cursor: pointer;
}

.ag-gate-form button:hover {
	background: rgba(128, 128, 128, .14);
}

.ag-gate-bad {
	margin: 9px 0 0;
	font-size: 12px;
	color: #c8553d;
}

/* Den lilla varianten under ett galleri där bara vissa verk är låsta */
.ag-gate-form.is-compact {
	max-width: 420px;
	margin: 16px auto 0;
	text-align: center;
}

.ag-album-blank.is-locked {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	font-size: 13px;
	line-height: 1.7;
	text-align: center;
	opacity: .7;
	max-width: 22em;
}

.ag-anchor {
	display: block;
	height: 0;
	scroll-margin-top: 80px;
}

/* Lösenordsrutan i bildtexten, för verk man går fram till i vyn */

.ag-caption-pass {
	display: flex;
	gap: 8px;
	margin: 12px 0 0;
	max-width: 320px;
}

.ag-caption-pass[hidden] {
	display: none;
}

.ag-caption-pass input[type="password"] {
	flex: 1 1 auto;
	min-width: 0;
	background: none;
	border: 1px solid rgba(232, 227, 218, .34);
	border-radius: 0;
	color: #e8e3da;
	font: inherit;
	font-size: 13px;
	padding: 8px 11px;
}

.ag-caption-pass input[type="password"]:focus {
	outline: none;
	border-color: rgba(232, 227, 218, .7);
}

.ag-caption-pass button {
	background: none;
	border: 1px solid rgba(232, 227, 218, .34);
	border-radius: 0;
	color: #e8e3da;
	font: inherit;
	font-size: 10px;
	letter-spacing: .22em;
	text-transform: uppercase;
	padding: 8px 16px;
	cursor: pointer;
	white-space: nowrap;
}

.ag-caption-pass button:hover {
	border-color: rgba(232, 227, 218, .7);
}

/* ---------- Länkknappen i bildtexten ---------- */

.ag-link {
	background: none;
	border: 1px solid rgba(232, 227, 218, .28);
	color: #e8e3da;
	padding: 9px 20px;
	font: inherit;
	font-size: 10px;
	letter-spacing: .24em;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 0;
	transition: border-color .2s ease, background .2s ease;
}

.ag-link:hover,
.ag-link:focus-visible {
	border-color: rgba(232, 227, 218, .6);
	background: rgba(232, 227, 218, .07);
}

.ag-link.is-done {
	background: rgba(232, 227, 218, .14);
	border-color: rgba(232, 227, 218, .65);
}

/* ---------- Draperiet ----------
   Mörkar ner rutan ett ögonblick: när salongens dörr öppnas, och
   mellan rummen i visningsläget. Ligger över slöjan men under
   albumet och stängknappen. */

.ag-dim {
	position: absolute;
	inset: 0;
	z-index: 7;
	background: #000;
	opacity: 0;
	pointer-events: none;
	transition: opacity .5s ease;
}

.ag-dim.is-on {
	opacity: 1;
}

/* Långsammare väg tillbaka in i ljuset än ner i mörkret */
.ag-dim.is-slow {
	transition-duration: 1.3s;
}

@media (prefers-reduced-motion: reduce) {
	.ag-dim { transition-duration: .2s; }
}
