/**
 * Watch Page - Israel.com White & Blue Video Hub
 * AP News-inspired layout with light theme, blue accents,
 * category sections with multiple layout variations.
 *
 * @package Israel_News_Theme
 * @since 2.0.0
 */

/* ==========================================================================
   BASE / LAYOUT
   ========================================================================== */
.watch-page {
    background: #fafbfc;
    min-height: 100vh;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #1f2937;
    padding-bottom: 60px;
}

.watch-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   SECTION HEADER (accent bar + title + nav arrows)
   ========================================================================== */
.watch-section-header {
    padding-top: 40px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 14px;
}

.watch-section-header-left {
    display: flex;
    flex-direction: column;
}

.watch-accent-bar {
    width: 48px;
    height: 4px;
    background: #0033cc;
    margin-bottom: 10px;
    border-radius: 2px;
}

.watch-section-title {
    font-family: "Roboto Condensed", "Roboto", sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: #1a1a2e;
    margin: 0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Carousel navigation arrows */
.watch-carousel-nav {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.watch-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.watch-nav-btn:hover {
    border-color: #0033cc;
    color: #0033cc;
    background: #f0f4ff;
}

.watch-nav-btn:active {
    background: #0033cc;
    color: #fff;
    border-color: #0033cc;
}

/* ==========================================================================
   HERO SECTION: Player (left) + Playlist Sidebar (right)
   ========================================================================== */
.watch-hero {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 32px 0 40px;
}

.watch-hero-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
}

/* --- Player Column --- */
.watch-player-col {
    min-width: 0;
}

.watch-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px 0 0 8px;
    overflow: hidden;
}

.watch-video-el {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Play overlay */
.watch-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s;
    background: rgba(0, 0, 0, 0.15);
}

.watch-play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.watch-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
}

.watch-play-btn:hover {
    transform: scale(1.1);
}

.watch-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Player info below */
.watch-player-info {
    padding: 18px 0 0;
}

.watch-player-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    color: #0033cc;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.watch-player-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
    color: #1a1a2e;
}

.watch-player-title a {
    color: inherit;
    text-decoration: none;
}

.watch-player-title a:hover {
    color: #0033cc;
}

.watch-player-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: #6b7280;
    margin: 0;
}

/* --- Playlist Sidebar Column --- */
.watch-playlist-col {
    border-left: 3px solid #0033cc;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    max-height: 520px;
}

.watch-playlist-header {
    padding: 12px 16px;
    background: #f8f9fc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.watch-playlist-label {
    font-size: 12px;
    font-weight: 800;
    color: #0033cc;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.watch-playlist {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* Scrollbar styling */
.watch-playlist::-webkit-scrollbar {
    width: 4px;
}

.watch-playlist::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.watch-playlist::-webkit-scrollbar-thumb {
    background: #ccd5e0;
    border-radius: 3px;
}

.watch-playlist-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #f0f1f3;
    transition: background 0.15s;
    align-items: flex-start;
}

.watch-playlist-item:hover {
    background: #f0f4ff;
}

.watch-playlist-item.is-active {
    background: #eef2ff;
    border-left: 3px solid #0033cc;
    padding-left: 11px;
}

/* "ON NOW" badge */
.watch-pl-now-badge {
    position: absolute;
    top: 6px;
    left: 14px;
    background: #0033cc;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    z-index: 2;
}

.watch-playlist-item.is-active .watch-pl-now-badge {
    left: 11px;
}

/* Playlist thumbnail */
.watch-pl-thumb {
    position: relative;
    width: 130px;
    min-width: 130px;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 4px;
}

.watch-pl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    color: transparent;
}

.watch-pl-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading shimmer for images awaiting first-frame extraction */
img[data-video-url] {
    background: linear-gradient(110deg, #1a1a2e 30%, #253052 50%, #1a1a2e 70%);
    background-size: 200% 100%;
    animation: watchShimmer 1.4s ease-in-out infinite;
    object-fit: cover;
    color: transparent;
}

/* Broken image handler: hide broken icon, let container bg show */
img.watch-img-broken {
    opacity: 0;
    position: absolute;
}

@keyframes watchShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.watch-pl-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 2px;
}

