/* 
 * LeoPalace Resort Guam - Gallery Page Stylesheet
 */

/* ----------------------------------------
   Hero Section for Gallery
---------------------------------------- */
.gallery-page .mv {
    background-image: url('/gallery/img/gallery-hero1.jpg');
    background-size: cover;
    background-position: center;
    min-height: 500px;
}


/* ----------------------------------------
   Gallery Section
---------------------------------------- */
.gallery-section {
    padding: 80px 0;
}

.gallery-inner {
    width: 80%;
    max-width: 1240px;
    margin: 0 auto;
}

.gallery-intro {
    width: 70%;
    margin: 0 auto 40px;
    text-align: center;
    line-height: 1.6;
}

/* ----------------------------------------
   Gallery Filter
---------------------------------------- */
.gallery-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: #f5f5f5;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: 200;
    letter-spacing: 1.8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.filter-btn:hover {
    background-color: #e8e8e8;
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* ----------------------------------------
   Gallery Grid
---------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    aspect-ratio: 4/3; /* Fixed aspect ratio for all gallery items */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    padding: 20px 15px;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: var(--color-white);
    font-size: var(--font-size-sm);
    font-weight: 400;
    text-align: center;
}

/* Show animation when filtering */
.gallery-item {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hide items when filtering */
.gallery-item.hide {
    display: none;
}

/* Lightbox2 overrides */
.lightbox .lb-image {
    border-radius: 5px;
    border: none;
}

.lb-data .lb-caption {
    font-size: 16px;
    font-weight: 400;
    color: #fff;
}

.lb-data .lb-number {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.5;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    opacity: 1;
}

/* ----------------------------------------
   Responsive Styles
---------------------------------------- */
@media screen and (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-intro {
        width: 90%;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 80%;
        text-align: center;
    }
    
    .gallery-section {
        padding: 40px 0;
    }
}

/* ───────── Lightbox2 モーダルを縦横中央に ───────── */
.lightbox, /* モーダル本体 */ 
#lightbox { /* ID セレクタも念のため */
  position: fixed !important;   /* ビューポートに固定 */
  top: 50%    !important;  
  left: 50%   !important;
  transform: translate(-50%, -50%) !important; /* 真ん中寄せ */
  margin: 0    !important;  
}

/* オーバーレイもスクロールに追随させる場合 */
.lightboxOverlay, /* class */ 
#lightboxOverlay { /* ID */
  position: fixed !important;
  top: 0    !important;
  left: 0   !important;
}

/* ─── スマホビュー時のみ適用 ─── */
@media (max-width: 768px) {
  /* ギャラリー全体を包む要素にクラスを付けておく */
  .gallery-container {
    height: 60vh;          /* ビューポートの高さの60%に固定 */
    max-height: 400px;     /* 必要に応じて上限をpxで指定 */
    overflow-y: auto;      /* 縦スクロールを許可 */
    -webkit-overflow-scrolling: touch; /* 滑らかな慣性スクロール */
  }
  
  /* 余白や見た目が気になる場合 */
  .gallery-container::-webkit-scrollbar {
    display: none; /* スクロールバー非表示 */
  }
}



/* コンテナをrelativeにしないと絶対配置が効かない */
.gallery-container {
  position: relative; /* 必須：子要素の絶対配置の基準点になる */
}

/* 縦スクロールヒント（丸に矢印デザイン） */
.scroll-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;  /* 丸の大きさ */
  height: 60px; /* 丸の大きさ */
  background-color: rgba(145, 138, 122, 0.8); /* 灰色の背景 */
  border-radius: 50%; /* 完全な円形 */
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: 1;
  transition: opacity 0.5s;
}

/* テキストを非表示にする */
.scroll-hint span:not(.arrow) {
  display: none;
}

/* 矢印のスタイル */
.scroll-hint .arrow {
  color: white;
  font-size: 24px;
  font-weight: bold;
  animation: bounceArrowVertical 1.5s infinite;
}

.lb-outerContainer {
    border-radius: 8px;
}

/* 矢印のアニメーション */
@keyframes bounceArrowVertical {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(5px);
  }
  60% {
    transform: translateY(3px);
  }
}

/* スクロール検知後にヒントを消すためのクラス */
.gallery-container.scrolled .scroll-hint {
  opacity: 0;
}

@media (min-width: 769px) {
  /* モーダル本体を固定サイズに */
  .lightbox .lb-outerContainer {
    width: 561px !important;
    height: 363px !important;
  }
  /* 内側コンテナを外側にフィットさせる */
  .lightbox .lb-container {
    width: 100% !important;
    height: 100% !important;
  }
  /* 画像を枠いっぱいに表示or余白ありで表示 */
  .lightbox .lb-image {
    width: 100% !important;
    height: 100% !important;
  }
}


/* ----------------------------------------
   Responsive Styles
---------------------------------------- */

/* YouTube動画タブセクションのスタイル */
.video-tabs-section {
    margin: 40px 0;
    padding: 0;
}

.video-tabs-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.video-tabs-header {
    margin-bottom: 30px;
}

.video-tabs-header h3 {
    color: var(--color-primary, #918A7A);
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: 3.6px;
    margin-bottom: 16px;
}

.video-tabs-description {
    color: var(--color-text, #000);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 2.4px;
    text-align: center;
    width: 70%;
    margin: 0 auto;
}

/* タブナビゲーション */
.video-tab-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.video-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    margin: 0 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1.8px;
    color: var(--color-text-light, #666);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.video-tab-btn:hover {
    color: var(--color-primary, #918A7A);
}

.video-tab-btn.active {
    color: var(--color-primary, #918A7A);
    border-bottom-color: var(--color-primary, #918A7A);
    font-weight: 600;
}

/* 動画コンテナ */
.video-content-container {
    position: relative;
    width: 50%;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.video-tab-content {
    display: none;
    padding: 0;
    animation: fadeIn 0.5s ease-in-out;
}

.video-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* YouTube iframe レスポンシブ設定 */
.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 アスペクト比 */
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 動画情報エリア */
.video-info {
    padding: 20px 30px;
    background: white;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary, #918A7A);
    margin-bottom: 8px;
    letter-spacing: 1.8px;
}

.video-description {
    font-size: 14px;
    color: var(--color-text-light, #666);
    line-height: 1.5;
    letter-spacing: 1.2px;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .video-content-container {
        width: 100%;
    }
    .video-tabs-container {
        padding: 0 0;
    }

    .video-tabs-description {
        width: 90%;
        font-size: 14px;
    }

    .video-tab-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .video-tab-btn {
        padding: 10px 16px;
        font-size: 12px;
        margin: 4px;
    }

    .video-info {
        padding: 15px 20px;
    }

    .video-title {
        font-size: 16px;
    }

    .video-description {
        font-size: 13px;
    }
    .video-tab-btn {
        padding: 8px 16px;
        background-color: #f5f5f5;
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius);
        color: var(--color-text);
        font-size: var(--font-size-sm);
        font-weight: 200;
        letter-spacing: 1.8px;
        cursor: pointer;
        transition: all var(--transition-speed) ease;
    }
    .video-tab-nav {
        border-bottom: none;
    }
    .video-tab-btn.active {
        background-color: var(--color-primary);
        color: var(--color-white);
        border-color: var(--color-primary);
    }
}

@media screen and (max-width: 480px) {
    .video-tab-nav {
        flex-direction: column;
        align-items: center;
    }

    .video-tab-btn {
        width: 80%;
        text-align: center;
        margin: 2px 0;
    }

    .video-tabs-header h3 {
        font-size: 20px;
    }
}