/*
 * Yumi Instagram Feed — フロントエンドスタイル
 * テーマのカラー変数（--lav, --wis 等）を引き継ぐ設計
 */

.yif-feed {
    display: grid;
    grid-template-columns: repeat( var(--yif-cols, 3), 1fr );
    gap: 4px;
    width: 100%;
}

/* ── 各セル ── */
.yif-item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #e4dff0; /* フォールバック背景（ラベンダーライン） */
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
}

.yif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* ── ホバー時：画像を拡大 + オーバーレイ表示 ── */
.yif-item:hover img,
.yif-item:focus img {
    transform: scale(1.04);
}

.yif-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(92, 74, 122, 0); /* --wis ベース */
    transition: background 0.3s ease;
    pointer-events: none;
}

.yif-item:hover::after,
.yif-item:focus::after {
    background: rgba(92, 74, 122, 0.35);
}

/* ── キャプション（ホバー時に表示） ── */
.yif-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 10px;
    font-size: 11px;
    line-height: 1.5;
    color: #fff;
    background: linear-gradient(to top, rgba(40, 28, 60, 0.85) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.yif-item:hover .yif-caption,
.yif-item:focus .yif-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ── 動画アイコン ── */
.yif-video-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.85);
    color: #5c4a7a;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    pointer-events: none;
}

/* ── レスポンシブ ── */
@media (max-width: 768px) {
    .yif-feed {
        --yif-cols: 2;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .yif-feed {
        --yif-cols: 2;
        gap: 2px;
    }

    .yif-caption {
        display: none; /* SP では非表示（タップ操作と干渉するため） */
    }
}