/* Playlist info */
.watch-pl-info {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.watch-pl-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #374151;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-playlist-item:hover .watch-pl-title,
.watch-playlist-item.is-active .watch-pl-title {
    color: #0033cc;
}

/* ==========================================================================
   CATEGORY SECTIONS
   ========================================================================== */
.watch-category-section {
    padding-bottom: 20px;
}

/* ==========================================================================
   LAYOUT A: Horizontal Card Carousel ("ON CAMERA" style)
   Landscape thumbnails with titles below
   ========================================================================== */
.watch-card-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.watch-card-carousel::-webkit-scrollbar {
    height: 0;
}

.watch-card {
    flex: 0 0 calc(25% - 15px);
    min-width: 240px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    display: block;
}

.watch-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.watch-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
    color: transparent;
}

.watch-card:hover .watch-card-thumb img {
    transform: scale(1.05);
}

.watch-card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
}

.watch-card-play-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.watch-card:hover .watch-card-play-hover {
    opacity: 1;
}

.watch-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    margin: 10px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-card:hover .watch-card-title {
    color: #0033cc;
}

/* ==========================================================================
   LAYOUT B: Featured + Sidebar ("INVESTIGATIONS" style)
   Large video left, vertical list right
   ========================================================================== */
.watch-feat-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.watch-feat-main {
    min-width: 0;
    padding-bottom: 20px;
}

.watch-feat-link {
    display: block;
    text-decoration: none;
}

.watch-feat-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
}

.watch-feat-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
    color: transparent;
}

.watch-feat-link:hover .watch-feat-media img {
    transform: scale(1.03);
}

.watch-feat-play {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 2;
    transition: transform 0.2s;
}

.watch-feat-link:hover .watch-feat-play {
    transform: scale(1.1);
}

.watch-feat-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 2;
}

.watch-feat-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 16px 16px 8px;
    line-height: 1.3;
}

.watch-feat-title a {
    color: inherit;
    text-decoration: none;
}

.watch-feat-title a:hover {
    color: #0033cc;
}

.watch-feat-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0 16px;
}

/* Featured sidebar list */
.watch-feat-sidebar {
    border-left: 3px solid #0033cc;
    background: #fafbfc;
    max-height: 520px;
    overflow-y: auto;
}

.watch-feat-sidebar::-webkit-scrollbar {
    width: 4px;
}

.watch-feat-sidebar::-webkit-scrollbar-track {
    background: #f5f6f8;
}

.watch-feat-sidebar::-webkit-scrollbar-thumb {
    background: #ccd5e0;
    border-radius: 3px;
}

.watch-feat-sidebar-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    align-items: flex-start;
}

.watch-feat-sidebar-item:hover {
    background: #f0f4ff;
}

.watch-feat-sidebar-thumb {
    position: relative;
    width: 130px;
    min-width: 130px;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 4px;
}

.watch-feat-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    color: transparent;
}

.watch-sidebar-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 2px;
}

.watch-feat-sidebar-info {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.watch-feat-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #374151;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-feat-sidebar-item:hover .watch-feat-sidebar-title {
    color: #0033cc;
}

/* ==========================================================================
   LAYOUT C: Tall Cards ("Behind the Scenes" style)
   Tall portrait cards with overlay text & play button
   ========================================================================== */
.watch-tall-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.watch-tall-row::-webkit-scrollbar {
    height: 0;
}

.watch-tall-card {
    flex: 0 0 calc(20% - 13px);
    min-width: 200px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    display: block;
}

.watch-tall-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.watch-tall-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
    color: transparent;
}

.watch-tall-card:hover .watch-tall-card-media img {
    transform: scale(1.05);
}

.watch-tall-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 40%, transparent 65%);
    pointer-events: none;
}

.watch-tall-card-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 2;
}

.watch-tall-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-tall-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.watch-tall-play-icon {
    flex-shrink: 0;
}

.watch-tall-card-dur {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   MORE VIDEOS GRID
   ========================================================================== */
.watch-more-section {
    border-top: 1px solid #e5e7eb;
}

.watch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.watch-grid-card {
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.watch-grid-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.watch-grid-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
}

.watch-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
    color: transparent;
}

