/* ============================================================
   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;
    /* visina se kontrolise kroz equal_height opciju u widgetu */
}
.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 */
}

/* + tri kruga overlay — pojavljuje se na hover kartice
   Slojevi (unutra → van):
   1. Najunutrašnjiji: plavi krug sa belim borderom i + znakom  (::after sam element)
   2. Srednji: pun plavi krug                                   (box-shadow sloj 1)
   3. Spoljni: providni plavi krug 50% opacity                  (box-shadow sloj 2)
*/
.rv-wrapper .rv-image-wrap::after {
    /* Plus kao background-image — uvek tačno centriran */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);

    /* Unutrašnji krug — plavi sa belim borderom */
    width: 56px;
    height: 56px;
    background-color: #0A7AAE;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 56'%3E%3Cline x1='28' y1='10' x2='28' y2='46' stroke='white' stroke-width='5' stroke-linecap='round'/%3E%3Cline x1='10' y1='28' x2='46' y2='28' stroke='white' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 34px 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);

    /* Srednji krug (box-shadow 1) i spoljni providni krug (box-shadow 2) */
    box-shadow:
        0 0 0 14px rgba(10, 122, 174, 0.70),
        0 0 0 30px rgba(10, 122, 174, 0.30);

    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s 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; }
}


/* ============================================================
   Horizontalni raspored kartice — slika pored teksta
   Uključuje se opcijom "Raspored kartice" u widgetu.
   ============================================================ */

.rv-wrapper .rv-card--horizontal {
    flex-direction: row;
    align-items: stretch;
}

/* Slika desno, tekst levo */
.rv-wrapper .rv-card--horizontal.rv-card--reverse {
    flex-direction: row-reverse;
}

.rv-wrapper .rv-card--horizontal > .rv-image-wrap {
    width: var(--rv-img-w, 50%);
    flex: 0 0 var(--rv-img-w, 50%);
    align-self: stretch;
}

.rv-wrapper .rv-card--horizontal > .rv-content {
    flex: 1 1 auto;
    min-width: 0; /* bez ovoga dugacke reci razvuku kolonu */
    justify-content: var(--rv-content-valign, flex-start);
}

/* Slika prati visinu kartice umesto fiksnog aspect ratio-a */
.rv-wrapper .rv-card--horizontal.rv-card--fill-height > .rv-image-wrap {
    display: flex;
}
.rv-wrapper .rv-card--horizontal.rv-card--fill-height > .rv-image-wrap img {
    height: 100%;
    aspect-ratio: auto;
    object-fit: var(--rv-img-fit, cover);
}

/* Dekoracija dna: u horizontalnom rasporedu traka ide ispod obe kolone,
   pa sadrzaju dodajemo razmak da je tekst ne dodiruje. */
.rv-wrapper .rv-card--horizontal.rv-corner > .rv-content {
    padding-bottom: 10px;
}

/* --- Mobilni: slika iznad teksta --------------------------------- */
@media (max-width: 767px) {
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile,
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile.rv-card--reverse {
        flex-direction: column;
    }
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile > .rv-image-wrap {
        width: 100%;
        flex: 0 0 auto;
    }
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile.rv-card--fill-height > .rv-image-wrap img {
        height: auto;
        aspect-ratio: var(--rv-ratio, 4/3);
    }
}

/* --- Fiksna visina slike (sve slike u loopu iste visine) --------- */
.rv-wrapper .rv-card--horizontal.rv-card--fixed-height > .rv-image-wrap {
    height: var(--rv-img-h-d, 500px);
    align-self: flex-start; /* da se ne razvuce na visinu kartice */
}
.rv-wrapper .rv-card--horizontal.rv-card--fixed-height > .rv-image-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: var(--rv-img-fit, cover);
}

@media (max-width: 1024px) {
    .rv-wrapper .rv-card--horizontal.rv-card--fixed-height > .rv-image-wrap {
        height: var(--rv-img-h-t, 380px);
    }
}
@media (max-width: 767px) {
    .rv-wrapper .rv-card--horizontal.rv-card--fixed-height > .rv-image-wrap {
        height: var(--rv-img-h-m, 280px);
    }
    /* I kad se kartica slozi u kolonu, fiksna visina i dalje vazi. */
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile.rv-card--fixed-height > .rv-image-wrap {
        width: 100%;
        align-self: stretch;
    }
}


/* ============================================================
   Tipografija sadrzaja kartice (.rv-text)
   Sadrzaj dolazi iz WP editora: <p>, <h2>-<h4>, <ul>, <ol>...
   ============================================================ */

/* Vertikalni ritam — prvi element bez razmaka gore, poslednji bez dole */
.rv-wrapper .rv-text > *:first-child { margin-top: 0; }
.rv-wrapper .rv-text > *:last-child  { margin-bottom: 0; }

.rv-wrapper .rv-text p { margin: 0 0 0.9em; }

