@charset "utf-8";

/* ===========================
main
=========================== */
.section--gallery-works {
    padding: 0 5.3%;
}

.galleryBtn {
    margin-top: 64px;
}

.galleryBtn__list {
    display: flex;
    gap: 8px;
}

.galleryBtn__item {
    color: var(--primary-blue);
    font-family: Outfit;
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1;
    border-radius: 49px;
    border: 1px solid var(--primary-blue);
    display: flex;
    padding: 9px 19px;
    justify-content: center;
    align-items: center;
}

.galleryBtn__select {
    color: var(--primary-white);
    background-color: var(--primary-blue);
}

/* ====== grid base ====== */
.gallery-works__list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* SP: 2カラム */
    column-gap: 15px; /* 横の余白 */
    row-gap: 48px;    /* ← liとliの縦の余白を48pxに設定 */
    margin: 32px auto 0;
}

/* 各カード：縦積み */
.gallery-works__item {
    display: flex;
    flex-direction: column;
    gap: 8px; 
    align-items: flex-start;
}

/* サムネイル（正方形・中身は全体を収める） */
.gallery img{
    /* 可変化しやすいように変数で管理 */
    /* --thumb-size: 160px;                 
    width: var(--thumb-size);
    height: var(--thumb-size); */
    /* width: clamp(160px, 42.7vw, 279px); */
    width: 100%;
    aspect-ratio: 1 / 1;                 /* 念のため明示 */
    object-fit: contain;                  /* 画像全体を収める（トリミングしない） */
    display: block;
    background-color: var(--bg-blue-light); /* 正方形の背景色（任意で上書き） */
}

.gallery-works__name {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    padding: 8px 16px;
    justify-content: center;
    align-items: center;
    border-radius: 3px;
    background: var(--bg-blue-soft);
}

.gallery-works__title {
    font-size: 1.3rem;
    line-height: 1.6; 
}

/* modal */
/*全て共通：hideエリアをはじめは非表示*/
.hide-area{
	display: none;
}

/* Modaal 閉じるボタンのデザイン調整 */
.modaal-close {
    background: none !important;   /* hover時の●（背景丸）を無効化 */
    box-shadow: none !important;
    width: 40px;                   /* ✕の全体ボタンサイズ（調整可） */
    height: 40px;
}

/* ✕の線（疑似要素） */
.modaal-close:before,
.modaal-close:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;                   /* ✕の線の長さ（お好みで） */
    height: 1px;                   /* 線の太さ */
    background-color: var(--bg-base);
    border-radius: 0;
    transform-origin: center;
}

/* ✕を45°・-45°で交差させる */
.modaal-close:before {
    transform: translate(-50%, -50%) rotate(45deg);
}
.modaal-close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* hover時の色変更 */
.modaal-close:hover:before,
.modaal-close:hover:after {
    background-color: rgba(254, 254, 254, 0.5);
}


.modaal-overlay {
    z-index: 10000 !important;
}

.modaal-wrapper {
    z-index: 10001 !important;
}

/* 画像モーダル内の画像サイズを制限 */
.modaal-image .modaal-content img {
    max-width: 100%;
    max-height: 72vh;  /* 画面の高さの90%まで */
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.gallery:focus,
.gallery:focus-visible {
    outline: none;
}

/* modal hover */
.gallery-works__item .gallery{
    display: block;
    transition: all .3s ease-in-out;
}
.gallery-works__item img{
    width: 100%;
    vertical-align: middle;
}
.gallery-works__item .gallery:hover{
    opacity: .7;
}

/* Modaalの次へ／前へボタンを非表示 */
.modaal-gallery-next,
.modaal-gallery-prev {
    display: none !important;
}
/* 〆modal */

/* main tb */
@media screen and (min-width: 768px){
    .section--gallery-works {
        padding: 0 7.3%;
    }

    .gallery-works__list {
    column-gap: 22px; /* 横の余白 */
    row-gap: 76px;    /* ← liとliの縦の余白を48pxに設定 */
}

    .gallery-works__list {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-works__item > img {
        max-width: 370px;;
    }

    .galleryBtn__item {
        font-size: 1.4rem;
    }

    .gallery-works__item {
        gap: 4px;
    }

    .gallery-works__name {
        margin-top: 4px;
        font-size: 1.4rem;
    }

    .gallery-works__title {
        font-size: 1.4rem;
        line-height: 1.5; 
    }

    .copy {
        padding-top: 108px;
    }

    .galleryBtn {
        padding-bottom: 8px;
    }
}
/* ↓もともとmin-width: 834px */
@media screen and (min-width: 900px){
    .gallery-works__list {
        margin-top: 74px;
        column-gap: 28px; /* 横の余白 */
        row-gap: 83px;    /* ← liとliの縦の余白を48pxに設定 */
    }

    .gallery-works__top {
        display: flex;
        justify-content: space-between;
        align-items: end;
    }

    .galleryBtn {
        padding-bottom: 13px;
    }

}

/* @media screen and (min-width: 1024px){
    .gallery-works__list {
        grid-template-columns: repeat(4, 1fr);
    }
} */

/* main pc */
@media screen and (min-width: 1440px){
    .gallery-works__list {
        grid-template-columns: repeat(4, 1fr);
    }

    .article {
        padding: 0 8.3%;
    }

    .section--gallery-works {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0;
    }

    .gallery-works__list {
        margin-top: 83px;
        row-gap: 92px;    /* ← liとliの縦の余白を48pxに設定 */
    }
}