:root {
    --mcp-gallery-white: #fff;
    --mcp-gallery-muted: rgba(255, 255, 255, .62);
    --mcp-gallery-line: rgba(255, 255, 255, .22);
}

html.mcp-gallery-open,
body.mcp-gallery-open {
    overscroll-behavior: none;
}

.mcp-floating-gallery {
    --mcp-overlay-opacity: .94;
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: none;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    background:
        radial-gradient(circle at 50% 40%, rgba(32, 32, 36, .42), transparent 52%),
        rgba(4, 4, 5, var(--mcp-overlay-opacity));
    color: var(--mcp-gallery-white);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    transition: opacity .28s ease, visibility .28s ease;
    -webkit-font-smoothing: antialiased;
}

.mcp-floating-gallery::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

.mcp-floating-gallery.is-open {
    display: block;
}

.mcp-floating-gallery.is-visible {
    opacity: 1;
    visibility: visible;
}

.mcp-gallery-chrome {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: clamp(16px, 2.2vw, 34px);
}

.mcp-gallery-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: start;
    gap: clamp(14px, 2vw, 28px);
    min-height: 56px;
}

.mcp-gallery-heading-wrap {
    min-width: 0;
    padding-left: clamp(0px, 3vw, 52px);
}

.mcp-gallery-title {
    margin: 0;
    color: #fff;
    font: 300 clamp(18px, 2vw, 29px)/1.15 "Helvetica Neue", Helvetica, Arial, sans-serif;
    letter-spacing: .22em;
    text-transform: uppercase;
    text-shadow: 0 1px 18px rgba(0, 0, 0, .6);
}

.mcp-gallery-description {
    max-width: 720px;
    margin-top: 7px;
    color: var(--mcp-gallery-muted);
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: .08em;
}

.mcp-gallery-description p {
    margin: 0;
}

.mcp-gallery-counter {
    align-self: center;
    min-width: 72px;
    color: var(--mcp-gallery-muted);
    font-size: 11px;
    letter-spacing: .2em;
    text-align: center;
    white-space: nowrap;
}

.mcp-gallery-close,
.mcp-gallery-nav,
.mcp-gallery-thumb {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.mcp-gallery-close {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--mcp-gallery-line);
    font-size: 33px;
    font-weight: 200;
    line-height: 1;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.mcp-gallery-close:hover,
.mcp-gallery-close:focus-visible {
    border-color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .1);
    transform: rotate(4deg);
    outline: none;
}

.mcp-gallery-stage {
    position: relative;
    display: grid;
    grid-template-columns: clamp(42px, 6vw, 88px) minmax(0, 1fr) clamp(42px, 6vw, 88px);
    align-items: center;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.mcp-gallery-nav {
    position: relative;
    z-index: 2;
    width: 100%;
    height: min(24vh, 180px);
    color: rgba(255, 255, 255, .66);
    font-size: clamp(48px, 7vw, 105px);
    font-weight: 100;
    line-height: 1;
    opacity: .72;
    transition: color .2s ease, opacity .2s ease, transform .2s ease;
}

.mcp-gallery-nav:hover,
.mcp-gallery-nav:focus-visible {
    color: #fff;
    opacity: 1;
    outline: none;
}

.mcp-gallery-prev:hover,
.mcp-gallery-prev:focus-visible {
    transform: translateX(-5px);
}

.mcp-gallery-next:hover,
.mcp-gallery-next:focus-visible {
    transform: translateX(5px);
}

.mcp-gallery-figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    padding: clamp(8px, 1.5vh, 18px) 0;
}

.mcp-gallery-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 210px);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transform: scale(.985);
    filter: saturate(.94) contrast(1.02);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .48);
    cursor: pointer;
    user-select: none;
    transition: opacity .34s ease, transform .45s cubic-bezier(.2,.7,.2,1);
}

.mcp-gallery-image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.mcp-gallery-image.is-changing {
    opacity: 0;
    transform: scale(.985);
}

.mcp-gallery-caption {
    min-height: 18px;
    max-width: 900px;
    margin-top: 10px;
    color: var(--mcp-gallery-muted);
    font-size: 11px;
    line-height: 1.45;
    letter-spacing: .08em;
    text-align: center;
}

.mcp-gallery-caption p {
    margin: 0;
}

.mcp-gallery-empty {
    color: var(--mcp-gallery-muted);
    letter-spacing: .12em;
    text-align: center;
}

.mcp-gallery-thumbnails {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    min-height: 68px;
    max-width: min(100%, 1180px);
    margin: 0 auto;
    padding: 8px 4px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.mcp-gallery-thumb {
    flex: 0 0 auto;
    width: 62px;
    height: 48px;
    padding: 2px;
    border: 1px solid transparent;
    opacity: .42;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.mcp-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(.18);
}

.mcp-gallery-thumb:hover,
.mcp-gallery-thumb:focus-visible,
.mcp-gallery-thumb.is-current {
    border-color: rgba(255, 255, 255, .72);
    opacity: 1;
    transform: translateY(-2px);
    outline: none;
}

@media (max-width: 720px) {
    .mcp-gallery-chrome {
        padding: 12px;
    }

    .mcp-gallery-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 52px;
    }

    .mcp-gallery-heading-wrap {
        padding-left: 2px;
    }

    .mcp-gallery-title {
        font-size: 16px;
        letter-spacing: .16em;
    }

    .mcp-gallery-description {
        display: none;
    }

    .mcp-gallery-counter {
        position: absolute;
        right: 62px;
        top: 30px;
    }

    .mcp-gallery-close {
        width: 42px;
        height: 42px;
    }

    .mcp-gallery-stage {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
    }

    .mcp-gallery-nav {
        height: 35vh;
        font-size: 54px;
    }

    .mcp-gallery-image {
        max-height: calc(100vh - 164px);
    }

    .mcp-gallery-caption {
        margin-top: 8px;
        font-size: 10px;
    }

    .mcp-gallery-thumbnails {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mcp-floating-gallery,
    .mcp-gallery-close,
    .mcp-gallery-nav,
    .mcp-gallery-image,
    .mcp-gallery-thumb {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
