/* YouTube Video Gallery Plugin Styles */

/* ============================================
   SUBSCRIBE BUTTON
   ============================================ */

.yvg-subscribe-wrap {
    margin-bottom: 24px;
}

.yvg-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ff0000;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
    padding: 9px 18px;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.yvg-subscribe-btn:hover,
.yvg-subscribe-btn:focus {
    background: #cc0000;
    color: #fff !important;
    transform: translateY(-1px);
    outline: none;
}

.yvg-subscribe-btn:active {
    transform: translateY(0);
}

.yvg-subscribe-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================
   GALLERY GRID
   ============================================ */

.yvg-gallery {
    display: grid;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.yvg-cols-1 { grid-template-columns: repeat(1, 1fr); }
.yvg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.yvg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.yvg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.yvg-cols-5 { grid-template-columns: repeat(5, 1fr); }
.yvg-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
    .yvg-cols-4,
    .yvg-cols-5,
    .yvg-cols-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .yvg-cols-3,
    .yvg-cols-4,
    .yvg-cols-5,
    .yvg-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
    .yvg-gallery { grid-template-columns: 1fr !important; }
}

/* --- Item --- */

.yvg-item {
    display: flex;
    flex-direction: column;
}

.yvg-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #000;
}

.yvg-thumb-wrap a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

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

.yvg-thumb-wrap:hover img {
    transform: scale(1.04);
    opacity: 0.85;
}

/* --- Play button overlay --- */

.yvg-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 40px;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.yvg-thumb-wrap:hover .yvg-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
}

.yvg-play-btn svg {
    width: 100%;
    height: 100%;
}

/* --- Duration badge --- */

.yvg-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.78);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 3px;
    font-family: sans-serif;
    pointer-events: none;
}

/* --- Info area --- */

.yvg-info {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.yvg-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yvg-views {
    font-size: 12px;
    color: #777;
}

/* --- Error / empty states --- */

.yvg-error,
.yvg-empty {
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fafafa;
    color: #555;
}

.yvg-error {
    border-color: #f5c2c7;
    background: #fff3f3;
    color: #842029;
}

/* ============================================
   LOAD MORE BUTTON
   ============================================ */

.yvg-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.yvg-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    font-family: sans-serif;
    padding: 10px 28px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    min-width: 180px;
}

.yvg-load-more-btn:hover:not(:disabled) {
    border-color: #ff0000;
    color: #ff0000;
    background: #fff8f8;
}

.yvg-load-more-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ============================================
   LIGHTBOX / MODAL
   ============================================ */

.yvg-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.yvg-modal.is-open {
    display: flex;
}

.yvg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    cursor: pointer;
}

.yvg-modal-inner {
    position: relative;
    width: 90vw;
    max-width: 960px;
    z-index: 1;
}

.yvg-modal-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.yvg-modal-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.yvg-modal-close {
    position: absolute;
    top: -38px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.yvg-modal-close:hover {
    opacity: 1;
}

.yvg-modal-title {
    color: #fff;
    font-size: 15px;
    margin: 10px 0 0;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .yvg-modal-inner {
        width: 96vw;
    }
    .yvg-modal-close {
        top: -34px;
        font-size: 26px;
    }
    .yvg-subscribe-wrap {
        justify-content: center;
    }
}
