/* ===== Home video posts section (always dark, like a cinema) ===== */
.home-videos-area {
    --hv-surface: #1d1d24;
    --hv-border: rgba(255, 255, 255, 0.08);
    --hv-text: #f3f3f6;
    --hv-muted: #a3a1b3;
    --hv-accent: #a98bf5;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--hv-text);
}

/* Deep brand-purple "screening room" instead of the theme's flat black */
.home-videos-area.bg-color-black {
    background:
        radial-gradient(60% 70% at 85% 0%, rgba(124, 58, 237, 0.35), transparent 70%),
        radial-gradient(50% 60% at 10% 100%, rgba(236, 72, 153, 0.18), transparent 70%),
        linear-gradient(160deg, #1a0b2e 0%, #0f0a1a 55%, #0a0a12 100%);
}

/* Faint dot grid, fading out towards the bottom */
.home-videos-area::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    pointer-events: none;
}

/* Cards sit on the gradient as frosted glass */
.home-videos-area .home-videos-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.09);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* ----- Heading (matches the other home sections) ----- */
.home-videos-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 28px;
}

.home-videos-title {
    margin: 0 0 6px;
    color: var(--hv-text);
    font-size: 28px;
    font-weight: 800;
}

.home-videos-subtitle {
    margin: 0;
    color: var(--hv-muted);
    font-size: 15px;
}

.home-videos-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.home-videos-area .home-videos-all {
    color: #fff;
}

.home-videos-all:hover,
.home-videos-all:focus-visible {
    border-color: var(--hv-accent);
    background: rgba(169, 139, 245, 0.12);
}

.home-videos-all i {
    transition: transform 0.2s ease;
}

.home-videos-all:hover i {
    transform: translateX(-4px);
}

/* ----- Grid ----- */
.home-videos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ----- Card ----- */
.home-videos-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hv-border);
    border-radius: 16px;
    background: var(--hv-surface);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.home-videos-card:hover,
.home-videos-card:focus-within {
    border-color: rgba(169, 139, 245, 0.45);
    transform: translateY(-4px);
}

.home-videos-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.home-videos-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.home-videos-card:hover .home-videos-thumb img {
    opacity: 0.85;
    transform: scale(1.04);
}

/* Play button */
.home-videos-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #49108b;
    font-size: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.home-videos-play i {
    margin-left: 4px; /* optically centre the triangle */
}

.home-videos-play--sm {
    width: 44px;
    height: 44px;
    font-size: 14px;
}

.home-videos-card:hover .home-videos-play {
    background: #49108b;
    color: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}

/* Length badge */
.home-videos-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 12px;
    font-weight: 600;
}

/* Body */
.home-videos-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
}

.home-videos-cats {
    position: relative;
    z-index: 2; /* above the card-wide title link */
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.home-videos-cats a {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(169, 139, 245, 0.14);
    font-size: 12px;
    font-weight: 600;
    direction: ltr;
}

.home-videos-area .home-videos-cats a {
    color: var(--hv-accent);
}

.home-videos-area .home-videos-cats a:hover {
    background: rgba(169, 139, 245, 0.26);
}

.home-videos-name {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-videos-excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--hv-muted);
    font-size: 14px;
    line-height: 1.9;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.home-videos-area .home-videos-name a {
    color: var(--hv-text);
}

/* The whole card opens the video */
.home-videos-name a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.home-videos-name a:focus-visible {
    outline: none;
}

.home-videos-card:has(.home-videos-name a:focus-visible) {
    outline: 3px solid rgba(169, 139, 245, 0.6);
    outline-offset: 2px;
}

/* ----- Tablet: featured on top, two columns below ----- */
@media (min-width: 576px) {
    .home-videos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .home-videos-card--featured {
        grid-column: 1 / -1;
    }
}

/* ----- Desktop: featured spans 2x2 beside four cards ----- */
@media (min-width: 992px) {
    .home-videos-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }

    .home-videos-card--featured {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* Keep 16:9 (thumbnails carry their own text); the body takes the extra height */
    .home-videos-card--featured .home-videos-body {
        padding: 18px 22px 22px;
    }

    .home-videos-card--featured .home-videos-name {
        font-size: 21px;
    }

    .home-videos-card--featured .home-videos-play {
        width: 80px;
        height: 80px;
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-videos-card,
    .home-videos-thumb img,
    .home-videos-play,
    .home-videos-all i {
        transition: none;
    }

    .home-videos-card:hover,
    .home-videos-card:focus-within,
    .home-videos-card:hover .home-videos-thumb img {
        transform: none;
    }

    .home-videos-card:hover .home-videos-play {
        transform: translate(-50%, -50%);
    }
}

/* ===== /videos page =====
   Same cards as the home section, but on the site's normal light/dark
   background so it matches the header, footer and /posts. */
.vpage {
    --hv-bg: #f6f5fa;
    --hv-surface: #ffffff;
    --hv-border: rgba(16, 12, 40, 0.08);
    --hv-text: #1f1d2b;
    --hv-muted: #6b6880;
    --hv-accent: var(--color-primary, #49108b);
    --hv-accent-soft: rgba(73, 16, 139, 0.1);
    padding: 36px 0 80px;
    background: var(--hv-bg);
    color: var(--hv-text);
}

body.active-dark-mode .vpage {
    --hv-bg: #111116;
    --hv-surface: #1d1d24;
    --hv-border: rgba(255, 255, 255, 0.08);
    --hv-text: #f3f3f6;
    --hv-muted: #a3a1b3;
    --hv-accent: #a98bf5;
    --hv-accent-soft: rgba(169, 139, 245, 0.14);
}

.vpage a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--hv-accent) 45%, transparent);
    outline-offset: 2px;
}

