/* ==========================================================================
   ギャラリー ショーケース — Tabbed Dual-Marquee (Art + Materials)
   ========================================================================== */

/* --- Section --- */
.gsc-section {
    padding: 40px 0 50px;
    overflow: hidden;
    background: #fafbfc;
    position: relative;
}

/* --- Header --- */
.gsc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 20px;
    gap: 16px;
}

.gsc-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gsc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.gsc-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0;
    letter-spacing: 0.02em;
}

/* --- Pill Tabs --- */
.gsc-tabs {
    display: flex;
    gap: 4px;
    background: #e8eaed;
    border-radius: 12px;
    padding: 4px;
    flex-shrink: 0;
}

.gsc-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #5f6368;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
}

.gsc-tab:hover {
    color: #1a1a2e;
    background: rgba(255, 255, 255, 0.5);
}

.gsc-tab.is-active {
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.gsc-tab i {
    font-size: 0.85rem;
}

.gsc-tab[data-tab="art"].is-active i {
    color: #f59f00;
}

.gsc-tab[data-tab="materials"].is-active i {
    color: #2e8b57;
}

/* --- Panels --- */
.gsc-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gsc-panel.is-active {
    display: block;
    opacity: 1;
}

/* --- Marquee Wrapper --- */
.gsc-marquee-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Row --- */
.gsc-marquee-row {
    overflow: hidden;
    width: 100%;
}

.gsc-marquee-track {
    display: flex;
    gap: 12px;
    width: max-content;
    will-change: transform;
}

.gsc-marquee-row[data-direction="left"] .gsc-marquee-track {
    animation: gsc-marquee-left 40s linear infinite;
}

.gsc-marquee-row[data-direction="right"] .gsc-marquee-track {
    animation: gsc-marquee-right 45s linear infinite;
}

.gsc-marquee-wrapper:hover .gsc-marquee-track {
    animation-play-state: paused;
}

/* --- Keyframes --- */
@keyframes gsc-marquee-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes gsc-marquee-right {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* --- Art Card (1:1) --- */
.art-marquee-card {
    flex: 0 0 auto;
    width: 200px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.art-marquee-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

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

.art-marquee-card:hover img {
    transform: scale(1.08);
}

/* --- Art Overlay --- */
.art-marquee-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.art-marquee-card:hover .art-marquee-overlay {
    opacity: 1;
}

.art-marquee-creator,
.art-marquee-likes {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.art-marquee-creator i,
.art-marquee-likes i {
    margin-right: 4px;
    font-size: 0.7rem;
}

.art-marquee-likes i {
    color: #ff6b6b;
}

/* --- Materials Card (4:3) --- */
.mat-marquee-card {
    flex: 0 0 auto;
    width: 220px;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.mat-marquee-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

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

.mat-marquee-card:hover img {
    transform: scale(1.08);
}

/* --- Panel Footer --- */
.gsc-panel-footer {
    display: flex;
    justify-content: center;
    padding: 18px 20px 0;
}

.gsc-see-all {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    border-radius: 24px;
    border: 2px solid;
    transition: all 0.2s ease;
}

.gsc-see-all--art {
    color: #043e80;
    border-color: #043e80;
}

.gsc-see-all--art:hover {
    background: #043e80;
    color: #fff;
}

.gsc-see-all--mat {
    color: #2e8b57;
    border-color: #2e8b57;
}

.gsc-see-all--mat:hover {
    background: #2e8b57;
    color: #fff;
}

/* --- Materials Lightbox --- */
.mat-sc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.mat-sc-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.mat-sc-lightbox-inner {
    position: relative;
    max-width: 900px;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.mat-sc-lightbox.active .mat-sc-lightbox-inner {
    transform: scale(1);
}

.mat-sc-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.mat-sc-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.mat-sc-lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    min-height: 200px;
}

.mat-sc-lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    object-fit: contain;
}

.mat-sc-lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 12px;
    border-top: 1px solid #eee;
}

.mat-sc-lightbox-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.mat-sc-lightbox-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.mat-sc-btn-dl,
.mat-sc-btn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.mat-sc-btn-dl {
    background: #2e8b57;
    color: #fff;
}

.mat-sc-btn-dl:hover {
    background: #3cb371;
    color: #fff;
}

.mat-sc-btn-more {
    background: #f0f0f0;
    color: #333;
}

.mat-sc-btn-more:hover {
    background: #e0e0e0;
    color: #333;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .gsc-section {
        padding: 30px 0 35px;
    }

    .gsc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0 15px;
    }

    .gsc-title {
        font-size: 1.2rem;
    }

    .gsc-tabs {
        align-self: stretch;
        justify-content: center;
    }

    .gsc-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 14px;
    }

    .gsc-marquee-wrapper {
        gap: 8px;
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 3%,
            black 97%,
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 3%,
            black 97%,
            transparent 100%
        );
    }

    .art-marquee-card {
        width: 150px;
    }

    .mat-marquee-card {
        width: 160px;
    }

    /* Single row on mobile */
    .gsc-marquee-row[data-direction="right"] {
        display: none;
    }

    .gsc-marquee-row[data-direction="left"] .gsc-marquee-track {
        animation-duration: 30s;
    }

    /* Lightbox responsive */
    .mat-sc-lightbox {
        padding: 10px;
    }

    .mat-sc-lightbox-inner {
        border-radius: 12px;
    }

    .mat-sc-lightbox-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 10px;
    }

    .mat-sc-lightbox-title {
        text-align: center;
    }

    .mat-sc-lightbox-actions {
        justify-content: center;
    }

    .mat-sc-btn-dl,
    .mat-sc-btn-more {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gsc-tab {
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .art-marquee-card {
        width: 130px;
    }

    .mat-marquee-card {
        width: 140px;
    }
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .gsc-marquee-track {
        animation: none !important;
    }

    .gsc-marquee-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .gsc-marquee-row::-webkit-scrollbar {
        display: none;
    }

    .art-marquee-card,
    .mat-marquee-card {
        scroll-snap-align: start;
    }

    .gsc-panel {
        transition: none;
    }
}
