/*--------------------------------------------------------------
# Gallery
--------------------------------------------------------------*/

.gallery-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gallery-filters {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-wrap: nowrap;
    gap: .5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.gallery-filters a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 12px;
    color: var(--nx-color-muted, var(--bs-secondary-color, #667085));
    background: var(--nx-color-card-bg, var(--bs-card-bg, #fff));
    border: 1px solid var(--nx-color-card-border, var(--bs-border-color, #d7dde6));
    border-radius: 9px;
    font-size: .87rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.gallery-filters a:hover,
.gallery-filters a:focus-visible {
    color: var(--nx-color-on-surface, var(--bs-body-color, #172033));
    border-color: color-mix(in srgb, var(--nx-color-primary, #ed7615) 36%, var(--nx-color-card-border, #d7dde6));
    transform: translateY(-1px);
}

.gallery-filters li.active a {
    color: var(--nx-template-button-primary-text, var(--nx-color-primary, #d96308));
    background: var(--nx-template-button-primary-bg, color-mix(in srgb, var(--nx-color-primary, #ed7615) 10%, transparent));
    border-color: var(--nx-template-button-primary-border, color-mix(in srgb, var(--nx-color-primary, #ed7615) 26%, transparent));
}

.gallery-filters li.active a:hover,
.gallery-filters li.active a:focus-visible {
    color: var(--nx-template-button-primary-hover-text, var(--nx-color-primary, #d96308));
    background: var(--nx-template-button-primary-hover-bg, color-mix(in srgb, var(--nx-color-primary, #ed7615) 17%, transparent));
    border-color: var(--nx-template-button-primary-hover-border, color-mix(in srgb, var(--nx-color-primary, #ed7615) 38%, transparent));
}

.gallery-search {
    display: flex;
    flex: 0 1 440px;
    width: min(440px, 100%);
    gap: .75rem;
}
.gallery-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--nx-color-muted, var(--bs-secondary-color, #6c757d));
}

.gallery-summary-term {
    font-weight: 600;
    color: var(--nx-color-on-surface, var(--bs-body-color, #212529));
}

.gallery-favorite-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .35rem .75rem;
    margin-left: auto;
    border: 1px solid rgba(218, 146, 143, .55);
    border-radius: 999px;
    background: rgba(249, 227, 224, .72);
    color: #9a625f;
    font-size: .78rem;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(128, 83, 79, .06);
}

.gallery-summary .gallery-favorite-count:not(:last-child) {
    display: none;
}

.grid-wrapper {
    --gallery-row-height: 280px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    grid-auto-rows: var(--gallery-row-height);
    grid-auto-flow: dense;
}

.gallery-pagination {
    width: min(calc(100% - 2rem), var(--jin-max, 1140px));
    margin: 1.5rem auto 0;
}

.portfolio-item {
    position: relative;
    min-width: 0;
    grid-row: span 1;
    overflow: hidden;
    /*border-radius: var(--nx-component-radius, var(--bs-border-radius-lg, .5rem));
    background: var(--nx-component-card-bg, var(--nx-color-card-bg, #f6f7f8));
    box-shadow: var(--nx-component-shadow, var(--nx-shadow-card, 0 8px 24px rgba(15, 23, 42, 0.08)));*/
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.portfolio-item.show {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item.wide {
    grid-column: span 2;
}

.portfolio-item.tall {
    grid-row: span 2;
}

.portfolio-item.big {
    grid-column: span 2;
    grid-row: span 2;
}

.lightbox-trigger {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: var(--nx-component-radius, var(--bs-border-radius-lg, .5rem));
    background: var(--nx-component-card-bg, var(--nx-color-card-bg, var(--bs-card-bg, #f3f4f6)));
    border: 1px solid var(--nx-component-border, var(--nx-color-border, rgba(15, 23, 42, 0.12)));
    box-shadow: none;
}

.portfolio-item.tall .lightbox-trigger {
    height: 100%;
}

.portfolio-item.wide .lightbox-trigger {
    height: 100%;
}

.portfolio-item.big .lightbox-trigger {
    height: 100%;
}

.lightbox-trigger::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 28%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.12) 100%);
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox-trigger:hover::after,
.lightbox-trigger:focus-visible::after {
    opacity: 1;
}

.grid-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.lightbox-trigger:hover img,
.lightbox-trigger:focus-visible img {
    transform: scale(1.025);
}

.gallery-card-meta {
    position: absolute;
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.65rem 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-left: 3px solid var(--nx-color-primary, var(--bs-primary, #0d6efd));
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    color: #3f454d;
    text-shadow: none;
    pointer-events: none;
    -webkit-backdrop-filter: blur(10px) saturate(110%);
    backdrop-filter: blur(10px) saturate(110%);
}

.gallery-card-meta > a {
    position: relative;
    z-index: 3;
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    color: var(--nx-color-primary, var(--bs-primary, #0d6efd)) !important;
    pointer-events: auto;
}

.gallery-card-meta > a:hover,
.gallery-card-meta > a:focus-visible {
    text-decoration: underline !important;
}

.gallery-card-meta strong {
    font-size: 1rem;
    line-height: 1.25;
    color: inherit !important;
}

.gallery-card-meta small {
    color: #5f6873;
}

.gallery-card-favorite {
    position: absolute;
    z-index: 4;
    top: .7rem;
    right: .7rem;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .3rem .62rem;
    border: 1px solid rgba(217, 151, 147, .45);
    border-radius: 999px;
    background: rgba(255, 251, 247, .86);
    color: #bc7774;
    font-size: .75rem;
    line-height: 1;
    box-shadow: 0 5px 16px rgba(105, 72, 67, .1);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    pointer-events: none;
}

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

.gallery-card-favorite.is-liked {
    border-color: rgba(209, 119, 116, .72);
    background: rgba(248, 222, 219, .92);
    color: #a95e5b;
}

.gallery-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.gallery-tags-lightbox {
    margin-top: 0;
    margin-bottom: 0.85rem;
}

.gallery-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--nx-component-border, var(--nx-color-card-border, var(--bs-border-color)));
    background: color-mix(in srgb, var(--nx-color-card-bg, var(--bs-card-bg, #f8fafc)) 92%, var(--nx-color-on-surface, #212529) 8%);
    color: var(--nx-color-muted, var(--bs-secondary-color, #475569));
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: var(--nx-component-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.gallery-empty {
    grid-column: 1 / -1;
    padding: 3rem 1rem;
}

.gallery-lightbox {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    column-gap: 1rem;
    align-items: center;
    min-height: 110vh;
    padding: 2rem;
    overflow: hidden;
    background: #080d18;
}

.gallery-lightbox::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: rgba(4, 8, 19, .28);
    pointer-events: none;
}

.gallery-backdrop {
    position: absolute;
    z-index: 0;
    inset: -36px;
    width: calc(100% + 72px);
    height: calc(100% + 72px);
    max-width: none;
    max-height: none;
    object-fit: cover;
    filter: blur(28px);
    transform: scale(1.06);
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
}

.gallery-backdrop.is-visible {
    opacity: .76;
}

.gallery-backdrop.is-resetting {
    transition: none !important;
}

.gallery-lightbox-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    min-width: 0;
    justify-self: center;
}

.gallery-image-stage {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    overflow-y: auto;
    width: min(100%, 1800px);
    height: min(78vh, 1000px);
    margin-inline: auto;
    display: grid;
    align-items: start;
    justify-items: center;
    border-radius: 20px;
    background: rgba(4, 8, 19, .18);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.4) rgba(255,255,255,.08);
}

.gallery-image-stage::-webkit-scrollbar { width: 10px; }
.gallery-image-stage::-webkit-scrollbar-track { background: rgba(255,255,255,.08); }
.gallery-image-stage::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.38);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

#lightboxImageCurrent,
#lightboxImageNext {
    position: relative;
    z-index: 2;
    grid-area: 1 / 1;
    width: min(100%, 1400px);
    max-width: 1400px;
    max-height: none;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

#lightboxImageCurrent.is-visible,
#lightboxImageNext.is-visible {
    opacity: 1;
}

#lightboxImageCurrent.is-resetting,
#lightboxImageNext.is-resetting {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    #lightboxImageCurrent,
    #lightboxImageNext,
    .gallery-backdrop {
        transition-duration: .01ms;
    }
}

/* Artbook detail page ---------------------------------------------------- */
body.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card {
    overflow: hidden;
    border: 1px solid rgba(139, 111, 102, .18) !important;
    border-radius: 7px;
    color: #554a47;
    background: #f6eee5 !important;
    box-shadow: 0 22px 60px rgba(87, 67, 61, .13) !important;
}

body.nx-site-gallery.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card > div.card-body {
    position: relative;
    isolation: isolate;
    padding: clamp(1.25rem, 2.6vw, 2.4rem);
    background:
        radial-gradient(circle at 7% 10%, rgba(232, 184, 178, .2), transparent 27%),
        radial-gradient(circle at 94% 88%, rgba(144, 192, 181, .16), transparent 30%),
        repeating-linear-gradient(96deg, rgba(105, 88, 80, .016) 0 1px, transparent 1px 6px),
        #f4ece2 !important;
}

body.nx-site-gallery.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card > div.card-body::before {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 8% 12%, rgba(232, 184, 178, .2), transparent 28%),
        radial-gradient(circle at 92% 86%, rgba(144, 192, 181, .16), transparent 31%),
        #f4ece2 !important;
    pointer-events: none;
}

body.nx-site-gallery.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card > div.card-body > nav,
body.nx-site-gallery.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card > div.card-body > .row {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

body.nx-site-gallery.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card > div.card-body > .row > [class*='col-'] {
    background: transparent !important;
}

.gallery-detail nav {
    margin-bottom: 1.35rem !important;
}

.gallery-detail nav .btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 38px;
    padding: .42rem .85rem;
    border: 1px solid rgba(121, 174, 163, .7);
    border-radius: 999px;
    color: #5b8d83;
    background: rgba(231, 243, 239, .58);
    box-shadow: none;
}

.gallery-detail nav .btn:hover,
.gallery-detail nav .btn:focus-visible {
    border-color: #75aa9f;
    color: #426f67;
    background: #deeee9;
    transform: translateX(-2px);
}

.gallery-detail .row {
    --bs-gutter-x: clamp(1.5rem, 3vw, 3rem);
}

.gallery-detail figure {
    display: grid;
    place-items: center;
    min-height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.gallery-detail figure picture {
    display: grid;
    place-items: center;
    width: 100%;
}

.gallery-detail figure img {
    display: block;
    width: 100% !important;
    max-width: 100%;
    max-height: none;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: contain;
    background: transparent;
    box-shadow: 0 14px 32px rgba(84, 65, 59, .12) !important;
}

.gallery-detail-copy {
    position: sticky;
    top: 1.5rem;
    padding: clamp(1.25rem, 2vw, 2rem);
    border: 1px solid #ead8cf;
    border-radius: 4px;
    background: #fffaf4;
}

.gallery-detail-copy h1 {
    margin-bottom: 1.1rem !important;
    color: #493d3a;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.85rem, 3vw, 2.7rem) !important;
    font-weight: 500;
    line-height: 1.12;
}

.gallery-detail-copy > p {
    margin-bottom: 1.35rem !important;
    color: #6d5e5a !important;
    font-size: .92rem;
    line-height: 1.72;
}

.gallery-detail-copy .badge {
    padding: .38rem .7rem;
    border: 1px solid rgba(130, 104, 97, .1);
    border-radius: 999px;
    color: #655854 !important;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1;
    background: #f2d5d1 !important;
    box-shadow: none;
}

.gallery-detail-copy .badge.text-bg-secondary {
    background: #efdfc5 !important;
}

.gallery-detail-copy .list-group {
    overflow: hidden;
    border-top: 1px solid rgba(139, 111, 102, .13);
    border-bottom: 1px solid rgba(139, 111, 102, .13);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.gallery-detail-copy .list-group-item {
    gap: 1rem;
    padding: .72rem 0 !important;
    border-color: rgba(139, 111, 102, .1);
    color: #9a8983;
    background: transparent !important;
    box-shadow: none !important;
}

.gallery-detail-copy .list-group-item strong {
    max-width: 70%;
    color: #5d504d;
    font-weight: 500;
    text-align: right;
    overflow-wrap: anywhere;
}

.gallery-detail-copy .list-group-item .badge {
    background: #d8ebe5 !important;
}

.gallery-detail-copy > .d-flex:last-child {
    flex-wrap: nowrap !important;
    align-items: center;
    gap: .6rem !important;
}

.gallery-detail-copy > .d-flex:last-child .btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 40px;
    width: auto !important;
    flex: 0 0 auto;
    padding: .48rem .9rem;
    border-radius: 999px;
    font-size: .82rem;
    box-shadow: none;
}

.gallery-detail-copy > .d-flex:last-child .btn-primary {
    border-color: #8cbdb2;
    color: #fffefa;
    background: #8cbdb2;
}

.gallery-detail-copy > .d-flex:last-child .btn-primary:hover,
.gallery-detail-copy > .d-flex:last-child .btn-primary:focus-visible {
    border-color: #73a99e;
    background: #73a99e;
}

.gallery-detail-copy > .d-flex:last-child .btn-outline-secondary {
    border-color: rgba(137, 105, 98, .28);
    color: #6d5c58;
    background: rgba(255, 253, 249, .76);
}

.gallery-detail-copy > .d-flex:last-child .btn-outline-secondary:hover,
.gallery-detail-copy > .d-flex:last-child .btn-outline-secondary:focus-visible {
    border-color: #dfa5a2;
    color: #805653;
    background: #f7e2df;
}

@media (max-width: 991.98px) {
    .gallery-detail figure {
        min-height: 0;
    }

    .gallery-detail figure img {
        max-height: none;
    }

    .gallery-detail-copy {
        position: static;
    }
}

@media (max-width: 575.98px) {
    body.nx-site-gallery.nx-frontend-subpage:not(.builder-active) main.flex-fill section.gallery-detail.card > div.card-body {
        padding: .85rem;
    }

    .gallery-detail figure {
        padding: 0;
    }

    .gallery-detail-copy {
        padding: 1.1rem;
    }

    .gallery-detail-copy .list-group-item {
        align-items: flex-start;
        flex-direction: column;
        gap: .35rem;
    }

    .gallery-detail-copy .list-group-item strong {
        max-width: 100%;
        text-align: left;
    }
}
.gallery-lightbox-caption {
    width: min(92vw, 1100px);
    color: #fff !important;
    padding: 0.75rem 0 0;
}

@media (min-width: 992px) {
    .gallery-lightbox {
        padding-bottom: 0;
    }

    .gallery-lightbox-stage {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 2rem);
    }

    .gallery-image-stage {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

    .gallery-lightbox-caption {
        flex: 0 0 auto;
    }
}

.gallery-lightbox-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
    color: rgba(255, 255, 255, 0.72);
}

.gallery-lightbox-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    color: #e2e8f0;
    font-size: 1rem;
}

.gallery-lightbox-meta-item:not(:empty):not([hidden]) + .gallery-lightbox-meta-item:not(:empty):not([hidden])::before {
    content: "-";
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.55);
}

.gallery-lightbox-title {
    font-size: clamp(1.6rem, 2vw, 2rem);
    font-weight: 700;
    color: #ffffff;
}

#lightboxMeta,
#lightboxTags {
    color: #cbd5e1 !important;
}

#lightboxCaption {
    max-width: 80ch;
    color: #f8fafc !important;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    opacity: 1 !important;
}

.gallery-lightbox-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.gallery-lightbox-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.gallery-lightbox-action:hover,
.gallery-lightbox-action:focus-visible {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
}

.gallery-nav,
.gallery-close {
    z-index: 2;
}

.gallery-nav {
    border: 0;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gallery-nav:hover,
.gallery-nav:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.04);
}

.gallery-nav i {
    font-size: 2rem;
}

.gallery-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

@media (max-width: 1199px) {
    .grid-wrapper {
        --gallery-row-height: 240px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

    .gallery-lightbox {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 4.5rem 1rem 1.25rem;
    }

    .gallery-lightbox-stage {
        order: 1;
    }

    .gallery-nav {
        position: absolute;
        top: auto;
        bottom: 1.25rem;
    }

    .gallery-nav-prev {
        left: 1rem;
    }

    .gallery-nav-next {
        right: 1rem;
    }

    #lightboxImage {
        max-height: 62vh;
    }
}

/* Artbook lightbox ------------------------------------------------------- */
#lightboxModal .modal-dialog,
#lightboxModal .modal-content {
    min-height: 100%;
}

#lightboxModal .modal-content {
    background: transparent !important;
}

.gallery-lightbox {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: clamp(.5rem, 1.4vw, 1.25rem);
    min-height: 100vh;
    padding: clamp(1rem, 2.5vw, 2.5rem);
    overflow: auto;
    color: #554a47;
    background:
        radial-gradient(circle at 8% 16%, rgba(225, 169, 162, .15), transparent 24%),
        radial-gradient(circle at 88% 78%, rgba(143, 190, 180, .14), transparent 27%),
        repeating-linear-gradient(96deg, rgba(105, 88, 80, .018) 0 1px, transparent 1px 5px),
        rgba(248, 245, 239, .96);
}

.gallery-lightbox::before,
.gallery-lightbox::after {
    content: '';
    position: fixed;
    z-index: -1;
    width: 34vw;
    height: 34vw;
    border-radius: 48% 52% 42% 58%;
    filter: blur(24px);
    opacity: .2;
    pointer-events: none;
}

.gallery-lightbox::before {
    top: -15vw;
    left: -9vw;
    background: #e9aaa6;
}

.gallery-lightbox::after {
    right: -12vw;
    bottom: -18vw;
    background: #8fbeb4;
}

.gallery-artbook {
    position: relative;
    z-index: 2;
    width: min(100%, 1480px);
    margin: auto;
    overflow: hidden;
    border: 1px solid rgba(139, 111, 102, .18);
    border-radius: 6px;
    background: rgba(255, 253, 249, .88);
    box-shadow: 0 28px 80px rgba(87, 67, 61, .16);
    opacity: 0;
    transform: scale(.95) translateY(8px);
}

#lightboxModal.show .gallery-artbook {
    animation: galleryArtbookOpen .25s ease-out forwards;
}

.gallery-artbook-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 370px);
    min-height: min(74vh, 880px);
}

.gallery-print-column {
    min-width: 0;
    padding: clamp(1rem, 2.4vw, 2rem);
    background:
        radial-gradient(circle at 20% 25%, rgba(232, 184, 178, .12), transparent 28%),
        radial-gradient(circle at 83% 76%, rgba(144, 192, 181, .11), transparent 30%),
        rgba(246, 240, 232, .72);
}

.gallery-image-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: min(68vh, 790px);
    min-height: 420px;
    overflow: auto;
    border-radius: 3px;
    background: rgba(239, 232, 222, .48);
    scrollbar-width: thin;
    scrollbar-color: #c4aaa3 transparent;
}

.gallery-image-stage::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.gallery-image-stage::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 20px;
    background: #c4aaa3;
    background-clip: padding-box;
}

.gallery-print {
    display: inline-flex;
    flex: none;
    margin: auto;
    padding: clamp(10px, 1.1vw, 18px);
    background: #fffefa;
    box-shadow: 0 18px 42px rgba(84, 65, 59, .18), 0 2px 7px rgba(84, 65, 59, .09);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity .2s ease, transform .25s ease, box-shadow .25s ease;
}

.gallery-print.is-changing {
    opacity: 0;
    transform: translateY(5px) scale(.95);
    box-shadow: 0 5px 15px rgba(84, 65, 59, .06);
}

#lightboxImage {
    display: block;
    flex: none;
    height: auto;
    max-width: none;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-zoom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: 1rem;
}

.gallery-zoom button,
.gallery-lightbox-action,
.gallery-favorite {
    border: 1px solid rgba(137, 105, 98, .22);
    border-radius: 999px;
    background: rgba(255, 253, 249, .78);
    color: #645653;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.gallery-zoom button {
    padding: .35rem .72rem;
    font-size: .76rem;
}

.gallery-zoom button:hover,
.gallery-zoom button:focus-visible,
.gallery-zoom button.is-active {
    border-color: #8cbdb2;
    background: #e5f1ed;
    color: #4d766e;
}

.gallery-zoom span {
    margin-left: .35rem;
    color: #968782;
    font-size: .72rem;
}

.gallery-artbook-info {
    position: relative;
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1.25rem, 2.5vw, 2.5rem);
    overflow-y: auto;
    border-left: 1px solid rgba(139, 111, 102, .14);
    background: rgba(255, 253, 249, .74);
    opacity: 0;
    transform: translateX(14px);
}

#lightboxModal.show .gallery-artbook-info {
    animation: galleryInfoOpen .25s .05s ease-out forwards;
}

.gallery-artbook-counter {
    display: block;
    margin-bottom: .65rem;
    color: #9d8c86;
    font-size: .72rem;
    letter-spacing: .13em;
}

.gallery-lightbox-title {
    margin: 0 0 1rem;
    color: #493d3a !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 500;
    line-height: 1.12;
}

.gallery-artbook-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 1.3rem;
}

.gallery-artbook-badge {
    display: inline-flex;
    padding: .35rem .68rem;
    border: 1px solid rgba(130, 104, 97, .1);
    border-radius: 999px;
    color: #655854;
    font-size: .72rem;
    line-height: 1;
}

.gallery-artbook-badge--rose { background: #f4dedb; }
.gallery-artbook-badge--mint { background: #deeee9; }
.gallery-artbook-badge--cream { background: #f4ead9; }

.gallery-artbook-facts {
    display: grid;
    gap: .45rem;
    margin: 0 0 1.35rem;
    padding: 0 0 1.1rem;
    border-bottom: 1px solid rgba(139, 111, 102, .13);
}

.gallery-artbook-facts > div {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: .75rem;
}

.gallery-artbook-facts dt {
    color: #a08f89;
    font-size: .76rem;
    font-weight: 400;
}

.gallery-artbook-facts dd {
    margin: 0;
    color: #5d504d;
    font-size: .82rem;
}

.gallery-artbook-copy,
.gallery-palette-block,
.gallery-artist-note {
    margin: 0 0 1.4rem;
}

.gallery-artbook-copy h3,
.gallery-palette-block h3,
.gallery-artist-note h3,
.gallery-related h3 {
    margin: 0 0 .65rem;
    color: #655653;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .98rem;
    font-weight: 500;
}

.gallery-artbook-copy p,
.gallery-artist-note p {
    margin: 0;
    color: #756763 !important;
    font-size: .84rem;
    line-height: 1.65;
}

#lightboxModal #lightboxCaption {
    color: #655754 !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

.gallery-palette {
    display: flex;
    gap: .55rem;
}

.gallery-palette-swatch {
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(95, 76, 70, .16), 0 3px 7px rgba(95, 76, 70, .1);
}

.gallery-artist-note {
    padding: 1rem 1.05rem;
    border: 0;
    border-left: 3px solid #e4b0ab;
    border-radius: 0 4px 4px 0;
    background: rgba(246, 229, 224, .56);
}

.gallery-favorite {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    margin-bottom: 1rem;
}

.gallery-favorite > span:first-child {
    color: #cd7f7c;
    font-size: 1.25rem;
    line-height: 1;
}

.gallery-favorite:hover,
.gallery-favorite:focus-visible,
.gallery-favorite.is-favorite {
    border-color: #dfa5a2;
    background: #f7e2df;
    color: #805653;
    transform: translateY(-1px);
}

.gallery-favorite.is-saving {
    cursor: wait;
    opacity: .62;
}

.gallery-lightbox-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.gallery-lightbox-action {
    padding: .45rem .75rem;
    font-size: .75rem;
}

.gallery-lightbox-action:hover,
.gallery-lightbox-action:focus-visible {
    border-color: #8cbdb2;
    background: #e5f1ed;
    color: #4d766e;
}

.gallery-related {
    padding: 1.15rem clamp(1rem, 2.4vw, 2rem) 1.45rem;
    border-top: 1px solid rgba(139, 111, 102, .14);
    background: rgba(252, 248, 242, .78);
}

.gallery-related-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}

.gallery-related-heading h3 { margin: 0; }
.gallery-related-heading span {
    color: #a0928d;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.gallery-related-item {
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 8;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(139, 111, 102, .15);
    border-radius: 3px;
    background: #f6eee5;
}

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

.gallery-related-item span {
    position: absolute;
    right: .4rem;
    bottom: .4rem;
    left: .4rem;
    padding: .3rem .45rem;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 252, 247, .85);
    color: #645653;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-related-item:hover img,
.gallery-related-item:focus-visible img {
    transform: scale(1.035);
}

.gallery-nav,
.gallery-close {
    z-index: 4;
    border: 0;
    color: #665754;
}

.gallery-nav {
    position: relative;
    inset: auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 70px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    opacity: .12;
    transition: opacity .2s ease, transform .2s ease, color .2s ease;
}

.gallery-lightbox:hover .gallery-nav,
.gallery-nav:focus-visible {
    opacity: .72;
}

.gallery-nav:hover {
    color: #74a99e;
    opacity: 1;
    transform: translateX(-2px);
    background: transparent;
}

.gallery-nav-next:hover { transform: translateX(2px); }

.gallery-close {
    position: fixed;
    top: 1rem;
    right: 1.2rem;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(120, 96, 89, .16);
    border-radius: 50%;
    background: rgba(255, 253, 249, .82);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform .2s ease, background .2s ease;
}

.gallery-close:hover,
.gallery-close:focus-visible {
    background: #f4dfdc;
    transform: rotate(5deg);
}

@keyframes galleryArtbookOpen {
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes galleryInfoOpen {
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1100px) {
    .gallery-lightbox {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        padding: 3.5rem .5rem 1rem;
    }

    .gallery-artbook-main {
        grid-template-columns: 1fr;
    }

    .gallery-artbook-info {
        border-top: 1px solid rgba(139, 111, 102, .14);
        border-left: 0;
    }

    .gallery-image-stage {
        height: 62vh;
    }
}

@media (max-width: 700px) {
    .gallery-lightbox {
        display: block;
        padding: 3.5rem .55rem 1rem;
    }

    .gallery-image-stage {
        min-height: 300px;
        height: 54vh;
    }

    .gallery-nav {
        position: fixed;
        top: 42vh;
        width: 38px;
        height: 54px;
        opacity: .72;
        background: rgba(255, 253, 249, .72);
    }

    .gallery-nav-prev { left: .25rem; }
    .gallery-nav-next { right: .25rem; }
    .gallery-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-zoom span { flex-basis: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    #lightboxModal.show .gallery-artbook,
    #lightboxModal.show .gallery-artbook-info {
        animation-duration: .01ms;
    }

    .gallery-print,
    .gallery-related-item img {
        transition-duration: .01ms;
    }
}

@media (max-width: 1180px) {
    .gallery-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-filters {
        width: 100%;
        flex-wrap: wrap;
    }

    .gallery-search {
        flex: 0 0 auto;
        width: 100%;
    }
}
@media (max-width: 575px) {
    .gallery-search {
        flex-basis: 100%;
        flex-direction: column;
    }

    .grid-wrapper {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .portfolio-item.wide,
    .portfolio-item.tall,
    .portfolio-item.big {
        grid-column: span 1;
        grid-row: span 1;
    }

    .lightbox-trigger,
    .portfolio-item.tall .lightbox-trigger,
    .portfolio-item.wide .lightbox-trigger,
    .portfolio-item.big .lightbox-trigger {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .gallery-lightbox-topline {
        flex-direction: column;
        align-items: flex-start;
    }
}
