/**
 * Feature Gallery Hover Video - Styles
 */

.feature-gallery-container {
    width: 100%;
    padding-top: 100px;
    padding-bottom: 100px;
    margin: 0;
    background: #ffffff;
}

.feature-gallery-section {
    margin-bottom: 80px;
}

.feature-gallery-section:last-child {
    margin-bottom: 0;
}

.feature-gallery-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 40px;
    color: #000;
    text-transform: capitalize;
}

/* グリッドレイアウト - 4列固定、最終行は中央揃え */
.feature-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

/* カラム数指定がある場合 */
.feature-gallery-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.feature-gallery-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.feature-gallery-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* ギャラリーアイテム - 16:9固定、4列レイアウト */
.feature-gallery-item {
    position: relative;
    width: calc((100% - 60px) / 4); /* 4列、gap 20px考慮 */
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* サムネイルと動画 */
.gallery-thumbnail,
.gallery-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail {
    opacity: 1;
    z-index: 1;
}

.gallery-video {
    opacity: 0;
    z-index: 2;
}

/* オーバーレイ（タイトル表示） */
.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-item-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ローディング状態 */
.gallery-video:not([src]) {
    background: #1a1a1a;
}

/* レスポンシブデザイン */
@media (max-width: 1200px) {
    .feature-gallery-title {
        font-size: 2rem;
    }

    .feature-gallery-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .feature-gallery-container {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .feature-gallery-section {
        margin-bottom: 60px;
    }

    .feature-gallery-title {
        font-size: 1.75rem;
        margin-bottom: 30px;
    }

    .feature-gallery-grid {
        gap: 15px;
    }

    .feature-gallery-item {
        width: calc((100% - 15px) / 2); /* 2列、gap 15px考慮 */
    }

    .gallery-item-overlay {
        padding: 12px;
    }

    .gallery-item-title {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .feature-gallery-title {
        font-size: 1.5rem;
    }

    .feature-gallery-item {
        width: calc((100% - 15px) / 2); /* スマホも2列維持 */
    }
}

/* 背景は常に白 */
.feature-gallery-container {
    background: #ffffff;
}

/* アニメーション効果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-gallery-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.feature-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.feature-gallery-item:nth-child(2) { animation-delay: 0.2s; }
.feature-gallery-item:nth-child(3) { animation-delay: 0.3s; }
.feature-gallery-item:nth-child(4) { animation-delay: 0.4s; }
.feature-gallery-item:nth-child(5) { animation-delay: 0.5s; }
.feature-gallery-item:nth-child(6) { animation-delay: 0.6s; }
