/* ═══════════════════════════════════════════════════════════════
   Plantbaes Video Grid — Frontend Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper ── */
.pvg-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

/* ── Heading ── */
.pvg-heading {
    text-align: left;
    font-family: inherit;
    font-size: 36px;
    font-weight: 400;
    margin-bottom: 0 !important;
    color: #2d2d2d;
}

/* ── Grid Container ── */
.pvg-grid-container {
    position: relative;
}

/* ── Scroll Arrows ── */
.pvg-scroll-arrow {
    position: absolute;
    top: 40%;
    transform: translateY( -50% );
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba( 255, 255, 255, 0.95 );
    box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.15 );
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s, transform 0.2s;
    color: #333;
}
.pvg-scroll-arrow:hover {
    transform: translateY( -50% ) scale( 1.08 );
    box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.2 );
}
.pvg-scroll-left  { left: -16px; }
.pvg-scroll-right { right: -16px; }

/* ── Grid ── */
.pvg-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pvg-grid::-webkit-scrollbar { display: none; }

/* ── Card ── */
.pvg-card {
    flex: 0 0 var( --pvg-card-width, 280px );
    cursor: pointer;
    user-select: none;
}

.pvg-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 0;
    overflow: hidden;
    background: #f0f0f0;
}

/* Play icon overlay */
.pvg-card-media::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate( -50%, -50% );
    z-index: 3;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon points='7 4 20 12 7 20 7 4' fill='rgba(255,255,255,0.9)'/%3E%3C/svg%3E")
        center / 22px no-repeat,
        rgba( 0, 0, 0, 0.32 );
    pointer-events: none;
    transition: opacity 0.3s;
}
.pvg-card--active .pvg-card-media::after {
    opacity: 0;
}

/* Thumbnail */
.pvg-card-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    transition: opacity 0.35s ease;
    background: #f0f0f0;
}

/* Video behind thumbnail — fades in when card becomes active */
.pvg-card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.pvg-card--active .pvg-card-video {
    opacity: 1;
}

.pvg-play-badge { display: none; }

/* Title below card */
.pvg-card-title {
    text-align: left;
    font-weight: 400;
    font-size: 23px;
    margin: 15px 0 0 !important;
    color: #2d2d2d;
    line-height: 1.3;
}


/* ═══════════════════════════════════════════════════════════════
   MODAL — single video, centered, with left/right nav arrows
   ═══════════════════════════════════════════════════════════════ */

.pvg-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba( 0, 0, 0, 0.92 );
    display: none;
    align-items: center;
    justify-content: center;
    gap: 24px;
}
.pvg-modal--open {
    display: flex;
}

/* Left / right nav arrows */
.pvg-modal-nav {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba( 255, 255, 255, 0.18 );
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
}
.pvg-modal-nav:hover {
    background: rgba( 255, 255, 255, 0.32 );
}

/* Inner wrapper — column flex: video-wrap on top, CTA below */
.pvg-modal-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

/* Video wrapper — clips children (progress bar, buttons) to rounded corners */
.pvg-modal-video-wrap {
    position: relative;
    display: block;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
}

/* The video */
.pvg-modal-video {
    height: 70vh;
    width: auto;
    max-width: 70vw;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

/* Shared style for close + mute overlay buttons */
.pvg-modal-close-btn,
.pvg-modal-mute-btn {
    position: absolute;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba( 0, 0, 0, 0.5 );
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}
.pvg-modal-close-btn:hover,
.pvg-modal-mute-btn:hover {
    background: rgba( 0, 0, 0, 0.8 );
}

/* Close — top-right of video */
.pvg-modal-close-btn { top: 10px; right: 10px; }

/* Mute — top-left of video */
.pvg-modal-mute-btn  { top: 10px; left: 10px; }

/* Progress bar — overlaid at the bottom of the video */
.pvg-modal-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba( 255, 255, 255, 0.3 );
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}
.pvg-modal-progress-fill {
    height: 100%;
    width: 0%;
    background: #775973;
    transition: width 0.25s linear;
}

/* VIEW RECIPE button — below the video */
.pvg-modal-cta {
    margin-top: 16px;
    background: #775973;
    color: #fff;
    text-decoration: none;
    font-weight: 400;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    padding: 14px 40px;
    border-radius: 8px;
    transition: background 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.35 );
    white-space: nowrap;
}
.pvg-modal-cta:hover {
    background: #5e4560;
    color: #fff;
    text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media ( max-width: 768px ) {
    .pvg-wrapper { padding: 0 0.5rem; }
    .pvg-heading { font-size: 30px; }
    .pvg-card { flex: 0 0 200px; }
    .pvg-scroll-arrow { display: none; }
    .pvg-card-title { font-size: 18px; }
    .pvg-modal { gap: 12px; }
    .pvg-modal-nav { width: 40px; height: 40px; }
    .pvg-modal-video { height: 60vh; max-width: 75vw; }
    .pvg-modal-cta { padding: 12px 28px; font-size: 0.95rem; margin-top: 12px; }
}

@media ( max-width: 480px ) {
    .pvg-card { flex: 0 0 160px; }
    .pvg-card-title { font-size: 18px; }
}
