.wcg-gallery,
.wcg-empty {
    --wcg-ink: #2e3442;
    --wcg-muted: #778095;
    --wcg-line: rgba(83, 98, 124, .16);
    --wcg-glass: rgba(255, 255, 255, .72);
    --wcg-accent: #7ab9e9;
    --wcg-accent-2: #d7b9ee;
    width: min(1180px, calc(100vw - 40px));
    margin: 34px 50%;
    transform: translateX(-50%);
    color: var(--wcg-ink);
}

.wcg-gallery *,
.wcg-empty * {
    box-sizing: border-box;
}

.wcg-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
    align-items: end;
    gap: 36px;
    padding: 0 18px 24px;
    border-bottom: 1px solid var(--wcg-line);
}

.wcg-gallery .wcg-eyebrow,
.wcg-empty .wcg-eyebrow {
    margin: 0 0 10px;
    color: #6ca8d6;
    font: 600 11px/1.4 ui-sans-serif, system-ui, sans-serif;
    letter-spacing: .21em;
}

.wcg-gallery .wcg-header h2,
.wcg-empty h2 {
    display: block;
    margin: 0;
    color: var(--wcg-ink);
    font-family: "Noto Serif SC", "Source Han Serif SC", serif;
    font-size: clamp(28px, 3.2vw, 46px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .02em;
}

.wcg-gallery .wcg-header h2::before,
.wcg-gallery .wcg-header h2::after,
.wcg-empty h2::before,
.wcg-empty h2::after {
    display: none;
    content: none;
}

.wcg-gallery .wcg-intro,
.wcg-empty > p:last-child {
    margin: 0 0 4px;
    color: var(--wcg-muted);
    font-size: 14px;
    line-height: 1.85;
}

.wcg-stage {
    position: relative;
    height: clamp(350px, 34vw, 435px);
    min-height: 350px;
    overflow: hidden;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.wcg-stage:focus-visible {
    border-radius: 24px;
    box-shadow: inset 0 0 0 3px rgba(122, 185, 233, .6);
}

.wcg-stage.is-dragging .wcg-viewport {
    cursor: grabbing;
}

.wcg-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    perspective: 1250px;
    perspective-origin: 50% 47%;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}

.wcg-ambient {
    position: absolute;
    top: 10%;
    left: 50%;
    width: min(760px, 80vw);
    height: 68%;
    transform: translateX(-50%);
    pointer-events: none;
    background:
        radial-gradient(circle at 32% 44%, rgba(123, 194, 238, .20), transparent 42%),
        radial-gradient(circle at 68% 58%, rgba(215, 185, 238, .20), transparent 44%);
    filter: blur(24px);
}

.wcg-track {
    --wcg-gap: clamp(16px, 2vw, 28px);
    display: flex;
    height: 100%;
    align-items: center;
    gap: var(--wcg-gap);
    margin-left: 0;
    padding: 0 0 52px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: none;
}

.wcg-track > br {
    display: none;
}

.wcg-card {
    position: relative;
    z-index: 1;
    display: block;
    flex: 0 0 clamp(340px, 37vw, 490px);
    min-width: 0;
    aspect-ratio: 3 / 2;
    margin-left: 0;
    color: #fff;
    text-decoration: none !important;
    opacity: 1;
    transition: opacity .16s linear;
    will-change: opacity;
    -webkit-tap-highlight-color: transparent;
}

.wcg-card__frame {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 22px;
    background: #cad9e7;
    box-shadow: 0 25px 70px rgba(40, 57, 79, .17);
    transition: box-shadow .28s ease, border-color .28s ease;
    transform-origin: center center;
    transform-style: preserve-3d;
    will-change: transform;
}

.wcg-card.is-active {
    z-index: 20;
}

.wcg-card.is-active .wcg-card__frame,
.wcg-card:focus-visible .wcg-card__frame {
    border-color: rgba(255, 255, 255, .82);
    box-shadow: 0 30px 85px rgba(40, 57, 79, .28), 0 0 0 4px rgba(122, 185, 233, .18);
}

.wcg-card:focus-visible {
    outline: none;
}

.wcg-card__image,
.wcg-card__visual {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.025);
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

/* Sakurairo constrains images nested in content spans to 30px high. */
.wcg-card__frame > img.wcg-card__image {
    height: 100%;
    max-height: none;
}

.wcg-card.is-active .wcg-card__image,
.wcg-card.is-active .wcg-card__visual {
    transform: scale(1);
}

.wcg-card__visual::before,
.wcg-card__visual::after,
.wcg-card__visual i {
    content: "";
    position: absolute;
    display: block;
}

.wcg-card__visual::before {
    right: -20%;
    bottom: -15%;
    left: -20%;
    height: 58%;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(155deg, rgba(30, 61, 83, .18), rgba(236, 245, 249, .68));
    clip-path: polygon(0 100%, 0 64%, 20% 40%, 38% 68%, 57% 18%, 74% 60%, 100% 34%, 100% 100%);
}

.wcg-card__visual::after {
    top: 18%;
    right: 17%;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 251, 229, .86);
    box-shadow: 0 0 48px rgba(255, 249, 214, .72);
}

.wcg-card__visual i {
    right: 0;
    bottom: 0;
    left: 0;
    height: 26%;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(23,43,63,.22));
}

