/* Bild-Text-Folien (projects, news): Bild ½ | Text ½, Detail in 3 Spalten */
.bildtext {
	position: relative;
	padding: 0 56px;            /* Platz für die Pfeile */
}

/* Nur die aktive Folie zeigen (ohne JavaScript: alle untereinander, siehe unten) */
.folie { display: none; }
.folie.aktiv { display: block; animation: folie-ein .5s ease; }
@keyframes folie-ein { from { opacity: 0; } to { opacity: 1; } }

/* Übersicht */
.folie .uebersicht {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--abstand);
	align-items: center;
}
.folie.ohne-bild .uebersicht { grid-template-columns: minmax(0, 1fr); }
.folie .uebersicht img {
	width: 100%;
	max-height: var(--bild-hoehe);
	aspect-ratio: 1470 / 1180;
	object-fit: cover;
}
.folie .text { max-width: 30em; }
.folie h2 { font-size: 1.8rem; font-weight: 400; line-height: 1.2; margin: 0 0 1rem; color: var(--akzent); }
.folie h3 { font-size: 1rem; margin: 0 0 .3rem; break-after: avoid; }
.folie p { margin: 0 0 1rem; }
.folie a { color: var(--akzent); }
.folie .datum { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #6B6B6B; margin: 0 0 .5rem; }

.mehr-lesen, .zurueck {
	min-height: 44px;
	padding: 10px 22px;
	border: 1.5px solid var(--akzent);
	background: var(--hintergrund);
	color: var(--akzent);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}
.mehr-lesen:hover { background: var(--akzent); color: var(--hintergrund); }
.zurueck { border-color: var(--text); color: var(--text); padding: 10px 18px; }
.zurueck:hover { background: var(--text); color: var(--hintergrund); }

/* Detailansicht: ersetzt die Übersicht der Folie */
.folie .detail { display: none; }
.folie.offen .uebersicht { display: none; }
.folie.offen .detail { display: block; }
.detail-kopf {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}
.detail-kopf h2 { margin: 0; }
/* Bild und Text fliessen über drei Spalten: Bild oben links, Text danach */
.detail-spalten { columns: 3; column-gap: 40px; }
.detail-spalten img { width: 100%; aspect-ratio: 1470 / 1180; object-fit: cover; margin-bottom: 1rem; }

/* Pfeile und Punkte (erzeugt von js/bildtext.js) */
.bildtext .pfeil {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px; height: 44px;
	display: flex; align-items: center; justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	color: var(--akzent);
	font-size: 22px;
	cursor: pointer;
}
.bildtext .pfeil.zurueck-pfeil { left: 0; }
.bildtext .pfeil.weiter-pfeil { right: 0; }
.bildtext .punkte {
	position: static;
	margin-top: 18px;
	display: flex;
	justify-content: center;
	gap: 4px;
}
.bildtext .punkte button {
	width: 28px; height: 28px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.bildtext .punkte button::before {
	content: "";
	display: block;
	width: 10px; height: 10px;
	margin: auto;
	border-radius: 50%;
	border: 1px solid #8A8A8A;
}
.bildtext .punkte button.aktiv::before { background: var(--akzent); border-color: var(--akzent); }

/* Mittlere Bildschirme: Detail zweispaltig */
@media (max-width: 1100px) {
	.detail-spalten { columns: 2; }
}

/* Handy: Bild über Text, Detail einspaltig, Pfeile aufs Bild */
@media (max-width: 760px) {
	.bildtext { padding: 0; }
	.folie .uebersicht { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.detail-spalten { columns: 1; }
	.bildtext .pfeil {
		top: 0;
		transform: none;
		margin-top: calc((100vw - 32px) * 1180 / 1470 / 2 - 22px);   /* Mitte des Bildes */
		border-radius: 50%;
		background: rgba(255,255,255,.85);
	}
	.bildtext .pfeil.zurueck-pfeil { left: 4px; }
	.bildtext .pfeil.weiter-pfeil { right: 4px; }
	.bildtext.detail-offen .pfeil { display: none; }
}

/* Ohne JavaScript: alle Folien untereinander, Detail direkt sichtbar */
@media (scripting: none) {
	.bildtext { padding: 0; }
	.folie { display: block; margin-bottom: 60px; }
	.folie .detail { display: block; margin-top: 30px; }
	.mehr-lesen, .zurueck { display: none; }
}

/* ---------- Hintergrundbild (z.B. galerie/projects/project-bg.jpg) ----------
   Das Bild hat das Galerieformat 1470×1180. Die Folien sitzen im Innenbereich,
   unter der Kopfzeile. Abstände in % der Breite, damit sie mitskalieren. */
.bildtext.mit-hintergrund {
	width: min(100%, calc(var(--bild-hoehe) * 1470 / 1180));
	min-height: calc(min(100%, var(--bild-hoehe) * 1470 / 1180) * 1180 / 1470);
	aspect-ratio: 1470 / 1180;
	padding: 17% 8% 4%;
	background: var(--hintergrund-bild) center / 100% 100% no-repeat;
}
.bildtext.mit-hintergrund .uebersicht { gap: 5%; }
.bildtext.mit-hintergrund .uebersicht img { max-height: none; }
.bildtext.mit-hintergrund .folie .text { color: #222; }
.bildtext.mit-hintergrund .pfeil.zurueck-pfeil { left: 3.5%; }
.bildtext.mit-hintergrund .pfeil.weiter-pfeil { right: 3.5%; }
.bildtext.mit-hintergrund .punkte { margin-top: 2%; }
.bildtext.mit-hintergrund .punkte button::before { border-color: #333; }
.bildtext.mit-hintergrund .mehr-lesen,
.bildtext.mit-hintergrund .zurueck { background: transparent; }
.bildtext.mit-hintergrund .mehr-lesen:hover { background: var(--akzent); }
.bildtext.mit-hintergrund .zurueck:hover { background: var(--text); }
.bildtext.mit-hintergrund .detail-kopf { margin-bottom: 3%; }
.bildtext.mit-hintergrund .detail-spalten { column-gap: 5%; }

@media (max-width: 760px) {
	.bildtext.mit-hintergrund {
		width: 100%;
		aspect-ratio: auto;
		min-height: 0;
		padding: 64px 20px 20px;
		/* ins Couvert hineinzoomen, damit der weisse Bildrand nicht sichtbar ist */
		background-size: auto 130%;
		background-position: 50% 51%;
		background-color: #F5C565;
	}
	.bildtext.mit-hintergrund .pfeil { margin-top: calc(64px + (100vw - 72px) * 1180 / 1470 / 2 - 22px); }
	.bildtext.mit-hintergrund .pfeil.zurueck-pfeil { left: 24px; }
	.bildtext.mit-hintergrund .pfeil.weiter-pfeil { right: 24px; }
}
