/* Spotlight Card Widget */
.wml-spotlight-card-wrapper {
    --sc-bg: #000;
    --sc-panel: #181b21;
    --sc-text: #eef0f3;
    --sc-muted: rgba(238, 240, 243, 0.72);
    --sc-accent: #6e45e2;
    --sc-accent-2: #88d3ce;
    --sc-ring: rgba(136, 211, 206, 0.35);
    --sc-border: rgba(255, 255, 255, 0.08);
    --sc-radius: 14px;
    --sc-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
    --sc-fast: 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
    --sc-slow: 520ms cubic-bezier(0.2, 0.6, 0.2, 1);
    --sc-shine-color: rgba(255, 255, 255, 0.08);
    background: var(--sc-bg);
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .wml-spotlight-card-wrapper {
        --sc-fast: 1ms linear;
        --sc-slow: 1ms linear;
    }
}

.wml-spotlight-card-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Grid */
.sc-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(350px, 1fr));
    gap: 24px;
}

/* Card */
.sc-item {
    position: relative;
    background: var(--sc-panel);
    border-radius: var(--sc-radius);
    overflow: hidden;
    box-shadow: var(--sc-shadow);
    border: 1px solid var(--sc-border);
    aspect-ratio: 4/5;
    transform-style: preserve-3d;
    transition: transform var(--sc-fast), box-shadow var(--sc-fast),
        border-color var(--sc-fast), opacity var(--sc-fast);
    isolation: isolate;
    opacity: 0;
    transform: translateY(14px);
    animation: scFadeInUp 0.6s ease forwards;
}

.sc-item:nth-child(1) {
    animation-delay: 0.06s;
}

.sc-item:nth-child(2) {
    animation-delay: 0.12s;
}

.sc-item:nth-child(3) {
    animation-delay: 0.18s;
}

.sc-item:nth-child(4) {
    animation-delay: 0.24s;
}

.sc-item:nth-child(5) {
    animation-delay: 0.3s;
}

.sc-item:nth-child(6) {
    animation-delay: 0.36s;
}

.sc-item:nth-child(7) {
    animation-delay: 0.42s;
}

.sc-item:nth-child(8) {
    animation-delay: 0.48s;
}

.sc-item:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--sc-ring) 60%, var(--sc-border) 40%);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

.sc-item::after {
    content: "";
    position: absolute;
    inset: -20%;
    background: linear-gradient(60deg,
            transparent 40%,
            var(--sc-shine-color) 50%,
            transparent 60%);
    transform: translateX(-40%);
    transition: transform var(--sc-slow);
    pointer-events: none;
    opacity: var(--sc-shine-opacity, 1);
}

.sc-item:hover::after {
    transform: translateX(40%);
}

/* SVG */
.sc-item svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.sc-item text {
    text-anchor: middle;
    paint-order: stroke fill;
    user-select: none;
}

.sc-svg-text {
    fill: rgba(255, 255, 255, 0.08);
}

.sc-svg-masked-text {
    fill: #fff;
    opacity: 0;
    transition: opacity var(--sc-fast);
}

.sc-item:hover .sc-svg-masked-text {
    opacity: 1;
    transition-delay: 0.08s;
}

.sc-item clipPath circle {
    transition: r var(--sc-slow);
    filter: drop-shadow(0 0 10px rgba(110, 69, 226, 0.45));
}

.sc-item image {
    transform-origin: 50% 50%;
    transition: transform var(--sc-slow), filter var(--sc-fast);
    filter: brightness(0.9) contrast(1.05);
}

.sc-item:hover image {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Description */
.sc-desc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 14px 14px 24px;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.45),
            rgba(0, 0, 0, 0) 60%);
    display: grid;
    gap: 6px;
    transition: transform var(--sc-slow);
}

.sc-desc.has-buttons {
    transform: translateY(70px);
}

.sc-item:hover .sc-desc.has-buttons {
    transform: translateY(0);
}

.sc-ttl {
    color: var(--sc-text);
}

.sc-copy {
    color: var(--sc-muted);
}

.sc-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transform: translateY(8px);
    opacity: 0;
    transition: transform var(--sc-slow), opacity var(--sc-slow);
    margin-top: 6px;
}

.sc-item:hover .sc-actions {
    transform: translateY(0);
    opacity: 1;
}

.sc-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sc-accent) 0%, var(--sc-accent-2) 100%);
    color: #0b0d12;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transition: transform var(--sc-fast), box-shadow var(--sc-fast), filter var(--sc-fast);
    text-decoration: none;
    display: inline-block;
}

.sc-btn:focus-visible {
    outline: 2px solid var(--sc-ring);
    outline-offset: 2px;
}

.sc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.sc-btn.ghost {
    background: transparent;
    color: var(--sc-text);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.sc-btn.ghost:hover {
    filter: brightness(1.1);
}

/* Modal */
.sc-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--sc-slow);
}

.sc-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.sc-modal-content {
    max-width: 92vw;
    max-height: 92vh;
    transform: scale(0.96);
    transition: transform var(--sc-slow);
    border-radius: 12px;
}

.sc-modal.active .sc-modal-content {
    transform: scale(1);
}

.sc-close-modal {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
}

.sc-item.is-hidden {
    display: none;
}

@keyframes scFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Responsive */
@media (max-width: 980px) {
    .sc-items {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }

    .sc-item {
        transform: translateY(-6px);
        border-color: color-mix(in srgb, var(--sc-ring) 60%, var(--sc-border) 40%);
        box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
    }

    .sc-item g {
        clip-path: none !important;
    }

    .sc-desc.has-buttons {
        transform: translateY(0) !important;
    }

    .sc-item clipPath circle {
        r: 1000;
    }

    .sc-item .sc-svg-masked-text,
    .sc-item:hover .sc-svg-masked-text {
        opacity: 1;
    }

    .sc-item image {
        transform: scale(1.04);
        filter: brightness(1);
    }

    .sc-item .sc-actions {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 620px) {
    .sc-items {
        grid-template-columns: 1fr;
    }
}