/**
 * Spicher – Header
 * =============================================================================
 * Markup: Breakdance-Template "Header" (ID 3537). Das Header-Element selbst
 * (Höhe 120/80/70 px, Hintergrund #f5f5f5, Sticky) und das Logo sind dort
 * eingestellt; hier steht alles für Navigation, Megamenü und Mobile-Menü.
 * JS: assets/js/header.js (Mobile-Menü, aktuelle Seite markieren)
 *
 * Farben:   #000 aktiv · #4a4a4a Navi · #8f8a80 Sekundärtext
 *           #e94834 CD-Rot · #f5f5f5 Fläche · #e3dfd7 Linien
 * Breakpoints (wie Breakdance): 1119 · 1023 · 767 (ab hier Mobile-Menü) · 479
 *
 * Alle Selektoren beginnen mit "html ": Breakdance lädt seine Element-Standard-
 * CSS (z. B. .bde-f-svg-icon2 { display: inline-flex }) NACH dieser Datei. Das
 * "html " hebt die Spezifität minimal an, damit unsere Regeln trotzdem gelten.
 * Neue Regeln bitte genauso schreiben.
 *
 * Inhalt
 *   1. Desktop-Navigation
 *   2. Megamenü "Projects"
 *   3. Dropdown "About"
 *   4. Mobile-Menü
 * =============================================================================
 */

/* Breakdance gibt dem inneren Header-Container position:relative. Damit Megamenü
   und Dropdown an der Unterkante des ganzen Headers hängen, schalten wir das ab.
   Achtung: "3537-101" ist die Element-ID im Header-Template – bei Umbau prüfen. */
html .bde-header-builder .bde-div-3537-101 { position: static; }


/* 1. Desktop-Navigation
   ========================================================================== */

html .ss-hd-nav { display: flex; align-items: center; }

html .ss-hd-menu {
	display: flex;
	align-items: center;
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

html .ss-hd-item { display: flex; align-items: center; }
html .ss-hd-has-dd { position: relative; }

html .ss-hd-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;                       /* Touch-Zielgröße */
	font-family: "Rubik", sans-serif;
	font-size: 15px;
	font-weight: 300;
	line-height: 1em;
	text-transform: uppercase;
	text-decoration: none;
	color: #4a4a4a;
	/* Rote Linie dicht unter dem Text (nicht am Rand der 44-px-Klickfläche) */
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 6px;
	text-decoration-color: transparent;
	transition: color .2s ease, text-decoration-color .2s ease;
}

/* Hover, Tastatur-Fokus und aktueller Bereich (is-cur kommt aus header.js) */
html .ss-hd-item:hover .ss-hd-link,
html .ss-hd-item:focus-within .ss-hd-link,
html .ss-hd-link.is-cur {
	color: #000;
	text-decoration-color: #e94834;
}

/* Chevron neben "Projects"/"About". Breakdance packt das SVG in ein div –
   das SVG muss den Rahmen exakt füllen, sonst dreht es sich versetzt. */
html .ss-hd-caret {
	display: block;
	flex: 0 0 auto;
	width: 10px;
	height: 6px;
	line-height: 0;
	transform-origin: 50% 50%;
	transition: transform .25s ease;
}
html .ss-hd-caret svg { display: block; width: 100%; height: 100%; overflow: visible; }

html .ss-hd-item:hover .ss-hd-caret,
html .ss-hd-item:focus-within .ss-hd-caret { transform: rotate(180deg); }

@media (max-width: 1023px) {
	html .ss-hd-menu { gap: 28px; }
}


/* 2. Megamenü "Projects"
   ==========================================================================
   Öffnet per CSS beim Überfahren/Fokussieren von .ss-hd-has-mm.
   Inhalt (Karten) = Breakdance-Post-Loop über die Serien, siehe inc/series.php. */

html .ss-mm {
	position: absolute;
	top: 100%;                              /* Unterkante des Headers */
	left: 0;
	right: 0;
	z-index: 30;
	background: #f5f5f5;
	border-top: 1px solid #e3dfd7;
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility 0s linear .25s; /* Schließen leicht verzögert */
}

