@media (min-width: 1280px) {
    .home-shell {
        padding-inline: clamp(2rem, 4vw, 4rem);
    }

    .home-main {
        gap: 2.4rem;
    }

    .films-home-section,
    .files-home-section {
        padding: clamp(2rem, 2.2vw, 2.75rem);
    }

    .films-toolbar {
        grid-template-columns: minmax(420px, 1fr) minmax(220px, 260px) auto;
    }

    .films-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
        gap: 1rem;
    }

    .film-card-open {
        grid-template-columns: minmax(150px, 38%) minmax(0, 1fr);
    }

    .folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    }

    .files-list {
        grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
        gap: 0.75rem;
    }
}

@media (min-width: 1680px) {
    .films-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
    }

    .film-card-content {
        padding: 1rem 1rem 1.1rem;
    }
}

@media (max-width: 1080px) {
    .file-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .file-actions {
        justify-content: flex-end;
    }

}

@media (max-width: 960px) {
    .hero-home {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .home-main {
        gap: 1rem;
    }

    .hero-home-copy,
    .films-home-section,
    .files-home-section {
        padding: 1.05rem;
        border-radius: 20px;
    }

    .films-toolbar {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        margin-bottom: 1rem;
    }

    .films-grid {
        grid-auto-rows: auto;
    }

    .section-heading {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.1rem;
    }

    .section-heading h2 {
        font-size: 1.65rem;
        line-height: 1.1;
    }

    .section-heading-actions {
        width: 100%;
        gap: 0.55rem;
    }

    .section-heading-actions .bouton {
        width: 100%;
        white-space: normal;
    }

    .files-limit-pill {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .files-back-button {
        width: 100%;
    }

    .folder-create-form {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .bouton.bouton-dossier {
        width: 100%;
    }

    .bouton.files-upload-button {
        width: 100%;
    }

    .file-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .file-actions {
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .hero-home-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .films-search-box,
    .films-rating-filter {
        min-height: 48px;
        border-radius: 14px;
        padding: 0.8rem 0.9rem;
    }

    .film-card-home {
        height: auto;
        border-radius: 18px;
    }

    .film-card-open {
        grid-template-columns: 96px minmax(0, 1fr);
        height: auto;
    }

    .film-card-visual {
        aspect-ratio: 2 / 3;
        min-height: 0;
    }

    .film-card-content {
        grid-template-rows: auto minmax(0, 1fr);
        gap: 0.55rem;
        padding: 0.85rem;
    }

    .film-card-content > div:first-child {
        grid-template-rows: auto auto;
    }

    .film-card-content h3 {
        font-size: 1rem;
    }

    .film-tags span {
        font-size: 0.74rem;
        padding: 0.3rem 0.5rem;
    }

    .film-synopsis {
        padding-top: 0.5rem;
    }

    .film-synopsis p {
        -webkit-line-clamp: 3;
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .film-rating-pill {
        right: 0.45rem;
        bottom: 0.45rem;
        padding: 0.36rem 0.56rem;
        font-size: 0.78rem;
    }

    .film-empty-state {
        padding: 2rem 1rem;
        border-radius: 18px;
    }

    .film-detail-modal {
        width: calc(100vw - 1rem);
        height: calc(100dvh - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: 18px;
    }

    .film-detail-modal.is-detail-expanded {
        width: calc(100vw - 1rem);
        height: calc(100dvh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .film-detail-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 38% minmax(0, 1fr);
    }

    .film-detail-modal.is-detail-expanded .film-detail-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 36% minmax(0, 1fr);
    }

    .film-detail-media {
        min-height: 0;
        padding: 0;
    }

    .film-detail-poster {
        width: min(86px, 22%);
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .film-detail-photo-nav {
        width: 38px;
        height: 38px;
    }

    .film-detail-photo-prev {
        left: 0.55rem;
    }

    .film-detail-photo-next {
        right: 0.55rem;
    }

    .film-detail-content {
        gap: 0.55rem;
        padding: 1rem;
    }

    .film-detail-facts {
        grid-template-columns: 1fr;
    }

    .film-detail-modal.is-detail-expanded .film-detail-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .film-detail-people div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

@media (max-width: 380px) {
    .film-card-open {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .film-tags {
        gap: 0.35rem;
    }
}
