/* Instagram Carousel Styles */
.instagram-carousel-container {
    width: 100%;
    max-width: 1820px; /* 5 * 364px */
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
}

.instagram-carousel {
    width: 100%;
    min-height: 632px; /* 改用 min-height */
    position: relative;
  padding-top: 48px;
}

.instagram-carousel .swiper-wrapper {
    height: auto !important; /* 確保高度自適應 */
  padding-top: 100px;
}

.instagram-carousel .swiper-slide {
    height: auto !important; /* 確保高度自適應 */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 改為 flex-start 避免垂直置中 */
}

.instagram-post {
    width: 364px;
    min-height: 632px; /* 改用 min-height */
    margin: 0 auto;
    position: relative;
    display: block; /* 確保是區塊元素 */
}

/* 確保 Instagram iframe 正確顯示 */
.instagram-post iframe {
    width: 100% !important;
    min-height: 632px !important; /* 確保最小高度 */
    height: auto !important; /* 允許自動調整高度 */
    border: none !important;
    position: relative !important;
    z-index: 2 !important;
    background: transparent !important;
    display: block !important; /* 確保是區塊元素 */
}

/* Swiper 導航按鈕樣式 */
.swiper-button-next,
.swiper-button-prev {
    color: #a98b7c;
    background: none;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    position: absolute; /* 改回 absolute 定位 */
    top: 50%; /* 垂直置中 */
    transform: translateY(-50%); /* 確保完全置中 */
    z-index: 3;
    transition: all 0.2s ease;
}

.swiper-button-prev {
    left: 10px; /* 左側按鈕位置 */
}

.swiper-button-next {
    right: 10px; /* 右側按鈕位置 */
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 24px;
    font-weight: normal;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    color: #7c5c4a;
    transform: translateY(-50%) scale(1.05);
}

/* Swiper 分頁樣式 */
.swiper-pagination {
    position: relative;
    z-index: 3;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #000;
    opacity: 0.3;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* 響應式設計 */
@media screen and (max-width: 1440px) {
    .instagram-carousel-container {
        padding: 20px;
    }
    
    .instagram-post {
        width: 100%;
        max-width: 400px;
        min-height: 600px;
        margin: 0 15px; /* 左右間距 */
    }

    .instagram-post iframe {
        min-height: 600px !important;
    }

    .instagram-media {
        min-height: 600px !important;
    }

    .instagram-carousel {
        padding-top: 50px;
    }
}

@media screen and (max-width: 1024px) {
    .instagram-carousel-container {
        padding: 18px;
    }
    
    .instagram-post {
        width: 100%;
        max-width: 380px;
        min-height: 580px;
        margin: 0 20px; /* 左右間距 */
    }

    .instagram-post iframe {
        min-height: 580px !important;
    }

    .instagram-media {
        min-height: 580px !important;
    }

    .instagram-carousel {
        padding-top: 45px;
    }
}

@media screen and (max-width: 768px) {
    .instagram-carousel-container {
        padding: 15px;
    }
    
    .instagram-post {
        width: 100%;
        max-width: 350px;
        min-height: 520px;
        margin: 0 25px; /* 左右間距 */
    }

    .instagram-post iframe {
        min-height: 520px !important;
    }

    .instagram-media {
        min-height: 520px !important;
    }

    /* 在手機上調整按鈕位置 */
    .swiper-button-prev {
        left: 15px;
    }

    .swiper-button-next {
        right: 15px;
    }

    .instagram-carousel {
        padding-top: 40px;
    }
}

@media screen and (max-width: 480px) {
    .instagram-carousel-container {
        padding: 12px;
    }
    
    .instagram-post {
        width: 100%;
        max-width: 320px;
        min-height: 480px;
        margin: 0 30px; /* 左右間距 */
    }

    .instagram-post iframe {
        min-height: 480px !important;
    }

    .instagram-media {
        min-height: 480px !important;
    }

    .instagram-carousel {
        padding-top: 35px;
    }
}

/* 確保 Instagram 嵌入腳本正確載入 */
.instagram-media {
    min-width: 326px !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    min-height: 632px !important; /* 確保最小高度 */
} 

.instagram-carousel-controls {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 10;
}
.instagram-arrow {
  font-size: 24px;
  color: #a98b7c;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-weight: normal;
  width: auto;
  height: auto;
  justify-content: center;
}
.instagram-arrow:hover {
  color: #7c5c4a;
  transform: scale(1.05);
}
.instagram-pagination {
  font-size: 16px;
  color: #a98b7c;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 1px;
}
