/* AVG Gallery Styles 9.0.16 - Professional Layered Black & Red Theme (Standalone CTA Mobile Fix) */

:root {
    --avg-bg-body: #141414;
    --avg-accent-red: #c41215;
    --avg-border: #2a2a2a;
    --avg-card-bg: #1e1e1e;
    --avg-text: #ffffff;
    --avg-text-muted: #a3a3a3;
}

[class^="avg-"] { box-sizing: border-box; }

.avg-gallery-section {
    content-visibility: auto; contain-intrinsic-size: 500px;
    width: 100%; max-width: 100%; margin: 0 auto;
}

/* --- 1. VIDEO PLAYER --- */
.avg-video-hero-container { position: relative; display: block; margin-bottom: 2rem; width: 100%; }
.avg-video-wrapper { 
    width: 100%; max-width: 100%; margin: 0 auto; position: relative; border-radius: 0.5rem;
    overflow: hidden; border: 1px solid var(--avg-border); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    display: flex; flex-direction: column; transform: translateZ(0); 
}

.avg-player-inner { position: relative; width: 100%; background: #000; overflow: hidden; border-radius: 0.5rem; }
.avg-player-frame { padding: 0; background: transparent; border: none; }
.avg-aspect-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.avg-aspect-box video { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; object-fit: contain !important; z-index: 1; }
.avg-lazy-poster { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; object-fit: cover !important; z-index: 2; }

.avg-play-btn-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3;
    width: 80px; height: 80px; background: var(--avg-accent-red); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 0 30px rgba(196, 18, 21, 0.6); transition: transform 0.2s ease;
}
.avg-play-btn-overlay svg { width: 35px; height: 35px; fill: #ffffff; margin-left: 6px; }

/* Paywall Overlay */
.avg-paywall-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9); z-index: 10;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.avg-paywall-overlay.active { opacity: 1; pointer-events: auto; }
.avg-paywall-content { text-align: center; padding: 20px; width: 100%; }

/* Standalone Red Button */
.avg-video-standalone-cta-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

.avg-standalone-cta-btn {
    display: inline-block;
    background-color: var(--avg-accent-red);
    color: #ffffff !important;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: capitalize;
    text-decoration: none !important;
    border-radius: 3rem; 
    box-shadow: 0 4px 15px rgba(196, 18, 21, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.avg-standalone-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 18, 21, 0.7);
    background-color: #a80f12;
}

/* Theme Matched CTA Buttons (For Gallery & Paywall) */
.avg-paywall-btn, .avg-gallery-cta-btn {
    display: inline-block;
    background-color: var(--avg-accent-red);
    color: #ffffff !important;
    padding: 1rem 2.5rem;
    font-family: inherit; font-size: 1rem; font-weight: bold;
    line-height: 1.5; border-radius: 0.375rem; text-decoration: none !important;
    text-transform: capitalize; border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196, 18, 21, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avg-paywall-btn:hover, .avg-gallery-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 18, 21, 0.7);
}

@media (max-width: 639px) {
    .avg-standalone-cta-btn {
        padding: 1rem 2rem; /* Shorter padding but NOT full width to keep it pill shaped */
    }
    .avg-paywall-btn, .avg-gallery-cta-btn { 
        padding: 1rem 2rem;
    }
}

/* --- 2. GALLERY GRID (3 Col Desktop / 2 Col Mobile) --- */
.avg-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; width: 100%; }
@media (min-width: 768px) { .avg-gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 639px) { .avg-gallery-grid { gap: 0.5rem; } } 

.avg-gallery-card { 
    position: relative; background: var(--avg-card-bg); overflow: hidden; border-radius: 0.5rem; 
    border: 1px solid var(--avg-border); box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.2s ease; cursor: zoom-in; 
}
.avg-gallery-card:hover { border-color: var(--avg-accent-red); }
.avg-gallery-thumb { width: 100% !important; height: 100% !important; aspect-ratio: 4/3; object-fit: cover !important; display: block !important; }

/* --- 3. AFFILIATE LIGHTBOX --- */
.avg-lightbox-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.98);
    z-index: 9999999; display: flex; flex-direction: column; align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
}

.avg-lightbox-bar {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; position: absolute; top: 0; left: 0; z-index: 10;
}

.avg-lightbox-ext-link {
    display: inline-flex; align-items: center; gap: 8px; background: var(--avg-accent-red);
    color: #fff !important; padding: 8px 16px; border-radius: 4px; text-decoration: none;
    font-weight: bold; font-size: 0.9rem; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.avg-lightbox-close { color: #fff; font-size: 40px; font-weight: bold; text-decoration: none; line-height: 1; }

.avg-lightbox-content { position: relative; max-width: 95vw; max-height: 80vh; text-align: center; }

.avg-lightbox-img {
    max-width: 100%; max-height: 80vh; object-fit: contain; cursor: pointer;
    border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.avg-lightbox-img:hover { transform: scale(1.01); }

.avg-lightbox-hint {
    margin-top: 15px; color: var(--avg-accent-red); font-weight: bold;
    text-transform: capitalize; font-size: 0.9rem; pointer-events: none;
}

.avg-lightbox-prev, .avg-lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%); font-size: 50px;
    color: rgba(255,255,255,0.4); cursor: pointer; padding: 20px; user-select: none;
    transition: color 0.2s; z-index: 100;
}
.avg-lightbox-prev { left: 10px; }
.avg-lightbox-next { right: 10px; }
.avg-lightbox-prev:hover, .avg-lightbox-next:hover { color: #fff; }

@media (max-width: 768px) {
    .avg-lightbox-img { max-height: 70vh; }
    .avg-lightbox-prev, .avg-lightbox-next { display: none; } /* Mobile uses swipe */
}