/* =========================================
   GALLERY ITEM DETAIL PAGE
   ========================================= */

/* Main photos field */
.block-field-blocknodegallery-itemfield-photos {
    width: 100%;
    max-width: 1100px;
    margin: 25px auto 35px;
}

/* =========================================
   TWO-IMAGE GALLERY
   ========================================= */

.block-field-blocknodegallery-itemfield-photos > div:has(> div:nth-child(2)):not(:has(> div:nth-child(3))) {
    column-count: 2;
}

.block-field-blocknodegallery-itemfield-photos > div:has(> div:nth-child(2)):not(:has(> div:nth-child(3))) > div {
    display: inline-block;
    width: 100%;
}







/* =========================================
   FLUID MASONRY-STYLE GALLERY
   ========================================= */

.block-field-blocknodegallery-itemfield-photos > div {
    column-count: 2;
    column-gap: 20px;
    margin: 0 0 10px 0;

}

/* Individual media item */
.block-field-blocknodegallery-itemfield-photos > div > div {
    display: inline-block;
    width: 100%;
    margin: 0 0 20px;
    vertical-align: top;

    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);

    break-inside: avoid;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

/* Slight modern lift */
.block-field-blocknodegallery-itemfield-photos > div > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.13);
}

/* Images */
.block-field-blocknodegallery-itemfield-photos img {
    width: 100%;
    height: auto;
    display: block;
}

/* Local videos */
.block-field-blocknodegallery-itemfield-photos video {
    width: 100%;
    height: auto;
    display: block;
}

/* YouTube / remote videos */
.block-field-blocknodegallery-itemfield-photos iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    border: 0;
}


/* =========================================
   GALLERY ITEM TITLE
   ========================================= */

.block-field-blocknodegallery-itemtitle {
    width: 100%;
    max-width: 1100px;
    margin: 10px auto 25px;
    text-align: center;
}

/* Title text */
.block-field-blocknodegallery-itemtitle span {
    display: block;

    font-weight: 700;
    font-size: 30px;
    line-height: 1.25;

    color: #153d6e;

    max-width: 950px;
    margin: 0 auto;

    text-align: center;
}

/* Small gold accent underneath */
.block-field-blocknodegallery-itemtitle::after {
    content: "";
    display: block;

    width: 55px;
    height: 3px;

    background: #b99d64;

    margin: 12px auto 0;
    border-radius: 3px;
}


/* Mobile */
@media (max-width: 640px) {
    .block-field-blocknodegallery-itemtitle span {
        font-size: 23px;
    }

    .block-field-blocknodegallery-itemtitle::after {
        width: 45px;
        height: 3px;
    }
}

/* =========================================
   SINGLE IMAGE GALLERY
   ========================================= */

/*
   If there is only one media item,
   remove the masonry columns entirely.
*/

.block-field-blocknodegallery-itemfield-photos > div:has(> div:only-child) {
    column-count: 1;
}

/* Keep the single image centered */
.block-field-blocknodegallery-itemfield-photos > div:has(> div:only-child) > div {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 20px;
}

/* Make sure the image itself doesn't exceed the page */
.block-field-blocknodegallery-itemfield-photos > div:has(> div:only-child) img,
.block-field-blocknodegallery-itemfield-photos > div:has(> div:only-child) video {
    max-width: 100%;
    height: auto;
}


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

@media (max-width: 640px) {

    .block-field-blocknodegallery-itemfield-photos {
        max-width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .block-field-blocknodegallery-itemfield-photos > div {
        column-count: 1;
    }

    .block-field-blocknodegallery-itemfield-photos > div > div {
        margin-bottom: 16px;
    }

    .block-field-blocknodegallery-itemtitle span {
        font-size: 21px;
    }
}

