/* Home title sections and horizontal poster rows. */

.home-section-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    color: #a99b92;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.home-section-list {
    min-width: 0;
    display: grid;
    gap: 32px;
    margin-top: 32px;
}

.home-title-section h2,
.home-community-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.5;
}

.home-title-section {
    min-width: 0;
    overflow-x: hidden;
}

/* Keep the first row immediately rendered and defer later rows until they
   approach the viewport. Their HTML remains server-rendered for SEO. */
.home-title-section:not(:first-child) {
    content-visibility: auto;
    contain-intrinsic-size: auto 280px;
}

.home-page.has-saved-position .home-title-section {
    content-visibility: visible;
}

.home-title-section h2::before,
.home-community-section h2::before {
    content: "";
    width: 5px;
    height: 22px;
    flex: 0 0 5px;
    border-radius: 999px;
    background: #ff7a1a;
}

.home-title-row {
    width: 100%;
    min-width: 0;
    display: flex;
    gap: 16px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 12px;
    list-style: none;
    scrollbar-color: rgba(255, 122, 26, 0.48) rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.home-title-row::-webkit-scrollbar {
    height: 6px;
}

.home-title-row::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.home-title-row::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 122, 26, 0.48);
}

.home-title-row::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 122, 26, 0.72);
}

.home-title-row::-webkit-scrollbar-button {
    display: none;
}

.home-title-row-item {
    flex: 0 0 auto;
    min-width: 0;
    scroll-snap-align: start;
}

/* This accessibility rule is page-wide because it covers several Home components. */
@media (prefers-reduced-motion: reduce) {
    .home-hero-preview,
    .home-hero-preview-copy,
    .home-title-poster img {
        animation: none;
        transition: none;
    }
}

@media (max-width: 640px) {
    .home-section-list {
        gap: 32px;
        margin-top: 32px;
    }

    .home-title-section h2 {
        margin-bottom: 12px;
        font-size: 20px;
    }

    .home-title-row {
        width: 100%;
        gap: 12px;
        padding-inline: 0;
    }

    .home-title-row-item {
        /* Three complete posters fit on a phone, matching the mobile title rows. */
        width: calc((100% - 24px) / 3);
    }

    .home-title-row-item .home-title-poster {
        width: 100%;
    }
}
