/*
 * Ergänzungen zu theme.css (Greyson) und modifications.css der alten Seite.
 * Ziel: gleiches Erscheinungsbild bei sauberem HTML und ohne externe Ressourcen.
 */

/* Footer immer am unteren Fensterrand, auch wenn der Inhalt kürzer ist
   (Impressum, 404, große Bildschirme). */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

main {
    flex: 1 0 auto;
}

/* Inline-SVG-Icons statt Font Awesome 5.7 / Ionicons 3 als Webfont.
   Maße wie .svg-inline--fa: Höhe 1em, Breite aus der viewBox. */
.svg-icon {
    display: inline-block;
    height: 1em;
    overflow: visible;
    vertical-align: -0.125em;
    fill: currentColor;
}

/* Footer-Pfeil: Die Ionicons-Glyphe war 16px breit (viewBox des SVG ist auf die
   Pfeilform zugeschnitten) und saß knapp über der Grundlinie; das <i> bleibt inline,
   damit sein Padding die Zeilenhöhe nicht vergrößert. */
.footer-icon .svg-icon {
    height: 0.668em;
    vertical-align: 0.04em;
}

.footer-legal {
    font-size: 0.875rem;
    align-self: center;
}

/* Die alten Views hatten ein leeres <p class="card-text"> vor der Tabelle,
   das den Abstand unter der Kartenüberschrift auf 1rem vergrößert hat. */
.card-title + .table {
    margin-top: 1rem;
}

/* Infoboxen und frei bearbeitbare Seiten: Absätze aus dem Editor ohne
   Abstand nach dem letzten Absatz (wie .card-text:last-child). */
.card-text > :last-child,
.page-body > :last-child {
    margin-bottom: 0;
}

/* ---- Bilder (/pictures) ------------------------------------------------ */

/* Liste: Vorschaubild links (Spalte so breit wie das breiteste Bild),
   Titel und Jahr rechts daneben. */
.picture-thumb {
    width: 1%;
    padding-right: 1.25rem !important;
}

.picture + .picture td {
    padding-top: 1.25rem;
}

.picture-thumb a {
    display: block;
    cursor: zoom-in;
}

.picture-thumb img {
    display: block;
    max-width: 200px;
    max-height: 200px;
    height: auto;
    background-color: #e3e5e3;
    box-shadow: 0 1px 3px rgba(30, 43, 55, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.picture:hover .picture-thumb img {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(30, 43, 55, 0.3);
}

.picture-caption {
    vertical-align: middle !important;
}

.picture-year {
    color: #6c757d;
    font-size: 0.875rem;
}

@media (max-width: 575.98px) {
    .picture-thumb {
        padding-right: 0.75rem !important;
    }

    .picture-thumb img {
        max-width: 110px;
    }
}

/* Vollansicht: <dialog> über die ganze Seite, blendet auf und ab. */
html.lightbox-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background-color: rgba(20, 29, 38, 0.96);
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox[open] {
    display: block;
}

.lightbox.is-open {
    opacity: 1;
}

.lightbox:focus {
    outline: none;
}

.lightbox::backdrop {
    background: transparent;
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 4rem 5.5rem 1.5rem;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 10rem);
    max-height: calc(100dvh - 10rem);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.lightbox-image:not([src]) {
    display: none;
}

.lightbox-caption {
    margin-top: 1.25rem;
    text-align: center;
    line-height: 1.3;
}

.lightbox-title {
    font-family: Oswald, sans-serif;
    font-size: 1.375rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.lightbox-year {
    margin-left: 0.6rem;
    color: #cdcd75;
    font-size: 1rem;
}

.lightbox-counter {
    position: absolute;
    top: 1.55rem;
    left: 1.5rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

.lightbox-button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lightbox-button:hover {
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.lightbox-button:focus {
    outline: none;
}

.lightbox-button:focus-visible {
    box-shadow: 0 0 0 2px #cdcd75;
}

.lightbox-button svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1.25rem;
}

.lightbox-next {
    right: 1.25rem;
}

.lightbox-prev:hover {
    transform: translate(-3px, -50%);
}

.lightbox-next:hover {
    transform: translate(3px, -50%);
}

.lightbox.is-single .lightbox-prev,
.lightbox.is-single .lightbox-next,
.lightbox.is-single .lightbox-counter {
    display: none;
}

/* Ladeanzeige, falls ein großes Bild auf sich warten lässt */
.lightbox.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.5rem;
    height: 2.5rem;
    margin: -1.25rem 0 0 -1.25rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #cdcd75;
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Schmale Bildschirme: Bild fast randlos, Pfeile über dem Bild (dazu Wischen) */
@media (max-width: 575.98px) {
    .lightbox-figure {
        padding: 3.75rem 0.5rem 1rem;
    }

    .lightbox-image {
        max-height: calc(100vh - 9rem);
        max-height: calc(100dvh - 9rem);
    }

    .lightbox-prev,
    .lightbox-next {
        width: 2.5rem;
        height: 2.5rem;
        background-color: rgba(20, 29, 38, 0.55);
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-button,
    .picture-thumb img {
        transition: none;
    }
}
