div.snaf-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 15px;
    padding: 4px 2px 10px;
    gap: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* スクロールバーのスタイリング（WebKit系） */
div.snaf-carousel::-webkit-scrollbar {
    height: 5px;
}
div.snaf-carousel::-webkit-scrollbar-track {
    background: transparent;
}
div.snaf-carousel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* カルーセル内アイテム（PC時: 幅140px固定、正方形） */
.snaf-carousel > a,
.snaf-carousel > img {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.snaf-carousel > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.snaf-carousel > a img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 画像の縦横比率を保持 */
    display: block;
}

.snaf-carousel > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* スマホ表示（767px以下）: 画面内に2.2〜2.5枚が見えるサイズに最適化 */
@media (max-width: 767px) {
    div.snaf-carousel {
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .snaf-carousel > a,
    .snaf-carousel > img {
        /* スマホ画面で2枚＋次の画像が覗く幅（2.3枚分） */
        flex: 0 0 calc((100% - 16px) / 2.3);
        width: calc((100% - 16px) / 2.3);
        height: auto;
        aspect-ratio: 1 / 1;
        padding: 5px;
        border-radius: 6px;
    }
}

/* カルーセルから開いたライトボックスのキャプション（タイトル）を非表示 */
body.snaf-mfp-no-title .mfp-title,
.mfp-snaf-carousel .mfp-title {
    display: none !important;
}

/* 空のキャプションを非表示にする防御策 */
.mfp-title:empty {
    display: none !important;
}