/* Albumseite (Partyfotos) und Großansicht – Vorlage templates/single-em_album.php
   Gestaltung: _uebergabe/entwurf-seiten/P-Fotos-Album.dc.html, P-Fotos-Lightbox.dc.html, P-Fotos-Lightbox-mobil.dc.html */

/* ---------- Kopf ---------- */
.em-album-head.em-section {
	padding-top: 16px;
	padding-bottom: clamp(48px, 5vw, 72px);
}

.em-album-head__inner {
	gap: 22px;
}

.em-album-head__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	color: var(--text-muted-on-navy);
}

.em-album-head__crumbs a {
	display: inline-flex;
	align-items: center;
	min-height: var(--touch-min);
	color: var(--white);
	text-decoration: underline;
	text-decoration-color: var(--yellow-400);
	text-underline-offset: 4px;
}

.em-album-head__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
	gap: 28px 64px;
	align-items: end;
}

.em-album-head__titles {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.em-album-head .em-album-head__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(36px, 5vw, 72px);
	font-weight: 400;
	line-height: 1;
	text-wrap: balance;
	overflow-wrap: break-word;
}

.em-album-head__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.em-album-head .em-album-pill {
	padding: 8px 12px;
	font-size: 15px;
	white-space: normal;
}

.em-album-pill--glass {
	background: rgba(255, 255, 255, 0.12);
	color: var(--white);
}

/* Bootparty-Etikett hätte auf Blau keinen Kontrast. */
.em-album-head .em-album-pill--bootparty {
	background: var(--white);
	color: var(--navy-700);
}

.em-album-head__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	min-width: 0;
}

.em-album-head__copy {
	align-self: flex-start;
}

.em-album-head__copy[hidden] {
	display: none;
}

.em-album-head__copy svg {
	width: 18px;
	height: 18px;
}

/* ---------- Galerie ---------- */
.em-gallery.em-section {
	padding-top: clamp(48px, 5vw, 72px);
	padding-bottom: clamp(64px, 7vw, 104px);
}

.em-gallery__inner {
	gap: 36px;
}

.em-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(200px, 46%), 1fr));
	gap: 22px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Mit JavaScript zuerst nur 24 Fotos; ohne JavaScript alle. */
.js .em-gallery__item.is-later {
	display: none;
}

.em-gallery__button {
	display: block;
	width: 100%;
	padding: 6px;
	border: 0;
	background: var(--paper);
	box-shadow: 0 14px 28px -18px rgba(15, 28, 58, 0.55);
	cursor: zoom-in;
	transform: rotate(-1deg);
	transition: transform 0.2s ease;
}

.em-gallery__item:nth-child(4n + 2) .em-gallery__button { transform: rotate(0.8deg); }
.em-gallery__item:nth-child(4n + 3) .em-gallery__button { transform: rotate(-0.5deg); }
.em-gallery__item:nth-child(4n + 4) .em-gallery__button { transform: rotate(1.2deg); }

.em-gallery__item .em-gallery__button:hover,
.em-gallery__item .em-gallery__button:focus-visible {
	transform: rotate(0deg) scale(1.03);
}

.em-gallery__button:focus-visible {
	outline: 3px solid var(--navy-700);
	outline-offset: 4px;
}

.em-gallery__button img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.em-gallery__more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.em-gallery__more[hidden] {
	display: none;
}

.em-gallery__count {
	margin: 0;
	font-size: 16px;
	color: var(--text-body);
}

.em-gallery__load {
	min-height: 54px;
	padding: 0 28px;
}

/* Älteres / neueres Album */
.em-gallery__nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
	gap: 16px;
	padding-top: 32px;
	border-top: 3px dashed var(--text-muted-on-navy);
}

.em-gallery__nav-link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
	border-radius: var(--radius-lg);
	background: var(--mist-100);
	color: var(--navy-900);
	text-decoration: none;
}

.em-gallery__nav-link--newer {
	grid-column: -2 / -1;
	justify-content: flex-end;
	text-align: right;
}

.em-gallery__nav-link:hover .em-gallery__nav-title {
	text-decoration: underline;
	text-decoration-color: var(--yellow-400);
	text-decoration-thickness: 3px;
	text-underline-offset: 4px;
}

.em-gallery__nav-link:focus-visible {
	outline: 3px solid var(--navy-700);
	outline-offset: 3px;
}

.em-gallery__nav-arrow {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--navy-900);
	color: var(--yellow-400);
}

.em-gallery__nav-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.em-gallery__nav-label {
	font-size: 14px;
	color: var(--text-label);
}

