* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Globaler Link-Reset: nie blau/unterstrichen, Farbe & Styling kommen
   von den jeweiligen Klassen (Header, Footer, Fließtext, ...) */
a {
    color: inherit;
    text-decoration: none;
}

html, body {
    width: 100%;
    font-family: sans-serif;
    /* clip statt hidden: schneidet seitlich ab, ohne einen eigenen
       Scroll-Container zu erzeugen (sonst funktioniert position: sticky
       für das Inhaltsverzeichnis nicht) */
    overflow-x: clip;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Header-Styles */
.header-menu {
    display: flex;
    justify-content: space-between;
    padding: 30px 15px 50px 15px;
    height: 60px;
}

header.header-hidden {
    transform: translateY(-100%);
}

#title {
    font-size: 14px;
    cursor: default;
    display: inline-block;
    text-decoration: none;
}

#title a {
    text-decoration: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

#title a:hover {
    opacity: 1;
}

#title span {
    display: inline-block;
    transition: margin-right 0.3s ease;
}

.menu {
    width: 50vw;
    display: flex;
    justify-content: flex-end;
    font-size: 14px;
}

.menu div a {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.menu div a:hover {
    opacity: 1;
}

.menu div a:link, a:visited {
    color: black;
    text-decoration: none;
}

/* Hauptbereich unter dem Header */
main {
    min-height: calc(100vh - 80px);
    padding: 100px 12px 2vh 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gallery-container {
    display: flex;
    gap: 12px;
    width: 100%;
    height: 80vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    cursor: grab;
    user-select: none;
}

.gallery-item {
    flex: 0 0 68%;
    display: flex;
    flex-direction: column;
    height: 100%;
    scroll-snap-align: center;
}

.gallery-container.dragging {
    cursor: grabbing;
}

.gallery-container::-webkit-scrollbar { display: none; }
.gallery-container { -ms-overflow-style: none; scrollbar-width: none; }

.gallery-item .project-thumbnail {
    cursor: zoom-in;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.gallery-meta .gallery-caption {
    font-style: italic;
    text-align: left;
}

.gallery-meta .gallery-credit {
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
}

.announcement-intro {
    font-size: 18px;
    line-height: 1.5;
    max-width: 900px;
    margin: 0 0 24px 0;
}

.announcement-intro p + p {
    margin-top: 0.6em;
}

.announcement-intro a {
    text-decoration: underline;
}

.project-title-head {
    font-size: 30px;
    font-weight: 100;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 100%;
    width: 100%;
    min-width: 0;
}

/* Heading-Formate h1–h5 */
h1, h2, h3, h4, h5 {
    font-family: inherit;
    color: black;
    line-height: 1.3;
}

h1 {
    font-size: 30px;
    font-weight: 100;
    margin: 60px 0 20px 0;
}

h2 {
    font-size: 24px;
    font-weight: 200;
    margin: 50px 0 18px 0;
}

h3 {
    font-size: 19px;
    font-weight: 300;
    margin: 40px 0 16px 0;
}

h4 {
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 70%;
    margin: 32px 0 14px 0;
}

h5 {
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 50%;
    margin: 0 0 16px 0;
}

.project-text > h1:first-child,
.project-text > h2:first-child,
.project-text > h3:first-child,
.project-text > h4:first-child,
.project-text > h5:first-child {
    margin-top: 0;
}

.project-thumbnail {
    background-color: #d8d8d8;
    width: 100%;
    flex: 13;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.project-body {
    display: flex;
    gap: 60px;
    width: 80%;
    margin-top: 60px;
    padding-bottom: 0;
    margin-bottom: 0;
    align-items: flex-start;
}

.project-text {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    line-height: 1.6;
    max-width: 100vw;
}

.project-text > *:last-child {
    margin-bottom: 0;
}

/* Linke Spalte: Angaben (scrollen mit) + Inhaltsverzeichnis (sticky) */
.project-aside {
    flex: 0 0 200px;
    min-width: 0;
    align-self: stretch;
    font-size: 14px;
    line-height: 1.6;
}

.project-meta {
    font-size: 14px;
    line-height: 1.6;
}

/* Inhaltsverzeichnis: scrollt mit, bis es 12px unter der Oberkante steht
   (bzw. 12px unter dem Header, wenn der eingeblendet ist), bleibt dann
   stehen. --toc-top setzt assets/js/toc.js */
.project-toc {
    position: sticky;
    top: var(--toc-top, 12px);
    transition: top 0.3s ease;
    max-height: calc(100vh - var(--toc-top, 12px) - 12px);
    overflow-y: auto;
    scrollbar-width: none;
    padding-bottom: 12px;
}

.project-toc::-webkit-scrollbar { display: none; }

/* dünne Linie zwischen Angaben und Inhaltsverzeichnis */
.project-toc {
    border-top: 1px solid #d8d8d8;
    padding-top: 16px;
}

.project-toc-title {
    margin-bottom: 6px;
    list-style: none;
    cursor: default;
}

.project-toc-title::-webkit-details-marker {
    display: none;
}

body.project-dark .project-toc {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.project-toc-list {
    list-style: none;
}

.project-toc-list a {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.project-toc-list a:hover,
.project-toc-list a.active {
    opacity: 1;
}

.project-toc-list .toc-num {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.project-toc-list .toc-level-2 { padding-left: 10px; }
.project-toc-list .toc-level-3 { padding-left: 20px; }

/* Nummerierte Überschriften im Text */
.toc-heading {
    scroll-margin-top: 24px;
}

.toc-heading .heading-num {
    margin-right: 0.5em;
    opacity: 0.4;
}

.project-meta p {
    margin-bottom: 20px;
}

.project-text p {
    margin-bottom: 20px;
}

/* Listen im Text-Block (Aufzählung mit Gedankenstrich, Nummerierung,
   beliebig tief verschachtelt) */
.project-text ul,
.project-text ol {
    margin: 0 0 20px 0;
    padding-left: 1.6em;
}

.project-text ul {
    list-style: none;
}

.project-text ul > li {
    position: relative;
}

.project-text ul > li::before {
    content: '–';
    position: absolute;
    left: -1.2em;
}

.project-text ol {
    list-style: decimal;
}

.project-text ol > li::marker {
    font-variant-numeric: tabular-nums;
}

.project-text li {
    margin-bottom: 0.3em;
}

.project-text li > p {
    margin-bottom: 0;
}

.project-text li ul,
.project-text li ol {
    margin: 0.3em 0 0 0;
}

.project-text ol ol {
    list-style: lower-alpha;
}

/* Textmarker */
.highlight {
    background-color: #d8d8d8;
    padding: 0.05em 0.15em;
    margin: 0 -0.05em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

body.project-dark .highlight {
    background-color: rgba(255, 255, 255, 0.25);
}

.standalone-image {
    width: 68%;
    margin: 10px auto;
}

.standalone-thumbnail {
    background-color: #d8d8d8;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.standalone-caption {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.4;
    color: grey;
    font-style: italic;
}

.inline-image {
    width: 100%;
    margin: 40px 0;
}

.inline-thumbnail {
    background-color: #d8d8d8;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: zoom-in;
}

.media-caption-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.5;
}

.media-caption-row .media-caption {
    font-style: italic;
    text-align: left;
}

.media-caption-row .media-credit {
    text-align: right;
    white-space: nowrap;
}

.inline-caption {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.4;
    color: grey;
    font-style: italic;
}

/* Anmerkungen & Literaturverzeichnis */
.ref-marker {
    font-size: 11px;
    line-height: 0;
    margin-left: 1px;
}

.ref-marker a {
    color: black;
    text-decoration: none;
    opacity: 60%;
}

.ref-marker a:hover {
    opacity: 100%;
}

/* Symbol-Marker (Anmerkungen) etwas größer, da Zeichen wie * / † optisch kleiner wirken */
.ref-marker-symbol {
    font-size: 12px;
}

/* Nummern-Marker (Literaturverzeichnis) */
.ref-marker-number {
    font-size: 11px;
}

.project-references {
    width: 100%;
    margin-top: 80px;
    padding-top: 40px;
    padding-bottom: 60px;
    border-top: 1px solid #d8d8d8;
}

/* innerer Wrapper: hält Inhalt auf gleicher Breite/Position wie .project-body */
.ref-inner {
    display: flex;
    gap: 60px;
    width: 80%;
}

/* unsichtbarer Spacer, damit die Ref-Spalte exakt so breit wie .project-text ist */
.ref-spacer {
    flex: 0 0 200px;
}

.ref-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.ref-column {
    width: 100%;
}

.ref-list {
    list-style: none;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.ref-list li {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ref-list li::before {
    flex: 0 0 auto;
    min-width: 16px;
    opacity: 50%;
}

/* Literaturverzeichnis: automatische Nummerierung */
.ref-list-numbers {
    counter-reset: ref-counter;
}

.ref-list-numbers li::before {
    content: counter(ref-counter);
    counter-increment: ref-counter;
}

/* Anmerkungen: Symbol aus data-symbol-Attribut, manuell zuweisbar */
.ref-list-symbols li::before {
    content: attr(data-symbol);
}

.ref-back {
    color: black;
    text-decoration: none;
    opacity: 40%;
    flex: 0 0 auto;
}

.ref-back:hover {
    opacity: 100%;
}

/* Bezüge zu anderen Arbeiten */
.project-relations {
    width: 100%;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #d8d8d8;
}

.project-relations + .project-references {
    margin-top: 0;
}

.relations-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px 24px;
}

.relation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.relation-thumb {
    flex: 0 0 64px;
    width: 64px;
    aspect-ratio: 1 / 1;
    background-color: #d8d8d8;
    background-size: cover;
    background-position: center;
}

.relation-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.relation-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
}

.relation-type .icon {
    width: 16px;
    height: 9px;
}

.relation-title {
    opacity: 0.8;
}

.relation:hover .relation-title {
    opacity: 1;
    text-decoration: underline;
}

.relation-note {
    font-size: 13px;
    opacity: 0.5;
    font-style: italic;
}

body.project-dark .project-relations {
    border-color: rgba(255, 255, 255, 0.2);
}

body.project-dark .relation-thumb {
    background-color: #2a2a2a;
}

/* Tabellenlayout */
.table-wrapper {
    width: 100%;
    margin: 40px 0;
    overflow-x: auto;
}

.project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.project-table th {
    text-align: left;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 50%;
    padding: 8px 16px 8px 0;
    border-bottom: 1px solid black;
    white-space: nowrap;
}

.project-table td {
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid #d8d8d8;
    vertical-align: top;
}

.project-table tr:last-child td {
    border-bottom: 1px solid #d8d8d8;
}

/* Video- & Audio-Player */
.av-block {
    width: 100%;
    margin: 40px 0;
}

.av-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    display: block;
    border: none;
}

.av-embed-audio {
    width: 100%;
    height: 54px;
    display: block;
    border: none;
}

audio.av-embed-audio {
    background-color: #f2f2f2;
}

.av-caption {
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.4;
    color: grey;
    font-style: italic;
}

/* Audio-Block: Cover + Titel, eigener Player – auf allen Geräten identisch */
.audio-block .ap-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.ap-cover {
    flex: 0 0 96px;
    width: 96px;
    aspect-ratio: 1 / 1;
    background-color: #d8d8d8;
    background-size: cover;
    background-position: center;
}

.ap-meta {
    min-width: 0;
    padding-top: 2px;
}

.ap-title {
    font-size: 18px;
    line-height: 1.35;
}

.ap-subtitle {
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.5;
    margin-top: 4px;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.audio-player audio {
    display: none;
}

.ap-play {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-play svg {
    width: 12px;
    height: 12px;
}

.ap-play .ap-icon-pause,
.audio-player.is-playing .ap-play .ap-icon-play {
    display: none;
}

.audio-player.is-playing .ap-play .ap-icon-pause {
    display: block;
}

.ap-time {
    flex: 0 0 auto;
    min-width: 3.2em;
    opacity: 0.6;
}

.ap-duration {
    text-align: right;
}

.ap-bar {
    position: relative;
    flex: 1 1 auto;
    height: 20px;
    cursor: pointer;
    touch-action: none;
}

.ap-bar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background-color: currentColor;
    opacity: 0.25;
}

.ap-progress {
    position: absolute;
    left: 0;
    top: calc(50% - 0.5px);
    height: 1px;
    width: 0;
    background-color: currentColor;
}

.ap-bar:focus-visible {
    outline: 1px dotted currentColor;
    outline-offset: 2px;
}

.audio-block .av-embed-audio {
    margin-top: 4px;
}

/* Untertitel im Video: weiß, normaler Schnitt, schmale Kontur + leichter Schatten */
video::cue {
    font-family: sans-serif;
    font-weight: 400;
    color: #fff;
    background-color: transparent;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.85),
        0 0 1px rgba(0, 0, 0, 0.85),
        0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Transkript unter Video/Audio (aufklappbar) */
.av-wrapper {
    margin: 40px 0;
}

.av-wrapper .av-block {
    margin: 0;
}

.av-transcript {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.av-transcript summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.av-transcript summary::-webkit-details-marker { display: none; }

.av-transcript summary::before {
    content: '›';
    display: inline-block;
    transition: transform 0.2s ease;
}

.av-transcript[open] summary::before {
    transform: rotate(90deg);
}

.av-transcript summary:hover,
.av-transcript[open] summary {
    opacity: 1;
}

.av-transcript-text {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 1px solid #d8d8d8;
}

.av-transcript-text p {
    margin-bottom: 12px;
}

body.project-dark .av-transcript-text {
    border-left-color: rgba(255, 255, 255, 0.2);
}

/* Pull-Quote / Zitatblock */
.pull-quote {
    width: 100%;
    margin: 50px 0;
    padding-left: 24px;
    border-left: 2px solid black;
}

.pull-quote p {
    font-size: 26px;
    font-weight: 200;
    line-height: 1.4;
    margin-bottom: 12px;
}

.pull-quote-source {
    font-size: 14px;
    font-style: normal;
    opacity: 50%;
    display: block;
}

/* Werkangaben / Credits-Block (auf-/zuklappbar) */
.credits-block {
    width: 100%;
    margin: 0 0 40px 0;
    padding: 24px 0;
    border-top: 1px solid #d8d8d8;
    border-bottom: 1px solid #d8d8d8;
}

.credits-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credits-summary::-webkit-details-marker {
    display: none;
}

.credits-summary::before {
    content: '›';
    display: inline-block;
    font-size: 19px;
    transition: transform 0.2s ease;
}

.credits-block[open] .credits-summary::before {
    transform: rotate(90deg);
}

.credits-summary h3 {
    margin: 0;
}

.credits-block[open] .credits-list {
    margin-top: 16px;
}

.credits-list {
    font-size: 14px;
    line-height: 1.8;
}

.credits-row {
    display: flex;
    gap: 16px;
}

.credits-row dt {
    flex: 0 0 140px;
    opacity: 50%;
}

.credits-row dd {
    flex: 1;
}

/* Aufklappbarer Abschnitt (Block "section") */
.section-block {
    width: 100%;
    margin: 0 0 40px 0;
    /* Linie oben und unten */
    border-top: 1px solid #d8d8d8;
    border-bottom: 1px solid #d8d8d8;
    padding: 24px 0;
}

/* direkt aufeinanderfolgende Abschnitte teilen sich eine Linie */
.section-block + .section-block {
    margin-top: -40px;
    border-top: none;
}

.section-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-summary::-webkit-details-marker {
    display: none;
}

.section-summary::before {
    content: '›';
    display: inline-block;
    font-size: 19px;
    transition: transform 0.2s ease;
}

.section-block[open] > .section-summary::before {
    transform: rotate(90deg);
}

.section-summary h3 {
    margin: 0;
}

.section-block[open] > .section-content {
    margin-top: 24px;
}

.section-content > *:last-child {
    margin-bottom: 0;
}

/* Download-Button */
.download-wrapper {
    margin: 30px 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    color: black;
    text-decoration: none;
    border: 1px solid black;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.download-btn:hover {
    background-color: black;
    color: white;
}

.download-icon {
    font-size: 14px;
}

/* Externe-Links-Liste */
.external-links {
    width: 100%;
    margin: 40px 0;
}

.external-links-list {
    list-style: none;
    font-size: 14px;
    line-height: 1.8;
}

.external-links-list a {
    color: black;
    opacity: 60%;
    text-decoration: underline;
}

.external-links-list a:hover {
    opacity: 100%;
}

/* Content-/Trigger-Warning-Block */
.content-note {
    width: 100%;
    margin: 0 0 40px 0;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.5;
    background-color: #f2f2f2;
    border-left: 2px solid black;
}

/* Bildunterschrift mit Copyright/Fotocredit */
.caption-credit {
    opacity: 70%;
    margin-left: 4px;
}

/* Prev/Next-Projekt-Navigation */
.project-nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 60px 0 40px 0;
    padding-top: 30px;
    border-top: 1px solid #d8d8d8;
}

.project-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: black;
    text-decoration: none;
    opacity: 60%;
    transition: opacity 0.15s ease;
}

.project-nav-link:hover {
    opacity: 100%;
}

.project-nav-link.next {
    text-align: right;
}

.project-nav-text {
    display: flex;
    flex-direction: column;
}

.project-nav-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 60%;
}

.project-nav-title {
    font-size: 16px;
}

.project-nav-arrow {
    display: flex;
    align-items: center;
}

footer {
    height: 60px;
    width: 100%;
    background-color: #ffffff;
    padding: 15px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.footer-content {
    margin: 0 0 0 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.footer-content a {
    opacity: 20%;
}

.footer-content a:hover {
    opacity: 100%;
}

.footer-content a:link, a:visited {
    color: black;
    text-decoration: none;
}

/* MOBILE / RESPONSIVE */

@media (max-width: 768px) {

    .header-menu {
        padding: 20px 12px 30px 12px;
    }

    .menu {
        width: auto;
    }

    main {
        padding: 90px 12px 2vh 12px;
    }

    /* Bildergalerie: größere, fast bildschirmfüllende Panels */
    .gallery-container {
        height: 50vh;
        gap: 8px;
    }

    .gallery-item {
        flex: 0 0 88%;
    }

    .project-title-head {
        font-size: 22px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    h1 {
        font-size: 22px;
        margin: 40px 0 16px 0;
    }

    h2 {
        font-size: 19px;
        margin: 36px 0 14px 0;
    }

    h3 {
        font-size: 17px;
        margin: 28px 0 12px 0;
    }

    h4 {
        font-size: 14px;
        margin: 26px 0 12px 0;
    }

    /* Sidebar (Ort/Datum) und Fließtext stapeln sich statt nebeneinander */
    .project-body {
        flex-direction: column;
        width: 100%;
        gap: 30px;
        margin-top: 40px;
        align-items: stretch;
    }

    .project-aside {
        flex: none;
        width: 100%;
    }

    .project-toc {
        position: static;
        max-height: none;
        margin-top: 24px;
    }

    /* mobil aufklappbar */
    .project-toc-title {
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 0;
    }

    .project-toc-title::before {
        content: '›';
        display: inline-block;
        transition: transform 0.2s ease;
    }

    .project-toc[open] > .project-toc-title {
        margin-bottom: 6px;
    }

    .project-toc[open] > .project-toc-title::before {
        transform: rotate(90deg);
    }

    .project-meta {
        position: static;
        flex: none;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 16px 32px;
    }

    .project-meta p {
        margin-bottom: 0;
    }

    .project-text {
        font-size: 16px;
    }

    .standalone-image {
        width: 100%;
    }

    .pull-quote {
        padding-left: 16px;
        margin: 36px 0;
    }

    .pull-quote p {
        font-size: 20px;
    }

    .credits-row {
        gap: 12px;
    }

    .credits-row dt {
        flex: 0 0 110px;
    }

    /* Anmerkungen/Literaturverzeichnis ebenfalls gestapelt, Spacer entfällt */
    .ref-inner {
        flex-direction: column;
        width: 100%;
        gap: 30px;
    }

    .ref-spacer {
        display: none;
    }

    .ref-content {
        gap: 30px;
    }

    /* Prev/Next-Navigation untereinander statt nebeneinander */
    .project-nav {
        flex-direction: column;
        gap: 24px;
        margin: 50px 0 30px 0;
    }

    .project-nav-link.next {
        flex-direction: row;
        text-align: left;
    }

    footer {
        height: auto;
        padding: 20px 15px;
    }

    .footer-content {
        flex-wrap: wrap;
        row-gap: 12px;
        column-gap: 24px;
        justify-content: flex-start;
        font-size: 13px;
    }

    .footer-content > div {
        flex: 0 0 calc(50% - 12px);
    }
}

@media (max-width: 420px) {

    .gallery-item {
        flex: 0 0 94%;
    }

    .project-text {
        font-size: 15px;
    }

    .pull-quote p {
        font-size: 18px;
    }

    .credits-row {
        flex-direction: column;
        gap: 2px;
    }

    .credits-row dt {
        flex: none;
    }

    footer {
        padding: 16px 15px;
    }

    .footer-content {
        row-gap: 10px;
        column-gap: 16px;
        font-size: 12px;
    }

    .footer-content > div {
        flex: 0 0 calc(50% - 8px);
    }
}
/* ==========================================================================
   ENDLOS-CAROUSEL (Kopf-Galerie + Block "Bildergalerie")
   site/snippets/loop-carousel.php · assets/js/project-gallery.js
   ========================================================================== */

.loop-carousel {
    /* Breite des zentrierten Bildes (relativ zur Carousel-Breite) */
    --w: 68%;
    /* maximale Bildhöhe */
    --maxh: 80vh;
    --gap: 12px;
    --item-w: var(--w);
    position: relative;
    width: 100%;
}

/* feste Seitenverhältnisse (Block-Option "Format") */
.loop-carousel.lc-ratio {
    --item-w: min(var(--w), calc(var(--maxh) * (var(--r))));
}

.lc-viewport {
    position: relative;
    display: flex;
    gap: var(--gap);
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lc-viewport::-webkit-scrollbar { display: none; }

.loop-carousel.dragging .lc-viewport {
    cursor: grabbing;
}

.lc-hero .lc-viewport {
    height: var(--maxh);
}

.lc-item {
    position: relative;
    flex: 0 0 var(--item-w);
    scroll-snap-align: center;
    /* eigener Stacking-Context, damit der Differenz-Effekt nur mit dem Bild mischt */
    isolation: isolate;
}

.lc-hero .lc-item {
    height: 100%;
}

.lc-image {
    width: 100%;
    height: 100%;
    background-color: #d8d8d8;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

/* nur das zentrale Bild öffnet die Großansicht */
.lc-item.is-center .lc-image {
    cursor: zoom-in;
}

.loop-carousel.dragging .lc-image {
    cursor: grabbing;
}

.lc-ratio .lc-image {
    height: auto;
    aspect-ratio: var(--r);
}

/* Einzelbild: zentriert, kein Ziehen */
.lc-single .lc-viewport {
    justify-content: center;
    cursor: default;
}

/* Bildunterschrift (unten links) + Credits (unten rechts) auf dem Bild */
.lc-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
}

.lc-overlay .lc-caption {
    font-style: italic;
    text-align: left;
}

.lc-overlay .lc-credit {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
    opacity: 0.4;
}

/* SVG-Pfeile/Kreuz (site/snippets/icon.php) – überall identisch */
.icon {
    display: block;
    flex: 0 0 auto;
}

.icon-arrow-left {
    transform: scaleX(-1);
}

/* Pfeile nebeneinander, rechtsbündig zur rechten Kante des rechten Bildes */
.lc-controls {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    width: 100%;
    margin: 10px 0 0 0;
}

.lc-btn {
    background: none;
    border: none;
    padding: 6px 6px;
    font-family: inherit;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    color: black;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.lc-btn:last-child {
    padding-right: 0;
}

/* Kopf-Galerie: Pfeile unten links */
.lc-controls-left {
    justify-content: flex-start;
}

.lc-controls-left .lc-btn:first-child {
    padding-left: 0;
}

.lc-controls-left .lc-btn:last-child {
    padding-right: 6px;
}

.lc-btn:hover {
    opacity: 1;
}

/* Block-Variante: von Kante zu Kante, ragt über die linke Infospalte.
   Die genaue Position setzt project-gallery.js; die Werte hier sind nur
   der Fallback ohne JavaScript (Infospalte 200px + 60px Abstand). */
.lc-bleed {
    margin: 50px 0;
    margin-left: -260px;
    width: calc(100% + 260px);
    max-width: none;
    z-index: 2;
    background-color: #fff;
}

@media (max-width: 768px) {
    .loop-carousel {
        --w: 88%;
        --maxh: 50vh;
        --gap: 8px;
    }

    .lc-bleed {
        margin-left: 0;
        width: 100%;
    }

    .lc-overlay {
        font-size: 12px;
        padding: 8px 10px;
    }
}

@media (max-width: 420px) {
    .loop-carousel {
        --w: 94%;
    }
}

/* ==========================================================================
   DARK MODE (pro Projekt im Panel aktivierbar)
   ========================================================================== */

body.project-dark {
    background-color: #000;
    color: #fff;
}

body.project-dark header,
body.project-dark footer {
    background-color: #000;
}

body.project-dark #title a,
body.project-dark .menu div a:link,
body.project-dark .menu div a:visited,
body.project-dark .footer-content a:link,
body.project-dark .footer-content a:visited,
body.project-dark .project-nav-link,
body.project-dark .ref-back,
body.project-dark .ref-marker a,
body.project-dark .external-links-list a,
body.project-dark .download-btn {
    color: #fff;
}

body.project-dark h1,
body.project-dark h2,
body.project-dark h3,
body.project-dark h4,
body.project-dark h5 {
    color: #fff;
}

body.project-dark .project-thumbnail,
body.project-dark .inline-thumbnail,
body.project-dark .lc-image,
body.project-dark .standalone-thumbnail {
    background-color: #2a2a2a;
}

body.project-dark .project-table th {
    border-bottom-color: #fff;
}

body.project-dark .project-table td,
body.project-dark .project-references,
body.project-dark .credits-block,
body.project-dark .project-nav,
body.project-dark .external-links-list a {
    border-color: rgba(255, 255, 255, 0.2);
}

body.project-dark .section-block,
body.project-dark .section-block + .section-block {
    border-color: rgba(255, 255, 255, 0.2);
}

body.project-dark .content-note {
    background-color: #1a1a1a;
    border-left-color: #fff;
}

body.project-dark .pull-quote {
    border-left-color: #fff;
}

body.project-dark .download-btn {
    border-color: #fff;
}

body.project-dark .download-btn:hover {
    background-color: #fff;
    color: #000;
}

body.project-dark .lc-bleed {
    background-color: #000;
}

body.project-dark .lc-btn {
    color: #fff;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 60px;
}

.lightbox.active {
    display: flex;
    overscroll-behavior: contain;
    touch-action: none;
}

/* Seite hinter der Großansicht festhalten */
html.lightbox-open,
html.lightbox-open body {
    overflow: hidden;
}

.lightbox-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.lightbox-stage.zoomed {
    cursor: zoom-out;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
    transform: scale(1);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-stage.zoomed .lightbox-image {
    transform: scale(2);
    cursor: zoom-out;
}

.lightbox-meta {
    /* Bildunterschrift an der linken, Credits an der rechten Kante
       (12px-Raster wie die Pfeile) */
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    opacity: 0.75;
}

.lightbox-meta .lightbox-caption {
    font-style: italic;
    text-align: left;
}

.lightbox-meta .lightbox-credit {
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 2;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 26px;
    line-height: 1;
    font-family: inherit;
    /* wie die Pfeile: weiß, ohne Kreis */
    background: none;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.lightbox-close:hover {
    background: none;
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 20px;
    line-height: 1;
    font-family: inherit;
    /* gleiche Pfeile wie in den Galerien, nur weiß und ohne Kreis */
    background: none;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: none;
    opacity: 1;
}

.lightbox-prev {
    left: 12px;
}

.lightbox-next {
    right: 12px;
}

@media (max-width: 768px) {
    .lightbox {
        /* oben Platz fürs Kreuz, unten für Bildunterschrift/Credits */
        padding: 56px 16px 48px 16px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
    }
}