.watch-grid-card:hover .watch-grid-thumb img {
    transform: scale(1.05);
}

.watch-grid-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
}

.watch-grid-card .watch-card-play-hover {
    border-radius: 0;
}

.watch-grid-info {
    padding: 12px 4px;
}

.watch-grid-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    color: #0033cc;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 4px;
}

.watch-grid-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-grid-card:hover .watch-grid-title {
    color: #0033cc;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.watch-pagination {
    padding: 40px 0;
    text-align: center;
}

.watch-pagination ul {
    list-style: none;
    display: inline-flex;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.watch-pagination li {
    display: inline-block;
}

.watch-pagination a,
.watch-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid #d1d5db;
    color: #4a5568;
    background: #fff;
}

.watch-pagination a:hover {
    background: #0033cc;
    color: #fff;
    border-color: #0033cc;
}

.watch-pagination .current {
    background: #0033cc;
    color: #fff;
    border-color: #0033cc;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.watch-empty-state {
    padding: 80px 0;
}

.watch-empty-inner {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.watch-empty-inner svg {
    margin-bottom: 20px;
}

.watch-empty-inner h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.watch-empty-inner p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 24px;
}

.watch-empty-home {
    display: inline-block;
    background: #0033cc;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.watch-empty-home:hover {
    background: #0044ee;
    color: #fff;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Large tablets */
@media (max-width: 1100px) {
    .watch-hero-layout {
        grid-template-columns: 1fr 320px;
    }

    .watch-feat-sidebar-layout {
        grid-template-columns: 1fr 320px;
    }

    .watch-card {
        flex: 0 0 calc(33.33% - 14px);
    }

    .watch-tall-card {
        flex: 0 0 calc(25% - 12px);
    }

    .watch-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .watch-pl-thumb,
    .watch-feat-sidebar-thumb {
        width: 110px;
        min-width: 110px;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .watch-hero-layout,
    .watch-feat-sidebar-layout {
        grid-template-columns: 1fr;
    }

    .watch-player-wrap {
        border-radius: 8px;
    }

    .watch-playlist-col,
    .watch-feat-sidebar {
        border-left: none;
        border-top: 3px solid #0033cc;
        max-height: 300px;
    }

    .watch-section-title {
        font-size: 24px;
    }

    .watch-card {
        flex: 0 0 calc(33.33% - 14px);
        min-width: 200px;
    }

    .watch-tall-card {
        flex: 0 0 calc(33.33% - 11px);
        min-width: 180px;
    }

    .watch-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile landscape */
@media (max-width: 680px) {
    .watch-container {
        padding: 0 16px;
    }

    .watch-hero {
        padding: 20px 0 28px;
    }

    .watch-section-header {
        padding-top: 28px;
    }

    .watch-section-title {
        font-size: 20px;
    }

    .watch-player-title {
        font-size: 18px;
    }

    .watch-card {
        flex: 0 0 calc(50% - 10px);
        min-width: 180px;
    }

    .watch-tall-card {
        flex: 0 0 calc(50% - 8px);
        min-width: 150px;
    }

    .watch-pl-thumb,
    .watch-feat-sidebar-thumb {
        width: 100px;
        min-width: 100px;
    }

    .watch-pl-title,
    .watch-feat-sidebar-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .watch-feat-title {
        font-size: 17px;
        margin: 12px 12px 6px;
    }

    .watch-feat-excerpt {
        margin: 0 12px;
        font-size: 13px;
    }

    .watch-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .watch-section-title {
        font-size: 18px;
    }

    .watch-player-title {
        font-size: 16px;
    }

    .watch-player-excerpt {
        font-size: 13px;
    }

    .watch-play-btn svg {
        width: 52px;
        height: 52px;
    }

    .watch-card {
        flex: 0 0 70%;
        min-width: 220px;
    }

    .watch-tall-card {
        flex: 0 0 60%;
        min-width: 200px;
    }

    .watch-playlist-col,
    .watch-feat-sidebar {
        max-height: 240px;
    }

    .watch-grid {
        grid-template-columns: 1fr;
    }

    .watch-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .watch-carousel-nav {
        align-self: flex-end;
    }
}
