/* gallery.css - IRON GATES gallery viewer stylesheet
-------------------------------
$Id: gallery.css 943 2026-09-29 08:16:52Z ralf $  RELEASE 3.1.0 -> SVN 931
-------------------------------
Abgeleitet von Ralfs generischer Galerie-Vorlage, plus Grid-Uebersicht.
*/

:root { color-scheme: dark; }

html, body {
    height: 100%;
    height: 100svh;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #111 url(../images/ig.backtile.mix.png);
    background-repeat: repeat;
    color: #eee;
    overflow: hidden;
}

.wrap {
    height: 100%;
    height: 100svh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

/* ── Kopfzeile ── */
.topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

h2 {
    margin: 0;
    font-weight: 700;
    letter-spacing: .2px;
    font-size: 18px;
}

.small {
    opacity: .65;
    font-size: 12px;
}

.source-link {
    margin-left: 10px;
    font-size: 13px;
    font-weight: 400;
    color: #9ad;
    text-decoration: none;
}
.source-link:hover {
    text-decoration: underline;
}

/* ── Viewer Cursor-Zonen ── */
.viewer-prev,
.viewer-next {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
}
.viewer-prev { left: 0;   cursor: w-resize; }
.viewer-next { right: 0;  cursor: e-resize; }

/* Bild ueber den Overlays, damit object-fit korrekt bleibt */
.viewer img  { position: relative; z-index: 0; }
.viewer {
    flex: 1 1 auto;
    min-height: 240px;
    position: relative;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.viewer:fullscreen     { border-radius: 0; border: none; }
.viewer:fullscreen img { width: 100vw; height: 100vh; object-fit: contain; }

/* ── Steuerleiste ── */
.bar {
    flex: 0 0 auto;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.left, .right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

button {
    background: #1c1c1c;
    color: #eee;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 9px 11px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
}

button:hover    { border-color: #666; }
button:disabled { opacity: .5; cursor: not-allowed; }

.counter {
    opacity: .75;
    font-size: 13px;
}

/* ── Bildunterschriften ── */
.cap {
    flex: 0 0 auto;
    min-height: 20px;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .88;
    font-size: 13px;
    line-height: 1.2;
}

.gpsline {
    flex: 0 0 auto;
    min-height: 20px;
    padding: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .88;
    font-size: 13px;
    line-height: 1.2;
}

.gpsline a       { color: #9ad; text-decoration: none; }
.gpsline a:hover { text-decoration: underline; }

/* ── Thumbnail-Leiste (unter dem Bild) ── */
.thumbStrip {
    flex: 0 0 auto;
    height: 128px;
    display: flex;
    gap: 10px;
    overflow: auto;
    padding: 8px;
    background: #0b0b0b;
    border: 1px solid #222;
    border-radius: 12px;
    scroll-behavior: smooth;
    box-sizing: border-box;
}

.thumbStrip::-webkit-scrollbar { height: 10px; }

.thumb {
    flex: 0 0 auto;
    width: 140px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #000;
}

.thumb img    { width: 100%; height: auto; display: block; }
.thumb.active { border-color: #9ad; }

/* ── Hinweiszeile ── */
.hint {
    flex: 0 0 auto;
    min-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .55;
    font-size: 12px;
    line-height: 1.2;
}

/* ── Grid-Uebersicht (alle Thumbnails, ueber Grid-Button/Taste g togglebar) ── */
.thumbGrid {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, .96);
    z-index: 10;
    overflow-y: auto;
    padding: 24px;
    box-sizing: border-box;
}

.thumbGridInner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.thumbGridInner .thumb {
    width: auto;
    aspect-ratio: 1 / 1;
}

.thumbGridInner .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    html, body { height: 100svh; overflow: hidden; }

    .wrap {
        height: 100svh;
        padding: 6px;
        gap: 4px;
    }

    /* Kopfzeile kompakt */
    .topline { gap: 4px; }
    h2 { font-size: 13px; }
    .small { display: none; }

    /* Viewer bekommt den meisten Platz */
    .viewer { min-height: 0; border-radius: 6px; }

    /* Steuerleiste: alle Buttons in einer Zeile, kein Umbrechen */
    .bar {
        min-height: auto;
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
    }
    .left {
        flex-wrap: nowrap;
        gap: 4px;
        flex: 1 1 auto;
    }
    .right { flex-shrink: 0; }

    button {
        padding: 6px 8px;
        font-size: 11px;
        border-radius: 6px;
        white-space: nowrap;
    }

    .counter { font-size: 11px; white-space: nowrap; }

    /* Caption einzeilig, kleiner */
    .cap { font-size: 11px; min-height: 16px; }
    .gpsline { font-size: 11px; min-height: 16px; }

    /* Hint ausblenden */
    .hint { display: none; }

    /* Thumbnails flacher */
    .thumbStrip {
        height: 70px;
        gap: 5px;
        padding: 5px;
        border-radius: 6px;
    }
    .thumb { width: 70px; border-radius: 4px; }

    .thumbGrid { padding: 12px; }
    .thumbGridInner { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
}
