/*
==========================================================================

 PROJECT     : SIGNATURE SPREADS AND TREATS BY DI
 VERSION     : 1.0.0
 AUTHOR      : JB

===========================================================================
*/

/* PAGE-SPECIFIC HERO IMAGE POSITION */

.gallery-page .site-hero-media img {
    object-position: center right;
}

/* GALLERY INTRODUCTION */

.gallery-page .gallery-intro {
    position: relative;
    padding:
        clamp(4.5rem, 7vw, 6.5rem)
        0
        clamp(1.75rem, 3vw, 2.5rem);
    background-color: var(--color-background);
}

.gallery-page .gallery-intro-header {
    max-width: 820px;
    margin-inline: auto;
    text-align: center;
}

.gallery-page .gallery-eyebrow {
    width: max-content;
    max-width: 100%;
    margin:
        0
        auto
        var(--space-md);
    color: var(--color-primary-dark);
    font-size: 0.68rem;
    font-weight: var(--fw-bold);
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.gallery-page .gallery-intro-header h2 {
    margin-bottom: var(--space-lg);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: clamp(3rem, 4.8vw, 4.9rem);
    font-weight: 600;
    line-height: 0.96;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.gallery-page .gallery-intro-header h2 em {
    display: block;
    margin-top: 0.12em;
    color: var(--color-primary-dark);
    font-size: 0.8em;
    font-weight: var(--fw-medium);
    line-height: 1.05;
}

.gallery-page .gallery-intro-header > p:last-child {
    max-width: 62ch;
    margin-inline: auto;
    color: var(--color-text-light);
    font-size: 0.94rem;
    line-height: 1.8;
}

/* STACKED PHOTO GALLERY */

.gallery-page .gallery-collection {
    position: relative;
    isolation: isolate;
    padding:
        clamp(1.25rem, 2vw, 2rem)
        0
        clamp(3.5rem, 6vw, 5rem);
    overflow: hidden;
    background-color: var(--color-background);
}

.gallery-page .gallery-collection::before {
    content: "";
    position: absolute;
    top: 9%;
    left: -220px;
    z-index: -1;
    width: 470px;
    height: 470px;
    border: 1px solid rgba(182, 106, 34, 0.055);
    border-radius: 50%;
    pointer-events: none;
}

/* GRID */

.gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:
        clamp(2.8rem, 4.5vw, 4.25rem)
        clamp(1.9rem, 3vw, 3rem);
    max-width: 1280px;
    margin-inline: auto;
}

/* MAIN PHOTO */

.gallery-page .gallery-photo {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    cursor: zoom-in;
    transform-origin: center;
}

.gallery-page .gallery-photo-frame {
    position: relative;
    z-index: 3;
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 8px solid var(--color-warm-white);
    border-radius: var(--radius-md);
    background-color: var(--color-section);
    box-shadow:
        0 18px 40px rgba(75, 46, 30, 0.16);
}

.gallery-page .gallery-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* DECORATIVE PHOTOS BEHIND MAIN IMAGE */

.gallery-page .gallery-photo-back {
    position: absolute;
    display: block;
    inset: 7px 9px;
    border: 6px solid rgba(252, 250, 246, 0.92);
    border-radius: var(--radius-md);
    background:
        linear-gradient(
            135deg,
            #DCCFC0,
            #C9B8A5
        );
    box-shadow:
        0 10px 26px rgba(75, 46, 30, 0.11);
    pointer-events: none;
}

.gallery-page .gallery-photo-back-one {
    z-index: 1;
    transform:
        rotate(-3.4deg)
        translate(-5px, 6px);
}

.gallery-page .gallery-photo-back-two {
    z-index: 2;
    transform:
        rotate(2.7deg)
        translate(5px, 3px);
    background:
        linear-gradient(
            135deg,
            #EFE7DD,
            #D7C9B9
        );
}


/* GENTLE VARIATION */

.gallery-page .gallery-photo-tilt-left {
    transform: rotate(-0.35deg);
}

.gallery-page .gallery-photo-tilt-right {
    transform: rotate(0.35deg);
}

/* EXPAND ICON */

.gallery-page .gallery-photo-expand {
    position: absolute;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(75, 46, 30, 0.12);
    border-radius: 50%;
    background-color: rgba(252, 250, 246, 0.96);
    color: var(--color-text);
    box-shadow:
        0 8px 24px rgba(75, 46, 30, 0.16);
    opacity: 0;
    transform: translateY(6px);
}

/* GALLERY CLOSING THOUGHT */

.gallery-page .gallery-closing-thought {
    max-width: 760px;
    margin:
        clamp(3.5rem, 5vw, 4.75rem)
        auto
        0;
    text-align: center;
}

.gallery-page .gallery-closing-flourish {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: min(100%, 250px);
    margin:
        0
        auto
        var(--space-xl);
    color: var(--color-primary);
}

.gallery-page .gallery-closing-flourish span {
    flex: 1;
    height: 1px;
    background:
        linear-gradient(
            to right,
            transparent,
            currentColor
        );
}

.gallery-page .gallery-closing-flourish span:last-child {
    background:
        linear-gradient(
            to left,
            transparent,
            currentColor
        );
}

.gallery-page .gallery-closing-flourish svg {
    flex: 0 0 auto;
    width: 58px;
    height: 22px;
}

.gallery-page .gallery-closing-thought p {
    margin: 0;
    color: var(--color-text-light);
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.25;
}

/*
.gallery-page .gallery-closing-thought p em {
    display: block;
    margin-top: 0.12em;
    color: var(--color-primary-dark);
    font-weight: var(--fw-medium);
}
*/

/* GALLERY LIGHTBOX */

.gallery-page .gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding:
        clamp(1rem, 3vw, 2.5rem);
    background-color: rgba(29, 18, 12, 0.94);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.gallery-page .gallery-lightbox-stage {
    display: grid;
    place-items: center;
    width: min(100%, 1180px);
    height: min(82vh, 900px);
}

.gallery-page .gallery-lightbox-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.34);
}

/* CLOSE */

.gallery-page .gallery-lightbox-close {
    position: absolute;
    top: clamp(1rem, 2vw, 1.75rem);
    right: clamp(1rem, 2vw, 1.75rem);
    z-index: 4;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(75, 46, 30, 0.16);
    border-radius: 50%;
    background-color: var(--color-background);
    color: var(--color-text);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.22);
}

/* PREVIOUS / NEXT */

.gallery-page .gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(252, 250, 246, 0.28);
    border-radius: 50%;
    background-color: rgba(252, 250, 246, 0.1);
    color: var(--color-warm-white);
    transform: translateY(-50%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-page .gallery-lightbox-prev {
    left: clamp(1rem, 2vw, 1.75rem);
}

.gallery-page .gallery-lightbox-next {
    right: clamp(1rem, 2vw, 1.75rem);
}

/* COUNTER */

.gallery-page .gallery-lightbox-counter {
    position: absolute;
    bottom: clamp(1rem, 2vw, 1.5rem);
    left: 50%;
    margin: 0;
    color: rgba(252, 250, 246, 0.78);
    font-size: 0.72rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.12em;
    transform: translateX(-50%);
}

/* BODY LOCK */

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