
.msc-history{
    --msc-red:#e21b2d;
    --msc-dark:#0b0c10;
    --msc-soft:#f4f5f7;
    --msc-line:#cfd3d8;
    width:min(1180px,calc(100% - 36px));
    margin:0 auto;
    padding:72px 0 90px;
    color:#17191d;
}

.msc-history-intro{
    margin-bottom:64px;
    max-width:820px;
}

.msc-history-kicker{
    color:var(--msc-red);
    font-size:13px;
    font-weight:900;
    letter-spacing:1.6px;
    text-transform:uppercase;
    margin:0 0 10px;
}

.msc-history-intro h1{
    margin:0 0 18px;
    font-size:clamp(42px,6vw,76px);
    line-height:.95;
    text-transform:uppercase;
    letter-spacing:-1.5px;
}

.msc-history-intro>p:last-child{
    font-size:19px;
    line-height:1.55;
    color:#555b64;
}

.msc-history-timeline{
    position:relative;
    padding:6px 0;
}

.msc-history-timeline::before{
    content:"";
    position:absolute;
    left:50%;
    top:0;
    bottom:0;
    width:3px;
    background:linear-gradient(
        to bottom,
        transparent 0,
        var(--msc-red) 4%,
        var(--msc-red) 96%,
        transparent 100%
    );
    transform:translateX(-50%);
}

.msc-history-item{
    position:relative;
    display:grid;
    grid-template-columns:1fr 130px 1fr;
    align-items:center;
    min-height:300px;
    margin:0 0 44px;
}

.msc-history-marker{
    grid-column:2;
    display:flex;
    justify-content:center;
    align-items:center;
    position:relative;
    z-index:2;
}

.msc-history-marker::before{
    content:"";
    position:absolute;
    width:22px;
    height:22px;
    border:5px solid var(--msc-red);
    background:#fff;
    border-radius:50%;
    box-sizing:border-box;
}

.msc-history-marker span{
    position:absolute;
    top:36px;
    background:var(--msc-dark);
    color:#fff;
    font-weight:900;
    font-size:17px;
    letter-spacing:.4px;
    padding:7px 12px;
    border-radius:4px;
    white-space:nowrap;
}

.msc-history-card{
    background:#fff;
    border-top:5px solid var(--msc-red);
    box-shadow:0 12px 34px rgba(0,0,0,.09);
    overflow:hidden;
    width:100%;
    max-width:475px;
}

.msc-history-left .msc-history-card{
    grid-column:1;
    justify-self:end;
}

.msc-history-right .msc-history-card{
    grid-column:3;
    justify-self:start;
}

.msc-history-left .msc-history-card::after,
.msc-history-right .msc-history-card::after{
    content:"";
    position:absolute;
}

.msc-history-image{
    aspect-ratio:16/9;
    overflow:hidden;
    background:#111;
}

.msc-history-image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
}

.msc-history-content{
    padding:26px 28px 30px;
}

.msc-history-content h2{
    margin:0 0 12px;
    font-size:25px;
    line-height:1.1;
    text-transform:uppercase;
}

.msc-history-text{
    color:#535861;
    line-height:1.65;
}

.msc-history-text p:last-child{
    margin-bottom:0;
}

.msc-history-year-mobile{
    display:none;
}

.msc-history-empty{
    background:var(--msc-soft);
    border-left:5px solid var(--msc-red);
    padding:28px;
}

@media(max-width:900px){
    .msc-history{
        width:min(100% - 26px,1180px);
        padding:50px 0 70px;
    }

    .msc-history-intro{
        margin-bottom:40px;
    }

    .msc-history-timeline::before{
        left:17px;
        transform:none;
    }

    .msc-history-item{
        display:block;
        min-height:0;
        margin:0 0 34px;
        padding-left:48px;
    }

    .msc-history-marker{
        position:absolute;
        left:0;
        top:28px;
        width:36px;
        height:36px;
        display:block;
    }

    .msc-history-marker::before{
        left:6px;
        top:0;
    }

    .msc-history-marker span{
        display:none;
    }

    .msc-history-card{
        max-width:none;
        width:100%;
    }

    .msc-history-year-mobile{
        display:inline-block;
        margin:0 0 8px;
        color:var(--msc-red);
        font-weight:900;
        font-size:18px;
    }
}


