/**
 * RPG Galerie postav — Plynulé animace a vícesnímkový posuvný pás
 */

/* Hlavní kontejner rámečku */
.rpg-gallery-container {
    position: relative;
    margin: 1.2rem auto;
    box-sizing: border-box;
    user-select: none;
}

/* Plátno/výřez galerie */
.rpg-gallery-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    background: rgba(13, 17, 23, 0.9);
}

/* Ozdobný překryvný rámeček (PNG/SVG) */
.rpg-gallery-overlay-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
    object-fit: fill;
}

/* Plynule animovaný posuvný pás (Track) */
.rpg-gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

/* Jednotlivé snímky v pásu */
.rpg-gallery-slide {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 4px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.rpg-gallery-container.is-multi-item .rpg-gallery-slide {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rpg-gallery-container.is-multi-item .rpg-gallery-slide:hover {
    border-color: rgba(198, 156, 109, 0.4);
}

/* Samotný obrázek */
.rpg-gallery-img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: block;
    margin: auto;
    cursor: zoom-in;
    transition: transform 0.35s ease;
}

.rpg-gallery-slide:hover .rpg-gallery-img {
    transform: scale(1.03);
}

/* Popisek u fotografie */
.rpg-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(5, 8, 15, 0.94) 0%, rgba(5, 8, 15, 0.75) 60%, transparent 100%);
    padding: 1.2rem 0.9rem 0.6rem;
    color: #f0f3f6;
    z-index: 4;
    text-align: left;
    pointer-events: none;
    box-sizing: border-box;
}

.rpg-gallery-caption-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #f9e2af;
    margin-bottom: 0.15rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rpg-gallery-caption-desc {
    font-size: 0.76rem;
    color: #cbd5e1;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Ovládací navigační šipky */
.rpg-gal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(13, 17, 23, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(198, 156, 109, 0.45);
    color: #f5eaad;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 0;
    outline: none;
}

.rpg-gal-nav-btn:hover {
    background: rgba(198, 156, 109, 0.4);
    border-color: #c69c6d;
    color: #ffffff;
    transform: translateY(-50%) scale(1.14);
    box-shadow: 0 0 14px rgba(198, 156, 109, 0.6);
}

.rpg-gal-prev {
    left: 10px;
}

.rpg-gal-next {
    right: 10px;
}

/* Tlačítko zvětšení (Lightbox) */
.rpg-gal-zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
}

.rpg-gal-zoom-btn:hover {
    background: rgba(198, 156, 109, 0.45);
    border-color: #c69c6d;
    transform: scale(1.12);
}

/* Počítadlo snímků */
.rpg-gal-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(13, 17, 23, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    z-index: 10;
    pointer-events: none;
}

/* Indikační tečky */
.rpg-gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.rpg-gal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.rpg-gal-dot.active {
    background: #c69c6d;
    width: 22px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(198, 156, 109, 0.8);
}

.rpg-gal-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.75);
}

/* ── Lightbox celoobrazovkový náhled ─────────────────────────────────────── */
.rpg-gal-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1.5rem;
    box-sizing: border-box;
}

.rpg-gal-lightbox-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.rpg-gal-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rpg-gal-lightbox-img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(198, 156, 109, 0.4);
    display: block;
    transition: transform 0.25s ease;
}

.rpg-gal-lightbox-caption {
    margin-top: 0.8rem;
    text-align: center;
    color: #f0f3f6;
    max-width: 800px;
}

.rpg-gal-lightbox-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f9e2af;
    margin-bottom: 0.2rem;
}

.rpg-gal-lightbox-desc {
    font-size: 0.88rem;
    color: #cbd5e1;
}

.rpg-gal-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.rpg-gal-lightbox-close:hover {
    background: rgba(200, 50, 50, 0.65);
    border-color: #ff6b6b;
    transform: scale(1.12);
}

.rpg-gal-lightbox-prev,
.rpg-gal-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(198, 156, 109, 0.5);
    color: #f5eaad;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rpg-gal-lightbox-prev {
    left: 25px;
}
.rpg-gal-lightbox-next {
    right: 25px;
}

.rpg-gal-lightbox-prev:hover,
.rpg-gal-lightbox-next:hover {
    background: rgba(198, 156, 109, 0.4);
    transform: translateY(-50%) scale(1.14);
}

/* Responzivní přizpůsobení */
@media (max-width: 768px) {
    .rpg-gallery-container.is-multi-item .rpg-gallery-slide {
        /* Na menších mobilech zobrazíme min 1 nebo 2 */
        flex: 0 0 calc((100% - 8px) / 2) !important;
        max-width: calc((100% - 8px) / 2) !important;
    }
}

@media (max-width: 480px) {
    .rpg-gallery-container.is-multi-item .rpg-gallery-slide {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .rpg-gal-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1.15rem;
    }
}