.wcg-card__visual--0 { background: linear-gradient(160deg, #8db8cf 0%, #d9e7ea 47%, #637f90 100%); }
.wcg-card__visual--1 { background: linear-gradient(160deg, #172a46 0%, #4a6584 50%, #d8afc2 100%); }
.wcg-card__visual--2 { background: linear-gradient(160deg, #75b7cb 0%, #d4ebe6 53%, #e5c4a3 100%); }
.wcg-card__visual--3 { background: linear-gradient(160deg, #b9d8ed 0%, #eff5f8 55%, #91b1c4 100%); }
.wcg-card__visual--4 { background: linear-gradient(160deg, #91a782 0%, #d5d1a8 49%, #a26c5c 100%); }
.wcg-card__visual--5 { background: linear-gradient(160deg, #a78aaa 0%, #e7b9a7 47%, #53657b 100%); }

.wcg-card__veil {
    position: absolute;
    inset: 0;
    display: block;
    background: linear-gradient(180deg, transparent 42%, rgba(16, 24, 34, .12) 58%, rgba(12, 20, 30, .84) 100%);
}

.wcg-card__copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 28px 24px 24px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

.wcg-card__date {
    color: rgba(255, 255, 255, .72);
    font: 600 10px/1.3 ui-sans-serif, system-ui, sans-serif;
    letter-spacing: .17em;
}

.wcg-card__copy strong {
    color: #fff;
    font-family: "Noto Serif SC", "Source Han Serif SC", serif;
    font-size: clamp(23px, 2.2vw, 30px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .05em;
}

.wcg-card__excerpt {
    overflow: hidden;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcg-controls {
    position: absolute;
    z-index: 50;
    bottom: 10px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(-50%);
}

.wcg-control {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: var(--wcg-ink);
    border: 1px solid var(--wcg-line);
    border-radius: 50%;
    background: var(--wcg-glass);
    box-shadow: 0 9px 28px rgba(52, 70, 95, .10);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.wcg-control:hover,
.wcg-control:focus-visible {
    color: #315d80;
    background: #fff;
    transform: translateY(-2px);
    outline: none;
}

.wcg-counter {
    display: flex;
    min-width: 76px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--wcg-muted);
    font: 500 11px/1 ui-sans-serif, system-ui, sans-serif;
    letter-spacing: .08em;
}

.wcg-counter b {
    color: var(--wcg-ink);
    font-size: 13px;
}

.wcg-counter i {
    width: 18px;
    height: 1px;
    background: var(--wcg-line);
}

.wcg-gallery .wcg-preview-note {
    margin: 2px auto 0;
    color: var(--wcg-muted);
    font-size: 12px;
    text-align: center;
}

.wcg-grid-anchor {
    display: block;
    height: 1px;
    scroll-margin-top: 110px;
}

.wcg-gallery.is-preview + .pbe-content-hub .pbe-content-empty {
    display: none;
}

.wcg-empty {
    padding: 70px 28px;
    border: 1px solid var(--wcg-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .62);
    text-align: center;
}

.wcg-empty .wcg-eyebrow {
    margin-bottom: 12px;
}

.wcg-empty > p:last-child {
    margin-top: 18px;
}

.dark .wcg-gallery,
.dark .wcg-empty {
    --wcg-ink: #eef4fb;
    --wcg-muted: #aab5c4;
    --wcg-line: rgba(210, 226, 244, .15);
    --wcg-glass: rgba(31, 40, 53, .66);
}

.dark .wcg-eyebrow {
    color: #91c9ee;
}

.dark .wcg-empty {
    background: rgba(28, 36, 48, .72);
}

.dark .wcg-control:hover,
.dark .wcg-control:focus-visible {
    color: #fff;
    background: rgba(49, 62, 80, .94);
}

@media (max-width: 720px) {
    .wcg-gallery,
    .wcg-empty {
        width: calc(100vw - 24px);
        margin-top: 22px;
        margin-bottom: 22px;
    }

    .wcg-header {
        display: block;
        padding: 0 10px 18px;
    }

    .wcg-gallery .wcg-header h2 {
        font-size: clamp(27px, 8vw, 36px);
    }

    .wcg-gallery .wcg-intro {
        margin-top: 13px;
        font-size: 13px;
    }

    .wcg-stage {
        height: 350px;
        min-height: 350px;
    }

    .wcg-viewport {
        perspective: 900px;
    }

    .wcg-card {
        flex-basis: min(84vw, 340px);
    }

    .wcg-card__frame {
        border-radius: 19px;
    }

    .wcg-card__copy {
        padding: 30px 20px 20px;
    }

    .wcg-controls {
        bottom: 9px;
    }
}

@media (max-width: 420px) {
    .wcg-stage {
        height: 325px;
        min-height: 325px;
    }

    .wcg-card {
        flex-basis: min(84vw, 320px);
    }

    .wcg-control {
        width: 39px;
        height: 39px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wcg-stage {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .wcg-viewport {
        position: relative;
        overflow-x: auto;
        perspective: none;
        cursor: auto;
        scroll-snap-type: x mandatory;
    }

    .wcg-track {
        position: relative;
        display: flex;
        gap: 16px;
        height: auto;
        margin-left: 0;
        padding: 24px 10px 26px;
        transform: none;
    }

    .wcg-card {
        position: relative;
        top: auto;
        left: auto;
        flex: 0 0 min(84vw, 340px);
        width: auto;
        min-width: 0;
        margin-left: 0;
        opacity: 1 !important;
        transform: none !important;
        scroll-snap-align: center;
    }

    .wcg-card__frame {
        transform: none !important;
    }

    .wcg-controls,
    .wcg-ambient {
        display: none;
    }

    .wcg-card__image,
    .wcg-card__visual,
    .wcg-card__frame,
    .wcg-control {
        transition: none !important;
    }
}