.em-gallery__nav-title {
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 1.25;
}

/* ---------- Großansicht ---------- */
.em-lightbox-open {
	overflow: hidden;
}

.em-lightbox {
	--lb-bg: #0b1530; /* Hintergrund der Großansicht laut Entwurf */
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--lb-bg);
	color: var(--white);
	--focus-ring: var(--yellow-400);
}

.em-lightbox::backdrop {
	background: rgba(11, 21, 48, 0.92);
}

.em-lightbox :focus-visible {
	outline: 3px solid var(--yellow-400);
	outline-offset: 3px;
}

.em-lightbox__frame {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 18px;
	height: 100%;
	padding: 24px;
}

.em-lightbox__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.em-lightbox__titles {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.em-lightbox .em-lightbox__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--white);
}

.em-lightbox__count {
	margin: 0;
	font-size: 15px;
	color: var(--text-muted-on-navy);
}

.em-lightbox__close {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-radius: var(--radius-lg);
	background: transparent;
	color: var(--white);
	cursor: pointer;
}

.em-lightbox__close:hover {
	border-color: var(--white);
}

.em-lightbox__stage {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-rows: minmax(0, 1fr);
	align-items: center;
	gap: 28px;
}

/* Das Foto liegt absolut in seiner Zelle: Die Zelle bestimmt den Platz, album.js die genaue Bildgröße. */
.em-lightbox__cell {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 0;
}

.em-lightbox__figure {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 12px 12px 0;
	background: var(--paper);
	box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
	transform: translate(-50%, -50%) rotate(-0.6deg);
}

.em-lightbox__image {
	display: block;
	max-width: none;
	background: var(--mist-100);
}

.em-lightbox__caption {
	padding: 12px 0 14px;
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 1.2;
	color: var(--navy-900);
	text-align: center;
}

.em-lightbox__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--yellow-400);
	color: var(--navy-900);
	cursor: pointer;
}

.em-lightbox__arrow:hover {
	background: var(--yellow-300);
}

.em-lightbox__strip {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	list-style: none;
}

.em-lightbox__thumb {
	display: block;
	width: 64px;
	height: 64px;
	padding: 3px;
	border: 0;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.12);
	cursor: pointer;
}

.em-lightbox__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 3px;
	opacity: 0.7;
}

.em-lightbox__thumb[aria-current="true"] {
	background: var(--yellow-400);
}

.em-lightbox__thumb[aria-current="true"] img,
.em-lightbox__thumb:hover img {
	opacity: 1;
}

.em-lightbox__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 14px;
}

.em-lightbox__action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: var(--radius-md);
	font-family: var(--font-display);
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.em-lightbox__action--share {
	background: var(--yellow-400);
	color: var(--navy-900);
}

.em-lightbox__action--download {
	border-color: rgba(255, 255, 255, 0.5);
	background: transparent;
	color: var(--white);
}

.em-lightbox__action--download:hover {
	border-color: var(--white);
	color: var(--white);
}

.em-lightbox__remove {
	display: inline-flex;
	align-items: center;
	min-height: 46px;
	padding: 0 8px;
	font-size: 15px;
	color: var(--text-muted-on-navy);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.em-lightbox__remove:hover {
	color: var(--white);
}

/* ---------- Handy ---------- */
@media (max-width: 640px) {
	.em-album-head.em-section {
		padding-top: 8px;
	}

	.em-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 14px;
	}

	.em-gallery__nav-link--newer {
		grid-column: auto;
	}

	.em-lightbox__frame {
		gap: 14px;
		padding: 14px;
	}

	.em-lightbox .em-lightbox__title {
		font-size: 17px;
	}

	/* Pfeile unter dem Foto. */
	.em-lightbox__stage {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: minmax(0, 1fr) auto;
		gap: 14px 16px;
	}

	.em-lightbox__cell {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.em-lightbox__arrow {
		grid-row: 2;
		width: 52px;
		height: 52px;
	}

	.em-lightbox__arrow--prev {
		justify-self: end;
	}

	.em-lightbox__arrow--next {
		justify-self: start;
	}

	.em-lightbox__figure {
		padding: 8px 8px 0;
	}

	.em-lightbox__caption {
		padding: 8px 0 10px;
		font-size: 15px;
	}
}

/* Sehr niedrige Fenster (Handy quer): Vorschau-Leiste weglassen. */
@media (max-height: 520px) {
	.em-lightbox__strip {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.em-gallery__button {
		transition: none;
	}
}
