/* Yad Sarah Videos v1.4 – Mobile-first, no horizontal scroll */

.ysv-page,
.ysv-page * {
    box-sizing: border-box;
}

.ysv-page {
    direction: rtl;
    font-family: Arial, 'Arial Hebrew', sans-serif;
    width: 100%;
    padding: 0 0 48px;
    color: #0d1b2a;
    overflow-x: hidden;
}

/* ══════════════════════════════
   FILTER BAR
   Scrollable internally but isolated — won't leak to page
══════════════════════════════ */
.ysv-page .ysv-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    padding: 10px 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    border-bottom: 2px solid #e4ebf2;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 50;
    /* prevent the bar's scroll from bubbling to page */
    touch-action: pan-x;
}
.ysv-page .ysv-filter-bar::-webkit-scrollbar { display: none; }

.ysv-page .ysv-filter-pill {
    flex-shrink: 0;
    background: #f0f4f8;
    border: 1.5px solid #d4dce6;
    color: #1a2a3a;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: Arial, 'Arial Hebrew', sans-serif;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background .15s, border-color .15s, color .15s;
}
.ysv-page .ysv-filter-pill:hover,
.ysv-page .ysv-filter-pill:focus {
    background: #dbeaf8;
    border-color: #0062b2;
    color: #0062b2;
    outline: none;
}
.ysv-page .ysv-filter-pill.active {
    background: #e8700a;
    border-color: #e8700a;
    color: #fff;
}

/* ══════════════════════════════
   SECTION
══════════════════════════════ */
.ysv-page .ysv-section { margin-bottom: 32px; }
.ysv-page .ysv-section.ysv-hidden { display: none !important; }

.ysv-page .ysv-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}
.ysv-page .ysv-section-line {
    display: inline-block;
    width: 4px;
    height: 19px;
    background: #e8700a;
    border-radius: 3px;
    flex-shrink: 0;
}
.ysv-page .ysv-section-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #0d1b2a !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}
.ysv-page .ysv-section-count {
    font-size: 11px;
    color: #8a9bb0;
    margin-right: auto;
    white-space: nowrap;
}

/* ══════════════════════════════
   GRID – 2 cols mobile-first
══════════════════════════════ */
.ysv-page .ysv-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
    width: 100%;
}

/* ══════════════════════════════
   CARD
══════════════════════════════ */
.ysv-page .ysv-card {
    background: #fff;
    border: 1.5px solid #e4ebf2;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 0;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ysv-page .ysv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,98,178,0.14);
    border-color: #a8c8e8;
}
.ysv-page .ysv-card:active { transform: scale(0.97); }

/* Thumbnail 16:9 */
.ysv-page .ysv-card-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #111c2a;
    overflow: hidden;
    flex-shrink: 0;
}
.ysv-page .ysv-card-thumb img {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    transition: transform .28s;
}
.ysv-page .ysv-card:hover .ysv-card-thumb img { transform: scale(1.05); }

.ysv-page .ysv-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    transition: background .18s;
    pointer-events: none;
}
.ysv-page .ysv-card:hover .ysv-card-overlay { background: rgba(0,20,50,.42); }
.ysv-page .ysv-card-play-btn {
    width: 38px;
    height: 38px;
    background: #0062b2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity .18s, transform .18s;
    box-shadow: 0 3px 14px rgba(0,0,0,.3);
}
.ysv-page .ysv-card:hover .ysv-card-play-btn { opacity: 1; transform: scale(1); }

.ysv-page .ysv-card-info {
    padding: 9px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}
