/**
 * Home "Latest releases" — panel colors follow body[data-home-sections-preset] via home-sections-presets.css.
 * Load after home-sections-presets.css; grid + generic pagination stay shared with browse/trending.
 */

.latest-shell-v2 {
    position: relative;
    margin-bottom: 0.5rem;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    border-radius: 20px;
    border: 1px solid var(--home-section-border);
    background: var(--home-section-surface);
    box-shadow: var(--home-section-box-shadow);
    overflow: hidden;
}

.latest-shell-v2::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: var(--home-section-panel-radials);
}

.latest-shell-v2 .section-header {
    position: relative;
    z-index: 1;
    margin-bottom: 1.35rem;
    align-items: flex-end;
}

.latest-shell-v2 .section-header__title {
    font-family: var(--font-display, inherit);
    font-size: clamp(1.45rem, 2.8vw, 1.95rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: var(--home-section-latest-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.latest-shell-v2 .section-header__meta {
    color: var(--home-section-latest-meta-color);
    font-size: 0.9rem;
    max-width: 36rem;
    line-height: 1.5;
}

.latest-shell-v2 .section-header__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--home-section-latest-cta-color);
    background: var(--home-section-latest-cta-bg);
    border: 1px solid var(--home-section-latest-cta-border);
    box-shadow: var(--home-section-latest-cta-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.latest-shell-v2 .section-header__link:hover {
    text-decoration: none;
    transform: translateY(-2px);
    border-color: var(--home-section-latest-cta-hover-border);
    box-shadow: var(--home-section-latest-cta-hover-shadow);
    color: var(--home-section-latest-cta-color);
}

.latest-shell-v2 .section-header__link i {
    font-size: 0.72em;
    opacity: 0.85;
}

.latest-shell-v2 .video-grid-v2 {
    position: relative;
    z-index: 1;
    padding-bottom: 0.5rem;
}

/* Header-only container: keep section styling but avoid big empty block above cards */
.latest-shell-v2.latest-shell-v2--header-only {
    padding: 0.55rem 0;
    margin-bottom: 0.9rem;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.latest-shell-v2.latest-shell-v2--header-only::before,
.latest-shell-v2.latest-shell-v2--header-only::after {
    display: none;
}

.latest-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.15rem 0;
}

.latest-strip__lead {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.latest-strip__accent {
    width: 3px;
    height: 1.4rem;
    border-radius: 2px;
    background: #ef4444;
}

.latest-strip__title {
    margin: 0;
    font-size: clamp(1.35rem, 2.7vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.08;
    color: #f8fafc;
}

/* Modern strip headings (Trending + Latest): bolder display feel */
body[data-home-sections-layout="modern_strip"] .latest-strip__title {
    font-family: "Trebuchet MS", "Segoe UI", "Arial Black", var(--font-sans), sans-serif;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.latest-strip__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.22rem 0.55rem;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: rgba(6, 78, 59, 0.35);
}

.latest-strip__action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffd7d7;
    text-decoration: none;
    border: 1px solid rgba(239, 68, 68, 0.28);
    background: rgba(127, 29, 29, 0.35);
}

.latest-strip__action:hover {
    color: #ffe8e8;
    text-decoration: none;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.5);
}

body[data-theme="light"] .latest-strip__title {
    color: #0f172a;
}

body[data-home-sections-layout="modern_strip"][data-theme="light"] .latest-strip__title {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-theme="light"] .latest-strip__badge {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.12);
}

body[data-theme="light"] .latest-strip__action {
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(254, 226, 226, 0.95);
}

@media (max-width: 767px) {
    .latest-strip {
        gap: 0.55rem;
    }

    .latest-strip__title {
        font-size: 1.22rem;
    }

    .latest-strip__badge {
        font-size: 0.62rem;
        padding: 0.2rem 0.5rem;
    }

    .latest-strip__action {
        padding: 0.38rem 0.72rem;
        font-size: 0.74rem;
    }
}

/* Shared listing grid: progressive responsive columns (1 -> 2 -> 3 -> 4 @ 1280px) */
.video-grid-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(0.9rem, 2vw, 1.5rem);
    padding-bottom: 2.5rem;
}

@media (min-width: 640px) {
    .video-grid-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .video-grid-v2 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .video-grid-v2 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.pagination-v2 {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    gap: 0.5rem;
}

.pagination-v2 a {
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 10, 12, 0.75);
    color: #fef3c7;
    text-decoration: none;
    border-radius: var(--radius-md, 12px);
    border: 1px solid rgba(245, 158, 11, 0.22);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.pagination-v2 a:hover,
.pagination-v2 a.active {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.85), rgba(127, 29, 29, 0.9));
    border-color: rgba(251, 191, 36, 0.45);
    color: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(185, 28, 28, 0.35);
}

