/* =========================
   AKTIVNA STAVKA MENIJA
========================= */

.main-nav > a.is-active {
    position: relative;
    color: #7a3e00;
}

.main-nav > a.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -8px;
    left: 0;
    height: 2px;
    background-color: #7a3e00;
}


/* =========================
   HERO GALERIJE
========================= */

.gallery-hero {
    padding: 90px 0 55px;
    background-color: #f6f1ec;
    text-align: center;
}

.gallery-hero-container {
    max-width: 820px;
}

.gallery-label {
    margin: 0 0 12px;
    color: #8b5b3d;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    margin: 0 0 18px;
    color: #2f211a;
    font-size: clamp(42px, 7vw, 70px);
    line-height: 1.05;
}

.gallery-intro {
    margin: 0;
    color: #6e625b;
    font-size: 17px;
    line-height: 1.75;
}


/* =========================
   SADRŽAJ I FILTERI
========================= */

.gallery-content {
    padding: 50px 0 100px;
}

.gallery-content-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.gallery-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-filter {
    padding: 13px 24px;
    border: 1px solid #ded5cc;
    border-radius: 8px;
    background-color: #f5f0eb;
    color: #2b211b;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.gallery-filter:hover {
    border-color: #7a3e00;
    transform: translateY(-2px);
}

.gallery-filter.is-active {
    border-color: #4f2f1f;
    background-color: #4f2f1f;
    color: #ffffff;
}


/* =========================
   MREŽA SLIKA
========================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background-color: #eee8e2;
    cursor: pointer;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}

.gallery-item::after {
    content: "\f00e";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(50 30 20 / 45%);
    color: #ffffff;
    font-family: "Font Awesome 6 Free";
    font-size: 28px;
    font-weight: 900;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
    filter: brightness(0.85);
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item[hidden] {
    display: none;
}


.gallery-item:focus-visible,
.gallery-filter:focus-visible {
    outline: 3px solid #7a3e00;
    outline-offset: 3px;
}



/* =========================
   LIGHTBOX
========================= */

body.gallery-lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background-color: rgb(20 12 8 / 92%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-lightbox-dialog {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1200px, 100%);
    height: min(850px, calc(100vh - 60px));
}

.gallery-lightbox-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
    padding: 60px 80px 100px;
    cursor: default;
    touch-action: pan-y;
}

.gallery-lightbox-image-wrapper.is-zoomed {
    cursor: grab;
}

.gallery-lightbox-image-wrapper.is-dragging {
    cursor: grabbing;
}

.gallery-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
    transform-origin: center;
    user-select: none;
    transition: transform 0.2s ease;
}

.gallery-lightbox-image-wrapper.is-dragging
.gallery-lightbox-image {
    transition: none;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 50%;
    background-color: rgb(255 255 255 / 12%);
    color: #ffffff;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.gallery-lightbox-close {
    top: 0;
    right: 0;
    width: 46px;
    height: 46px;
    font-size: 22px;
}

.gallery-lightbox-close:hover {
    background-color: rgb(255 255 255 / 22%);
    transform: scale(1.05);
}

.gallery-lightbox-arrow {
    top: 50%;
    width: 52px;
    height: 52px;
    font-size: 20px;
    transform: translateY(-50%);
}

.gallery-lightbox-arrow:hover {
    background-color: rgb(255 255 255 / 22%);
}

.gallery-lightbox-arrow-left {
    left: 0;
}

.gallery-lightbox-arrow-right {
    right: 0;
}

.gallery-lightbox-counter {
    position: absolute;
    bottom: 7px;
    left: 50%;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background-color: rgb(255 255 255 / 12%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    transform: translateX(-50%);
}

.gallery-lightbox-zoom-controls {
    position: absolute;
    bottom: 52px;
    left: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border-radius: 999px;
    background-color: rgb(255 255 255 / 12%);
    transform: translateX(-50%);
}

.gallery-lightbox-zoom-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background-color: rgb(255 255 255 / 12%);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.gallery-lightbox-zoom-controls button:hover {
    background-color: rgb(255 255 255 / 22%);
}

.gallery-lightbox-zoom-controls span {
    min-width: 52px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.gallery-lightbox button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .gallery-lightbox {
        padding: 15px;
    }

    .gallery-lightbox-dialog {
        height: calc(100vh - 30px);
    }

    .gallery-lightbox-image-wrapper {
        padding: 65px 10px 135px;
    }

    .gallery-lightbox-close {
        top: 5px;
        right: 5px;
        width: 42px;
        height: 42px;
    }

    .gallery-lightbox-arrow {
        top: auto;
        bottom: 5px;
        width: 44px;
        height: 44px;
        transform: none;
    }

    .gallery-lightbox-arrow-left {
        left: calc(50% - 78px);
    }

    .gallery-lightbox-arrow-right {
        right: calc(50% - 78px);
    }

    .gallery-lightbox-counter {
        bottom: 15px;
    }

    .gallery-lightbox-zoom-controls {
        bottom: 65px;
    }
}

@media (max-width: 600px) {
    .gallery-hero {
        padding: 65px 0 40px;
    }

    .gallery-content {
        padding: 35px 0 70px;
    }

    .gallery-filters {
        justify-content: flex-start;
    }

    .gallery-filter {
        flex-grow: 1;
        padding: 11px 14px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}


@media (prefers-reduced-motion: reduce) {
    .gallery-filter,
    .gallery-item img,
    .gallery-item::after,
    .gallery-lightbox,
    .gallery-lightbox-image,
    .gallery-lightbox-close,
    .gallery-lightbox-arrow {
        transition: none;
    }
}

