/* ═══════════════════════════════════════════════════════════════
   Ammy Video Gallery – Frontend Styles v2
   Design: Title overlaid on thumbnail bottom (like screenshot)
   Colors: Dark card, gold play button, white title text
   ═══════════════════════════════════════════════════════════════ */

.avg-gallery-wrap {
    display: grid;
    gap: 16px;
    margin: 24px 0;
    width: 100%;
}
.avg-cols-1 { grid-template-columns: 1fr; }
.avg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.avg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.avg-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
    .avg-cols-3, .avg-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .avg-cols-2, .avg-cols-3, .avg-cols-4 { grid-template-columns: 1fr; }
    .avg-gallery-wrap { gap: 12px; }
}

/* ── Card ──────────────────────────────────────────────────────── */

.avg-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: block;
}

.avg-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 36px rgba(0,0,0,0.65), 0 0 0 2px #c9a96e;
}

/* ── Thumbnail container ───────────────────────────────────────── */

.avg-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
    background: #0a0a0a;
}

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

.avg-item:hover .avg-thumb img {
    transform: scale(1.06);
}

/* ── Dark gradient overlay — always visible ─────────────────────
   This makes the title text readable against any image
   ─────────────────────────────────────────────────────────────── */

.avg-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.05) 0%,
        rgba(0,0,0,0.08) 45%,
        rgba(0,0,0,0.72) 78%,
        rgba(0,0,0,0.88) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* ── Title overlaid on thumbnail bottom ────────────────────────── */

.avg-thumb-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 36px 14px 12px 14px;
    z-index: 2;
    pointer-events: none;
}

.avg-thumb-title h4 {
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    border: none !important;
    background: none !important;
}

/* ── Play button ───────────────────────────────────────────────── */

.avg-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: 2.5px solid rgba(201,169,110,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 3;
    transition: background 0.22s ease,
                border-color 0.22s ease,
                transform 0.22s ease;
}

/* shift down slightly so title doesn't overlap play btn */
.avg-has-title .avg-play-btn {
    top: 42%;
}

.avg-play-btn svg {
    width: 20px;
    height: 20px;
    fill: #c9a96e;
    margin-left: 3px;
    flex-shrink: 0;
    transition: fill 0.22s ease;
}

.avg-item:hover .avg-play-btn {
    background: #c9a96e;
    border-color: #e8c98a;
    transform: translate(-50%, -50%) scale(1.1);
}

.avg-item:hover .avg-play-btn svg {
    fill: #0a0a0a;
}

/* ── Optional below-card description ──────────────────────────── */

.avg-caption {
    padding: 10px 14px 12px;
    background: #141414;
    border-top: 1px solid #2a2220;
}

.avg-desc {
    color: #a89880 !important;
    font-size: 12px !important;
    margin: 0 !important;
    line-height: 1.45 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avg-empty {
    color: #a89880;
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

/* ── Lightbox ──────────────────────────────────────────────────── */
.avg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5,4,3,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: auto;
    --modal-origin-x: 50vw;
    --modal-origin-y: 50vh;
}

.avg-lightbox[hidden] { 
    display: none !important; 
}

.avg-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,4,3,0.92);
    backdrop-filter: blur(8px);
    cursor: pointer;
    z-index: 1;
}

.avg-lightbox-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 920px;
    background: #0e0c0a;
    border: 1px solid #2a2220;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0,0,0,0.9);
    animation: avgLBIn 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform-origin: var(--modal-origin-x) var(--modal-origin-y);
}

@keyframes avgLBIn {
    from { 
        opacity: 0; 
        transform: scale(0.3) translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* Mobile fallback - center it */
@media (max-width: 600px) {
    .avg-lightbox-inner {
        transform-origin: center center;
    }
}

.avg-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 12px 20px;
    background: #111009;
    border-bottom: 1px solid #2a2220;
}

.avg-lightbox-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.avg-lightbox-title-wrap::before {
    content: '';
    flex-shrink: 0;
    width: 3px;
    height: 17px;
    background: #c9a96e;
    border-radius: 2px;
}

.avg-lightbox-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.avg-lightbox-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: #aaa;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.avg-lightbox-close:hover {
    background: #c9a96e;
    border-color: #c9a96e;
    color: #0a0a0a;
}

.avg-lightbox-player {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

#avg-iframe-container {
    position: absolute;
    inset: 0;
}

#avg-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Mobile ────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .avg-lightbox { padding: 10px; }
    .avg-lightbox-inner { border-radius: 8px; }
    .avg-play-btn { width: 46px; height: 46px; }
    .avg-play-btn svg { width: 16px; height: 16px; }
    .avg-thumb-title h4 { font-size: 12px !important; }
}
