/* Bootstrap handles the page grid; custom CSS preserves the photo mosaics. */
.nanas-gallery-wrap.container-fluid {
    --bs-gutter-x: 0;
}

/* =========================================================
01. RESET
========================================================= */

.nanas-room-gallery,
.nanas-room-gallery * {
    box-sizing: border-box;
}

.nanas-room-gallery {
    --black: #111111;
    --dark: #191919;
    --grey: #707070;
    --light-grey: #e8e8e8;
    --soft: #f5f5f5;
    --white: #ffffff;

    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--white);
    color: var(--black);
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.nanas-room-gallery img {
    display: block;
    width: 100%;
    max-width: 100%;
}

.nanas-room-gallery button {
    font: inherit;
}


/* =========================================================
02. MAIN WRAPPER
========================================================= */

.nanas-gallery-wrap {
    width: min(1440px, calc(100% - 80px));
    margin: 0 auto;
    padding: 70px 0 110px;
}


/* =========================================================
03. ROOM SECTION
========================================================= */

.nanas-gallery-room {
    width: 100%;
    margin: 0 0 110px;
}

.nanas-gallery-room:last-child {
    margin-bottom: 0;
}


/* =========================================================
04. ROOM TITLE
========================================================= */

.nanas-room-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #d7d7d7;
}

.nanas-room-title {
    margin: 0;
    max-width: 920px;

    color: var(--black);
    font-size: clamp(28px, 3vw, 48px);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -1.6px;
}

.nanas-room-index {
    flex: 0 0 auto;
    color: #9a9a9a;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 2px;
}


/* =========================================================
05. GALLERY GRID
========================================================= */

.nanas-photo-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 120px;
    gap: 12px;
}


/* =========================================================
06. PHOTO ITEM
========================================================= */

.nanas-photo {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 0;
    background: #ededed;
    overflow: hidden;
    cursor: zoom-in;
}

.nanas-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background .4s ease;
}

.nanas-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.001);
    transition:
        transform .75s cubic-bezier(.2, .7, .2, 1),
        filter .5s ease;
}

.nanas-photo:hover img {
    transform: scale(1.025);
}

.nanas-photo:hover::after {
    background: rgba(0, 0, 0, .035);
}

.nanas-photo:focus-visible {
    outline: 2px solid #111;
    outline-offset: 4px;
}


/* =========================================================
07. GRID LAYOUT A
========================================================= */

.nanas-layout-a .nanas-photo:nth-child(1) {
    grid-column: 1 / span 8;
    grid-row: 1 / span 5;
}

.nanas-layout-a .nanas-photo:nth-child(2) {
    grid-column: 9 / span 4;
    grid-row: 1 / span 3;
}

.nanas-layout-a .nanas-photo:nth-child(3) {
    grid-column: 9 / span 4;
    grid-row: 4 / span 2;
}

.nanas-layout-a .nanas-photo:nth-child(4) {
    grid-column: 1 / span 12;
    grid-row: 6 / span 4;
}


/* =========================================================
08. GRID LAYOUT B
========================================================= */

.nanas-layout-b .nanas-photo:nth-child(1) {
    grid-column: 1 / span 5;
    grid-row: 1 / span 5;
}

.nanas-layout-b .nanas-photo:nth-child(2) {
    grid-column: 6 / span 7;
    grid-row: 1 / span 3;
}

.nanas-layout-b .nanas-photo:nth-child(3) {
    grid-column: 6 / span 3;
    grid-row: 4 / span 3;
}

.nanas-layout-b .nanas-photo:nth-child(4) {
    grid-column: 9 / span 4;
    grid-row: 4 / span 3;
}


/* =========================================================
09. GRID LAYOUT C
========================================================= */

.nanas-layout-c .nanas-photo:nth-child(1) {
    grid-column: 1 / span 12;
    grid-row: 1 / span 4;
}

.nanas-layout-c .nanas-photo:nth-child(2) {
    grid-column: 1 / span 4;
    grid-row: 5 / span 4;
}

.nanas-layout-c .nanas-photo:nth-child(3) {
    grid-column: 5 / span 4;
    grid-row: 5 / span 4;
}

.nanas-layout-c .nanas-photo:nth-child(4) {
    grid-column: 9 / span 4;
    grid-row: 5 / span 4;
}


/* =========================================================
10. GRID LAYOUT D
========================================================= */

.nanas-layout-d .nanas-photo:nth-child(1) {
    grid-column: 1 / span 7;
    grid-row: 1 / span 4;
}

.nanas-layout-d .nanas-photo:nth-child(2) {
    grid-column: 8 / span 5;
    grid-row: 1 / span 6;
}

.nanas-layout-d .nanas-photo:nth-child(3) {
    grid-column: 1 / span 3;
    grid-row: 5 / span 3;
}

