/* svg-front.css */

/* ── Grid ───────────────────────────────────────────── */
.svg-grid { width: 100%; }

.svg-item {
    width: calc(33.333% - var(--svg-gap, 16px) * 2 / 3);
    margin-bottom: var(--svg-gap, 16px);
    cursor: pointer;
}
.svg-cols-2 .svg-item { width: calc(50%      - var(--svg-gap,16px) * 1/2); }
.svg-cols-3 .svg-item { width: calc(33.333%  - var(--svg-gap,16px) * 2/3); }
.svg-cols-4 .svg-item { width: calc(25%      - var(--svg-gap,16px) * 3/4); }
.svg-cols-5 .svg-item { width: calc(20%      - var(--svg-gap,16px) * 4/5); }
.svg-cols-6 .svg-item { width: calc(16.666%  - var(--svg-gap,16px) * 5/6); }

/* ── Item inner ─────────────────────────────────────── */
.svg-item-inner {
    position: relative;
    overflow: hidden;
    line-height: 0;
    background: #111;
}

.svg-item-inner img,
.svg-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 1 !important;
    filter: none !important;
    transition: transform .45s cubic-bezier(.25,.46,.45,.94),
                opacity .35s ease !important;
}

.svg-item:hover .svg-item-inner img {
    transform: scale(1.04);
    opacity: 0.75 !important;
}

/* ── No thumbnail fallback ──────────────────────────── */
.svg-no-thumb-front {
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    position: relative;
    background: #1a1a1a;
}
.svg-no-thumb-front span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
}

/* ── Play button ────────────────────────────────────── */
.svg-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 56px;
    height: 56px;
    opacity: 0.85;
    transition: transform .25s, opacity .25s;
    pointer-events: none;
    z-index: 2;
}
.svg-play-btn svg { width: 100%; height: 100%; }

.svg-item:hover .svg-play-btn {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ── Title ──────────────────────────────────────────── */
.svg-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    line-height: 1.4;
    z-index: 3;
}
.svg-title-hover {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s, transform .25s;
}
.svg-item:hover .svg-title-hover {
    opacity: 1;
    transform: translateY(0);
}

/* ── Lightbox ───────────────────────────────────────── */
.svg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    pointer-events: none;
}
.svg-lightbox[style*="block"] { pointer-events: auto; }

.svg-lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 100000;
    cursor: pointer;
    display: none;
}

.svg-lb-content {
    position: relative;
    z-index: 100002;
    width: 90vw;
    max-width: 1100px;
    pointer-events: auto;
}

.svg-lb-iframe-wrap {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 12px 60px rgba(0,0,0,.8);
}

.svg-lb-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.svg-lb-title {
    color: rgba(255,255,255,.7);
    font-size: 13px;
    text-align: center;
    margin: 12px 0 0;
    letter-spacing: .03em;
}

.svg-lb-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100003;
    transition: background .2s;
    line-height: 1;
}
.svg-lb-close:hover { background: rgba(255,255,255,.28); }

body.svg-lb-open { overflow: hidden; }

/* ── Empty state ────────────────────────────────────── */
.svg-empty { color: #888; text-align: center; padding: 40px 0; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .svg-cols-4 .svg-item,
    .svg-cols-5 .svg-item,
    .svg-cols-6 .svg-item { width: calc(33.333% - var(--svg-gap,16px) * 2/3); }
}
@media (max-width: 768px) {
    .svg-cols-3 .svg-item,
    .svg-cols-4 .svg-item,
    .svg-cols-5 .svg-item,
    .svg-cols-6 .svg-item { width: calc(50% - var(--svg-gap,16px) / 2); }
    .svg-lightbox { padding: 20px; }
    .svg-lb-content { width: 95vw; }
}
@media (max-width: 480px) {
    .svg-item,
    .svg-cols-2 .svg-item,
    .svg-cols-3 .svg-item,
    .svg-cols-4 .svg-item,
    .svg-cols-5 .svg-item,
    .svg-cols-6 .svg-item { width: 100%; }
}
