/**
 * 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;
}

/* Shared listing grid: home latest, browse, trending, etc. — mobile 1 col, desktop 4 col */
.video-grid-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .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);
}
