/* ================================
   ギャラリーページ専用スタイル
   作成場所: css/gallery-page.css
================================ */

/* ローディングプレースホルダー */
.card-image {
    background: linear-gradient(45deg, 
        rgba(14, 95, 216, 0.1) 0%, 
        rgba(14, 95, 216, 0.05) 50%, 
        rgba(14, 95, 216, 0.1) 100%);
    position: relative;
}

.card-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(14, 95, 216, 0.2);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-image.loading::before {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 画像のフェードイン効果 */
.card-image img {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.card-image img.loaded {
    opacity: 1;
}

/* ================================
   ページヒーロー
================================ */
.page-hero {
    position: relative;
    height: 400px;
    margin-top: 80px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)),
        url('../images/gallery-hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

.page-hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.8) 0%, transparent 100%);
}

.page-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.page-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--white);
    margin: 0 0 1rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(14, 95, 216, 0.8);
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--gradient-blue);
    box-shadow: 0 0 20px rgba(14, 95, 216, 0.6);
}

.page-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

/* パンくずリスト */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-blue);
}

.separator {
    color: rgba(255, 255, 255, 0.4);
}

.current {
    color: var(--primary-blue);
    font-weight: 500;
}

/* ================================
   ギャラリーメインセクション
================================ */
.gallery-main {
    background: linear-gradient(to bottom, #0a0a0a 0%, #000000 100%);
    padding: clamp(3rem, 8vw, 5rem) 0;
    min-height: 100vh;
}

/* フィルターセクション */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.8rem 1.5rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 30px;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-blue);
    transition: left 0.3s ease;
    z-index: -1;
}

.filter-tab:hover,
.filter-tab.active {
    color: var(--white);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(14, 95, 216, 0.3);
}

.filter-tab:hover::before,
.filter-tab.active::before {
    left: 0;
}

.tab-icon {
    font-size: 1.2rem;
}

.count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* ビューオプション */
.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

/* ================================
   ギャラリーコンテナ
================================ */
.gallery-container {
    margin-bottom: 4rem;
}

/* グリッドビュー */
.gallery-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* リストビュー */
.gallery-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gallery-container.list-view .gallery-card {
    display: flex;
    flex-direction: row;
    max-width: none;
}

.gallery-container.list-view .card-image {
    width: 300px;
    flex-shrink: 0;
}

.gallery-container.list-view .card-info {
    flex: 1;
    padding: 2rem;
}

/* ギャラリーアイテムの情報部分 */
.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: var(--white);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.gallery-info .date {
    color: var(--primary-blue);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.gallery-info .description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* カテゴリータグの位置調整 */
.gallery-overlay .category-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-blue);
    color: var(--white);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ズームボタンの位置調整 */
.gallery-overlay .zoom-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-overlay .zoom-btn:hover {
    background: var(--primary-blue);
    transform: scale(1.1);
}

/* ================================
   ページネーション
================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-btn,
.page-num {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    border-radius: 5px;
}

.page-btn:hover:not(:disabled),
.page-num:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(14, 95, 216, 0.3);
}

.page-num.active {
    background: var(--gradient-blue);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(14, 95, 216, 0.4);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ================================
   ライトボックス
================================ */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-container {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    padding: 2rem;
    color: var(--white);
    text-align: center;
    border-radius: 0 0 10px 10px;
}

.lightbox-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.lightbox-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

/* ライトボックスボタン */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    border-radius: 50%;
    z-index: 10;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: scale(1.1) translateY(-50%);
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
}

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

.gallery-card {
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
}

.gallery-card:nth-child(1) { animation-delay: 0.1s; }
.gallery-card:nth-child(2) { animation-delay: 0.2s; }
.gallery-card:nth-child(3) { animation-delay: 0.3s; }
.gallery-card:nth-child(4) { animation-delay: 0.4s; }
.gallery-card:nth-child(5) { animation-delay: 0.5s; }
.gallery-card:nth-child(6) { animation-delay: 0.6s; }
.gallery-card:nth-child(7) { animation-delay: 0.7s; }
.gallery-card:nth-child(8) { animation-delay: 0.8s; }
.gallery-card:nth-child(9) { animation-delay: 0.9s; }
.gallery-card:nth-child(10) { animation-delay: 1s; }
.gallery-card:nth-child(11) { animation-delay: 1.1s; }
.gallery-card:nth-child(12) { animation-delay: 1.2s; }

/* ================================
   レスポンシブデザイン
================================ */
@media (max-width: 1200px) {
    .gallery-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .gallery-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .page-hero {
        height: 300px;
        margin-top: 60px;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-tabs {
        order: 2;
        justify-content: center;
    }
    
    .view-options {
        order: 1;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .gallery-container.grid-view {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-container.list-view .gallery-card {
        flex-direction: column;
    }
    
    .gallery-container.list-view .card-image {
        width: 100%;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 3rem;
        letter-spacing: 2px;
    }
    
    .filter-tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .tab-icon {
        display: none;
    }
    
    .gallery-card {
        border-radius: 8px;
    }
    
    .card-info {
        padding: 1rem;
    }
    
    .card-info h3 {
        font-size: 1.1rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .page-btn,
    .page-num {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}