/* ============================================================
   VLIG Post Loop Gallery — Frontend Styles v2.0.0
   ============================================================ */

/* === Grid ======================================================= */
.rv-wrapper .rv-grid {
    display: grid;
    grid-template-columns: repeat(var(--rv-col-d, 4), 1fr);
    gap: var(--rv-gap, 30px);
    margin: 0;
}
@media (max-width: 1024px) {
    .rv-wrapper .rv-grid { grid-template-columns: repeat(var(--rv-col-t, 2), 1fr); }
}
@media (max-width: 767px) {
    .rv-wrapper .rv-grid { grid-template-columns: repeat(var(--rv-col-m, 1), 1fr); }
}

/* === Swiper ===================================================== */
.rv-wrapper .rv-swiper        { padding-bottom: 40px; }
.rv-wrapper .swiper-slide      { height: auto; }
.rv-wrapper .rv-nav-prev,
.rv-wrapper .rv-nav-next       { color: var(--rv-accent, #0A7AAE); }
.rv-wrapper .rv-nav-prev::after,
.rv-wrapper .rv-nav-next::after { font-size: 1.4rem; font-weight: 700; }
.rv-wrapper .rv-pagination .swiper-pagination-bullet-active {
    background: var(--rv-accent, #0A7AAE);
}

/* === Kartica ==================================================== */
.rv-wrapper .rv-card {
    background: var(--rv-card-bg, #fff);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.rv-wrapper .rv-card.rv-corner { padding-bottom: 25px; }
.rv-wrapper .rv-card.rv-corner::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 8px;
    background-color: var(--rv-accent, #0A7AAE);
    transition: background-color 0.25s ease;
}
.rv-wrapper .rv-card.rv-corner::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    border-bottom: 60px solid var(--rv-accent, #0A7AAE);
    border-left: 60px solid transparent;
    transition: border-bottom-color 0.25s ease, border-left-color 0.25s ease;
}

/* === Slika ====================================================== */
.rv-wrapper .rv-image-wrap {
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative; /* potrebno za + overlay */
}
.rv-wrapper .rv-image-wrap img {
    width: 100%; height: auto;
    aspect-ratio: var(--rv-ratio, 4/3);
    object-fit: cover; display: block;
    /* nema zoom transform na hoveru */
}

/* + krug overlay — pojavljuje se na hover kartice */
.rv-wrapper .rv-image-wrap::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 72px;
    height: 72px;
    background: rgba(10, 122, 174, 0.88);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.4rem;
    font-weight: 300;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.rv-wrapper .rv-card:hover .rv-image-wrap::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Kursor pointer samo na klikabilnim */
.rv-wrapper .rv-clickable { cursor: pointer; }

/* === Hover kartica — dno ======================================= */
/* Na hover: strelica nestaje, linija menja boju u #86BDD7 */
.rv-wrapper .rv-card.rv-corner:hover::after {
    border-bottom-color: transparent;
    border-left-color: transparent;
}
.rv-wrapper .rv-card.rv-corner:hover::before {
    background-color: #86BDD7;
}

/* === Sadrzaj kartice =========================================== */
.rv-wrapper .rv-content {
    padding: 20px 15px 15px;
    flex: 1; display: flex; flex-direction: column;
}
.rv-wrapper .rv-title {
    color: var(--rv-title-color, #0A7AAE);
    font-size: var(--rv-title-size, 1.6rem);
    font-weight: 700;
    margin: 0 0 12px; line-height: 1.2;
}
/* Nema hover efekat na naslovu */
.rv-wrapper .rv-title .rv-clickable { color: inherit; }
.rv-wrapper .rv-text { color: var(--rv-text-color, #333); font-size: 1rem; line-height: 1.6; flex: 1; }
.rv-wrapper .rv-text p:last-child { margin-bottom: 0; }


/* ============================================================
   Custom Lightbox
   ============================================================ */

.rv-lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.92);
}
.rv-lb-overlay.rv-lb-active {
    display: flex;
}

/* Backdrop za klik-zatvori */
.rv-lb-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* === Stage — prostor za sliku ================================== */
.rv-lb-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Prostor odozdo za thumb strip */
    padding-bottom: 90px;
}

/* === Slika ===================================================== */
.rv-lb-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.15s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

/* === Spinner =================================================== */
.rv-lb-spinner {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rv-lb-spinner div {
    width: 10px; height: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    animation: rv-bounce 1.2s infinite ease-in-out;
}
.rv-lb-spinner div:nth-child(1) { animation-delay: -0.32s; }
.rv-lb-spinner div:nth-child(2) { animation-delay: -0.16s; }
.rv-lb-spinner div:nth-child(3) { animation-delay: 0s; }
.rv-lb-spinner div:nth-child(4) { animation-delay: 0.16s; }
@keyframes rv-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40%            { transform: scale(1); opacity: 1;   }
}

/* === Dugmad (zajednicki stilovi) ================================ */
.rv-lb-btn {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    padding: 0;
    line-height: 1;
}
.rv-lb-btn:hover { background: rgba(0, 0, 0, 0.85); transform: scale(1.08); }
.rv-lb-btn:disabled { opacity: 0.3; pointer-events: none; }
.rv-lb-btn svg { display: block; }

/* Zatvori — gore desno */
.rv-lb-close {
    top: 16px; right: 16px;
    width: 44px; height: 44px;
}
.rv-lb-close svg { width: 22px; height: 22px; }

/* Arrows — sredina levo/desno */
.rv-lb-prev,
.rv-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 52px;
    margin-top: -45px; /* kompenzacija za thumb strip */
}
.rv-lb-prev:hover,
.rv-lb-next:hover { transform: translateY(-50%) scale(1.08); }
.rv-lb-prev { left: 16px; }
.rv-lb-next { right: 16px; }
.rv-lb-prev svg,
.rv-lb-next svg { width: 26px; height: 26px; }

/* Zoom bar — gore lijevo */
.rv-lb-zoom-bar {
    position: absolute;
    top: 16px; left: 16px;
    z-index: 10;
    display: flex;
    gap: 6px;
}
.rv-lb-zoom-bar .rv-lb-btn {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    width: 40px; height: 40px;
}
.rv-lb-zoom-bar .rv-lb-btn svg { width: 20px; height: 20px; }

/* Counter — gore centar */
.rv-lb-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-family: sans-serif;
    background: rgba(0,0,0,0.45);
    padding: 4px 12px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
}

/* === Thumbnail strip — fiksno na dnu ========================== */
.rv-lb-thumbs {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 60px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
    flex-shrink: 0;
}
.rv-lb-thumbs::-webkit-scrollbar       { height: 3px; }
.rv-lb-thumbs::-webkit-scrollbar-track { background: transparent; }
.rv-lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

/* Thumb item */
.rv-lb-thumb-item {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.45;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.rv-lb-thumb-item:hover              { opacity: 0.8;  transform: translateY(-2px); }
.rv-lb-thumb-item.rv-lb-thumb-active { opacity: 1;    border-color: #fff; transform: translateY(-3px); }
.rv-lb-thumb-item img {
    display: block;
    width: 72px;
    height: 54px;
    object-fit: cover;
    pointer-events: none;
}

/* === Mobilni ================================================== */
@media (max-width: 600px) {
    .rv-lb-thumbs { height: 70px; padding: 8px 16px; }
    .rv-lb-thumb-item img { width: 54px; height: 40px; }
    .rv-lb-stage { padding-bottom: 70px; }
    .rv-lb-prev, .rv-lb-next { width: 40px; height: 40px; }
    .rv-lb-prev svg, .rv-lb-next svg { width: 20px; height: 20px; }
}