/* v1.2.0 – anklickbare Chronikbilder / Lightbox */
.msc-history-lightbox-link{
    position:relative;
    display:block;
    width:100%;
    height:100%;
    cursor:zoom-in;
}

.msc-history-lightbox-link img{
    transition:transform .22s ease, filter .22s ease;
}

.msc-history-lightbox-link:hover img,
.msc-history-lightbox-link:focus-visible img{
    transform:scale(1.025);
    filter:brightness(.88);
}

.msc-history-zoom-hint{
    position:absolute;
    right:14px;
    bottom:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    border-radius:50%;
    background:rgba(11,12,16,.82);
    border:2px solid var(--msc-red);
    color:#fff;
    font-size:28px;
    line-height:1;
    font-weight:500;
    pointer-events:none;
}

.msc-history-lightbox[hidden]{
    display:none!important;
}

.msc-history-lightbox{
    position:fixed;
    inset:0;
    z-index:999999;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:28px;
    background:rgba(0,0,0,.92);
    cursor:zoom-out;
}

.msc-history-lightbox img{
    display:block;
    max-width:min(95vw,1800px);
    max-height:90vh;
    width:auto;
    height:auto;
    object-fit:contain;
    box-shadow:0 18px 60px rgba(0,0,0,.55);
    cursor:default;
}

.msc-history-lightbox-close{
    position:fixed;
    top:18px;
    right:22px;
    z-index:2;
    width:48px;
    height:48px;
    border:2px solid rgba(255,255,255,.65);
    border-radius:50%;
    background:rgba(11,12,16,.72);
    color:#fff;
    font-size:34px;
    line-height:1;
    cursor:pointer;
}

.msc-history-lightbox-close:hover,
.msc-history-lightbox-close:focus-visible{
    background:var(--msc-red);
    border-color:var(--msc-red);
    outline:none;
}

body.msc-history-lightbox-open{
    overflow:hidden;
}

@media(max-width:700px){
    .msc-history-lightbox{
        padding:16px;
    }

    .msc-history-lightbox img{
        max-width:96vw;
        max-height:84vh;
    }

    .msc-history-lightbox-close{
        top:10px;
        right:10px;
    }
}


/* =========================================================
   v1.3.0 – CSS-only Lightbox, komplett ohne JavaScript
   ========================================================= */

.msc-history-css-lightbox{
    position:fixed;
    inset:0;
    z-index:999999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:28px;
}

.msc-history-css-lightbox:target{
    display:flex;
}

.msc-history-css-lightbox-backdrop{
    position:absolute;
    inset:0;
    display:block;
    background:rgba(0,0,0,.93);
    cursor:zoom-out;
}

.msc-history-css-lightbox-inner{
    position:relative;
    z-index:2;
    max-width:95vw;
    max-height:92vh;
    display:flex;
    align-items:center;
    justify-content:center;
}

.msc-history-css-lightbox-inner img{
    display:block;
    width:auto;
    height:auto;
    max-width:95vw;
    max-height:90vh;
    object-fit:contain;
    box-shadow:0 18px 60px rgba(0,0,0,.65);
    background:#111;
}

.msc-history-css-lightbox-close{
    position:absolute;
    top:-18px;
    right:-18px;
    z-index:3;
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,.8);
    background:#0b0c10;
    color:#fff!important;
    text-decoration:none!important;
    font-size:34px;
    line-height:1;
    font-weight:400;
}

.msc-history-css-lightbox-close:hover,
.msc-history-css-lightbox-close:focus{
    background:var(--msc-red);
    border-color:var(--msc-red);
}

.msc-history-lightbox-link{
    position:relative;
    display:block;
    width:100%;
    height:100%;
    cursor:zoom-in;
    text-decoration:none!important;
}

.msc-history-lightbox-link img{
    transition:transform .2s ease, filter .2s ease;
}

.msc-history-lightbox-link:hover img{
    transform:scale(1.02);
    filter:brightness(.9);
}

