/* --- Main-Bereich Container --- */
.main-container {
    padding: 10px;
    background-color: #f0ead6;
    border: 1px solid #c0b080;
    border-radius: 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    /* backdrop-filter: blur(6px); -- Diesen Effekt entfernen wir für den Zeitungs-Look */
    box-sizing: border-box;
    max-width: 1450px;
    margin: 30px auto;
}

/* --- Hauptinhalt (Sidebar + Artikelübersicht / Vollartikel) --- */
/* Diesen Bereich brauchen wir immer noch als Flex-Container */
.main-content {
    display: flex;
    width: 100%;
    padding-bottom: 0;   /* Entfernen */
}

/* --- Sidebar --- */
/* Die Sidebar-Regeln bleiben im Grunde gleich, sie funktionieren gut */
.sidebar {
    flex-basis: 300px;
    flex-shrink: 0;
    padding-right: 30px;
    border-right: 1px dashed #c0b080; /* Gestrichelte Trennlinie zur Artikelübersicht */
    padding-bottom: 20px; /* Für die Linie, falls main-content flex-direction: column ist */
}

/* Die Stile für Search, Topics, Tags bleiben gleich, da sie unabhängig vom Artikel-Content sind */
.search-container,
.topics-container,
.tags-container {
    background-color: transparent;
    border-radius: 0;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: none;
    border-bottom: 1px dashed #c0b080;
}

.search-container {
    padding-top: 0;
}

.tags-container {
    border-bottom: none;
}

.search-container input[type="text"] {
    width: calc(100% - 60px);
    padding: 8px;
    border: 1px solid #c0b080;
    border-radius: 0;
    margin-right: 10px;
    box-sizing: border-box;
    font-family: 'Merriweather', serif;
    background-color: #fdfae9;
}

.search-container button {
    padding: 8px 12px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Merriweather', serif;
    font-weight: bold;
}

.topics-container h3,
.tags-container h3 {
    font-family: 'Old Standard TT', serif;
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #222;
}

.topic-list,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
}

.topic-list li {
    margin-bottom: 5px;
    flex: 1 1 auto;
    max-width: calc(50% - 10px); /* z.B. zwei Spalten auf kleinen Bildschirmen */
}

.topic-list button,
.tag-list button {
    width: 100%;
    padding: 4px 5px;
    background-color: #f2f2f2;
    border: 1px solid #c0b08050;
    border-radius: 8px;
    font-family: 'Lora', serif;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 5px 5px 10px #c0b080c1;
}

.topic-list button:hover,
.tag-list button:hover {
    background-color: #d0c8b0;
    background: linear-gradient(to bottom,  #d0c8b0,  #f3ebd5);
    color: #108112;
}

/* --- Content-Display Bereich (umfasst Überblick und Vollartikel) --- */
/* Dies ist der neue Container, der entweder die Übersicht oder den Vollartikel hält */
.content-display {
    flex-grow: 1;
    padding-left: 30px; /* Abstand zur Sidebar */
}

.article-overview {
    scroll-margin-top: 130px; /* Korrigiert das Scroll-Verhalten bei festem Header */
}

.article-overview h2 {
    font-family: 'Old Standard TT', serif;
    font-size: 2.5em;
    color: #222;
    margin-bottom: 25px;
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
}

.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* --- Artikel-Container (für die Vorschauen) --- */
.article-container {
    background-color: #fdfae9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 0;
    border: 1px solid #c0b080;
    border-radius: 8px;
    overflow: hidden;
}

.article-container:hover {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Artikel-Vorschau innerhalb des Containers --- */
.article-preview {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    cursor: pointer; /* **NEU:** Zeigt an, dass die Vorschau klickbar ist */
    word-wrap: break-word; /* Stellt sicher, dass lange Wörter umgebrochen werden, falls sie nicht hypheniert werden können */
    hyphens: auto; /* Dies ist der entscheidende Teil für die Silbentrennung */
}

.article-preview:hover {
    background-color: #fafafa00;
}


.article-image {
    position: relative;
    height: 350px;
    overflow: hidden;
    border-bottom: 1px dashed #c0b080;
    z-index: 0;
    isolation: isolate; /* >>> sorgt für neuen Stacking-Kontext! */
}

.article-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/wfj.png');
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 100%;
    opacity: 0.2; /* Nur das Hintergrundbild */
    mix-blend-mode: multiply;
    pointer-events: none; /* Klicks gehen durch */
    z-index: 1;
}

.article-image img {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    width: auto;
    object-fit: contain;
    z-index: 2; /* explizit über ::before */
    filter: sepia(0.3) saturate(0.8);
}

.article-summary {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Lora', serif;
}

.article-summary h3 {
    font-family: 'Old Standard TT', serif;
    font-size: 1.6em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #222;
    line-height: 1.2;
}

.article-summary p {
    font-family: 'Lora', serif;
    color: #444;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
    border-top: 2px solid #2222226f;
}

/* Der "Weiterlesen"-Button in der Vorschau */
.read-more {
    padding: 10px 15px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-self: flex-start;
    font-family: 'Merriweather', serif;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.read-more:hover {
    background: linear-gradient(to bottom, #555, #948282);
}

/* Deine Keyframes für die Hintergrundanimation */
@-webkit-keyframes AnimateBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes AnimateBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}


/* --- Einzelartikel im Popup-Fenster (statische Seite) --- */
.popup-article {
    padding: 30px;
    max-width: 950px;
    margin: 0 auto;
    background-color: #fdfae9;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border: 1px solid #c0b080;
    font-family: 'Lora', serif;
}

/* Optional: Wenn du Artikel ganz ohne Sidebar öffnest */
.popup-article .full-article {
    padding: 20px;
}



/* Für Tablets und kleinere Desktops */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
        border-right: none;
        border-bottom: 1px dashed #c0b080; /* Linie unten für Trennung von Sidebar und Artikeln */
        padding-bottom: 20px; /* Platz für die Linie */
    }

    .sidebar {
        width: 100%;
        padding-right: 0;
        margin-bottom: 30px;
        border-right: none;
        border-bottom: 1px dashed #c0b080; /* Linie unten, um Sidebar vom Rest zu trennen */
        padding-bottom: 20px;
    }

    .content-display { /* **ANGEPASST:** Von .article-overview zu .content-display */
        padding-left: 0;
    }

    .article-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .article-preview {
        flex-direction: column;
    }

    .article-image {
        flex-basis: auto;
        height: 300px;
        border-radius: 0;
    }

}

/* Für Smartphones */
@media (max-width: 600px) {
    .main-container {
        padding: 15px;
        margin: 20px auto;
    }

    .article-list {
        grid-template-columns: 1fr;
    }

    .article-image {
        height: 200px;
    }

    .article-summary {
        padding: 15px;
    }

    .article-summary h3 {
        font-size: 1.4em;
    }

    .article-summary p {
        font-size: 0.9em;
    }

    .read-more {
        font-size: 0.9em;
        padding: 8px 12px;
    }
}

@media screen and (max-width: 768px) {
    .popup-article {
        padding: 15px;
        margin: 0 10px;
    }

    .popup-article .article-header-layout {
        flex-direction: column;
        align-items: flex-start;
    }

    .popup-article h2#article-full-title {
        font-size: 2em;
        max-width: 100%;
    }

    .popup-article .article-full-image-container {
        width: 100%;
        height: auto;
        margin-top: 15px;
    }

    .popup-article .article-full-image-container img {
        width: 100%;
        height: auto;
    }

    .popup-article #article-full-body {
        font-size: 1em;
        line-height: 1.6;
    }
}
