/* ---------------------------------------------------------------------
   ui-extra.css - themeunabhaengige Ergaenzungen.

   Wird in layout.tpl NACH dem gewaehlten Theme geladen und ueberschreibt
   dessen aeltere .lightbox-Regeln. Farben kommen weiterhin aus den
   CSS-Variablen des Themes, damit light/dark/violet gueltig bleiben.
   --------------------------------------------------------------------- */

/* --- Fusszeile -------------------------------------------------------- */

.site-footer {
    max-width: 1100px;
    margin: 3rem auto 2rem;
    padding: 1.1rem 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .8rem;
    text-align: center;
    line-height: 1.7;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover { text-decoration: underline; }

/* --- Grossansicht ----------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(8, 10, 18, 0.92);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
    overscroll-behavior: contain;
}

.lightbox[hidden] { display: none; }

.lb-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.lightbox img {
    max-width: 92vw;
    max-height: 84vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    transform-origin: center center;
    transition: transform .12s ease-out;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox.is-zoomed img {
    cursor: grab;
    transition: none;
}

.lightbox.is-zoomed img:active { cursor: grabbing; }

/* Werkzeugleiste oben rechts */
.lb-bar {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .3rem;
    border-radius: 999px;
    background: rgba(22, 26, 38, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    cursor: default;
}

.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #f2f4f8;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.lb-btn svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lb-btn:active { transform: scale(.92); }
.lb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lb-btn[hidden] { display: none; }

.lb-close:hover {
    background: #e5484d;
    color: #fff;
}

.lb-level {
    min-width: 62px;
    height: 38px;
    padding: 0 .55rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #cfd5e4;
    font: inherit;
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.lb-level:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.lb-sep {
    width: 1px;
    height: 22px;
    margin: 0 .2rem;
    background: rgba(255, 255, 255, 0.18);
}

/* Blaettern */
.lb-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(22, 26, 38, 0.6);
    color: #f2f4f8;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background .15s ease;
}

.lb-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lb-nav[hidden] { display: none; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

.lb-caption {
    position: absolute;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 2;
    max-width: 80vw;
    padding: .4rem .9rem;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(22, 26, 38, 0.66);
    color: #e7eaf3;
    font-size: .78rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

@media (max-width: 640px) {
    .lb-bar { top: .6rem; right: .6rem; }
    .lb-btn, .lb-nav { width: 34px; height: 34px; }
    .lb-prev { left: .4rem; }
    .lb-next { right: .4rem; }
    .lightbox img { max-width: 100vw; max-height: 78vh; }
}

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

/* --- CLI-Hinweis unter dem Formular ------------------------------------ */

.cli-hint {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-muted);
}

.cli-hint-title {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: .5rem;
    color: var(--text);
}

.cli-hint pre {
    margin: 0;
    /* Eigene Code-Box mit Innenabstand, damit der Text nicht direkt am
       Rand klebt. */
    padding: .85rem 1rem;
    overflow-x: auto;
    background: var(--code-bg, rgba(22, 33, 62, 0.06));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 10px);
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular,
                 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: .8rem;
    line-height: 1.7;
}

.cli-hint code { background: none; padding: 0; }

/* --- Ergebnis nach dem Upload ------------------------------------------ */

.result-link {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: .4rem;
}

.result-link input {
    flex: 1 1 16rem;
    min-width: 0;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular,
                 Menlo, Consolas, monospace;
    font-size: .82rem;
}

.result-link .btn { flex: 0 0 auto; }


/* --- Statistik: Listen-Link, durchblätterbare Liste, Pagination -------- */

.sub { color: var(--text-muted); font-size: .85rem; }

.list-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.list-link-row .btn { flex: 0 0 auto; }

table.stats-table.list-table td { vertical-align: middle; }
.list-title { color: var(--accent); font-weight: 600; text-decoration: none; }
.list-title:hover { text-decoration: underline; }
.list-slug {
    display: inline-block;
    margin-left: .5rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: .74rem;
}
.lock-badge { margin-left: .35rem; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0 .5rem;
    flex-wrap: wrap;
}
.pager .pager-info { color: var(--text-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pager .btn.secondary { padding: .5rem 1rem; font-size: .85rem; }
.btn.disabled, .btn.secondary.disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

/* Vorschau-Link (No-JS-Fallback) in der Galerie soll das Layout nicht
   veraendern: der <a> verhaelt sich wie nicht vorhanden, das <img> bleibt
   direktes Flex-Kind von .preview. */
.grid .preview-link { display: contents; }