.msc-history-zoom-hint{
    position:absolute;
    right:14px;
    bottom:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    border-radius:50%;
    background:rgba(11,12,16,.86);
    border:2px solid var(--msc-red);
    color:#fff;
    font-size:28px;
    line-height:1;
    pointer-events:none;
}

@media(max-width:700px){
    .msc-history-css-lightbox{
        padding:14px;
    }

    .msc-history-css-lightbox-inner img{
        max-width:96vw;
        max-height:84vh;
    }

    .msc-history-css-lightbox-close{
        top:-12px;
        right:-6px;
        width:44px;
        height:44px;
    }
}


/* =========================================================
   v1.3.1 – Mobile: Chronik immer sofort sichtbar
   Überschreibt Scroll-/Reveal-Animationen des Themes.
   ========================================================= */
@media (max-width: 900px) {
    .msc-history,
    .msc-history *,
    .msc-history-item,
    .msc-history-card,
    .msc-history-image,
    .msc-history-content,
    .msc-history-marker {
        opacity:1!important;
        visibility:visible!important;
        transform:none!important;
        translate:none!important;
        scale:1!important;
        animation:none!important;
        transition:none!important;
        filter:none!important;
    }

    .msc-history-item{
        display:block!important;
        position:relative!important;
        min-height:0!important;
        margin:0 0 34px!important;
        padding-left:48px!important;
    }

    .msc-history-card{
        display:block!important;
        position:relative!important;
        width:100%!important;
        max-width:none!important;
        margin:0!important;
    }

    .msc-history-image{
        display:block!important;
        width:100%!important;
        aspect-ratio:16/9!important;
        overflow:hidden!important;
    }

    .msc-history-image img{
        display:block!important;
        width:100%!important;
        height:100%!important;
        object-fit:cover!important;
        opacity:1!important;
        visibility:visible!important;
    }

    .msc-history-content{
        display:block!important;
    }

    /* CSS-Lightbox muss trotz globalem Animation-Override weiterhin verborgen bleiben,
       bis ein Bild angeklickt wird. */
    .msc-history-css-lightbox{
        display:none!important;
    }

    .msc-history-css-lightbox:target{
        display:flex!important;
        opacity:1!important;
        visibility:visible!important;
    }
}


/* =========================================================
   v1.4.0 – Native HTML-Dialog-Lightbox
   Gilt automatisch für bestehende und neue Chronik-Einträge.
   ========================================================= */

.msc-history-dialog-open{
    position:relative!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    cursor:zoom-in!important;
    overflow:hidden!important;
    font:inherit!important;
}

.msc-history-dialog-open img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    transition:transform .2s ease, filter .2s ease!important;
}

.msc-history-dialog-open:hover img,
.msc-history-dialog-open:focus-visible img{
    transform:scale(1.025)!important;
    filter:brightness(.9)!important;
}

.msc-history-dialog{
    width:auto!important;
    max-width:none!important;
    height:auto!important;
    max-height:none!important;
    margin:auto!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    overflow:visible!important;
}

.msc-history-dialog[open]{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
}

.msc-history-dialog::backdrop{
    background:rgba(0,0,0,.93)!important;
}

.msc-history-dialog img{
    display:block!important;
    width:auto!important;
    height:auto!important;
    max-width:94vw!important;
    max-height:90vh!important;
    object-fit:contain!important;
    background:#111!important;
    box-shadow:0 18px 60px rgba(0,0,0,.65)!important;
}

.msc-history-dialog form{
    position:absolute!important;
    top:-18px!important;
    right:-18px!important;
    z-index:5!important;
    margin:0!important;
    padding:0!important;
}

.msc-history-dialog-close{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:48px!important;
    height:48px!important;
    padding:0!important;
    border-radius:50%!important;
    border:2px solid rgba(255,255,255,.8)!important;
    background:#0b0c10!important;
    color:#fff!important;
    font-size:34px!important;
    line-height:1!important;
    cursor:pointer!important;
}

.msc-history-dialog-close:hover,
.msc-history-dialog-close:focus-visible{
    background:var(--msc-red)!important;
    border-color:var(--msc-red)!important;
}

/* Alte CSS-Lightbox sicher aus dem Weg nehmen. */
.msc-history-css-lightbox{
    display:none!important;
}

