@charset "utf-8";

/* ==========================================================
   モザイクギャラリー — CSS Grid（幅一定セル＋ランダム span）
   正方形中心のソース画像を、幅一定のグリッドセル（auto-fill）に
   object-fit:cover で流し込み、一部を wide/tall/big にしてモザイク感を出す。
   セル幅は画面幅に依らず一定（横長になり過ぎない）。列数は自動調整。
   wide/tall/big の割り当ては mosaic-gallery.js がシード付き乱数で行う（反復感を消す）。
   ライトボックスは共通の dtp-lightbox に一本化済み。
   ========================================================== */

.mosaic-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 4px;
    width: 100%;
}

.mosaic-gallery__item {
    overflow: hidden;
    position: relative;
    background: #111;
}

.mosaic-gallery__item.mg-wide  { grid-column: span 2; }
.mosaic-gallery__item.mg-tall  { grid-row: span 2; }
.mosaic-gallery__item.mg-tall3 { grid-row: span 3; }
.mosaic-gallery__item.mg-big   { grid-column: span 2; grid-row: span 2; }

/* --- 画像のフィル --- */
.mosaic-gallery__link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.mosaic-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, opacity 0.4s ease;
}

.mosaic-gallery__item:hover img {
    transform: scale(1.06);
    opacity: 0.9;
}

/* --- キャプション --- */
.mosaic-gallery__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: #fff;
    font-size: 12rem;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mosaic-gallery__item:hover .mosaic-gallery__caption { opacity: 1; }

/* ==========================================================
   スマホ (767px以下)
   ========================================================== */
@media screen and (max-width: 767px) {
    .mosaic-gallery {
        grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
        grid-auto-rows: 115px;
        gap: 3px;
    }
}
