/*
 * Handy-Ansicht (Theme 2.1) – wird nur bei Fensterbreiten bis 899 px geladen
 * (siehe functions.php). Desktop und Tablets (Desktop-Ansicht, skaliert) bleiben unverändert.
 *
 * Prinzip: eine Spalte, alles fließt untereinander, Bilder/Videos volle Breite.
 * Typografie, Farben und Hintergründe bleiben wie am Desktop.
 */

:root {
	--am-gutter: 20px;
}

body {
	font-size: 14px;
	line-height: 21px;
	-webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 {
	line-height: 21px;
}

/* ---------- Kopf: Name + Navigation ---------- */
#sidebar {
	position: static;
	padding: 24px var(--am-gutter) 0;
	font-size: 16px;
	line-height: 26px;
}
/* Name und Navigation in einer Zeile, wenn Platz ist – sonst rutscht die
   Navigation als Ganzes in die zweite Zeile (nie einzelne Menüpunkte). */
#sidebar {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 18px;
	row-gap: 6px;
}
#sidebar > div {
	float: none;
	width: auto;
	margin: 0;
}
#sidebar ul {
	display: flex;
	white-space: nowrap;
}
#sidebar ul li {
	float: none;
	padding: 0 12px 0 0;
	letter-spacing: 1.5px;
}
#sidebar ul li:last-child {
	padding-right: 0;
}

/* prev / next bzw. Unternavigation */
#sub-navi {
	position: static;
	padding: 12px var(--am-gutter) 0;
}
#sub-navi ul {
	overflow: hidden;
}

/* ---------- Inhalt ---------- */
#main-container {
	min-width: 0;
	padding: 36px var(--am-gutter) 12px;
	display: flex;
	flex-direction: column;
}
/* Blueprint-Spalten werden einspaltig */
#main-container [class*="span-"],
#main-container .block,
#footer {
	float: none;
	width: auto !important;
	margin-right: 0;
}
.second-column {
	margin-left: 0;
}
/* Blueprint-Einrückungen (z.B. Contact, Impressum, Suche: Text am Desktop in der rechten Spalte) */
#main-container .prepend-1, #main-container .prepend-2, #main-container .prepend-3,
#main-container .prepend-4, #main-container .prepend-5 {
	padding-left: 0;
}
#main-container .append-1, #main-container .append-2, #main-container .append-3,
#main-container .append-4, #main-container .append-5 {
	padding-right: 0;
}

/* Kacheln: statt Masonry einfach untereinander */
#floating-grid {
	position: static !important;
	height: auto !important;
}
#floating-grid .block {
	position: static !important;
	left: auto !important;
	top: auto !important;
	margin-bottom: 42px;
}

/* Startseite & Tag-Seite: Projekte zuerst, News bzw. Tag-Cloud danach */
#main-container > #floating-grid { order: 1; }
#main-container > #news,
#main-container > #tag-cloud {
	order: 2;
	margin-top: 12px;
	padding-top: 24px;
	border-top: 1px solid #ddd;
}

/* ---------- Bilder & Videos: volle Breite ---------- */
.media-container,
.image-small .media-container,
.media-big .media-container {
	width: auto !important;
	max-width: 100%;
}
.media-container img,
.media-big img,
#main-container img,
#media img {
	max-width: 100%;
	height: auto;
}
/* Kachel- und Einzelbilder volle Breite (auf dem Handy lädt <picture> dafür eine größere Fassung) */
.am-picture,
.am-picture img {
	display: block;
	width: 100% !important;
	height: auto !important;
}
.media-container iframe,
.media-big iframe,
.video-making-of iframe {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 16 / 9;
}

/* Blueprint-Container haben feste Breiten */
.container,
#sidebar,
#footer {
	width: auto !important;
	min-width: 0 !important;   /* Blueprint: .container { min-width: 912px } */
	max-width: 100%;
	box-sizing: border-box;
}

/* ---------- Einzelseite: großes Bild/Video → Text → Galerie → Making-of ---------- */
body.single {
	display: flex;
	flex-direction: column;
}
body.single #sidebar        { order: 1; }
body.single #sub-navi       { order: 2; }
body.single #media          { display: contents !important; }   /* Kinder von #media einzeln anordnen; !important schlägt das Inline-display von jQuery fadeIn() */
body.single .media-big      { order: 3; padding: 24px var(--am-gutter) 0; }
body.single #main-container { order: 4; padding-top: 12px; }
body.single #media > *:not(.media-big) { order: 5; padding: 0 var(--am-gutter); }
body.single #footer         { order: 6; }

/* Galerie-Vorschaubilder: zwei pro Reihe, einheitliches Format (wie am Desktop gleich hohe Reihen) */
.gallery-container {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}
.gallery-container .thumbnail {
	float: none;
	width: calc(50% - 5px) !important;
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.gallery-container .thumbnail a {
	display: block;
	width: 100%;
	height: 100%;
}
.gallery-container .thumbnail img {
	display: block;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
}
.gallery-container .clear-left {
	display: none;
}

/* ---------- Fuß ---------- */
#footer {
	padding: 0 var(--am-gutter) 24px;
}
#news #footer.footer-in-column {
	padding: 0 0 24px;
	margin-top: 48px;
}

/* ---------- Lightbox: Bedienelemente größer zum Tippen ---------- */
#gallery-wrapper a {
	display: inline-block;
	padding: 8px 10px;
}

/* ---------- Cookie-Hinweis ---------- */
#am-cookie-notice {
	padding: 14px var(--am-gutter) 16px;
	line-height: 21px;
}
#am-cookie-notice p {
	display: block;
}
#am-cookie-notice .am-cookie-actions {
	margin: 10px 0 0;
}