.pagination-v2 a.prev-next {
    width: auto;
    padding: 0 1.15rem;
}

/* Home Latest pagination only (sibling of shell) — follows preset; browse/trending keep generic rules above */
.latest-shell-v2 ~ .pagination-v2 a {
    background: var(--home-section-pagination-bg);
    color: var(--home-section-pagination-color);
    border: 1px solid var(--home-section-pagination-border);
}

.latest-shell-v2 ~ .pagination-v2 a:hover,
.latest-shell-v2 ~ .pagination-v2 a.active {
    background: var(--home-section-pagination-active-bg);
    border-color: var(--home-section-pagination-active-border);
    color: var(--home-section-pagination-active-color);
    box-shadow: var(--home-section-pagination-active-shadow);
}

[data-theme="light"] .latest-shell-v2 .section-header__link {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(79, 70, 229, 0.88));
    border-color: rgba(37, 99, 235, 0.4);
    color: #f8fafc;
}

[data-theme="light"] .latest-shell-v2 .section-header__link:hover {
    color: #f8fafc;
    box-shadow: 0 12px 36px rgba(37, 99, 235, 0.28);
}

[data-theme="light"] .pagination-v2 a:hover,
[data-theme="light"] .pagination-v2 a.active {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-color: rgba(37, 99, 235, 0.45);
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .latest-shell-v2 ~ .pagination-v2 a:hover,
[data-theme="light"] .latest-shell-v2 ~ .pagination-v2 a.active {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-color: rgba(37, 99, 235, 0.45);
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

/* Neo noir preset: alternate dark layout treatment for home Latest. */
body[data-home-sections-preset="neo_noir"] .latest-shell-v2 {
    border-radius: 22px;
    border-color: color-mix(in srgb, #67e8f9 42%, rgba(148, 163, 184, 0.2));
}

body[data-home-sections-preset="neo_noir"] .latest-shell-v2::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(167, 139, 250, 0.2);
    pointer-events: none;
}

body[data-home-sections-preset="neo_noir"] .latest-shell-v2 .section-header__link {
    border-radius: 999px;
}

body[data-home-sections-preset="neo_noir"] .latest-shell-v2 .video-card-premium {
    border-radius: 14px;
}

/* Split contrast: Latest gets editorial/warm panel unlike Trending neon. */
body[data-home-sections-preset="split_contrast"] .latest-shell-v2 {
    background: linear-gradient(128deg, rgba(12, 15, 22, 0.96) 0%, rgba(15, 19, 28, 0.98) 42%, rgba(10, 13, 20, 0.99) 100%);
    border-color: rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body[data-home-sections-preset="split_contrast"] .latest-shell-v2::before {
    background: radial-gradient(ellipse 72% 56% at 100% 0%, rgba(71, 85, 105, 0.2), transparent 56%),
        radial-gradient(ellipse 52% 42% at 0% 100%, rgba(51, 65, 85, 0.12), transparent 52%);
}

body[data-home-sections-preset="split_contrast"] .latest-shell-v2 .video-card-premium {
    border-radius: 10px;
    border-color: rgba(148, 163, 184, 0.22);
}