/* Unsichtbare Brücke zwischen Menüpunkt und Megamenü, damit es beim
   Herunterfahren mit der Maus nicht zuklappt */
html .ss-mm::before {
	content: "";
	position: absolute;
	top: -40px;
	left: 0;
	right: 0;
	height: 40px;
}

/* Abdunkeln der Seite unter dem offenen Megamenü. pointer-events:none, damit
   der Schleier keine Maus abfängt – sonst bliebe das Menü offen. */
html .ss-mm::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 100vh;
	background: rgba(18, 18, 18, .38);
	pointer-events: none;
}

html .ss-hd-has-mm:hover .ss-mm,
html .ss-hd-has-mm:focus-within .ss-mm {
	opacity: 1;
	visibility: visible;
	transition: opacity .25s ease, visibility 0s;
}

/* Innenbereich: links "All projects", rechts bündig die Karten */
html .ss-mm-in {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	gap: 40px;
	padding: 28px 20px 30px;
}

html .ss-mm-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 150px)); /* max. 150 px pro Karte */
	justify-content: end;                   /* Karten rechtsbündig unter der Navigation */
	gap: 28px;
	flex: 1 1 auto;
	width: auto;
}

html .ss-mm-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: #000;
	text-decoration: none;
}

/* Vorschaubild: im Ruhezustand schwarz-weiß, bei Hover farbig */
html .ss-mm-card img,
html .ss-mm-card .ss-mm-img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	margin: 0;
	background: #e9e6e0;
	filter: grayscale(1);
	opacity: .78;
	transition: filter .45s ease, opacity .45s ease;
}

html .ss-mm-card:hover img,
html .ss-mm-card:focus-visible img,
html .ss-mm-card.is-cur img {
	filter: grayscale(0);
	opacity: 1;
}

html .ss-mm-txt { display: flex; flex-direction: column; gap: 3px; }

html .ss-mm-p {                                  /* Zeitraum */
	font-family: "Rubik", sans-serif;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.3em;
	color: #8f8a80;
}

html .ss-mm-t {                                  /* Serientitel */
	align-self: flex-start;
	font-family: "Rubik", sans-serif;
	font-size: 13px;
	font-weight: 300;
	line-height: 1.3em;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #4a4a4a;
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
	transition: color .25s ease, border-color .25s ease;
}

html .ss-mm-card:hover .ss-mm-t,
html .ss-mm-card.is-cur .ss-mm-t {
	color: #000;
	border-bottom-color: #e94834;
}

/* "All projects →" links unten */
html .ss-mm-foot {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	order: -1;
	margin: 0 auto 0 0;
	padding: 0 0 22px;
}

