/*
Theme Name: Steinheim Institut
Description: Child theme for Avada theme
Author: p1xel
Author URI: https://p1xel.net
Template: Avada
Version: 1.0.0
Text Domain:  Avada
*/

:root {
	/* Breiten randloser Flächen – je Element hier ändern.
	   100cqw = randlos (volle Fensterbreite ohne Scrollbalken), sonst z. B. 1536px. */
	--sti-breite-buehne: 100cqw;      /* Bühnenbild Startseite (die Intro-Box geht mit) */
	--sti-breite-streifen: 100cqw;    /* Zierstreifen unter dem Header (Unterseiten) */
	--sti-breite-weitere: 100cqw;     /* grauer Kasten „Weitere interessante Inhalte“ */
	--sti-breite-bild-rechts: 1536px; /* Bild oben rechts auf Unterseiten */
	--sti-bleed-max: 1536px;          /* alle übrigen randlosen Flächen (Farbblöcke) */

	--sti-sticky-abstand: 20px;       /* Sticky-Header: Abstand über und unter dem Logo */

	--sti-pfeil-versatz: 4px;         /* Pfeile und Extern-Icons: rücken beim Rollover nach rechts */
	--sti-download-versatz: 3px;      /* Download-Icon: Pfeil rückt beim Rollover nach unten */
	--sti-download-kontur: 0.03em;    /* Download-Icon: zusätzliche Strichstärke (Kontur) */
	--sti-chevron-kontur: 0.065em;    /* Chevron bei „Mehr lesen“ (Collapsible): zusätzliche Strichstärke */
	--sti-linie-dauer: 0.3s;          /* Unterstreichung: Dauer der Animation ins dunkle Orange */
}

/* ==========================================================================
   Global
   ========================================================================== */

/* Metanavi: kein Trennstrich nach dem letzten Punkt */
#meta-navigation .awb-menu__main-li:last-child .awb-menu__main-background-default,
#meta-navigation .awb-menu__main-li:last-child .awb-menu__main-background-active {
	border-right: none;
}
/* Metanavi: kein Padding nach dem letzten Punkt */
#meta-navigation .awb-menu__main-li:last-child a{
	padding-right: 0px;
}

/* Fließtext: zwischen Absätzen eine Leerzeile (XD), Avada setzt fest 20px (keine Option).
   Der letzte Absatz bleibt bei Avada (im Text-Element 0). Avadas CSS lädt nach diesem, daher :not(). */
.post-content p:not(:last-child) {
	margin-bottom: 1lh;
}

/* Silbentrennung im Fließtext: Text-Elemente in Fließtext-Typo (Typografie 4) oder ohne eigene Typo,
   dazu der Meldungstext. Überschriften, Subheadlines, Kategorien und Bildunterschriften trennen nicht.
   Sprache kommt aus <html lang="de">. */
#main .fusion-text:is([style*="--awb-typography4-font-size"], :not([style*="typography"])),
#main .sti-meldung-inhalt {
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 6 3 3;
}

/* Überschriften in solchen Text-Elementen (Impressum, Datenschutz) erben die Trennung sonst */
#main .fusion-text :is(h1, h2, h3, h4, h5, h6) {
	-webkit-hyphens: manual;
	hyphens: manual;
}

/* Avada rechnet -clamp() als -0px; volle Breite braucht den echten Wert */
body {
	--hundredp_padding-hundred_percent_negative_margin: calc(-1 * var(--hundredp_padding));
}

/* Randlose Flächen: Überstand über den Inhalt bis zum Fensterrand, höchstens bis --sti-bleed-max.
   100cqw = Fensterbreite ohne Scrollbalken (#wrapper als Container) */
#wrapper {
	container-type: inline-size;
}

body {
	--sti-breite: var(--sti-bleed-max);
}

.sti-intro {
	--sti-breite: var(--sti-breite-buehne);
}

.sti-weitere-inhalte {
	--sti-breite: var(--sti-breite-weitere);
}

.sti-bild-rechts {
	--sti-breite: var(--sti-breite-bild-rechts);
}

/* Überstand je Element aus seiner --sti-breite (var() wird am jeweiligen Element aufgelöst) */
body,
.sti-intro,
.sti-weitere-inhalte,
.sti-bild-rechts {
	--sti-bleed: max(var(--hundredp_padding), min((100cqw - var(--site_width)) / 2, (var(--sti-breite) - var(--site_width)) / 2));
}

