* {
    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%;
    height: 100vh;
    overflow: hidden;
    font-family: sans-serif;
}

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

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

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

#title span {
    display: inline-block;
    /* pointer-events: none; verhindert Flicker durch Lücken zwischen Buchstaben */
    transition: margin-right 0.3s ease;
}

.menu div a:hover {
    opacity: 50%;
}

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

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

/* Horizontales Raster-System */
.projects-container {
    display: flex;
    gap: 12px;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.projects-container::-webkit-scrollbar {
    display: none;
}

.projects-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Die einzelnen vertikalen Spalten */
.project-column {
    flex: 0 0 calc((100vw - 48px) / 3);
    display: flex;
    flex-direction: column;
    height: 100%;
    scroll-snap-align: start;

    /* Reset für <a>-Elemente (proj-2 nutzt jetzt <a class="project-column">) */
    text-decoration: none;
    color: inherit;
}

/* Titelzeile über dem Thumbnail */
.project-title {
    font-size: 14px;
    font-style: italic;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 50%;
}

.project-column:hover .project-title {
    opacity: 100%;
    font-style: normal;
}

/* Der graue hohe Balken */
.project-thumbnail {
    background-color: #d8d8d8;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    flex: 1;
}

/* Ankündigungen: erste, eigenständig scrollbare Spalte
   Aufbau: .announcements-wrapper (nicht scrollend, liefert die
   Positionierungs-Referenz) > .announcements-scrollbar (bleibt beim
   vertikalen Scrollen fix stehen) + .announcements-column (scrollt) */
.announcements-wrapper {
    position: relative;
    flex: 0 0 calc((100vw - 48px) / 3);
    height: 100%;
    display: flex;
    scroll-snap-align: start;
}

.announcements-column {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Abstand Bild ↔ Scrollbar = Abstand der Projekt-Kacheln (12px) */
    padding-left: 12px;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.announcements-column::-webkit-scrollbar {
    display: none;
}

.announcement-card {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    text-decoration: none;
    color: inherit;
}

.announcement-card + .announcement-card {
    margin-top: 12px;
}

.announcement-title {
    font-size: 14px;
    font-style: italic;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 50%;
    flex: 0 0 auto;
}

.announcement-card:hover .announcement-title {
    opacity: 100%;
    font-style: normal;
}

.announcement-text p {
    margin: 0;
}

.announcement-text p + p {
    margin-top: 0.4em;
}

.announcement-text a {
    text-decoration: underline;
    position: relative;
    z-index: 2;
}

/* Titel-Link macht die ganze Kachel klickbar */
.announcement-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.announcement-title {
    display: block;
}

.announcement-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
    flex: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.announcement-thumbnail {
    background-color: #d8d8d8;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* Track-Linie (grau, ruhend) - Abstand zur linken Seite entspricht dem
   Abstand der horizontalen Scrollbar zur Seitenkante (main-Padding) */
.announcements-scrollbar {
    position: relative;
    flex: 0 0 1px;
    height: 100%;
    cursor: pointer;
}

/* sichtbare Linie (1px) */
.announcements-scrollbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background-color: #d8d8d8;
}

/* unsichtbar breiterer Greifbereich */
.announcements-scrollbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -6px;
    width: 13px;
    height: 100%;
}

/* Story-Feed: Linie füllt sich von oben (ohne Transition, läuft per JS) */
.announcements-scrollbar.is-story .announcements-scrollbar-thumb {
    transition: none;
    top: 0;
}

.announcements-scrollbar.dragging {
    cursor: grabbing;
}

.announcements-scrollbar-thumb {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
    width: 1px;
    background-color: #000;
    border-radius: 1px;
    pointer-events: none;
    transition: height 0.2s ease, transform 0.15s ease;
}

.progress-bars {
    display: flex;
    gap: 0;
    width: 100%;
    margin-top: 12px;
    position: relative;
    cursor: pointer;
}


/* Mit Ankündigungs-Spalte: horizontale Leiste beginnt erst an der linken
   Kante des Bildkastens (1px Scrollbar + 12px Abstand) */
/* Zeile unter den Projekten: Leiste + Pfeile am Ende (gleiche Höhe) */
.home-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.home-nav .progress-bars {
    flex: 1 1 auto;
    width: auto;
    margin-top: 0;
}

/* Mit Ankündigungs-Spalte: Leiste beginnt erst an der linken Kante des
   Bildkastens (1px Scrollbar + 12px Abstand) */
.home-nav.has-announcements {
    margin-left: 13px;
}

.home-arrows {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.home-arrow {
    background: none;
    border: none;
    padding: 0 6px;
    height: 12px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.home-arrow:last-child {
    padding-right: 0;
}

.home-arrow:hover {
    opacity: 1;
}

.home-arrow:disabled {
    opacity: 0.2;
    cursor: default;
}

.icon {
    display: block;
}

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

/* Bezüge: beim Überfahren eines Projekts treten verbundene Arbeiten hervor */
.project-column .project-thumbnail {
    transition: opacity 0.25s ease;
}

.projects-container.has-focus .project-column:not(.is-focus):not(.is-related) .project-thumbnail {
    opacity: 0.25;
}

.projects-container.has-focus .project-column.is-related .project-title {
    opacity: 100%;
}

/* Ziehen mit der Maus */
.projects-container.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
}

.projects-container.is-dragging a {
    pointer-events: none;
}

.project-column,
.announcement-card {
    -webkit-user-drag: none;
}

.progress-bars.dragging {
    cursor: grabbing;
}

.progress-thumb {
    position: absolute;
    top: calc(50% - 0.5px);
    left: 0;
    height: 1px;
    background-color: #000;
    border-radius: 1px;
    pointer-events: none;
    transition: width 0.2s ease, transform 0.15s ease;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background-color: transparent;
    cursor: pointer;
    border: none;
    padding: 0;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.progress-bar::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background-color: black;
    opacity: 20%;
    transition: opacity 0.2s ease;
}

.progress-bar.active::before {
    opacity: 50%;
}

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

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

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

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

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


/* MOBILE / RESPONSIVE */

@media (max-width: 768px) {

    html, body {
        height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    header {
        flex: 0 0 auto;
    }

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

    /* main nimmt jetzt den verbleibenden Platz ein, statt fester calc()-Höhe */
    main {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        padding: 0 12px 12px 12px;
    }

    .project-column,
    .announcements-wrapper {
        flex: 0 0 85%;
    }

    .project-title {
        font-size: 13px;
    }

    /* Footer wächst jetzt automatisch mit, ohne dass etwas abgeschnitten wird */
    footer {
        flex: 0 0 auto;
        height: auto;
        padding: 20px 15px;
    }

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

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

@media (max-width: 400px) {
    .project-column,
    .announcements-wrapper {
        flex: 0 0 92%;
    }

    footer {
        padding: 16px 15px;
    }

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

    /* zweispaltig bleibt erhalten, nur enger gefasst statt auf eine Spalte zu kippen */
    .footer-content > div {
        flex: 0 0 calc(50% - 8px);
    }
}