/* --- Podnaslovi iz sadrzaja (npr. "Osnovna oprema") ------------- */
.rv-wrapper .rv-text h1,
.rv-wrapper .rv-text h2,
.rv-wrapper .rv-text h3,
.rv-wrapper .rv-text h4,
.rv-wrapper .rv-text h5,
.rv-wrapper .rv-text h6 {
    position: relative;
    margin: 1.7em 0 0.85em;
    padding-bottom: 0.5em;
    font-size: var(--rv-subtitle-size, 1rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: var(--rv-subtitle-transform, uppercase);
    color: var(--rv-subtitle-color, #1D2327);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Kratka akcentna linija ispod podnaslova */
.rv-wrapper .rv-text h1::after,
.rv-wrapper .rv-text h2::after,
.rv-wrapper .rv-text h3::after,
.rv-wrapper .rv-text h4::after,
.rv-wrapper .rv-text h5::after,
.rv-wrapper .rv-text h6::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 34px;
    height: 2px;
    background-color: var(--rv-accent, #0A7AAE);
}

/* Editor cesto upakuje naslov u <strong> — bez dupliranja debljine */
.rv-wrapper .rv-text h1 strong, .rv-wrapper .rv-text h2 strong,
.rv-wrapper .rv-text h3 strong, .rv-wrapper .rv-text h4 strong,
.rv-wrapper .rv-text h5 strong, .rv-wrapper .rv-text h6 strong {
    font-weight: inherit;
}

/* --- Liste ------------------------------------------------------ */
.rv-wrapper .rv-text ul { list-style: none; margin: 0 0 0.9em; padding: 0; }
.rv-wrapper .rv-text ol { margin: 0 0 0.9em; padding-left: 1.3em; }

.rv-wrapper .rv-text li {
    margin-bottom: 0.4em;
    line-height: 1.5;
}
.rv-wrapper .rv-text li:last-child { margin-bottom: 0; }

/* Akcentna kockica umesto default tackice */
.rv-wrapper .rv-text ul > li {
    position: relative;
    padding-left: 1.4em;
}
.rv-wrapper .rv-text ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background-color: var(--rv-accent, #0A7AAE);
}

/* Ugnjezdene liste — prazna kockica, da se razlikuje nivo */
.rv-wrapper .rv-text li > ul,
.rv-wrapper .rv-text li > ol { margin: 0.4em 0 0; }
.rv-wrapper .rv-text li > ul > li::before {
    background-color: transparent;
    border: 1px solid var(--rv-accent, #0A7AAE);
}

/* --- Sitnice ---------------------------------------------------- */
.rv-wrapper .rv-text a {
    color: var(--rv-accent, #0A7AAE);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rv-wrapper .rv-text a:hover { text-decoration: none; }

.rv-wrapper .rv-text img { max-width: 100%; height: auto; }


/* --- Razmak izmedju slike i teksta u horizontalnom rasporedu ----- */
.rv-wrapper .rv-card--horizontal > .rv-content {
    padding-left: var(--rv-content-gap, 28px);
}
.rv-wrapper .rv-card--horizontal.rv-card--reverse > .rv-content {
    padding-left: 15px;
    padding-right: var(--rv-content-gap, 28px);
}

@media (max-width: 767px) {
    /* Kad se kartica slozi u kolonu, tekst se vraca na normalan padding */
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile > .rv-content,
    .rv-wrapper .rv-card--horizontal.rv-card--stack-mobile.rv-card--reverse > .rv-content {
        padding-left: 15px;
        padding-right: 15px;
    }
}


/* ============================================================
   Tabela specifikacije (ACF polje "Specifikacija")
   ============================================================ */
.rv-wrapper .rv-specs {
    width: 100%;
    table-layout: fixed;
    margin: 1.5em 0 0;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--rv-text-color, #333);
}

.rv-wrapper .rv-specs th,
.rv-wrapper .rv-specs td {
    padding: 0.55em 0.75em;
    overflow-wrap: break-word;
    text-align: left;
    vertical-align: top;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Zaglavlje */
.rv-wrapper .rv-specs thead th {
    background-color: var(--rv-specs-header-bg, #F1F2F3);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--rv-subtitle-color, #1D2327);
}
.rv-wrapper .rv-specs thead .rv-specs-head-value {
    color: var(--rv-title-color, #0A7AAE);
}

/* Redovi naziv / vrednost */
.rv-wrapper .rv-specs tbody .rv-specs-label {
    font-weight: 400;
    width: 55%;
}
.rv-wrapper .rv-specs tbody .rv-specs-value {
    font-weight: 600;
}

/* Naizmenicne boje redova */
.rv-wrapper .rv-specs tbody tr:nth-child(even) > * {
    background-color: var(--rv-specs-zebra-bg, transparent);
}

/* Red koji je podnaslov sekcije (npr. OPCIJE:) */
.rv-wrapper .rv-specs .rv-specs-section > th {
    background-color: var(--rv-specs-header-bg, #F1F2F3);
    font-weight: 700;
    text-transform: var(--rv-subtitle-transform, uppercase);
    letter-spacing: 0.05em;
    color: var(--rv-subtitle-color, #1D2327);
    border-top-width: 2px;
    border-top-color: var(--rv-accent, #0A7AAE);
}

/* Red bez vrednosti — ide preko cele sirine */
.rv-wrapper .rv-specs .rv-specs-single > td {
    font-weight: 400;
}

/* Uske kolone: tabela i dalje mora da stane */
@media (max-width: 480px) {
    .rv-wrapper .rv-specs { font-size: 0.8125rem; }
    .rv-wrapper .rv-specs th,
    .rv-wrapper .rv-specs td { padding: 0.45em 0.55em; }
}
