header {
    background-color: #ecaebf;
}

#show-sm {
    margin-bottom: 0em;
}

figure {
    margin: 0;
    text-align: center;
}

figcaption {
    margin: 0.3125em;
    text-align: center;
}

.image-container {
    display: grid;
    /* Immer 4 Spalten, wie gewünscht */
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 0.5em;
    /* Etwas mehr Abstand ist oft schöner */
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.photo {
    /* Stellt sicher, dass das Bild den Container perfekt ausfüllt */
    overflow: hidden;
    position: relative;
    /* Erzwingt ein quadratisches Seitenverhältnis */
    aspect-ratio: 1 / 1;
}

.photo a,
.photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Schneidet das Bild passend zu, anstatt es zu verzerren */
    transition: transform 0.2s ease-in-out;
}

/* Kleiner Zoom-Effekt beim Hovern */
.photo a.gallery-thumbnail:hover img {
    transform: scale(1.05);
}

ul.quellen {
    text-align: left;
    margin: 0;
    list-style-type: none;
    padding: 0 0 0.75em 0;
}

ul.quellen li {
    padding-left: 2em;
    /* enough space for icon */
    text-indent: -1.5em;
    /* pull first line left */
    margin-bottom: 0.5em;
    position: relative;
}

ul.quellen li i {
    position: absolute;
    left: 0;
    top: 0.3em;
    /* adjust vertically if needed */
}

details summary {
    cursor: pointer;
}

details summary>* {
    display: inline;
}

/*
=========================================
Anpassungen für vertikale Abstände
=========================================
*/

/*
 * Blendet die horizontale Linie (<hr>) aus, die in der Artikelliste
 * direkt nach der Überschrift (h2.title) kommt.
 * Dies verhindert den "doppelten Trennstrich"-Effekt in der Übersicht.
*/
h2.title+hr {
    display: none;
}

/* Add more vertical spacing before H1 heading */
h1 {
    margin-top: 1.5em !important;
}

/* H2: Großer, klarer Abschnittstrenner */
#posts h2,
#kube-component h2,
.content h2 {
    font-size: 1.8em;
    /* Deutlich größer als H3 */
    font-weight: 600;
    /* Semi-fett für Wichtigkeit */
    margin-top: 1.5em;
    /* Großzügiger Abstand nach oben */
    margin-bottom: 1em;
    /* Abstand zum folgenden Text */
    padding-bottom: 0.3em;
    /* Etwas Platz unter dem Text */
    border-bottom: 1px solid #e0e0e0;
    /* Dezente Trennlinie */
    line-height: 1.2;
    /* Zurücksetzen der Line-Height für größere Schrift */
}

/* H3: Klare Unter-Überschrift */
#posts h3,
#kube-component h3,
.content h3 {
    font-size: 1.4em;
    /* Kleiner als H2 */
    font-weight: 600;
    /* Ebenfalls semi-fett */
    margin-top: 2em;
}

/* H4: Kleinere Überschrift für Detail-Abschnitte */
#posts h4,
#kube-component h4,
.content h4 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 1.8em;
}

/* Emoji */
img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

/* -- Spezielles Styling für vertikale Bilder mit begrenzter Höhe -- */

figure img.constrain-height {
    max-height: 500px;

    /* Wichtig, damit die Höhe auch angewendet wird und das Bild nicht verzerrt wird */
    height: auto;
    width: auto;
    object-fit: contain;

    /* Zentriert das Bild horizontal, falls es schmaler als der Container ist */
    margin: 0 auto;
    display: block;
}

/* Custom Shadow for selected Figures Class */
.figure-shadow {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, .2), 0 6px 20px 0 rgba(0, 0, 0, .19);
    border-radius: 8px;
    overflow: hidden;
}

/* -- Stil für den Video-Shortcode (Final, mit Flexbox-Fix, korrigiert) -- */

figure.lausitzer-video-container {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
}

figure.lausitzer-video-container video {
    width: 100%;
    height: auto;
    display: block;
    overflow: hidden;
}

figure.lausitzer-video-container figcaption {
    margin-top: 0.5rem;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

/* Custom Shadow for Paths */
#hero .breadcrumb {
    font-size: 0.85em;
    font-weight: 500;
    width: 100%;
    margin: 1.2rem 0 1rem 0;
}

#hero .breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

#hero .breadcrumb li {
    color: #999;
    text-align: left;
}

#hero .breadcrumb li:not(:last-child)::after {
    content: '›';
    margin: 0 0.6em;
    color: #ccc;
    font-weight: 300;
}

#hero .breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

