:root {
    --bg: #071018;
    --bg-elev: #0d1621;
    --bg-card: #111c29;
    --border: rgba(196, 219, 255, 0.15);
    --border-strong: rgba(230, 252, 133, 0.34);
    --text: #e9f1f7;
    --muted: #9eb1c2;
    --accent: #e6fc85;
    --accent-soft: rgba(230, 252, 133, 0.12);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top, rgba(42, 67, 99, 0.35), transparent 34%),
        linear-gradient(180deg, #04080d 0%, var(--bg) 100%);
    color: var(--text);
    font: 14px/1.45 "Segoe UI", Tahoma, Verdana, sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .18s ease, opacity .18s ease, transform .18s ease;
}

a:hover {
    color: #f5ffbf;
}

img { max-width: 100%; display: block; }
hr {
    border: 0;
    height: 1px;
    margin: 0;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.gallery-shell {
    width: min(1380px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 34px;
}

.gallery-header {
    margin-bottom: 26px;
    text-align: center;
}

.gallery-title {
    margin: 0;
    color: var(--accent);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.gallery-subtitle {
    margin: 10px auto 0;
    max-width: 900px;
    color: var(--muted);
    font-size: 15px;
}

.section-block {
    margin-top: 34px;
    padding-top: 2px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 29px;
    font-weight: 600;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.gallery-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), var(--bg-card);
    box-shadow: var(--shadow);
}

.gallery-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.gallery-card__thumb {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}

.gallery-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card__body {
    padding: 12px 13px 14px;
}

.gallery-card__title {
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.gallery-card__meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.author-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
}

.author-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(230, 252, 133, 0.18);
    border-radius: 999px;
    background: var(--accent-soft);
    white-space: nowrap;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
}

.spaced, .spacedBar, table.popis, table.popis2 {
    font: inherit;
}

.image {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* Detail */
body.detail-page {
    overflow: hidden;
}

.detail-shell {
    width: min(1500px, calc(100vw - 24px));
    height: 100vh;
    margin: 0 auto;
    padding: 14px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
}

.detail-title-wrap {
    min-width: 0;
}

.detail-title {
    margin: 0;
    color: var(--accent);
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
}

.detail-motto {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.detail-paging {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    color: var(--accent);
    font-size: 18px;
    line-height: 1;
}

.nav-btn.is-disabled {
    opacity: .35;
    pointer-events: none;
}

#paging {
    padding: 0 14px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}

#paging a { margin: 0 2px; }

.detail-stage {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 300px;
    gap: 14px;
}

.detail-media,
.detail-sidebar {
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)), var(--bg-elev);
    box-shadow: var(--shadow);
}

.detail-media {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}

#main_image_div,
#main_image_loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main_image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
}

.detail-sidebar {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    padding: 5px 15px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    background: rgba(255,255,255,0.02);
}

.info-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.info-value {
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    word-break: break-word;
}

.info-value:empty::before {
    content: "—";
    color: #70879c;
}

.detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 4px;
}

.detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-links a,
.map-link,
.map-link-disabled {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
}

.map-link-disabled {
    color: #70879c;
}

@media (max-width: 1100px) {
    body.detail-page {
        overflow: auto;
    }
    .detail-shell {
        height: auto;
        min-height: 100vh;
    }
    .detail-stage {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .gallery-shell {
        width: min(100vw - 20px, 1380px);
        padding-top: 18px;
    }
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 12px;
    }
    .detail-header,
    .detail-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .detail-paging {
        justify-content: space-between;
    }
}


.paging-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
}

.paging-select-label {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.paging-select {
    height: 36px;
    min-width: 110px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: #0f1a25;
    color: #e9f1f7;
    font: inherit;
    cursor: pointer;
}

.paging-select option {
    background: #0f1a25;
    color: #e9f1f7;
}

.detail-media-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-half-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 2;
}

.photo-half-nav--left { left: 0; }
.photo-half-nav--right { right: 0; }

.side-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 72px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    background: rgba(7, 16, 24, 0.72);
    color: var(--accent);
    font-size: 34px;
    line-height: 1;
    box-shadow: var(--shadow);
}

.side-nav-btn--left { left: 12px; }
.side-nav-btn--right { right: 12px; }

.side-nav-btn:hover {
    background: rgba(13, 22, 33, 0.92);
}

#main_image_div,
#main_image_loading {
    position: relative;
    z-index: 1;
}

@media (max-width: 720px) {
    .paging-select-wrap {
        width: 100%;
        justify-content: space-between;
    }
    .paging-select {
        min-width: 96px;
    }
    .side-nav-btn {
        width: 48px;
        height: 62px;
        font-size: 28px;
    }
}