/* Card details that the home section scopes to its own (always dark) wrapper */
.vpage .home-videos-card:hover,
.vpage .home-videos-card:focus-within {
    border-color: color-mix(in srgb, var(--hv-accent) 35%, transparent);
    box-shadow: 0 16px 32px rgba(16, 12, 40, 0.08);
}

.vpage .home-videos-cats a {
    background: var(--hv-accent-soft);
    color: var(--hv-accent);
}

.vpage .home-videos-cats a:hover {
    background: color-mix(in srgb, var(--hv-accent) 20%, transparent);
}

.vpage .home-videos-name a {
    color: var(--hv-text);
}

.vpage .home-videos-card:hover .home-videos-name a {
    color: var(--hv-accent);
}

.vpage .home-videos-card:has(.home-videos-name a:focus-visible) {
    outline-color: color-mix(in srgb, var(--hv-accent) 45%, transparent);
}

.vpage-head {
    margin-bottom: 20px;
}

.vpage-breadcrumb {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--hv-muted);
    font-size: 13px;
}

.vpage .vpage-breadcrumb a {
    color: var(--hv-muted);
}

.vpage .vpage-breadcrumb a:hover {
    color: var(--hv-accent);
}

.vpage .vpage-title {
    margin: 0 0 8px;
    color: var(--hv-text);
    font-size: 32px;
    font-weight: 800;
}

.vpage-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
    color: var(--hv-muted);
    font-size: 15px;
}

.vpage-count {
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--hv-accent-soft);
    color: var(--hv-accent);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 700;
}

/* ----- Section tabs + sort chips ----- */
.vpage-sections,
.vpage-sorts {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.vpage-sections::-webkit-scrollbar,
.vpage-sorts::-webkit-scrollbar {
    display: none;
}

.vpage-sections {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hv-border);
}

.vpage-sections a,
.vpage-sorts a {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.vpage .vpage-sections a,
.vpage .vpage-sorts a {
    color: var(--hv-muted);
}

.vpage .vpage-sections a:hover,
.vpage .vpage-sorts a:hover {
    background: var(--hv-surface);
    color: var(--hv-text);
}

.vpage .vpage-sections a.is-active {
    background: var(--hv-accent);
    color: #fff;
}

body.active-dark-mode .vpage .vpage-sections a.is-active {
    background: #6d3fd1;
}

.vpage .vpage-sorts a.is-active {
    background: var(--hv-accent-soft);
    color: var(--hv-accent);
}

.vpage-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--hv-muted);
    font-size: 13px;
}

.vpage-toolbar > span {
    flex: none;
}

/* ----- Grid: 3 columns, the newest video 2x2 ----- */
@media (min-width: 992px) {
    .vpage .vpage-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* "Newest" ribbon on the featured video */
.vpage-new {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

/* ----- Meta (author, time, views) ----- */
.vpage-meta {
    position: relative;
    z-index: 2; /* author link above the card-wide link */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-top: auto;
    padding-top: 6px;
    color: var(--hv-muted);
    font-size: 12px;
}

.vpage-meta,
.vpage-meta * {
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
}

.vpage .vpage-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--hv-text);
    font-weight: 600;
}

.vpage .vpage-author:hover {
    color: var(--hv-accent);
}

.vpage-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.vpage-meta-items {
    display: inline-flex;
    gap: 6px;
}

/* ----- Empty + pagination ----- */
.vpage-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 56px 16px;
    border: 2px dashed var(--hv-border);
    border-radius: 20px;
    color: var(--hv-muted);
    text-align: center;
}

.vpage-empty span {
    font-size: 42px;
}

.vpage-empty p {
    margin: 0;
}

.vpage-pagination {
    margin-top: 32px;
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
}

@media (max-width: 575px) {
    .vpage {
        padding-top: 22px;
    }

    .vpage .vpage-title {
        font-size: 26px;
    }
}
