/* ==========================================================================
   Zusatzstile fuer die dynamisch erzeugten Seiten (Startseite, Blog).
   Wird nur von lib/view/header.php eingebunden, style.css bleibt unberuehrt.
   ========================================================================== */

/* Beitragsbild in Kartenrastern: einheitliche Hoehe, damit die Karten
   unabhaengig vom Seitenverhaeltnis der Bilder buendig bleiben. */
.post-thumb,
.single-blog-item img.post-thumb {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Platzhalter, wenn ein Beitrag kein Bild hat. */
.post-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 220px;
    background-color: var(--primaryColor);
    color: var(--whiteColor);
    font-size: 40px;
    opacity: 0.85;
}

.single-blog-item:hover .post-thumb-empty {
    opacity: 1;
}

/* ==========================================================================
   Typografie des Beitragstexts.
   Das Theme setzt `ul { list-style: none }` global (fuer Navigation und
   Widgets) und bringt fuer Tabellen, Code und Zitate gar keine Regeln mit.
   Innerhalb von .blog-text wird beides wiederhergestellt.
   ========================================================================== */

.blog-text ul,
.blog-text ol {
    padding-left: 1.6rem;
    margin-bottom: 1.2rem;
}

.blog-text ul {
    list-style: disc outside;
}

.blog-text ol {
    list-style: decimal outside;
}

.blog-text li {
    margin-bottom: 0.5rem;
}

.blog-text li > ul,
.blog-text li > ol {
    margin-top: 0.5rem;
}

.blog-text h2 {
    margin-top: 2.2rem;
    margin-bottom: 0.9rem;
}

.blog-text h3 {
    margin-top: 1.8rem;
    margin-bottom: 0.7rem;
}

.blog-text p {
    margin-bottom: 1.1rem;
}

/* Tabellen: neutrale Rahmen, damit sie in beiden Farbschemata funktionieren */
.blog-text table {
    width: 100%;
    margin-bottom: 1.4rem;
    border-collapse: collapse;
}

.blog-text th,
.blog-text td {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(128, 128, 128, 0.35);
    text-align: left;
    vertical-align: top;
}

.blog-text th {
    background-color: rgba(128, 128, 128, 0.12);
    font-weight: 600;
}

/* Auf schmalen Bildschirmen darf die Tabelle seitlich scrollen */
@media (max-width: 575.98px) {
    .blog-text table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.blog-text code {
    padding: 0.15em 0.4em;
    border-radius: 3px;
    background-color: rgba(128, 128, 128, 0.15);
    font-size: 0.9em;
}

.blog-text pre {
    padding: 1rem;
    margin-bottom: 1.2rem;
    overflow-x: auto;
    border-left: 3px solid var(--primaryColor);
    background-color: rgba(128, 128, 128, 0.12);
}

.blog-text pre code {
    padding: 0;
    background: none;
}

.blog-text blockquote {
    padding: 0.6rem 0 0.6rem 1.2rem;
    margin-bottom: 1.2rem;
    border-left: 3px solid var(--primaryColor);
    font-style: italic;
}

.blog-text img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Inhaltsbausteine: Bereiche, die direkt aneinander anschliessen sollen.
   Ist ein Block als "anschliessend" markiert, faellt sein Abstand nach oben
   weg - und ueber :has() auch der Abstand nach unten beim Block davor.
   Damit sehen zwei Bloecke aus wie ein durchgehender Bereich.
   ========================================================================== */

.content-block-area.block-tight-top {
    padding-top: 0;
}

.content-block-area:has(+ .content-block-area.block-tight-top) {
    padding-bottom: 0;
}