@media(max-width:700px){
    .msc-history-dialog img{
        max-width:96vw!important;
        max-height:84vh!important;
    }

    .msc-history-dialog form{
        top:-10px!important;
        right:-4px!important;
    }

    .msc-history-dialog-close{
        width:44px!important;
        height:44px!important;
    }
}


/* =========================================================
   v1.4.1 – Direkter Link zum Originalbild
   Maximale Kompatibilität ohne JavaScript/Lightbox.
   ========================================================= */
.msc-history-fullimage-link{
    position:relative!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    text-decoration:none!important;
    cursor:zoom-in!important;
    pointer-events:auto!important;
}

.msc-history-fullimage-link img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    pointer-events:none!important;
}

.msc-history-fullimage-link .msc-history-zoom-hint{
    pointer-events:none!important;
}

/* Alte Dialog-/Lightbox-Elemente werden in v1.4.1 nicht mehr ausgegeben. */
.msc-history-dialog,
.msc-history-css-lightbox{
    display:none!important;
}


/* =========================================================
   v1.5.0 – Gutenberg-Bildblöcke in Chronik-Einträgen
   ========================================================= */
.msc-history-text .msc-history-block-image-link{
    position:relative!important;
    display:inline-block!important;
    max-width:100%!important;
    cursor:zoom-in!important;
    text-decoration:none!important;
    pointer-events:auto!important;
}

.msc-history-text .msc-history-block-image-link img{
    display:block!important;
    max-width:100%!important;
    height:auto!important;
    pointer-events:none!important;
}

.msc-history-text .wp-block-image{
    margin-top:18px!important;
    margin-bottom:18px!important;
}

.msc-history-text .msc-history-block-image-link::after{
    content:"+";
    position:absolute;
    right:12px;
    bottom:12px;
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    border:2px solid var(--msc-red);
    background:rgba(11,12,16,.86);
    color:#fff;
    font-size:26px;
    line-height:1;
    pointer-events:none;
}


/* =========================================================
   v1.5.1 – Lightbox für Gutenberg-Bildblöcke
   ========================================================= */
.msc-history-block-lightbox[hidden]{
    display:none!important;
}

.msc-history-block-lightbox{
    position:fixed!important;
    inset:0!important;
    z-index:2147483000!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:28px!important;
    background:rgba(0,0,0,.94)!important;
    box-sizing:border-box!important;
}

.msc-history-block-lightbox img{
    display:block!important;
    width:auto!important;
    height:auto!important;
    max-width:94vw!important;
    max-height:90vh!important;
    object-fit:contain!important;
    box-shadow:0 18px 70px rgba(0,0,0,.7)!important;
}

.msc-history-block-lightbox-close{
    position:fixed!important;
    top:18px!important;
    right:20px!important;
    z-index:2147483001!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:50px!important;
    height:50px!important;
    padding:0!important;
    border:2px solid rgba(255,255,255,.8)!important;
    border-radius:50%!important;
    background:#0b0c10!important;
    color:#fff!important;
    font-size:34px!important;
    line-height:1!important;
    cursor:pointer!important;
}

.msc-history-block-lightbox-close:hover,
.msc-history-block-lightbox-close:focus-visible{
    background:var(--msc-red)!important;
    border-color:var(--msc-red)!important;
}

html.msc-history-lightbox-open,
body.msc-history-lightbox-open{
    overflow:hidden!important;
}

@media(max-width:700px){
    .msc-history-block-lightbox{
        padding:14px!important;
    }

    .msc-history-block-lightbox img{
        max-width:96vw!important;
        max-height:84vh!important;
    }

    .msc-history-block-lightbox-close{
        top:10px!important;
        right:10px!important;
        width:46px!important;
        height:46px!important;
    }
}


/* =========================================================
   v1.5.2 – Gutenberg-Bilder unverändert anzeigen
   ========================================================= */
.msc-history-text .wp-block-image img,
.msc-history-text img[data-msc-full]{
    display:block!important;
    max-width:100%!important;
    height:auto!important;
    opacity:1!important;
    visibility:visible!important;
    cursor:zoom-in!important;
    pointer-events:auto!important;
}

