/* ===================================
   Part: Section - Instagram
   ================================== */
.instagram {
    padding: var(--space-lg) 0;
    background: #fff;
    position: relative;
    overflow: hidden;
}

@media (min-width: 900px) {
    .instagram {
        min-height: 70vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Background Decoration (Optional) */
.instagram::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(235, 68, 90, 0.05) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.instagram-header {
    margin-bottom: var(--space-md);
    text-align: center;
}

.instagram-title-logo {
    font-family: var(--font-fancy);
    /* Pinyon Script or similar */
    font-size: 3rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.instagram-scroll-wrapper {
    width: 100%;
    /* height: 300px; */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 1.5rem;
    /* 下に余白を追加して影が見えるように */
    /* Scroll snap for clean stopping */
    scroll-snap-type: x mandatory;
    scroll-padding: 0rem;

    /* Hide scrollbar for cleaner look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.instagram-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.instagram-grid {
    display: flex;
    gap: 1.5rem;
    /* アイテム間の間隔を広げる */
    width: max-content;
    margin: 0 auto;
    padding: 0 1rem;
}

.instagram-grid>* {
    scroll-snap-align: center;
}

/* Wrapper for Instagram Item to control layout */
.instagram-item {
    width: 326px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    /* テーマカラー：ターコイズブルー */
    background: var(--color-primary);
    border-radius: 12px;
    padding: 2px;
    padding-top: 16px;
    /* 枠を小さく */
    box-shadow:
        6px 12px 16px rgba(0, 0, 0, 0.5);
    /* 右下に影 */
    transition: all 0.3s ease;
}

.instagram-item:hover {
    /* ホバーアニメーションはなし */
}

/* Specific style for Instagram Embeds to maintain size */
.instagram-grid .instagram-media {
    min-width: 200px !important;
    max-width: 290px !important;
    margin: 0 auto !important;
    /* 左右中央に配置 */
    /* height: auto !important; */
    max-height: 485px !important;
    min-height: 350px !important;
    overflow: visible !important;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media screen and (min-width: 768px) {
    .instagram-item {
        /* 
           ここがデスクトップ（PC）での「1つの投稿の幅」です。
           300px 〜 350px くらいの間で調整するのがおすすめです。
        */
        width: 326px;
        margin: 0;
    }
}





/* Button Container */
.instagram-cta {
    margin-top: 3rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.btn-instagram {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-instagram:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 39, 67, 0.3);
}

/* Responsive */
@media (max-width: 900px) {
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Hide the 4th item on tablet if needed, or show all */
}

@media (max-width: 600px) {
    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .instagram-title-logo {
        font-size: 2.5rem;
    }
}

/* Pagination Dots */
.instagram-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

/* PCでは横に全部表示されるのでpagination不要 */
@media screen and (min-width: 768px) {
    .instagram-pagination {
        display: none;
    }
}

/* Navigation Arrows */
.instagram-nav {
    display: none;
    /* モバイルでは非表示 */
}

@media screen and (min-width: 768px) {
    .instagram-nav {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 20;
    }

    .instagram-nav-btn {
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        font-size: 1.2rem;
        color: var(--color-dark);
    }

    .instagram-nav-btn:hover {
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        transform: scale(1.1);
    }

    .instagram-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none;
    }

    .instagram-nav.prev {
        left: 0.5rem;
    }

    .instagram-nav.next {
        right: 0.5rem;
    }
}

.instagram-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #aaa;
    /* 濃いグレー */
    cursor: pointer;
    transition: all 0.3s ease;
}

.instagram-dot:hover {
    background: var(--color-gray);
}

.instagram-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

/* Instagram Follow CTA */
.instagram-follow {
    text-align: center;
    padding: 1.5rem 0;
}

.instagram-follow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-light);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    transition: all 0.3s ease;
}

.instagram-follow-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.4);
}

.instagram-follow-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* ▼▼▼ 切り抜き（クロップ）の調整エリア ▼▼▼ */
/* Crop the Instagram embed to hide the footer */
.instagram-img-crop {
    width: 100%;
    /* 
       固定の高さで切り抜きます。
       数値を大きくすると縦長、小さくするとコンパクトになります。
    */
    /* height: 100%; */
    overflow: hidden;
    /* 枠からはみ出た部分（フッター等）を非表示にする */
    border-radius: 4px;
    position: relative;
    z-index: 0;
}

/* Ensure the iframe fills the crop area */
.instagram-img-crop iframe {
    /* 
       iframeを大きくして、はみ出た部分をクロップで隠します。
       heightを大きくすると下部（いいね等）が見えなくなります。
    */
    /* height: 30px !important; */

    /* 
       画像を上下中央に合わせるための調整です。
       画像の位置がズレている場合はここを調整してください (-10% や -20% など)
    */
    /* margin-top: -100% !important; */
}

/* ▲▲▲ 調整エリアここまで ▲▲▲ */

/* Custom Caption from CMS - 白抜きおしゃれデザイン */
.instagram-custom-caption {
    font-family: var(--font-base);
    font-size: 0.85rem;
    color: #fff;
    margin: 0rem 0 0;
    padding: 0.5rem;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.02em;
}