﻿@charset "UTF-8";
/* エリア確保 */
.insta-widget-container {
  overflow:hidden;
  width:100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

/* インスタウィジェット全体のグリッド配置 */
.insta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列 */
    gap: clamp(12px, 4.68px + 1.7vw, 20px); /* 画像同士のすき間 */
}

/* 各投稿アイテムの箱 */
.insta-item {
    display: block;
    aspect-ratio: 1 / 1; /* 必ず正方形を維持 */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #f0f0f0;
}

/* 縮小画像 */
.insta-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* 更新アニメーション */
.insta-widget-container {
    transition: opacity 0.3s ease;
}
.insta-widget-container.insta-fade-out {
    opacity: 0;
}

/* ===================================================
   🎥 動画（VIDEO）の場合の再生マーク（Base64完全互換版）
   =================================================== */
.insta-item.is-video::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    z-index: 2;
    transition: opacity 0.2s ease;
    
    /* Base64コードに変換 */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZmZmZiI+PHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE0LjV2LTlsNiA0LjUtNiA0LjV6Ii8+PC9zdmc+");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
    /* 白い写真の上でもクッキリ見せるためのドロップシャドウ */
    filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.4));
}


/* ===================================================
   💬 キャプションのマスク層（スマホ・PC共通の基本設定）
   =================================================== */
.insta-caption {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    padding: 23px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 初期状態は「非表示」ではなく「完全に消去」が必要 */
    display: none; 
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 4;
}

/* 📝 テキスト自体のスタイル */
.caption-text {
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.03em;
    word-break: break-all;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}


/* ===================================================
   💻 PC（マウスホバーができる端末）だけの限定演出
   =================================================== */
@media (hover: hover) and (pointer: fine) {
    /* PCの時だけ、キャプション用の要素を構造として表示させる */
    .insta-caption {
        display: flex; 
    }
    
    /* マウスが乗ったらふわっと出す */
    .insta-item:hover .insta-caption {
        opacity: 1;
    }
    
    /* マウスが乗ったら画像を少し大きくする */
    .insta-item:hover img {
        transform: scale(1.03);
    }
    
    /* マウスが乗ったら動画マークを薄くする */
    .insta-item:hover.is-video::after {
        opacity: 0.6;
    }
    /* 干渉対策 */
    .insta-item:hover {
        opacity: unset;
    }

}

/* エラー・空文字のスタイル */
.insta-error, .insta-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #888888;
    font-size: 14px;
}
