/* Sola-Historie: aufklappbare Galerien mit bunter Bildermatrix, Vergrößerung und Diashow.
   Farben kommen aus der Palette des Templates (--d-*); die Rückfallwerte gelten ohne Template. */

.sola-historie {
	--h-primary: var(--d-primary, #173d2d);
	--h-paper: var(--d-paper, #f7faf3);
	--h-tint: var(--d-tint, #e8f1e2);
	--h-line: var(--d-line, #cfe0c8);
	--h-hl: var(--d-hl, #f6b23c);
	--h-hl-text: var(--d-hl-text, #173d2d);
	--h-text: var(--d-text, #173d2d);
	--h-muted: var(--d-muted, #4a6558);
	--h-gap: 10px;
	--h-cols: 4;
	margin: 0 auto;
	max-width: 1100px;
	padding: 1.5rem 1rem 3rem;
	color: var(--h-text);
}

.sola-historie__title { margin: 0 0 .5rem; color: var(--h-primary); }
.sola-historie__lead { margin: 0 0 1.5rem; color: var(--h-muted); max-width: 46rem; }
.sola-historie__empty { color: var(--h-muted); }

/* ---- Akkordeon ---- */
.sola-hist {
	margin: 0 0 .9rem;
	border: 2px solid var(--h-line);
	border-radius: 14px;
	background: #fff;
	overflow: hidden; scroll-margin-top: 90px;
	transition: border-color .2s, box-shadow .2s;
}
.sola-hist.is-open { border-color: var(--h-primary); box-shadow: 0 6px 22px rgb(23 61 45 / 12%); }

.sola-hist__bar { display: flex; align-items: stretch; gap: .5rem; }
.sola-hist__head { margin: 0; flex: 1 1 auto; font-size: 1.15rem; line-height: 1.3; }

.sola-hist__toggle {
	display: flex; align-items: center; gap: .75rem; width: 100%;
	padding: 1rem 1.1rem; border: 0; background: transparent; color: inherit;
	font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.sola-hist__toggle:hover { background: var(--h-tint); }
.sola-hist__toggle:focus-visible, .sola-hist__play:focus-visible, .sola-hist__pic:focus-visible, .sola-hist__btn:focus-visible {
	outline: 3px solid var(--h-hl); outline-offset: -3px;
}
.sola-hist__name { flex: 1 1 auto; color: var(--h-primary); }
.sola-hist__count { flex: 0 0 auto; font-size: .85rem; font-weight: 400; color: var(--h-muted); }
.sola-hist__chev {
	flex: 0 0 auto; width: .7rem; height: .7rem; margin: 0 .2rem;
	border-right: 3px solid var(--h-primary); border-bottom: 3px solid var(--h-primary);
	transform: rotate(45deg) translate(-2px, -2px); transition: transform .3s;
}
.sola-hist.is-open .sola-hist__chev { transform: rotate(-135deg) translate(-2px, -2px); }

/* Play-Knopf: im gelben Akzent der Seite */
.sola-hist__play {
	display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto;
	margin: .55rem .7rem .55rem 0; padding: 0 1rem; border: 0; border-radius: 999px;
	background: var(--h-hl); color: var(--h-hl-text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
	transition: filter .15s, transform .15s;
}
.sola-hist__play[hidden] { display: none; }
.sola-hist__play:hover { filter: brightness(1.06); transform: translateY(-1px); }
.sola-hist__play-icon {
	width: 0; height: 0; border-style: solid; border-width: .45rem 0 .45rem .75rem; border-color: transparent transparent transparent currentcolor;
}
.sola-hist__play[aria-pressed="true"] .sola-hist__play-icon { width: .8rem; height: .8rem; border: 0; background: currentcolor; border-radius: 2px; }

/* Aufklappen: ohne Skript sind alle Bereiche offen */
.sola-hist__panel { display: grid; grid-template-rows: 1fr; }
.sola-historie.is-ready .sola-hist__panel {
	grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .4s ease, visibility 0s .4s;
}
.sola-historie.is-ready .sola-hist.is-open .sola-hist__panel { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.sola-hist__inner { min-height: 0; overflow: hidden; }
.sola-hist__intro { margin: 0; padding: .25rem 1.1rem .75rem; color: var(--h-muted); }
.sola-hist__intro > :first-child { margin-top: 0; }
.sola-hist__intro > :last-child { margin-bottom: 0; }
.sola-hist__intro p, .sola-hist__intro ul, .sola-hist__intro ol { margin: 0 0 .7rem; }
.sola-hist__intro a { color: inherit; text-decoration: underline; }

/* ---- Bunte Matrix: Bilder behalten ihr Format (hoch, quer, quadratisch) und fügen sich ohne Lücken zusammen ---- */
.sola-hist__stage { position: relative; padding: .25rem 1.1rem 1.2rem; }
.sola-hist__grid { column-count: var(--h-cols); column-gap: var(--h-gap); margin: 0; padding: 0; list-style: none; }
.sola-hist__item { margin: 0 0 var(--h-gap); break-inside: avoid; page-break-inside: avoid; }

.sola-hist__pic {
	display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
	background: var(--h-tint); cursor: zoom-in; position: relative;
	transition: transform .25s, box-shadow .25s;
}
.sola-hist__pic img { display: block; width: 100%; height: auto; transition: transform .45s; }
.sola-hist__pic:hover { transform: translateY(-2px); }
.sola-hist__pic:hover img { transform: scale(1.05); }
/* bunter Rand je nach Position, damit die Matrix lebendig wirkt */
.sola-hist__item:nth-child(4n+1) .sola-hist__pic { box-shadow: 0 0 0 3px var(--h-hl); }
.sola-hist__item:nth-child(4n+2) .sola-hist__pic { box-shadow: 0 0 0 3px var(--h-primary); }
.sola-hist__item:nth-child(4n+3) .sola-hist__pic { box-shadow: 0 0 0 3px var(--h-line); }
.sola-hist__item:nth-child(4n) .sola-hist__pic { box-shadow: 0 0 0 3px var(--h-hl-ink, #2f6b4f); }
.sola-hist__item .sola-hist__pic:hover { box-shadow: 0 8px 20px rgb(23 61 45 / 28%), 0 0 0 3px var(--h-hl); }

@media (max-width: 900px) { .sola-historie { --h-cols: 3; } }
@media (max-width: 560px) {
	.sola-historie { --h-cols: 2; --h-gap: 8px; }
	.sola-hist__toggle { padding: .85rem .8rem; }
	.sola-hist__count { display: none; }
	.sola-hist__play-text { display: none; }
	.sola-hist__play { padding: 0 .85rem; }
}

/* ---- Diashow: Überlagerung der Matrix ---- */
.sola-hist__show {
	position: absolute; inset: .25rem 1.1rem 1.2rem; z-index: 3;
	border-radius: 12px; background: #0e241b; color: #fff;
	animation: sola-hist-in .35s ease;
}
.sola-hist__show[hidden] { display: none; }
.sola-hist__pane {
	position: sticky; top: 12px; display: flex; flex-direction: column;
	height: min(calc(100vh - 14rem), 100%); min-height: 260px;
}
.sola-hist__slides { position: relative; flex: 1 1 auto; min-height: 0; }
.sola-hist__slide {
	position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center;
	opacity: 0; will-change: opacity, transform;
}
.sola-hist__slide.is-on { opacity: 1; z-index: 2; }
.sola-hist__slide.is-leaving { opacity: 1; z-index: 1; }
.sola-hist__show[data-effect="kenburns"] .sola-hist__slide.is-on img,
.sola-hist__show[data-effect="kenburns"] .sola-hist__slide.is-leaving img { animation: sola-hist-kb var(--sola-kb, 6s) linear both; }
@keyframes sola-hist-kb { from { transform: scale(1); } to { transform: scale(1.2); } }
.sola-hist__slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.sola-hist__bottom {
	display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; background: rgb(0 0 0 / 35%); font-size: .9rem;
}
.sola-hist__cap { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sola-hist__num { flex: 0 0 auto; opacity: .8; font-variant-numeric: tabular-nums; }
.sola-hist__bar-time { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--h-hl); }

.sola-hist__btn {
	display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .8rem;
	border: 0; border-radius: 999px; background: var(--h-hl); color: var(--h-hl-text); font: inherit; font-weight: 700; cursor: pointer;
}
.sola-hist__btn:hover { filter: brightness(1.07); }

@keyframes sola-hist-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* ---- Vergrößerung (Lightbox): Klick aufs Bild schließt wieder ---- */
.sola-lb {
	position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center;
	padding: 2.5rem 3.5rem; background: rgb(8 22 16 / 92%); animation: sola-lb-in .25s ease;
}
.sola-lb[hidden] { display: none; }
.sola-lb__fig { position: relative; margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.sola-lb__img {
	display: block; max-width: 100%; max-height: calc(100vh - 8rem); width: auto; height: auto; border-radius: 10px;
	cursor: zoom-out; box-shadow: 0 10px 40px rgb(0 0 0 / 50%); border: 3px solid var(--d-hl, #f6b23c); background: #fff;
}
.sola-lb__cap { margin: .75rem 0 0; color: #fff; text-align: center; font-size: .95rem; max-width: 60rem; }
.sola-lb__nav, .sola-lb__close {
	position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 2.8rem; height: 2.8rem; padding: 0;
	border: 0; border-radius: 50%; background: var(--d-hl, #f6b23c); color: var(--d-hl-text, #173d2d); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.sola-lb__nav:hover, .sola-lb__close:hover { filter: brightness(1.08); }
.sola-lb__nav:focus-visible, .sola-lb__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sola-lb__prev { left: .6rem; top: 50%; transform: translateY(-50%); }
.sola-lb__next { right: .6rem; top: 50%; transform: translateY(-50%); }
.sola-lb__close { right: .8rem; top: .8rem; }
@media (max-width: 560px) { .sola-lb { padding: 3.2rem .5rem 1rem; } .sola-lb__prev { top: auto; bottom: .6rem; left: .6rem; transform: none; } .sola-lb__next { top: auto; bottom: .6rem; right: .6rem; transform: none; } }
@keyframes sola-lb-in { from { opacity: 0; } to { opacity: 1; } }
body.sola-lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.sola-hist, .sola-hist__panel, .sola-hist__chev, .sola-hist__pic, .sola-hist__pic img, .sola-hist__slide, .sola-hist__show, .sola-lb { transition: none !important; animation: none !important; }
}