#hero .breadcrumb a:hover {
    color: #007bff;
}

#hero .breadcrumb li:first-child a {
    font-size: 1.1em;
    line-height: 1;
}

#hero .breadcrumb .is-active {
    color: #333;
    font-weight: 600;
}

/* -- CSS-Only Lightbox Stil -- */

/* Das Overlay, standardmäßig unsichtbar */
.css-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);

    /* Unsichtbar machen und für Transition vorbereiten */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;

    /* Inhalt zentrieren */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

/* Der entscheidende Teil: Wenn das Overlay zum Ziel wird, mach es sichtbar! */
.css-lightbox:target {
    visibility: visible;
    opacity: 1;
}

/* Das große Bild im Overlay */
.css-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Der Schließen-Button (deckt den ganzen Hintergrund ab) */
.css-lightbox-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: default;
}

/* Optional: Ein sichtbares "X" als Schließen-Symbol hinzufügen */
.css-lightbox-close::after {
    content: '×';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3em;
    color: white;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

/* -- Stil für den einklappbaren Shortcode -- */

.collapsible-block {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.collapsible-block summary {
    /* Wichtig für die Klickbarkeit-Anzeige */
    cursor: pointer;

    padding: 0.5rem 1rem;
    font-weight: bold;
    outline: none;
    /* Verhindert den blauen Rahmen bei Klick in manchen Browsern */
}

/* Ändert den Pfeil bei offenem Zustand */
.collapsible-block[open]>summary {
    border-bottom: 1px solid #ddd;
}

.collapsible-content {
    padding: 1rem;
    padding-top: 0.5rem;
}

/* Wichtig: Entfernt den doppelten Rand, wenn ein Codeblock direkt drin ist */
.collapsible-content pre {
    margin-top: 0;
    margin-bottom: 0;
}

/* -- Stil für den "Code kopieren"-Button (Finale Version mit Icon-Wechsel) -- */

.code-block-container {
    position: relative;
}

button.code-copy-button {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    padding: 0.5em;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Verhindert den Hintergrund bei Interaktion */
button.code-copy-button:hover,
button.code-copy-button:focus,
button.code-copy-button:active {
    background-color: transparent;
    color: inherit;
}

/* Wird sichtbar, wenn man über den ganzen Code-Block fährt */
.code-block-container:hover .code-copy-button {
    opacity: 1;
}

/* --- HIER IST DIE NEUE LOGIK FÜR DIE ICONS --- */

/* Generelles Icon-Styling */
.code-copy-button i {
    font-size: 1.2em;
    transition: color 0.2s ease-in-out, transform 0.2s ease;
}

/* Standardzustand: Nur das "Kopieren"-Icon ist sichtbar */
.code-copy-button .copy-icon {
    display: inline-block;
    color: #aaa;
}

.code-copy-button .check-icon {
    display: none;
    /* Das Häkchen ist versteckt */
}

/* Zustand nach dem Klick (wenn der Button die Klasse .is-copied hat) */
.code-copy-button.is-copied .copy-icon {
    display: none;
    /* Das "Kopieren"-Icon wird versteckt */
}

.code-copy-button.is-copied .check-icon {
    display: inline-block;
    /* Das Häkchen wird sichtbar */
    color: #28a745;
    /* Und bekommt seine grüne Farbe */
}

/* Hover-Effekt wirkt nur auf das "Kopieren"-Icon */
.code-copy-button:hover .copy-icon {
    color: #333;
}

.code-copy-button:active .copy-icon {
    color: #000;
}

/* -- Stil für automatische Anker-Links bei Überschriften -- */

.heading-with-anchor {
    position: relative;
    /* Wichtig für die Positionierung des Icons */
    scroll-margin-top: 2em;
    /* Verhindert, dass die Überschrift bei Anspringen hinter einer fixen Navigationsleiste landet */
}

.anchor-link {
    position: absolute;
    /* Positioniert das Icon links neben der Überschrift */
    left: -1.2em;
    top: 50%;
    transform: translateY(-50%);

    /* Standardmäßig unsichtbar */
    opacity: 0;
    transition: opacity 0.2s ease-in-out;

    /* Styling des Icons */
    color: #aaa;
    text-decoration: none;
}

.anchor-link svg {
    display: block;
    /* Verhindert seltsame Abstände unter dem SVG */
}

/* Link wird sichtbar, wenn man über die Überschrift fährt */
.heading-with-anchor:hover .anchor-link {
    opacity: 1;
}

.anchor-link:hover {
    color: #333;
    /* Macht das Icon beim Hover dunkler */
}