/* ============================================================
   红石镇 | Redstone Town —— 图集样式（gallery.html）
   ============================================================ */

/* ========== 1. 图集说明 ========== */
.flow-note {
    background: var(--panel);
}

.flow-note p {
    color: var(--muted);
    line-height: 1.8;
}

.flow-note a {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 2px solid var(--red);
    padding: 10px 18px;
    color: var(--red);
    transition: background 240ms, color 240ms;
}

.flow-note a:hover {
    background: var(--red);
    color: var(--bg);
}

/* ========== 2. 流动图廊 ========== */

.gallery-track {
    overflow: hidden;
    white-space: nowrap;
}

.gallery-inner {
    display: inline-flex;
    width: max-content;
    will-change: transform;
}

.gallery-run {
    display: flex;
    flex: 0 0 auto;
    gap: 24px;
    padding-right: 24px;
    white-space: nowrap;
}

.gallery-a .gallery-inner {
    animation: gallery-scroll 80s linear infinite;
}

.gallery-b .gallery-inner {
    animation: gallery-scroll 60s linear infinite reverse;
}

@keyframes gallery-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.gallery-track:hover .gallery-inner {
    animation-play-state: paused;
}

.gallery-card {
    flex: 0 0 auto;
    width: clamp(220px, 28vw, 360px);
    background: var(--panel);
    border: 2px solid var(--line-strong);
    padding: 8px;
    transition: border-color 240ms ease, opacity 240ms ease;
}

.gallery-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    opacity: 0.92;
    cursor: zoom-in;
    transition: opacity 240ms ease;
}

.gallery-card figcaption {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 240ms ease;
}

.gallery-card:hover {
    border-color: var(--red);
}

.gallery-card:hover img {
    opacity: 1;
}

.gallery-card:hover figcaption {
    color: var(--red);
}

/* ========== 3. 图片放大查看 ========== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--pad);
    background: rgba(8, 8, 10, 0.88);
    opacity: 0;
    visibility: hidden;
    transition: opacity 280ms ease, visibility 280ms ease;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-frame {
    position: relative;
    max-width: min(960px, 100%);
    max-height: 100%;
    background: var(--panel);
    border: 2px solid var(--line-strong);
    padding: 12px;
    transform: scale(0.94) translateY(10px);
    transition: transform 280ms ease;
}

.lightbox.open .lightbox-frame {
    transform: scale(1) translateY(0);
}

.lightbox-frame img {
    display: block;
    max-width: 100%;
    max-height: 74vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 260ms ease 80ms;
}

.lightbox.open .lightbox-frame img {
    opacity: 1;
}

.lightbox-caption {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0;
    transition: opacity 260ms ease 140ms;
}

.lightbox.open .lightbox-caption {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: -26px;
    right: -18px;
    width: 34px;
    height: 34px;
    border: none;
    background: var(--red);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover {
    background: var(--red-deep);
}
