/* =============================================
   News Video Grid v3 — CSS
   ============================================= */

/* ── Grid ── */
.nvg-grid {
    display: grid;
    grid-template-columns: repeat(var(--nvg-cols,4), 1fr);
    gap: 20px;
    margin: 0; padding: 0;
}
@media (max-width:1024px) { .nvg-grid { grid-template-columns: repeat(var(--nvg-cols-t,2), 1fr); } }
@media (max-width:767px)  { .nvg-grid { grid-template-columns: repeat(var(--nvg-cols-m,1), 1fr); } }

/* ── Carousel ── */
.nvg-carousel {
    position: relative;
}
.nvg-carousel__viewport {
    overflow: hidden;
}
.nvg-carousel__track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
}
.nvg-carousel__track .nvg-card {
    flex: 0 0 var(--nvg-card-w, 25%);
    min-width: 0;
}

/* Arrows — positioned via JS at vertical center of thumbnails */
.nvg-carousel__arrow {
    position: absolute;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    padding: 0;
    /* top is set by JS to center on thumbnail */
    top: 0;
}
.nvg-carousel__arrow svg {
    width: 18px; height: 18px;
}
.nvg-carousel__arrow--prev { left: 0; transform: translateX(-50%); }
.nvg-carousel__arrow--next { right: 0; transform: translateX(50%); }
.nvg-carousel__arrow:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.nvg-carousel__arrow--prev:hover { transform: translateX(-50%) scale(1.08); }
.nvg-carousel__arrow--next:hover { transform: translateX(50%) scale(1.08); }
.nvg-carousel__arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

/* ── Card ── */
.nvg-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
}
a.nvg-card { text-decoration: none; color: inherit; }
.nvg-card:focus-visible { outline: 2px solid #0073aa; outline-offset: 2px; }

/* ── Thumbnail ── */
.nvg-card__thumb {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    aspect-ratio: 16/9;
}
.nvg-wrapper[data-aspect="4-3"]  .nvg-card__thumb { aspect-ratio: 4/3; }
.nvg-wrapper[data-aspect="1-1"]  .nvg-card__thumb { aspect-ratio: 1/1; }
.nvg-wrapper[data-aspect="3-2"]  .nvg-card__thumb { aspect-ratio: 3/2; }
.nvg-wrapper[data-aspect="21-9"] .nvg-card__thumb { aspect-ratio: 21/9; }

.nvg-card__thumb img {
    display: block; width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}

.nvg-card__no-thumb {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: #2a2a2a; color: #555;
}
.nvg-card__no-thumb svg { width: 36px; height: 36px; }

/* Hover */
.nvg-hover-zoom:hover .nvg-card__thumb img        { transform: scale(1.06); }
.nvg-hover-darken:hover .nvg-card__thumb img       { filter: brightness(.75); }
.nvg-hover-zoom_darken:hover .nvg-card__thumb img  { transform: scale(1.06); filter: brightness(.75); }

/* Gradient */
.nvg-card__grad {
    position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,.15), transparent);
    pointer-events: none; z-index: 1;
}

/* Play */
.nvg-card__play {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 48px; height: 48px;
    background: rgba(0,0,0,.55);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
    transition: transform .2s, background .2s;
    pointer-events: none;
}
.nvg-card__play svg { width: 40%; height: 40%; fill: #fff; margin-left: 2px; }
.nvg-card:hover .nvg-card__play {
    transform: translate(-50%,-50%) scale(1.12);
    background: rgba(0,0,0,.7);
}

/* Duration */
.nvg-card__dur {
    position: absolute; bottom: 8px; left: 8px; z-index: 2;
    padding: 2px 6px; font-size: 12px; font-weight: 600;
    line-height: 1.4; color: #fff; background: rgba(0,0,0,.7);
    border-radius: 3px; letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}
.nvg-wrapper[data-dur-pos="right"] .nvg-card__dur { left: auto; right: 8px; }

/* Body */
.nvg-card__body { padding: 10px 0 0; display: flex; flex-direction: column; }

.nvg-card__cat {
    display: inline-block; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: #c0392b; text-decoration: none; margin-bottom: 4px; align-self: flex-start;
}
.nvg-card__cat:hover { text-decoration: underline; }

.nvg-card__title {
    margin: 0 0 4px; font-size: 15px; font-weight: 600; line-height: 1.35;
    display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--nvg-lines,3); overflow: hidden; word-break: break-word;
}

.nvg-card__exc {
    margin: 0 0 4px; font-size: 13px; line-height: 1.45; color: #666;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.nvg-card__date { font-size: 13px; color: #888; line-height: 1.3; }

.nvg-section-title { margin: 0 0 20px; font-size: 22px; font-weight: 700; line-height: 1.3; }

.nvg-no-posts {
    grid-column: 1/-1; text-align: center; padding: 40px 20px; color: #888; font-size: 14px;
}

/* ── Pagination ── */
.nvg-load-more { display: flex; justify-content: center; margin-top: 30px; }
.nvg-load-more__btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 28px; font-size: 14px; font-weight: 600;
    border: 1px solid #ddd; background: transparent; color: #333;
    cursor: pointer; transition: background .2s, border-color .2s;
    border-radius: 4px; min-width: 160px; line-height: 1.4;
}
.nvg-load-more__btn:hover { background: #f5f5f5; border-color: #bbb; }
.nvg-load-more__btn:disabled { opacity: .5; cursor: default; }
.nvg-load-more__btn[data-done="true"] { display: none; }

.nvg-infinite-scroll { margin-top: 30px; text-align: center; }
.nvg-infinite-scroll__trigger { height: 1px; }
.nvg-infinite-scroll__loading { padding: 16px; color: #888; font-size: 14px; }
.nvg-infinite-scroll__loading span { display: inline-flex; align-items: center; gap: 8px; }
.nvg-infinite-scroll__loading span::before {
    content: ''; width: 16px; height: 16px;
    border: 2px solid #ddd; border-top-color: #888; border-radius: 50%;
    animation: nvg-spin .6s linear infinite;
}
@keyframes nvg-spin { to { transform: rotate(360deg); } }

.nvg-pagination { display: flex; justify-content: center; gap: 4px; margin-top: 30px; flex-wrap: wrap; }
.nvg-pagination a, .nvg-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px; font-size: 14px;
    border: 1px solid #ddd; text-decoration: none; color: #333;
    border-radius: 4px; transition: background .15s;
}
.nvg-pagination a:hover { background: #f5f5f5; }
.nvg-pagination .current { background: #333; color: #fff; border-color: #333; font-weight: 600; }

/* ── Lightbox ── */
.nvg-lightbox {
    position: fixed; inset: 0; z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.9);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.nvg-lightbox--open { opacity: 1; visibility: visible; }
.nvg-lightbox__inner { position: relative; width: 90%; max-width: 960px; aspect-ratio: 16/9; background: #000; }
.nvg-lightbox__inner video { width: 100%; height: 100%; display: block; }
.nvg-lightbox__close {
    position: absolute; top: -40px; right: 0; width: 36px; height: 36px;
    background: none; border: none; color: #fff; font-size: 28px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: .7; transition: opacity .15s; padding: 0;
}
.nvg-lightbox__close:hover { opacity: 1; }

.nvg-card__inline-video { position: absolute; inset: 0; z-index: 5; background: #000; }
.nvg-card__inline-video video { width: 100%; height: 100%; object-fit: cover; }

/* Editor */
.elementor-editor-active .nvg-grid { display: grid !important; }
.elementor-editor-active .nvg-carousel__track { display: flex !important; }
.elementor-editor-active .nvg-card { cursor: default; }
