/* ==========================================================================
   GLOBAL LAYOUT & BASE STYLES
   ========================================================================== */

.video-archive-wrapper,
.single-video-wrapper {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 24px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
}

/* Fix for potential wide layout blowouts */
.video-archive-wrapper *,
.single-video-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   ARCHIVE HEADER
   ========================================================================== */

.video-archive-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f2f5;
}

.video-archive-heading {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin: 0 0 12px 0;
    line-height: 1.1;
}

.video-archive-subtitle {
    font-size: 1.15rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* ==========================================================================
   VIDEO GRID ARCHIVE
   ========================================================================== */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.video-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.10);
    border-color: #cbd5e1;
}

.video-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ==========================================================================
   THUMBNAILS & OVERLAY
   ========================================================================== */

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #090d16;
    overflow: hidden;
}

.video-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-card:hover .video-image {
    transform: scale(1.05);
}

.video-placeholder {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
}

.placeholder-icon {
    font-size: 2.2rem;
    opacity: 0.4;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.25);
    opacity: 0.85;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
    background: rgba(15, 23, 42, 0.45);
}

.play-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #dc2626; /* Dynamic Red Accent */
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

.video-card:hover .play-button {
    transform: scale(1.15);
    background: #ef4444;
}

/* ==========================================================================
   CARD CONTENT
   ========================================================================== */

.video-card-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.video-meta {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e11d48;
    margin-bottom: 10px;
}

.video-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    color: #0f172a;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.video-card:hover .video-card-title {
    color: #dc2626;
}

.video-excerpt {
    font-size: 0.938rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   SINGLE VIDEO PAGE (WITH TEXT WRAP FIX)
   ========================================================================== */

.single-video-container {
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}

.single-video-header {
    margin-bottom: 30px;
}

.single-video-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 16px 0;
    
    /* Title text wrapping safe-guards */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.single-video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 0.938rem;
    font-weight: 500;
}

.video-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
}

.single-video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

.single-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- FIX FOR INFINITE DESCRIPTION LINE STRETCH --- */
.single-video-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
    
    /* Force text wrapping and line breaks */
    width: 100%;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.single-video-description p,
.single-video-description div,
.single-video-description span {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    margin-bottom: 1.5em;
}

.single-video-description img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.video-pagination {
    margin-top: 60px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.video-pagination a,
.video-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.938rem;
    transition: all 0.2s ease;
}

.video-pagination a:hover {
    background: #dc2626;
    color: #ffffff;
}

.video-pagination .current {
    background: #0f172a;
    color: #ffffff;
}

/* ==========================================================================
   EMPTY / NO RESULTS STATE
   ========================================================================== */

.no-videos {
    text-align: center;
    padding: 70px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    margin: 40px 0;
}

.no-videos h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.no-videos p {
    color: #64748b;
    margin: 0;
}

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

@media (max-width: 768px) {
    .video-archive-wrapper,
    .single-video-wrapper {
        margin: 24px auto;
        padding: 0 16px;
    }

    .video-archive-header {
        margin-bottom: 30px;
    }

    .video-archive-heading {
        font-size: 2.1rem;
    }

    .video-archive-subtitle {
        font-size: 1rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .single-video-title {
        font-size: 1.75rem;
    }

    .single-video-description {
        font-size: 1rem;
        line-height: 1.65;
    }

    .play-button {
        width: 48px;
        height: 48px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}