.ysv-page .ysv-card-cat-badge {
    display: inline-block !important;
    background: #e8f2fc !important;
    color: #0050a0 !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 20px !important;
    width: fit-content !important;
    max-width: 100% !important;
    line-height: 1.5 !important;
    border: none !important;
    margin: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ysv-page .ysv-card-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0d1b2a !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    flex: 1;
}
.ysv-page .ysv-card-share-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #7a99b8 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer;
    padding: 4px 0 0 !important;
    margin: 0 !important;
    font-family: Arial, 'Arial Hebrew', sans-serif;
    transition: color .15s;
    text-decoration: none !important;
    width: auto !important;
    min-height: 28px !important;
    min-width: unset !important;
    border-radius: 0 !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ysv-page .ysv-card-share-btn:hover { color: #0062b2 !important; background: none !important; }

/* ══════════════════════════════
   MODAL – bottom sheet on mobile
══════════════════════════════ */
.ysv-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(4,14,32,.85) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    direction: rtl;
    touch-action: none;
}
.ysv-modal-overlay.ysv-hidden-modal { display: none !important; }

.ysv-modal-box {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 92vh;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 -8px 40px rgba(0,0,0,.4);
    display: flex;
    flex-direction: column;
    direction: rtl;
}
.ysv-modal-handle {
    width: 40px;
    height: 4px;
    background: #d0dce8;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}
.ysv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #e4ebf2;
    flex-shrink: 0;
}
.ysv-modal-cat-label {
    background: #e8f2fc;
    color: #0050a0;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
}
.ysv-modal-close {
    background: #f0f4f8 !important;
    border: none !important;
    width: 34px !important; height: 34px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #4a6080 !important;
    box-shadow: none !important;
    padding: 0 !important; margin: 0 !important;
    flex-shrink: 0;
    min-height: unset !important; min-width: unset !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ysv-modal-close:hover { background: #dce6f0 !important; }

.ysv-modal-player {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
    flex-shrink: 0;
    width: 100%;
}
.ysv-modal-iframe {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    border: none;
}
.ysv-modal-footer {
    padding: 12px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #e4ebf2;
    flex-shrink: 0;
}
.ysv-modal-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #0d1b2a !important;
    margin: 0 !important; padding: 0 !important;
    line-height: 1.4 !important;
}
.ysv-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ysv-modal-actions a,
.ysv-modal-actions button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    font-family: Arial, 'Arial Hebrew', sans-serif !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    min-height: 40px !important;
    min-width: unset !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.ysv-modal-wa   { background: #25D366 !important; color: #fff !important; }
.ysv-modal-fb   { background: #1877F2 !important; color: #fff !important; }
.ysv-modal-copy { background: #f0f4f8 !important; color: #1a2a3a !important; border: 1.5px solid #c8d8e8 !important; }

/* ══════════════════════════════
   TABLET 600px+
══════════════════════════════ */
@media (min-width: 600px) {
    .ysv-page .ysv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .ysv-page .ysv-section-title { font-size: 16px !important; }
    .ysv-modal-overlay { align-items: center !important; padding: 16px !important; }
    .ysv-modal-box { border-radius: 14px; max-width: 680px; max-height: calc(100vh - 32px); }
    .ysv-modal-handle { display: none; }
    .ysv-modal-footer { flex-direction: row; align-items: center; justify-content: space-between; }
    .ysv-modal-title { flex: 1; }
}

/* ══════════════════════════════
   DESKTOP 900px+
══════════════════════════════ */
@media (min-width: 900px) {
    .ysv-page .ysv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .ysv-page .ysv-section-title { font-size: 17px !important; }
    .ysv-page .ysv-card-title { font-size: 13px !important; }
    .ysv-modal-box { max-width: 820px; }
}
@media (min-width: 1200px) {
    .ysv-page .ysv-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
}

/* ══════════════════════════════
   VERY SMALL 360px-
══════════════════════════════ */
@media (max-width: 360px) {
    .ysv-page .ysv-grid { gap: 8px; }
    .ysv-page .ysv-card-title { font-size: 11px !important; }
    .ysv-page .ysv-filter-pill { font-size: 12px; padding: 6px 13px; }
}

/* ══════════════════════════════
   FIX: NetFree browser extension causes horizontal scroll
   by injecting a fixed iframe that extends beyond viewport.
   Lock horizontal scroll site-wide when our plugin is active.
══════════════════════════════ */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}
