/* ============================================================
   Swadesh Bharat News — YouTube Video Section
   ============================================================ */

/* ---------- Section wrapper — inherits sbn-cat-block layout ---------- */
.sbn-yt-section {
    /* No extra override needed; .sbn-cat-block handles spacing */
}

/* Play icon badge next to the section title */
.sbn-yt-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ff0000;
    color: #fff;
    border-radius: 4px;
    font-size: 0.62rem;
    line-height: 1;
    vertical-align: middle;
    margin-right: 4px;
}

/* ---------- Archive page wrapper ---------- */
.sbn-yt-archive-wrap {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

.sbn-yt-archive__header {
    margin-bottom: 20px;
}

.sbn-yt-archive__count {
    font-size: .82rem;
    color: #888;
    margin-left: auto;
}

.sbn-yt-archive__pagination {
    margin-top: 28px;
}

/* Archive grid: 4 columns (same as homepage) */
.sbn-yt-grid--archive {
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1024px) {
    .sbn-yt-grid--archive { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .sbn-yt-grid--archive { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .sbn-yt-grid--archive { grid-template-columns: 1fr; }
}

/* ---------- Video card grid ---------- */
.sbn-yt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 1024px) {
    .sbn-yt-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .sbn-yt-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
    .sbn-yt-grid { grid-template-columns: 1fr; }
    .sbn-yt-section { padding: 0 10px; }
}

/* ---------- Individual card ---------- */
.sbn-yt-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .10);
    transition: transform .22s ease, box-shadow .22s ease;
    cursor: pointer;
    position: relative;
}

.sbn-yt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

/* ---------- Thumbnail wrapper ---------- */
.sbn-yt-card__thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}

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

.sbn-yt-card:hover .sbn-yt-card__thumb {
    transform: scale(1.06);
    filter: brightness(.75);
}

/* Dark overlay on hover */
.sbn-yt-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .3s ease;
    pointer-events: none;
}
.sbn-yt-card:hover .sbn-yt-card__overlay {
    background: rgba(0, 0, 0, .32);
}

/* Play button */
.sbn-yt-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.85);
    opacity: .9;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
}
.sbn-yt-card:hover .sbn-yt-card__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

/* ---------- Card body ---------- */
.sbn-yt-card__body {
    padding: 10px 12px 12px;
}

.sbn-yt-card__title {
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sbn-yt-card__title-link {
    color: #1a1a1a;
    text-decoration: none;
    transition: color .2s;
}
.sbn-yt-card__title-link:hover {
    color: #c1121f;
    text-decoration: underline;
}

.sbn-yt-card__excerpt {
    font-size: .76rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   Popup / Modal overlay
   ============================================================ */

.sbn-yt-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sbn-yt-popup[hidden] {
    display: none !important;
}

/* Semi-transparent backdrop —
   pointer-events: none so the card underneath keeps receiving
   mouseenter/mouseleave and doesn't blink when the popup opens. */
.sbn-yt-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .82);
    cursor: default;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
}

/* Modal box */
.sbn-yt-popup__box {
    position: relative;
    z-index: 1;
    width: min(860px, 92vw);
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.8);
    animation: sbnYtSlideIn .22s ease;
}

@keyframes sbnYtSlideIn {
    from { opacity: 0; transform: translateY(24px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close button */
.sbn-yt-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    padding: 0;
}
.sbn-yt-popup__close:hover {
    background: #c1121f;
}

/* 16:9 iframe wrapper */
.sbn-yt-popup__embed-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.sbn-yt-popup__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer bar inside popup */
.sbn-yt-popup__footer {
    padding: 10px 16px;
    background: #111;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sbn-yt-popup__yt-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    opacity: .85;
    transition: opacity .2s, color .2s;
}
.sbn-yt-popup__yt-link:hover {
    opacity: 1;
    color: #ff4040;
}

/* ============================================================
   Hover card-level popup anchor (position near card)
   — used when JS positions the popup near the hovered card
   ============================================================ */
.sbn-yt-card.is-popup-open .sbn-yt-card__thumb-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid #ff0000;
    border-radius: 4px;
    pointer-events: none;
}