/* Sticky-Header (Avada setzt .fusion-sticky-transition beim Scrollen): schmaler, Hauptmenü auf Logohöhe.
   Metanavi ausblenden und Logo verkleinern macht der Builder. Inline-Variablen der Spalten → !important */
.fusion-tb-header .fusion-sticky-transition > .fusion-builder-row > .fusion-layout-column {
	--awb-margin-top-large: var(--sti-sticky-abstand) !important;
	--awb-margin-bottom-large: var(--sti-sticky-abstand) !important;
	--awb-margin-top-medium: var(--sti-sticky-abstand) !important;
	--awb-margin-bottom-medium: var(--sti-sticky-abstand) !important;
	align-self: center;
}

/* Sticky-Header: Submenü beginnt an der Unterkante des Headers (wie im normalen Header).
   Avadas „Dropdown-Abstand“ (45 px) gilt nur für den großen Header und hat keine Sticky-Variante.
   14px ≈ (Höhe kleines Logo 58,6 − Höhe Hauptmenü 30) / 2, abgerundet: lieber 0,3 px Überlappung als eine Lücke.
   Bei anderer Sticky-Logogröße anpassen. */
.fusion-tb-header .fusion-sticky-transition #main-navigation {
	--awb-submenu-space: calc(var(--sti-sticky-abstand) + 14px) !important;
}

/* Header: Bildstreifen max. --sti-breite-streifen breit, mittig */
.fusion-tb-header .sti-streifen {
	max-width: var(--sti-breite-streifen);
	margin-right: auto;
	margin-left: auto;
}

/* Nach-oben-Button: obere Ecken eckig. body davor, weil Avadas gleich spezifische Regel später lädt */
body .to-top-container #toTop {
	border-top-left-radius: 0px;
	border-top-right-radius: 0px;
}

/* ==========================================================================
   Bausteine (überall)
   ========================================================================== */

/* Kategorie-Zeile mit 2px-Linie unter dem Text */
.sti-kategorie span,
.sti-meldung-kategorie span {
	display: inline-block;
	padding-bottom: 1px;
	border-bottom: 2px solid var(--awb-color7);
}

/* Kategorie als Link mit Pfeil („Publikationen →“) */
.sti-kategorie-link a {
	color: var(--awb-color7);
}

.sti-kategorie-link i {
	color: var(--awb-color4);
	font-size: 1.73em;
	vertical-align: middle;
}

/* Links mit Icon: Icongröße wie im XD (Pfeil 34, Extern 48 bei 25px Text) */
.sti-link-pfeil i {
	font-size: 1.37em;
}

.sti-link-extern i {
	font-size: 1.9em;
}

/* Download-Icon (quadratisch, XD 42 × 42): etwa so hoch wie das Extern-Icon */
.sti-link-download i {
	font-size: 1.2em;
}

/* Abstand Text → Icon: im XD überall 13 px (1440: ≈10), Avada setzt 0,7em */
.sti-link-pfeil i,
.sti-link-extern i,
.sti-link-download i,
.sti-meldungen-titel .sti-pfeil,
.sti-kategorie-link i {
	margin-left: 10px;
}

/* Rollover-Animation der Icons (wie steinerne-zeugen.digital):
   Pfeile und Extern-Icons rücken nach rechts – in Buttons, „Publikationen →“, „Meldungen →“ und Icon-Elementen.
   „← Alle Meldungen“ nicht (Icon links, gespiegelt per transform). */
a.sti-link-pfeil:not(.sti-link-zurueck) i,
a.sti-link-extern i,
.sti-kategorie-link a i,
.sti-meldungen-titel a i,
a.fb-icon-element.sti-icon-extern::before,
a.fb-icon-element.sti-icon-pfeil::before {
	display: inline-block;
	transition: color 0.2s, transform 0.2s ease-out;
}

a.sti-link-pfeil:not(.sti-link-zurueck):is(:hover, :focus-visible) i,
a.sti-link-extern:is(:hover, :focus-visible) i,
.sti-kategorie-link a:is(:hover, :focus-visible) i,
.sti-meldungen-titel a:is(:hover, :focus-visible) i,
a.fb-icon-element.sti-icon-extern:is(:hover, :focus-visible)::before,
a.fb-icon-element.sti-icon-pfeil:is(:hover, :focus-visible)::before {
	transform: translateX(var(--sti-pfeil-versatz));
}

