@charset "utf-8";

/* ==================================================================
    gallery.css
    作品モーダル（共通）／PRODUCTグリッド補助
    横スライダーは component.css
=================================================================== */

.galleryWorks.wide,
.productWorks.wide {
    overflow: hidden;
}

.galleryWorks.wide > .galleryBlock,
.productWorks.wide > .galleryBlock {
    margin-top: 27px;
}

.gallerySlider__empty {
    max-width: 1228px;
    margin: 0 auto;
    padding: 40px 52px;
    color: #fff;
    text-align: center;
}

.productWorks .gallerySlider__empty {
    max-width: none;
    margin: 0;
    padding: 40px 0;
}


/* --------------------------------
    モーダル
-------------------------------- */
.galleryModal {
    --stage-w: min(90vw, 720px);
    --stage-h: min(50vh, 520px);
    --panel-w: min(90vw, 720px);
    --gallery-duration: 0.42s;
}

.galleryModal[hidden] {
    display: none !important;
}

.galleryModal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 10050;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 16px;
    box-sizing: border-box;
}

.galleryModal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.galleryModal__panel {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
    width: var(--panel-w);
    min-width: min(90vw, 720px);
    max-width: min(90vw, 1000px);
    max-height: none;
    margin: auto;
    padding: 0;
    flex-shrink: 0;
    pointer-events: auto;
    transition: width var(--gallery-duration) ease;
}

.galleryModal__close,
.galleryModal__stage,
.galleryModal__dots,
.galleryModal__info {
    pointer-events: auto;
}

.galleryModal__close {
    position: relative;
    z-index: 2;
    align-self: flex-end;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: 0 0 16px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.galleryModal__closeIcon {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
}

.galleryModal__closeIcon::before,
.galleryModal__closeIcon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    margin-top: -0.5px;
    background: #fff;
}

.galleryModal__closeIcon::before {
    transform: rotate(45deg);
}

.galleryModal__closeIcon::after {
    transform: rotate(-45deg);
}

.galleryModal__close:focus-visible {
    outline: 1px solid #fff;
    outline-offset: 4px;
}

.galleryModal__stage {
    position: relative;
    display: block;
    width: var(--stage-w);
    height: var(--stage-h);
    min-height: var(--stage-min-h, var(--stage-h));
    max-width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    margin-inline: auto;
    line-height: 0;
    background: transparent;
    touch-action: pan-y;
    transition: width var(--gallery-duration) ease, height var(--gallery-duration) ease;
}

.galleryModal__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.98);
    transition: opacity var(--gallery-duration) ease, transform var(--gallery-duration) ease, visibility var(--gallery-duration);
    user-select: none;
    -webkit-user-drag: none;
}

.galleryModal__image.is-from-next {
    transform: translate3d(32px, 0, 0) scale(0.98);
}

.galleryModal__image.is-from-prev {
    transform: translate3d(-32px, 0, 0) scale(0.98);
}

.galleryModal__image.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    z-index: 1;
}

.galleryModal__dots,
.galleryModal__info {
    width: 0;
    min-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.galleryModal__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 8px 0 0;
}

.galleryModal__dot {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
}

.galleryModal__dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.galleryModal__dot.is-current::after {
    background: #fff;
}

.galleryModal__dot:focus-visible {
    outline: 1px solid #fff;
    outline-offset: 3px;
}

.galleryModal__info {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: start;
    gap: 8px 20px;
    margin-top: 20px;
    color: #fff;
}

@media only screen and (min-width: 768px) {
    .galleryModal__info.is-centered {
        justify-content: center;
    }

    .galleryModal__info.has-comment {
        display: grid;
        grid-template-columns: auto auto auto minmax(0, 1fr);
        justify-content: stretch;
    }
}

.galleryModal__category,
.galleryModal__name,
.galleryModal__size,
.galleryModal__comment {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.7;
    letter-spacing: 0.06em;
}

.galleryModal__category {
    display: inline-block;
    justify-self: start;
    padding: 3px 10px;
    font-size: 1.3rem;
    color: #111;
    background: #d8d5d0;
}

.galleryModal__category.is-empty,
.galleryModal__field.is-empty,
.galleryModal__field[hidden] {
    display: none !important;
}

.galleryModal__label {
    display: none;
}

.galleryModal__comment {
    min-width: 0;
}

.galleryModal__comment .js-gallery-modal-comment {
    display: block;
    white-space: normal;
}

.galleryFallback {
    max-width: 1228px;
    margin: 40px auto 0;
    padding: 0 52px;
    color: #fff;
}

html.is-gallery-modal-open {
    overflow: hidden;
}

@media only screen and (max-width: 767px) {
    .galleryModal.is-open {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .galleryModal__panel {
        display: inline-flex;
        width: calc(100% - 32px);
        min-width: calc(100% - 32px);
        max-width: calc(100% - 32px);
        height: auto;
        max-height: none;
        margin: 16px auto 32px;
        padding: 0;
    }

    .galleryModal__close {
        position: sticky;
        top: 12px;
        margin: 0 0 16px;
        background: rgba(0, 0, 0, 0.82);
    }

    .galleryModal__stage {
        width: var(--stage-w);
        height: var(--stage-h);
        max-width: 100%;
        margin-inline: auto;
    }

    .galleryModal__image {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
    }

    .galleryModal__dot {
        width: 28px;
        height: 44px;
    }

    .galleryModal__info,
    .galleryModal__info.has-comment,
    .galleryModal__info.is-centered {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        justify-content: start;
        justify-items: start;
        text-align: left;
        column-gap: 16px;
        row-gap: 14px;
        align-items: start;
        margin-top: 20px;
    }

    .galleryModal__category {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .galleryModal__field {
        display: contents;
    }

    .galleryModal__field.is-empty,
    .galleryModal__field[hidden] {
        display: none !important;
    }

    /* 未入力の項目だけ見出し・値を消す（display:contents 対策） */
    .galleryModal__field.is-empty .galleryModal__label,
    .galleryModal__field.is-empty > span:last-child,
    .galleryModal__field[hidden] .galleryModal__label,
    .galleryModal__field[hidden] > span:last-child {
        display: none !important;
    }

    .galleryModal__label {
        display: block;
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        font-size: 1.1rem;
        line-height: 1.7;
        letter-spacing: 0.14em;
        color: rgba(255, 255, 255, 0.48);
    }

    .galleryModal__name > span:last-child,
    .galleryModal__size .js-gallery-modal-size,
    .galleryModal__comment .js-gallery-modal-comment {
        min-width: 0;
    }

    .galleryModal__comment {
        line-height: 1.8;
    }

    .galleryFallback {
        padding: 0 5%;
    }

    .gallerySlider__empty {
        padding: 32px 5%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .galleryModal {
        --gallery-duration: 0s;
    }

    .galleryModal__panel,
    .galleryModal__stage,
    .galleryModal__image {
        transition: none;
    }

    .galleryModal__image,
    .galleryModal__image.is-from-next,
    .galleryModal__image.is-from-prev,
    .galleryModal__image.is-active {
        transform: none;
    }
}
