/**
 * Photo Block - Default Pattern CSS
 */

/* ==========================================================================
   フォトブロック基本スタイル
   ========================================================================== */

.photo-block--default {
    margin: 2rem 0;
}

/* ==========================================================================
   タブナビゲーション
   ========================================================================== */

.photo-block__tabs-wrap {
    position: relative;
    margin-bottom: 1.5rem;
}

.photo-block__scroll-hint {
    display: none;
}

.photo-block__tabs {
    display: flex;
    width: 100%;
}

.photo-block__tab {
    flex: 1 1 0;
    padding: 0.6rem 1.5rem;
    border: none;
    background: #e8e8e8;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-align: center;
}

.photo-block__tab:first-child {
    border-radius: 4px 0 0 4px;
}

.photo-block__tab:last-child {
    border-radius: 0 4px 4px 0;
}

.photo-block__tab:hover {
    background: #d8d8d8;
    color: #333;
}

.photo-block__tab.is-active {
    background: #333;
    color: #fff;
    border-bottom-color: var(--ark-color--main);
}

/* ==========================================================================
   タブパネル
   ========================================================================== */

.photo-block__panel {
    display: none;
}

.photo-block__panel.is-active {
    display: block;
    animation: photoFadeIn 0.3s ease;
}

@keyframes photoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   グリッドレイアウト
   ========================================================================== */

.photo-block-grid {
    display: grid;
    gap: 6px;
}

/* PC カラム */
.photo-block-grid--pc-2 { grid-template-columns: repeat(2, 1fr); }
.photo-block-grid--pc-3 { grid-template-columns: repeat(3, 1fr); }
.photo-block-grid--pc-4 { grid-template-columns: repeat(4, 1fr); }
.photo-block-grid--pc-5 { grid-template-columns: repeat(5, 1fr); }
.photo-block-grid--pc-6 { grid-template-columns: repeat(6, 1fr); }

/* ==========================================================================
   画像アイテム
   ========================================================================== */

.photo-block__item {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
}

.photo-block__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.photo-block__item:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   動画サムネイル
   ========================================================================== */

.photo-block__video-thumb {
    width: 100%;
    height: 100%;
    position: relative;
}

.photo-block__video-thumb img,
.photo-block__video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.photo-block__play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    pointer-events: none;
    transition: background 0.3s ease;
}

.photo-block__item:hover .photo-block__play-icon {
    background: rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   空状態
   ========================================================================== */

.photo-block__empty {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   レスポンシブ - タブレット
   ========================================================================== */

@media not all and (min-width: 1000px) {
    .photo-block-grid--tb-2 { grid-template-columns: repeat(2, 1fr); }
    .photo-block-grid--tb-3 { grid-template-columns: repeat(3, 1fr); }
    .photo-block-grid--tb-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   レスポンシブ - スマホ
   ========================================================================== */

@media not all and (min-width: 768px) {
    .photo-block-grid--sp-1 { grid-template-columns: repeat(1, 1fr); }
    .photo-block-grid--sp-2 { grid-template-columns: repeat(2, 1fr); }
    .photo-block-grid--sp-3 { grid-template-columns: repeat(3, 1fr); }

    .photo-block__tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .photo-block__tabs::-webkit-scrollbar {
        display: none;
    }

    .photo-block__tab {
        flex: 1 0 auto;
        min-width: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* スクロールヒント（タブ右上に配置） */
    .photo-block__tabs-wrap.is-scrollable .photo-block__scroll-hint {
        display: block;
        text-align: right;
        font-size: 0.7rem;
        color: #999;
        margin-bottom: 4px;
        transition: opacity 0.3s ease;
    }

    /* 右端フェード */
    .photo-block__tabs-wrap.is-scrollable::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40px;
        height: calc(100% - 1.2em);
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* スクロール済みで非表示（高さ維持のためopacityで消す） */
    .photo-block__tabs-wrap.is-scrolled .photo-block__scroll-hint {
        opacity: 0;
    }

    .photo-block__tabs-wrap.is-scrolled::after {
        opacity: 0;
    }

    .photo-block-grid {
        gap: 4px;
    }
}

@keyframes photoScrollHintFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