.msc-history-text .wp-block-image{
    display:block!important;
    opacity:1!important;
    visibility:visible!important;
}

/* Alte Link-spezifische Darstellung aus v1.5.0 nicht mehr verwenden. */
.msc-history-text .msc-history-block-image-link::after{
    display:none!important;
}


/* =========================================================
   v1.6.0 – Gutenberg-Bilder immer sichtbar
   + globale Lightbox außerhalb aller Chronik-Container
   ========================================================= */

.msc-history .msc-history-text figure.wp-block-image,
.msc-history .msc-history-text .wp-block-image,
.msc-history .msc-history-text figure,
.msc-history .msc-history-text img{
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    translate:none!important;
    scale:1!important;
    filter:none!important;
    animation:none!important;
}

.msc-history .msc-history-text figure.wp-block-image,
.msc-history .msc-history-text .wp-block-image{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:18px 0!important;
    overflow:visible!important;
    background:transparent!important;
}

.msc-history .msc-history-text figure.wp-block-image img,
.msc-history .msc-history-text .wp-block-image img,
.msc-history .msc-history-text img{
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    min-height:1px!important;
    margin:0 auto!important;
    object-fit:contain!important;
    cursor:zoom-in!important;
    pointer-events:auto!important;
    background:transparent!important;
}

/* Alle alten plugin-internen Lightboxen komplett deaktivieren. */
.msc-history-block-lightbox,
.msc-history-css-lightbox,
.msc-history-dialog{
    display:none!important;
}

/* Die neue Lightbox hängt direkt unter BODY und bleibt immer im Viewport. */
#msc-chronik-global-lightbox[hidden]{
    display:none!important;
}

#msc-chronik-global-lightbox{
    position:fixed!important;
    inset:0!important;
    z-index:2147483646!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    width:100vw!important;
    height:100dvh!important;
    margin:0!important;
    padding:24px!important;
    background:rgba(0,0,0,.94)!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    animation:none!important;
}

#msc-chronik-global-lightbox .msc-chronik-global-lightbox-stage{
    position:absolute!important;
    inset:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:28px!important;
    box-sizing:border-box!important;
}

#msc-chronik-global-lightbox .msc-chronik-global-lightbox-stage img{
    position:relative!important;
    z-index:1!important;
    display:block!important;
    width:auto!important;
    height:auto!important;
    max-width:94vw!important;
    max-height:90dvh!important;
    object-fit:contain!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    filter:none!important;
    background:#111!important;
    box-shadow:0 18px 70px rgba(0,0,0,.72)!important;
}

#msc-chronik-global-lightbox .msc-chronik-global-lightbox-close{
    position:fixed!important;
    top:16px!important;
    right:18px!important;
    z-index:2147483647!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:52px!important;
    height:52px!important;
    margin:0!important;
    padding:0!important;
    border:2px solid #fff!important;
    border-radius:50%!important;
    background:#0b0c10!important;
    color:#fff!important;
    font-size:36px!important;
    font-family:Arial,sans-serif!important;
    font-weight:400!important;
    line-height:1!important;
    text-align:center!important;
    cursor:pointer!important;
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
}

#msc-chronik-global-lightbox .msc-chronik-global-lightbox-close:hover,
#msc-chronik-global-lightbox .msc-chronik-global-lightbox-close:focus{
    background:var(--msc-red)!important;
    border-color:var(--msc-red)!important;
    outline:none!important;
}

html.msc-chronik-lightbox-open,
body.msc-chronik-lightbox-open{
    overflow:hidden!important;
}

@media(max-width:700px){
    #msc-chronik-global-lightbox{
        padding:10px!important;
    }

    #msc-chronik-global-lightbox .msc-chronik-global-lightbox-stage{
        padding:12px!important;
    }

    #msc-chronik-global-lightbox .msc-chronik-global-lightbox-stage img{
        max-width:96vw!important;
        max-height:84dvh!important;
    }

    #msc-chronik-global-lightbox .msc-chronik-global-lightbox-close{
        top:10px!important;
        right:10px!important;
        width:48px!important;
        height:48px!important;
    }
}
