/**
 * Studio OS Fotos – Fotorückblicke (Übersicht, Detail, Lightbox)
 *
 * Gleiche Tokens wie Kurse und Events (Magenta #a50775, Dunkelgrau #242021, Roboto);
 * Themes können --soc-* auf .sop überschreiben.
 */

.sop {
	--soc-accent: #a50775;
	--soc-accent-hover: #c4168f;
	--soc-card: #242021;
	--soc-ink: #ffffff;
	--soc-ink-muted: rgba(255, 255, 255, 0.7);

	container: sop / inline-size;
	max-width: 1100px;
	margin: 24px auto;
	color: var(--soc-ink);
	font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.45;
}

.sop img {
	display: block;
	max-width: none;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.sop-meta {
	margin: 4px 0 0;
	color: var(--soc-ink-muted);
	font-size: 0.9rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.sop-empty {
	margin: 16px 0;
	color: var(--soc-ink-muted);
	font-style: italic;
}

/* --- Übersicht ---------------------------------------------------------- */

.sop--overview {
	display: grid;
	gap: 24px;
}

.sop-gallery {
	background: var(--soc-card);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

.sop-gallery__head {
	padding: 16px 20px 14px;
	border-left: 4px solid var(--soc-accent);
}

.sop-gallery__title {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.25;
}

.sop-gallery__title a {
	color: var(--soc-ink);
	text-decoration: none;
}

.sop-gallery__title a:hover,
.sop-gallery__title a:focus {
	color: var(--soc-ink);
	text-decoration: underline;
	text-decoration-color: var(--soc-accent);
	text-underline-offset: 4px;
}

.sop-gallery__preview {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 3px;
}

.sop-gallery__preview img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: opacity 0.15s ease;
}

.sop-gallery__preview:hover img {
	opacity: 0.85;
}

/* --- Detail ------------------------------------------------------------- */

.sop-back {
	margin: 0 0 16px;
	font-size: 0.95rem;
	font-weight: 600;
}

.sop-back a {
	color: var(--soc-ink);
	text-decoration: none;
}

.sop-back a:hover,
.sop-back a:focus {
	color: var(--soc-accent-hover);
}

.sop-detail__head {
	margin: 0 0 16px;
	padding-left: 14px;
	border-left: 4px solid var(--soc-accent);
}

.sop-detail__title {
	margin: 0;
	color: var(--soc-ink);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
}

.sop-photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sop-photos__item {
	margin: 0;
	padding: 0;
}

.sop-photos__item::before {
	content: none;
}

.sop-photo {
	display: block;
	background: var(--soc-card);
}

.sop-photo img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	transition: opacity 0.15s ease;
}

.sop-photo:hover img {
	opacity: 0.85;
}

.sop-photo:focus-visible {
	outline: 2px solid var(--soc-accent);
	outline-offset: 2px;
}

@container sop (max-width: 560px) {
	.sop-gallery__head {
		padding: 12px 14px 10px;
	}

	.sop-gallery__title {
		font-size: 1.1rem;
	}

	.sop-detail__title {
		font-size: 1.25rem;
	}

	.sop-photos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* --- Lightbox ----------------------------------------------------------- */

.sop-lightbox-open {
	overflow: hidden;
}

.sop-lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.94);
	color: #fff;
	font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sop-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.94);
}

.sop-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 56px 64px 24px;
	box-sizing: border-box;
	touch-action: pan-y;
}

.sop-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100% - 32px);
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.sop-lightbox__counter {
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

.sop-lightbox__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font: 400 2rem/1 sans-serif;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.sop-lightbox__btn:hover,
.sop-lightbox__btn:focus-visible {
	background: #a50775;
}

.sop-lightbox__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.sop-lightbox__close {
	top: 8px;
	right: 8px;
}

.sop-lightbox__prev,
.sop-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.sop-lightbox__prev {
	left: 8px;
}

.sop-lightbox__next {
	right: 8px;
}

.sop-lightbox--single .sop-lightbox__prev,
.sop-lightbox--single .sop-lightbox__next {
	display: none;
}

@media (max-width: 600px) {
	.sop-lightbox__figure {
		padding: 56px 8px 16px;
	}

	/* Auf dem Handy wischen; Pfeile unten, damit sie das Bild nicht verdecken. */
	.sop-lightbox__prev,
	.sop-lightbox__next {
		top: auto;
		bottom: 8px;
		transform: none;
		width: 40px;
		height: 40px;
		font-size: 1.6rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sop-gallery__preview img,
	.sop-photo img,
	.sop-lightbox__btn {
		transition: none;
	}
}