/* Download-Icon: nur der Pfeil rückt nach unten, die Schale bleibt stehen.
   Dasselbe Zeichen liegt zweimal übereinander: ::before zeigt nur den Pfeil (mittlere 80 %, über dem Boden),
   ::after nur die Schale (Seitenwände und Boden). Maße aus der Glyphe in sti-icons (U+E905). */
a.fb-icon-element.sti-icon-download::before,
a.fb-icon-element.sti-icon-download::after,
a.sti-link-download i::before,
a.sti-link-download i::after {
	display: inline-block;
	line-height: 1;
	vertical-align: baseline;
}

a.fb-icon-element.sti-icon-download::before,
a.sti-link-download i::before {
	clip-path: polygon(10% 0, 90% 0, 90% 91%, 10% 91%);
	transition: transform 0.2s ease-out;
}

a.fb-icon-element.sti-icon-download::after,
a.sti-link-download i::after {
	content: "\e905";
	margin-left: -1em;
	clip-path: polygon(0 0, 10% 0, 10% 91%, 90% 91%, 90% 0, 100% 0, 100% 100%, 0 100%);
}

a.fb-icon-element.sti-icon-download:is(:hover, :focus-visible)::before,
a.sti-link-download:is(:hover, :focus-visible) i::before {
	transform: translateY(var(--sti-download-versatz));
}

/* Strichstärke angleichen (Feedback 01.12.2026): Download-Glyphe ist in Linkgröße dünner (≈ 2,1 px) als Pfeil (2,5)
   und Extern-Icon (3); Avadas Chevron bei „Mehr lesen“ (awb-icons) nur ≈ 1,8 px. Kontur in Textfarbe macht beide ≈ 2,6–2,8 px.
   Wert in em, damit er mit der Icongröße mitwächst. */
a.fb-icon-element.sti-icon-download::before,
a.fb-icon-element.sti-icon-download::after,
a.sti-link-download i::before,
a.sti-link-download i::after {
	-webkit-text-stroke: var(--sti-download-kontur) currentColor;
}

.awb-collapse-trigger .fusion-button-text::after {
	-webkit-text-stroke: var(--sti-chevron-kontur) currentColor;
}

@media (prefers-reduced-motion: reduce) {
	a.sti-link-pfeil i,
	a.sti-link-extern i,
	.sti-kategorie-link a i,
	.sti-meldungen-titel a i,
	a.fb-icon-element::before,
	a.sti-link-download i::before {
		transition: none;
	}
}

/* Linklisten und Textlinks: dunkelblau, unterstrichen. Die Linie ist ein Hintergrund (statt text-decoration),
   damit sie beim Rollover von links nach rechts ins dunkle Orange (Farbe 5) laufen kann – auch über Zeilenumbrüche. */
.sti-linkliste a,
.sti-textlinks a {
	--sti-linie: max(1px, 0.07em);
	color: var(--awb-color7);
	text-decoration: none;
	background-image: linear-gradient(var(--awb-color5), var(--awb-color5)), linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 calc(100% - 0.08em), 0 calc(100% - 0.08em);
	background-size: 0 var(--sti-linie), 100% var(--sti-linie);
	transition: background-size var(--sti-linie-dauer) ease-out;
}

.sti-linkliste a:is(:hover, :focus-visible),
.sti-textlinks a:is(:hover, :focus-visible) {
	background-size: 100% var(--sti-linie), 100% var(--sti-linie);
}

/* Hauptmenü: Linie (Stärke, Farbe Orange) und Übergang „Left“ stehen im Menü-Element des Global Headers.
   Hier nur: Linie wächst wie bei den Textlinks ausschließlich in der Breite – ohne Avadas zusätzliches Einblenden. */
#main-navigation .awb-menu__main-li > .awb-menu__main-background-active_left {
	opacity: 1;
	transition: width var(--sti-linie-dauer) ease-out;
}

/* Submenü: oben und unten so viel Luft wie links/rechts (20px). Abstand der Punkte (8px oben/unten) steht im Menü-Element;
   für den Rand der ganzen Liste hat Avada keine Option: 12px + 8px Punkt-Abstand = 20px. */
#main-navigation .awb-menu__sub-ul_main,
#main-navigation .awb-menu__sub-ul_grand {
	padding: 12px 0;
	background-color: var(--awb-submenu-bg);
}

