/* ============================================================
   PREMIUM ROOM GALLERY
   3 VISIBLE THUMBNAILS
============================================================ */

.room-gallery-section {
    background: var(--linen, #FAF7F2);
    padding: 70px 48px;
}


.room-gallery {
    width: 100%;
    max-width: 1320px;

    margin: 0 auto;

    display: grid;

    grid-template-columns: 270px minmax(0, 1fr);

    gap: 24px;

    align-items: stretch;
}


/* ============================================================
   LEFT THUMBNAIL PANEL
============================================================ */

.room-thumb-panel {
    height: 610px;

    display: grid;

    grid-template-rows:
        42px
        minmax(0, 1fr)
        42px;

    gap: 10px;
}


/* ============================================================
   THUMBNAIL NAVIGATION ARROWS
============================================================ */

.thumb-nav {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(26, 58, 42, .14);

    border-radius: 4px;

    background: #fff;

    color: var(--green, #1A3A2A);

    font-size: 19px;

    cursor: pointer;

    transition:
        background .3s ease,
        color .3s ease,
        border-color .3s ease,
        transform .3s ease;
}


.thumb-nav:hover {
    background: var(--green, #1A3A2A);

    color: var(--gold, #C9A84C);

    border-color: var(--green, #1A3A2A);
}


.thumb-prev:hover {
    transform: translateY(-2px);
}


.thumb-next:hover {
    transform: translateY(2px);
}


/* Disabled */

.thumb-nav:disabled {
    opacity: .3;

    cursor: default;

    transform: none;
}


/* ============================================================
   THUMBNAIL VIEWPORT

   Only 3 images visible
============================================================ */

.room-thumb-viewport {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;
}


/* TRACK */

.room-gallery-thumbs {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 12px;

    transition:
        transform .55s
        cubic-bezier(.4,0,.2,1);
}


/* ============================================================
   THUMBNAILS
============================================================ */

.room-thumb {
    position: relative;

    width: 100%;

    /*
       3 thumbnails visible within viewport
       minus two gaps
    */

    height: calc((100% - 24px) / 3);

    min-height: calc((100% - 24px) / 3);

    flex-shrink: 0;

    padding: 0;

    overflow: hidden;

    border: 1px solid transparent;

    border-radius: 4px;

    background: #eee;

    cursor: pointer;

    transition:
        border-color .3s ease,
        box-shadow .3s ease;
}


.room-thumb img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform .65s ease,
        filter .35s ease;
}


/* Inactive image */

.room-thumb:not(.active) img {
    filter:
        brightness(.84)
        saturate(.92);
}


/* ACTIVE */

.room-thumb.active {
    border-color: var(--gold, #C9A84C);

    box-shadow:
        0 6px 20px rgba(15,35,24,.12);
}


.room-thumb.active img {
    filter:
        brightness(1)
        saturate(1.03);
}


/* Active Gold Line */

.room-thumb.active::after {
    content: "";

    position: absolute;

    left: 0;
    top: 50%;

    width: 3px;
    height: 46px;

    transform: translateY(-50%);

    background: var(--gold, #C9A84C);
}


/* HOVER */

.room-thumb:hover img {
    transform: scale(1.055);

    filter:
        brightness(1)
        saturate(1.03);
}


/* ============================================================
   BIG IMAGE
============================================================ */

.room-gallery-main {
    position: relative;

    height: 610px;

    overflow: hidden;

    border-radius: 5px;

    background: #eee;

    box-shadow:
        0 18px 50px rgba(15,35,24,.10);
}


.room-gallery-main > img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    filter:
        brightness(1.04)
        saturate(1.04);

    transition:
        opacity .32s ease,
        transform 1s ease;
}


.room-gallery-main:hover > img {
    transform: scale(1.012);
}


/* ============================================================
   SUBTLE OVERLAY
============================================================ */

.room-gallery-overlay {
    position: absolute;

    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            to top,
            rgba(8,20,12,.20) 0%,
            rgba(8,20,12,.02) 30%,
            transparent 52%
        );
}


/* ============================================================
   MAIN IMAGE ARROWS
============================================================ */

.room-main-arrow {
    position: absolute;

    top: 50%;

    z-index: 4;

    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    border:
        1px solid rgba(255,255,255,.48);

    border-radius: 50%;

    background:
        rgba(15,35,24,.34);

    color: #fff;

    font-size: 19px;

    cursor: pointer;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition:
        background .3s ease,
        color .3s ease,
        transform .3s ease;
}


.room-main-prev {
    left: 22px;
}


.room-main-next {
    right: 22px;
}


.room-main-arrow:hover {
    background:
        var(--gold, #C9A84C);

    color:
        var(--green-dark, #0F2318);
}


.room-main-prev:hover {
    transform:
        translateY(-50%)
        translateX(-3px);
}


.room-main-next:hover {
    transform:
        translateY(-50%)
        translateX(3px);
}


/* ============================================================
   IMAGE COUNTER
============================================================ */

.room-gallery-count {
    position: absolute;

    right: 22px;
    bottom: 20px;

    z-index: 4;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 8px 12px;

    background:
        rgba(15,35,24,.42);

    border:
        1px solid rgba(255,255,255,.22);

    border-radius: 3px;

    color:
        rgba(255,255,255,.78);

    font-size: .68rem;

    letter-spacing: .12em;

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}


#currentImage {
    color:
        var(--gold-lt, #E0BB6A);
}


.gallery-divider {
    width: 25px;
    height: 1px;

    display: block;

    background:
        rgba(255,255,255,.45);
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 991px) {

    .room-gallery-section {
        padding: 55px 24px;
    }


    .room-gallery {
        grid-template-columns:
            190px minmax(0, 1fr);

        gap: 15px;
    }


    .room-gallery-main,
    .room-thumb-panel {
        height: 500px;
    }


    .room-main-arrow {
        width: 44px;
        height: 44px;
    }

}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 767px) {

    .room-gallery-section {
        padding: 40px 18px;
    }


    .room-gallery {
        display: flex;

        flex-direction: column;

        gap: 12px;
    }


    /* BIG IMAGE FIRST */

    .room-gallery-main {
        order: 1;

        height: 60vw;

        min-height: 280px;
        max-height: 420px;
    }


    /*
       Mobile thumbnails become horizontal
    */

    .room-thumb-panel {
        order: 2;

        width: 100%;
        height: auto;

        display: grid;

        grid-template-columns:
            40px minmax(0,1fr) 40px;

        grid-template-rows: 82px;

        gap: 8px;
    }


    .room-thumb-viewport {
        height: 82px;
    }


    .room-gallery-thumbs {
        flex-direction: row;

        gap: 8px;
    }


    .room-thumb {
        width:
            calc((100% - 16px) / 3);

        min-width:
            calc((100% - 16px) / 3);

        height: 82px;
        min-height: 82px;
    }


    /*
       Top/bottom arrows become
       Left/right arrows on mobile
    */

    .thumb-prev {
        grid-column: 1;
        grid-row: 1;
    }


    .room-thumb-viewport {
        grid-column: 2;
        grid-row: 1;
    }


    .thumb-next {
        grid-column: 3;
        grid-row: 1;
    }


    .thumb-prev::before {
        content: "←";

        font-size: 18px;
    }


    .thumb-next::before {
        content: "→";

        font-size: 18px;
    }


    .thumb-prev,
    .thumb-next {
        font-size: 0;
    }


    .room-thumb.active::after {
        left: 50%;
        top: auto;
        bottom: 0;

        width: 34px;
        height: 3px;

        transform: translateX(-50%);
    }


    .room-main-prev {
        left: 12px;
    }


    .room-main-next {
        right: 12px;
    }


    .room-main-arrow {
        width: 40px;
        height: 40px;
    }


    .room-gallery-count {
        right: 12px;
        bottom: 12px;
    }

}