html .ss-mm-all {
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	font-family: "Rubik", sans-serif;
	font-size: 15px;
	font-weight: 300;
	line-height: 1em;
	text-transform: uppercase;
	text-decoration: none;
	color: #000;
}
html .ss-mm-all:hover { color: #e94834; }

html .ss-mm-arrow { display: block; width: 24px; height: 10px; }
html .ss-mm-arrow svg { display: block; width: 100%; height: 100%; }

@media (max-width: 1023px) {
	html .ss-mm-grid { gap: 20px; }
}


/* 3. Dropdown "About"
   ==========================================================================
   Weiße Box, die leicht über die Header-Unterkante ragt; Hover = schwarz/weiß. */

html .ss-dd {
	position: absolute;
	top: 100%;
	left: -20px;                            /* Text bündig mit "About" */
	z-index: 30;
	min-width: 190px;                       /* breiter ragt rechts aus dem Fenster */
	margin: 26px 0 0;                       /* oberer Rand 12 px über der Header-Unterkante (120-px-Header) */
	padding: 0;                             /* schwarzer Hover reicht bis an die Kanten */
	list-style: none;
	background: #fff;
	border-radius: 3px;
	box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

html .ss-dd::before {                            /* Brücke, wie beim Megamenü */
	content: "";
	position: absolute;
	top: -40px;
	left: 0;
	right: 0;
	height: 40px;
}

html .ss-hd-has-dd:hover .ss-dd,
html .ss-hd-has-dd:focus-within .ss-dd {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

html .ss-dd-link {
	display: block;
	padding: 14px 20px;
	font-family: "Rubik", sans-serif;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.2em;
	text-transform: uppercase;
	text-decoration: none;
	color: #4a4a4a;
	transition: background-color .15s ease, color .15s ease;
}
html .ss-dd-link.is-cur { color: #000; }
/* Ecken des schwarzen Hovers an die Box anpassen (kein overflow:hidden – das
   würde die unsichtbare Brücke ::before abschneiden) */
html .ss-dd li:first-child .ss-dd-link { border-radius: 3px 3px 0 0; }
html .ss-dd li:last-child .ss-dd-link { border-radius: 0 0 3px 3px; }
html .ss-dd-link:hover,
html .ss-dd-link:focus-visible {
	background: #000;
	color: #fff;
}

@media (max-width: 1119px) {
	html .ss-dd { margin-top: 6px; }             /* Header dort nur 80 px hoch */
}


/* 4. Mobile-Menü (bis 767 px)
   ==========================================================================
   Button .ss-hd-burger → header.js setzt html.ss-menu-open */

html .ss-hd-burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 -10px 0 0;                    /* Icon optisch bündig mit dem Rand */
	padding: 0;
	border: 0;
	background: transparent;
	color: #000;
	cursor: pointer;
}

html .ss-hd-ic-open { display: block; width: 24px; height: 24px; }
html .ss-hd-ic-close { display: none; width: 20px; height: 20px; }
html .ss-hd-ic-open svg,
html .ss-hd-ic-close svg { display: block; width: 100%; height: 100%; }

html.ss-menu-open .ss-hd-ic-open { display: none; }
html.ss-menu-open .ss-hd-ic-close { display: block; }
html.ss-menu-open body { overflow: hidden; }        /* Seite dahinter nicht scrollen */

/* Panel unter dem Header */
html .ss-mob {
	display: none;
	position: fixed;
	top: 80px;                              /* Header-Höhe Phone Landscape */
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 899;
	overflow-y: auto;
	padding: 8px 20px 40px;
	background: #f5f5f5;
	border-top: 1px solid #e3dfd7;
}

html .ss-mob-label {
	margin: 0;
	padding: 20px 0 8px;
	font-family: "Rubik", sans-serif;
	font-size: 11px;
	font-weight: 300;
	line-height: 1.3em;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #8f8a80;
}

/* Eine Serie: Thumbnail + Titel + Zeitraum */
html .ss-mob-row {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 44px;
	padding: 12px 0;
	border-bottom: 1px solid #e3dfd7;
	color: #000;
	text-decoration: none;
}

html .ss-mob-row img,
html .ss-mob-row .ss-mob-img {
	display: block;
	flex: 0 0 auto;
	width: 56px;
	height: 72px;
	max-width: none;
	object-fit: cover;
	margin: 0;
}

html .ss-mob-list { display: block; }            /* Post-Loop-Container der Serien */

html .ss-mob-txt { display: flex; flex-direction: column; gap: 4px; }

html .ss-mob-t {
	font-family: "Rubik", sans-serif;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.3em;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #000;
}

html .ss-mob-p {
	font-family: "Rubik", sans-serif;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.3em;
	color: #8f8a80;
}

html .ss-mob-row.is-cur .ss-mob-t { color: #e94834; }

/* Weitere Links: All projects, Vita, Exhibitions, Contact */
html .ss-mob-links { display: flex; flex-direction: column; padding-top: 28px; }

html .ss-mob-link {
	padding: 12px 0;
	font-family: "Rubik", sans-serif;
	font-size: 18px;
	font-weight: 300;
	line-height: 1.2em;
	text-transform: uppercase;
	text-decoration: none;
	color: #000;
}
html .ss-mob-link.is-cur { color: #e94834; }

@media (max-width: 767px) {
	html .ss-hd-menu { display: none; }
	html .ss-hd-burger { display: inline-flex; }
	html.ss-menu-open .ss-mob { display: block; }
}

@media (max-width: 479px) {
	html .ss-mob { top: 70px; }                  /* Header-Höhe Phone Portrait */
}
