/*
 * Fi1m — Home page
 * ================
 * Hero ask bar, latest releases, latest reviews, series, articles.
 */

.hero {
    padding: 5rem 0 4rem;
}

.hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.hero-main {
    flex: 1;
    max-width: 680px;
    padding-top: 2rem;
}

.hero-greeting h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.hero-greeting p {
    font-size: 1.1rem;
    color: var(--text-color-muted);
    max-width: 560px;
}

.hero-suggestions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 2.5rem;
    min-width: 180px;
}

.suggestion-chip {
    background-color: var(--search-background);
    border-radius: 24px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: nowrap;
    line-height: 1.3;
    max-height: var(--chip-h, 3rem);   /* set to the real height by site.js so in/out are symmetrical */
    overflow: hidden;
    flex-shrink: 0;
    transition:
        background-color 0.3s ease,
        transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        opacity 0.35s ease,
        max-height 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        padding 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
        margin 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.suggestion-chip:hover {
    background-color: var(--search-focus-background);
    transform: translateY(-2px);
}

/*
 * Rotation, chat-style. A new chip is inserted at the top fully collapsed
 * (no height, no padding, and a negative margin swallowing the flex gap),
 * then released so it grows into place and pushes the others down. The
 * oldest chip collapses the same way at the bottom and is removed.
 */
.suggestion-chip.is-entering,
.suggestion-chip.is-leaving {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: -0.75rem;
    opacity: 0;
    pointer-events: none;
}

.suggestion-chip.is-entering {
    transform: translateY(-10px);
    transition: none;
}

.suggestion-chip.is-leaving {
    transform: translateY(6px);
}

/* The pool is data, not content */
.hero-suggestions script { display: none; }

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.reviews-grid .article-image {
    aspect-ratio: 16 / 9;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-inner {
        flex-direction: column;
    }

    .hero-main {
        max-width: 100%;
        padding-top: 0;
    }

    .hero-suggestions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        margin-top: 0;
    }

    /* In the row layout the new chip grows in from the left and pushes the rest along */
    .suggestion-chip {
        max-width: 100%;
        transition:
            background-color 0.3s ease,
            transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
            opacity 0.35s ease,
            max-width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
            padding 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
            margin 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    .suggestion-chip.is-entering,
    .suggestion-chip.is-leaving {
        max-height: var(--chip-h, 3rem);
        max-width: 0;
        padding: 0.6rem 0;
        margin-bottom: 0;
        margin-right: -0.75rem;
    }

    .suggestion-chip.is-entering { transform: translateX(-10px); }
    .suggestion-chip.is-leaving { transform: translateX(6px); }

    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero-greeting h1 {
        font-size: 2rem;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-greeting h1 {
        font-size: 1.75rem;
    }

    .hero-greeting p {
        font-size: 1rem;
    }
}
