/**
 * Showcase Section Styles
 * 所属クリエイターの実績を絵画ギャラリー風に無限スクロールで表示
 */

/* ========================================
   SHOWCASEセクション（PC版）
   ======================================== */

@media (min-width: 768px) {
    #showcase {
        min-height: 100vh;
        padding: 80px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }
}

.showcase-layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ========================================
   無限スクロール カルーセル
   ======================================== */

.showcase-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    /* 左右端のフェードアウトマスク */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        black 100px,
        black calc(100% - 100px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        black 100px,
        black calc(100% - 100px),
        transparent 100%
    );
}

.showcase-carousel-track {
    display: flex;
    align-items: center;
    gap: 48px;
    width: max-content;
    animation: showcase-scroll linear infinite;
    animation-duration: 40s;
    padding: 20px 0;
}

@keyframes showcase-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ========================================
   絵画スタイルのアイテム
   ======================================== */

.showcase-item {
    flex-shrink: 0;
    max-width: 540px; /* 500px + padding 20px*2 */
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.showcase-item:hover {
    transform: translateY(-8px);
}

/* 絵画フレーム（アスペクト比はインラインで指定） */
.showcase-item-frame {
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    padding: 20px;
    background: rgba(180, 220, 240, 0.06);
    border: 1px solid rgba(180, 220, 240, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(200, 230, 255, 0.12);
    transition: box-shadow 0.3s ease, background 0.3s ease;
    display: inline-block;
}

.showcase-item:hover .showcase-item-frame {
    background: rgba(180, 220, 240, 0.1);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(200, 230, 255, 0.2);
}

/* フレーム内の画像ラッパー */
.showcase-item-image-inner {
    border-radius: 2px;
    overflow: hidden;
    line-height: 0;
}

/* 絵画画像 */
.showcase-item-image {
    max-width: 500px;
    max-height: 500px;
    width: auto;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.showcase-item:hover .showcase-item-image {
    transform: scale(1.03);
}

/* キャプション（下の説明パネル） */
.showcase-item-caption {
    width: 85%;
    margin: 0 auto;
    margin-top: 16px;
    padding: 14px 20px;
    background: rgba(27, 23, 32, 0.85);
    border: 1px solid rgba(247, 249, 251, 0.1);
    border-radius: 6px;
    backdrop-filter: blur(4px);
    text-align: center;
}

.showcase-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f7f9fb;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showcase-item-creator {
    font-size: 0.8rem;
    color: rgba(247, 249, 251, 0.55);
    font-weight: 400;
}

.showcase-item-category {
    display: inline-block;
    font-size: 0.7rem;
    color: rgba(247, 249, 251, 0.7);
    background: rgba(247, 249, 251, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 6px;
}

/* ランダム縦ゆらゆらアニメーション */
.showcase-item--float {
    animation: showcase-float var(--float-duration, 4s) ease-in-out var(--float-delay, 0s) infinite;
}

@keyframes showcase-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(calc(-1 * var(--float-amplitude, 10px)));
    }
}

/* ========================================
   詳細オーバーレイ
   ======================================== */

.showcase-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.showcase-overlay.active {
    display: flex;
    opacity: 1;
}

.showcase-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.showcase-overlay.active .showcase-overlay-backdrop {
    opacity: 1;
}

.showcase-overlay-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    background: none;
    border-radius: 0;
    overflow: visible;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
    box-shadow: none;
}

/* 詳細情報は最初は非表示、フライング着地後に出す */
.showcase-overlay-details {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.showcase-overlay.active .showcase-overlay-details {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.5s;
}

/* 閉じるボタンも同様に遅延表示 */
.showcase-overlay-close {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.showcase-overlay.active .showcase-overlay-close {
    opacity: 1;
    transition-delay: 0.5s;
}

@keyframes showcase-overlay-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* オーバーレイ左側: 画像（枠なし、サムネそのまま） */
.showcase-overlay-image-area {
    position: relative;
    overflow: hidden;
    background: none;
    max-width: 400px;
    border-radius: 4px;
}

.showcase-overlay-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* YouTube埋め込み iframe */
.showcase-overlay-youtube {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border-radius: 4px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* フライングサムネイル（クリック元から飛んでくる） */
.showcase-flying-thumb {
    position: fixed;
    z-index: 10001;
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.showcase-flying-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.showcase-flying-thumb.flying {
    border-radius: 0;
}

/* オーバーレイ右側: 詳細情報（広めに） */
.showcase-overlay-details {
    padding: 32px 40px;
    overflow-y: auto;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #f7f9fb;
}

.showcase-overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(247, 249, 251, 0.1);
    border: 1px solid rgba(247, 249, 251, 0.3);
    border-radius: 50%;
    color: #f7f9fb;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.showcase-overlay-close:hover {
    background: rgba(247, 249, 251, 0.2);
    transform: scale(1.1);
}

.showcase-detail-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #f7f9fb;
    line-height: 1.3;
}

.showcase-detail-category {
    display: inline-block;
    font-size: 0.8rem;
    color: #f7f9fb;
    background: rgba(247, 249, 251, 0.15);
    padding: 4px 12px;
    border-radius: 4px;
    width: fit-content;
    font-weight: 500;
}

/* クレジット一覧 */
.showcase-detail-credits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid rgba(247, 249, 251, 0.1);
    border-bottom: 1px solid rgba(247, 249, 251, 0.1);
}

.showcase-credit-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.showcase-credit-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.showcase-credit-role {
    font-size: 0.8rem;
    color: rgba(247, 249, 251, 0.5);
    min-width: 140px;
    flex-shrink: 0;
}

.showcase-credit-name {
    font-size: 0.9rem;
    color: rgba(247, 249, 251, 0.9);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.showcase-credit-name:hover {
    color: #f7f9fb;
    text-decoration: underline;
}

.showcase-detail-description {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(247, 249, 251, 0.85);
    white-space: pre-line;
}

.showcase-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.showcase-detail-tag {
    font-size: 0.75rem;
    color: rgba(247, 249, 251, 0.7);
    border: 1px solid rgba(247, 249, 251, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

/* 外部リンクボタン */
.showcase-detail-external-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(247, 249, 251, 0.1);
    border: 1px solid rgba(247, 249, 251, 0.25);
    border-radius: 6px;
    color: #f7f9fb;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: fit-content;
    margin-top: 8px;
}

.showcase-detail-external-link:hover {
    background: rgba(247, 249, 251, 0.18);
    border-color: rgba(247, 249, 251, 0.5);
    transform: translateY(-2px);
}

.showcase-detail-external-link svg {
    flex-shrink: 0;
}

/* ========================================
   モバイル版（768px未満）
   ======================================== */

@media (max-width: 767px) {
    #showcase {
        padding: 60px 0;
    }

    /* PC用の無限スクロールを非表示 */
    .showcase-carousel {
        display: none;
    }

    /* モバイル用スライドショー */
    .showcase-slideshow {
        display: block;
        position: relative;
        width: 100%;
        padding: 0 20px;
    }

    .showcase-slideshow-container {
        position: relative;
        width: 100%;
        overflow: hidden;
    }

    .showcase-slideshow-slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        opacity: 0;
        transition: opacity 0.6s ease-in-out;
        pointer-events: none;
    }

    .showcase-slideshow-slide.active {
        position: relative;
        opacity: 1;
        pointer-events: auto;
    }

    .showcase-slideshow-slide-image {
        width: 100%;
        border-radius: 8px;
        display: block;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .showcase-slideshow-slide-caption {
        padding: 12px 16px;
        text-align: center;
    }

    .showcase-slideshow-slide-caption .showcase-item-title {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }

    .showcase-slideshow-slide-caption .showcase-item-creator {
        font-size: 0.8rem;
    }

    .showcase-slideshow-slide-caption .showcase-item-category {
        margin-top: 4px;
    }

    /* ドットインジケーター */
    .showcase-slideshow-dots {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 16px;
    }

    .showcase-slideshow-dot {
        width: 8px;
        height: 8px;
        background: rgba(247, 249, 251, 0.3);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        padding: 0;
        transition: all 0.3s ease;
    }

    .showcase-slideshow-dot.active {
        width: 10px;
        height: 10px;
        background: #f7f9fb;
    }

    /* ゆらゆら無効化 */
    .showcase-item--float {
        animation: none !important;
    }

    /* モバイル用ナビボタン（サムネ中心に配置、半透明、中央にフェード） */
    .showcase-slideshow-container .showcase-slideshow-nav {
        opacity: 1;
        position: absolute;
        top: 50%;
        transform: translateY(calc(-50% - 20px));
        padding: 20px 0;
        border: none;
        border-radius: 0;
        width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        color: #202023;
        font-size: 1.5rem;
    }

    .showcase-slideshow-container .showcase-slideshow-prev {
        left: 0;
        background: linear-gradient(to right, rgba(247, 249, 251, 0.5), transparent);
    }

    .showcase-slideshow-container .showcase-slideshow-next {
        right: 0;
        background: linear-gradient(to left, rgba(247, 249, 251, 0.5), transparent);
    }

    /* オーバーレイモバイル */
    .showcase-overlay-content {
        grid-template-columns: 1fr;
        max-height: 90vh;
        width: 95%;
        gap: 20px;
    }

    .showcase-overlay-image-area {
        max-width: 100%;
    }

    .showcase-overlay-details {
        padding: 20px;
    }

    .showcase-detail-title {
        font-size: 1.4rem;
    }

    .showcase-credit-role {
        min-width: 100px;
    }
}

/* PC版ではモバイルスライドショーを非表示 */
@media (min-width: 768px) {
    .showcase-slideshow {
        display: none;
    }
}

/* ========================================
   Moreボタン
   ======================================== */

.showcase-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 48px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #202023;
    background: rgba(32, 32, 35, 0.05);
    border: 1px solid rgba(32, 32, 35, 0.4);
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.1em;
    margin-top: 48px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    z-index: 10;
}

#showcase.visible .showcase-more-button {
    animation: showcase-slide-up-fade 0.4s ease-out 0.3s forwards;
}

.showcase-more-button:hover {
    background: rgba(32, 32, 35, 0.12);
    border-color: rgba(32, 32, 35, 0.7);
    transform: translateY(-2px);
}

.showcase-more-button:active {
    transform: translateY(0);
}

/* ========================================
   slide-up fade-in アニメーション
   ======================================== */

@keyframes showcase-slide-up-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .showcase-more-button {
        margin-top: 32px;
        padding: 12px 36px;
        font-size: 0.9rem;
    }
}


/* ========================================
   Display Type バッジ
   ======================================== */

.showcase-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
    pointer-events: none;
}

.showcase-type-video {
    background: rgba(220, 53, 69, 0.85);
}

.showcase-type-music {
    background: rgba(111, 66, 193, 0.85);
}

.showcase-type-link {
    background: rgba(0, 123, 255, 0.85);
}

/* ========================================
   YouTube iframe オーバーレイ
   ======================================== */

.showcase-overlay-youtube {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
}