/* Flyout der 3. Ebene (z. B. Sammlungen > Archive): Oberkante bündig mit der 1. Ebene, also am Header.
   Avada setzt es auf Höhe seines Menüpunkts, der wegen der 12px oben in der Liste tiefer sitzt. */
#main-navigation .awb-menu__sub-ul_grand {
	top: -12px;
}

/* Submenü: Sprungmarken (/institut/#team usw.) markiert WordPress auf ihrer Seite alle als „aktuell“.
   Die bleiben normal (weiß); orange werden sie bei Rollover, Fokus und wenn ihr Abschnitt im Bild ist
   (Klasse sti-sprung-aktiv vom Script im Code-Element des Global Headers). Echte Unterseiten bleiben aktiv markiert. */
#main-navigation .awb-menu__sub-li.current-menu-item:has(> .awb-menu__sub-a[href*="#"]):not(:hover, :focus-within, .hover, .expanded, .sti-sprung-aktiv) {
	--awb-submenu-active-color: var(--awb-submenu-color);
	--awb-submenu-active-bg: var(--awb-submenu-bg);
}

@media (prefers-reduced-motion: reduce) {
	.sti-linkliste a,
	.sti-textlinks a,
	#main-navigation .awb-menu__main-li > .awb-menu__main-background-active {
		transition: none;
	}
}

.sti-linkliste ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sti-linkliste ul ul {
	line-height: 1.77;
}

/* Aufklapper („mehr Stimmen →“, Avada-Toggle): Pfeil direkt hinter dem Text statt am rechten Rand.
   .panel-title nötig: Avadas Regel ist sonst gleich spezifisch und lädt später. */
.sti-aufklapper .panel-title a {
	justify-content: flex-end;
}

.sti-aufklapper .fusion-toggle-icon-right .panel-title .fusion-toggle-heading {
	width: auto;
	margin-right: 10px;
}

/* Aufklapper und Akkordeon: Pfeil zeigt geöffnet nach unten */
.sti-aufklapper .active-icon,
.sti-akkordeon .active-icon {
	transform: rotate(90deg);
}

/* Aufklapper: Pfeil rückt beim Rollover wie bei den „mehr“-Links (geschlossen nach rechts, geöffnet nach unten).
   #main: Avadas Übergang am Toggle-Icon (nur Farben) ist sonst spezifischer. */
#main .sti-aufklapper .panel-title a i {
	transition: transform 0.2s ease-out;
}

.sti-aufklapper .panel-title a:is(:hover, :focus-visible) .inactive-icon {
	transform: translateX(var(--sti-pfeil-versatz));
}

.sti-aufklapper .panel-title a:is(:hover, :focus-visible) .active-icon {
	transform: rotate(90deg) translateX(var(--sti-pfeil-versatz));
}

@media (prefers-reduced-motion: reduce) {
	#main .sti-aufklapper .panel-title a i {
		transition: none;
	}
}

/* Farbblöcke: Fläche (Spaltenfarbe) bis zum Rand der randlosen Fläche verlängern */
.sti-block-rechts > .fusion-column-wrapper,
.sti-block-links > .fusion-column-wrapper {
	position: relative;
}

.sti-block-rechts > .fusion-column-wrapper::after,
.sti-block-links > .fusion-column-wrapper::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: var(--sti-bleed);
	background: var(--awb-bg-color);
}

.sti-block-rechts > .fusion-column-wrapper::after {
	left: 100%;
}

.sti-block-links > .fusion-column-wrapper::before {
	right: 100%;
}

/* Bildunterschrift so breit wie das Bild darüber (Feedback 01.12.2026, global; Avada hat dafür keine Option).
   Die Spalte wird so breit wie ihr Bild, die Unterschrift zählt dabei nicht mit (contain) und füllt dann diese Breite.
   Nicht im Seitenkopf (sti-bild-rechts): dort läuft das Bild bis zum Fensterrand, die Unterschrift bleibt in der Spalte.
   #main: Avadas „width: 100%“ am Spalten-Wrapper ist sonst gleich spezifisch und lädt später. */
#main .fusion-layout-column:not(.sti-bild-rechts) > .fusion-column-wrapper:has(> .sti-bildunterschrift) {
	width: fit-content;
	max-width: 100%;
}

