/* ------------------------------------------------------------- carusel */

.igs-wrap {
    position: relative;
}

.igs-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.igs-track::-webkit-scrollbar {
    display: none;
}

.igs-card,
.igs-tile {
    flex: 0 0 calc((100% - 48px) / 4);
    aspect-ratio: 9 / 16;
    scroll-snap-align: start;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f2f2f2;
    cursor: pointer;
}

.igs-card img,
.igs-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.igs-card:hover img,
.igs-tile:hover img {
    transform: scale(1.03);
}

.igs-card:focus-visible,
.igs-tile:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Sageti */

.igs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: none;
    color: #333;
    cursor: pointer;
    transition: opacity .2s ease;
}

.igs-nav:disabled {
    opacity: .25;
    cursor: default;
}

.igs-prev { left: -40px; }
.igs-next { right: -40px; }

/* Dots */

.igs-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.igs-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d5d5d5;
    cursor: pointer;
    transition: background .2s ease;
}

.igs-dot.is-active {
    background: #333;
}

/* --------------------------------------------------------- grid arhiva */

.igs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.igs-grid .igs-tile {
    flex: none;
}

.igs-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.igs-more {
    padding: 12px 32px;
    border: 1px solid #333;
    border-radius: 2px;
    background: transparent;
    color: #333;
    font-size: .95rem;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.igs-more:hover:not(:disabled) {
    background: #333;
    color: #fff;
}

.igs-more:disabled {
    opacity: .5;
    cursor: default;
}

.igs-count {
    text-align: center;
    color: #888;
    font-size: .875rem;
    margin-bottom: 24px;
}

/* ------------------------------------------------------------ lightbox */

.igs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .92);
    opacity: 1;
    transition: opacity .2s ease;
}

.igs-lightbox[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
}

.igs-lb-figure {
    margin: 0;
    max-width: min(92vw, 480px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.igs-lb-figure img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
}

.igs-lb-figure figcaption {
    color: #eee;
    font-size: .875rem;
    text-align: center;
    margin-top: 12px;
    max-width: 100%;
}

.igs-lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.igs-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    opacity: .8;
}

.igs-lb-nav:hover { opacity: 1; }
.igs-lb-prev { left: 8px; }
.igs-lb-next { right: 8px; }

body.igs-no-scroll {
    overflow: hidden;
}

/* --------------------------------------------------------------- mobil */

@media (max-width: 991px) {
    .igs-card { flex-basis: calc((100% - 32px) / 3); }
    .igs-grid { grid-template-columns: repeat(3, 1fr); }
    .igs-prev { left: -16px; }
    .igs-next { right: -16px; }
}

@media (max-width: 767px) {
    .igs-card { flex-basis: calc((100% - 16px) / 2); }
    .igs-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .igs-prev { left: -8px; }
    .igs-next { right: -8px; }
    .igs-nav { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    .igs-card img,
    .igs-tile img,
    .igs-lightbox {
        transition: none;
    }
    .igs-card:hover img,
    .igs-tile:hover img {
        transform: none;
    }
}