.nanas-layout-d .nanas-photo:nth-child(4) {
    grid-column: 4 / span 4;
    grid-row: 5 / span 3;
}


/* =========================================================
11. LIGHTBOX
========================================================= */

.nanas-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 34px 90px;

    background: rgba(8, 8, 8, .97);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .28s ease,
        visibility .28s ease;
}

.nanas-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nanas-lightbox-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nanas-lightbox-image {
    display: block;
    width: auto;
    height: auto;

    max-width: 100%;
    max-height: calc(100vh - 68px);

    object-fit: contain;

    opacity: 0;
    transform: scale(.985);

    transition:
        opacity .28s ease,
        transform .35s ease;
}

.nanas-lightbox.is-open .nanas-lightbox-image {
    opacity: 1;
    transform: scale(1);
}


/* =========================================================
12. LIGHTBOX CLOSE
========================================================= */

.nanas-lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;

    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;

    color: #fff;
    background: rgba(0, 0, 0, .18);

    cursor: pointer;

    transition:
        background .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.nanas-lightbox-close:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .55);
    transform: rotate(3deg);
}

.nanas-lightbox-close svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}


/* =========================================================
13. LIGHTBOX ARROWS
========================================================= */

.nanas-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;

    color: #fff;
    background: rgba(0, 0, 0, .18);

    cursor: pointer;

    transition:
        background .25s ease,
        border-color .25s ease;
}

.nanas-lightbox-arrow:hover {
    background: rgba(255, 255, 255, .11);
    border-color: rgba(255, 255, 255, .58);
}

.nanas-lightbox-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nanas-lightbox-prev {
    left: 25px;
}

.nanas-lightbox-next {
    right: 25px;
}


/* =========================================================
14. TABLET
========================================================= */

@media(max-width:1024px) {

    .nanas-gallery-wrap {
        width: min(100% - 44px, 1200px);
        padding: 55px 0 90px;
    }

    .nanas-gallery-room {
        margin-bottom: 85px;
    }

    .nanas-photo-grid {
        grid-auto-rows: 95px;
        gap: 10px;
    }

    .nanas-lightbox {
        padding: 30px 70px;
    }

}


/* =========================================================
15. MOBILE
========================================================= */

@media(max-width:767px) {

    .nanas-gallery-wrap {
        width: 100%;
        padding: 38px 16px 68px;
    }

    .nanas-gallery-room {
        margin-bottom: 66px;
    }

    .nanas-room-heading {
        align-items: flex-start;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .nanas-room-title {
        max-width: 88%;
        font-size: 27px;
        line-height: 1.08;
        letter-spacing: -.8px;
    }

    .nanas-room-index {
        padding-top: 7px;
        font-size: 10px;
    }

    .nanas-photo-grid,
    .nanas-layout-a,
    .nanas-layout-b,
    .nanas-layout-c,
    .nanas-layout-d {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 8px;
    }

    .nanas-layout-a .nanas-photo:nth-child(n),
    .nanas-layout-b .nanas-photo:nth-child(n),
    .nanas-layout-c .nanas-photo:nth-child(n),
    .nanas-layout-d .nanas-photo:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }

    .nanas-photo {
        aspect-ratio: 4 / 3;
    }

    .nanas-photo:nth-child(1) {
        aspect-ratio: 4 / 3;
    }

    .nanas-photo:nth-child(2) {
        aspect-ratio: 3 / 2;
    }

    .nanas-photo:nth-child(3),
    .nanas-photo:nth-child(4) {
        aspect-ratio: 4 / 3;
    }

    .nanas-photo:hover img {
        transform: none;
    }

    .nanas-lightbox {
        padding: 72px 12px 64px;
    }

    .nanas-lightbox-image {
        max-width: 100%;
        max-height: calc(100vh - 136px);
    }

    .nanas-lightbox-close {
        top: 15px;
        right: 15px;
        width: 43px;
        height: 43px;
    }

    .nanas-lightbox-arrow {
        top: auto;
        bottom: 14px;
        transform: none;

        width: 44px;
        height: 44px;
    }

    .nanas-lightbox-prev {
        left: calc(50% - 53px);
    }

    .nanas-lightbox-next {
        right: calc(50% - 53px);
    }

}


/* =========================================================
16. VERY SMALL MOBILE
========================================================= */

@media(max-width:420px) {

    .nanas-gallery-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .nanas-room-title {
        font-size: 24px;
    }

}


/* =========================================================
17. REDUCED MOTION
========================================================= */

@media(prefers-reduced-motion:reduce) {

    .nanas-photo img,
    .nanas-photo::after,
    .nanas-lightbox,
    .nanas-lightbox-image,
    .nanas-lightbox-close,
    .nanas-lightbox-arrow {
        transition: none !important;
    }

}