#main .fusion-layout-column:not(.sti-bild-rechts) > .fusion-column-wrapper > .sti-bildunterschrift {
	contain: inline-size;
}

/* ==========================================================================
   Startseite
   ========================================================================== */

/* Bühnenbild max. --sti-breite-buehne breit, mittig; Höhe fest, Bild per cover */
.width-100 .fusion-fullwidth.sti-buehne {
	--awb-min-height: min(41.39vw, 596px);
	margin-right: max(calc(-1 * var(--hundredp_padding)), calc((100% - var(--sti-breite-buehne)) / 2));
	margin-left: max(calc(-1 * var(--hundredp_padding)), calc((100% - var(--sti-breite-buehne)) / 2));
}

/* Startseite: Intro-Box bis zur linken Kante des Bühnenbilds */
.sti-intro > .fusion-column-wrapper {
	position: relative;
}

.sti-intro > .fusion-column-wrapper::before {
	content: "";
	position: absolute;
	top: 0;
	right: 100%;
	bottom: 0;
	width: var(--sti-bleed);
	background: var(--awb-color1);
}

/* Meldungen */
.sti-meldungen-titel .sti-pfeil {
	color: var(--awb-color4);
	font-size: 1em;
}

/* Silbentrennung nur im Kurztext; Meldungstitel brechen nur an Wortgrenzen */
.sti-meldung-text,
.sti-teaser-titel h3 {
	hyphens: auto;
}

/* NET OLAM: Signet vor dem Titel */
.sti-netolam-titel .sti-signet {
	margin-right: 0.28em;
	color: var(--awb-color4);
	font-size: 0.95em;
}

/* ==========================================================================
   Publikationen
   ========================================================================== */

/* ISBN nicht an den Bindestrichen umbrechen (Span setzt das Plugin) */
.sti-isbn {
	white-space: nowrap;
}

/* ==========================================================================
   Institut
   ========================================================================== */

/* Bild rechts bis zum Rand der randlosen Fläche (Container schneidet darunter ab) */
.sti-bild-rechts .fusion-imageframe {
	width: calc(100% + var(--sti-bleed));
	max-width: none;
}

.sti-bild-rechts .fusion-imageframe img {
	width: 100%;
}

/* Mit Seitenverhältnis (Builder): Höhe wie bei 1440 (Rahmen bis Seitenrand), Bild darüber hinaus per cover */
.sti-bild-rechts .fusion-imageframe.has-aspect-ratio {
	width: calc(100% + var(--hundredp_padding));
	overflow: visible;
	aspect-ratio: var(--awb-aspect-ratio);
}

.sti-bild-rechts .fusion-imageframe.has-aspect-ratio img {
	width: calc(100% + var(--sti-bleed) - var(--hundredp_padding));
	max-width: none;
	height: 100%;
	aspect-ratio: auto;
}

/* ==========================================================================
   Sammlungen
   ========================================================================== */

/* Zeittafel (Steinhardt „Künstlerische Stationen“): Jahr | Text, ohne Linien;
   XD: Text 190 px nach dem Jahr, 20 px zwischen den Einträgen, Zwischenzeile mit mehr Luft */
.sti-zeittafel table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}

.sti-zeittafel td {
	padding: 0 0 15px;
	border: 0;
	vertical-align: top;
}

.sti-zeittafel td:first-child {
	width: 142px;
}

.sti-zeittafel tr:last-child td {
	padding-bottom: 0;
}

.sti-zeittafel .sti-zwischenzeile td {
	padding-top: 29px;
	padding-bottom: 31px;
}

/* ==========================================================================
   Aktuelles / Meldung
   ========================================================================== */

/* Meldungstext (Element „Content“): letzter Absatz ohne Abstand wie im Text-Element (Avada setzt 20px) */
.sti-meldung-inhalt p:last-child {
	margin-bottom: 0;
}

/* „← Alle Meldungen“: Pfeil gespiegelt vor dem Text (sti-icons hat keinen Pfeil links) */
.sti-link-zurueck i {
	margin-left: 0;
	margin-right: 10px;
	transform: scaleX(-1);
}

/* ==========================================================================
   Footer
   ========================================================================== */

/* Kontakt: Leerzeile zwischen den Blöcken, Links dunkelblau ohne Unterstrich */
.sti-footer-kontakt p {
	margin-bottom: 1lh;
}

.sti-footer-kontakt a {
	color: var(--awb-color7);
}
