/* =========================================================
   style_community.css — Community catalog layout (Phase 4)

   Depends on:
     style.css          — shared avatars, badges, empty states, btn variants
     style_list.css     — .action-button base, .view-button
     style_modal.css    — .modal, .modal-body, .modal-header, .close
   ========================================================= */

/* ── Filter bar ──────────────────────────────────────────── */

.community-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.community-filters select {
    min-width: 160px;
}

.community-filters input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: var(--small-padding) var(--base-padding);
    border: 1px solid var(--element_border);
    border-radius: 5px;
}

/* "Effacer les filtres" link styled as subtle button */
.community-filters .community-clear {
    text-decoration: none;
    font-size: 0.9em;
    white-space: nowrap;
}

/* ── Table tweaks ────────────────────────────────────────── */

/* Scrollable wrapper for small screens */
.community-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Let the title column breathe; constrain narrower columns */
.community-table-wrap table {
    min-width: 720px;
}

/* Author + collab columns: keep avatar and name on one line */
.community-author-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* Override style_list.css .action-cell { white-space: nowrap }
   so that multiple action buttons can wrap on narrow screens. */
.community-table-wrap .action-cell {
    white-space: normal;
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Empty state ─────────────────────────────────────────── */

/* .community-empty uses the shared .empty-state rules from
   style.css.  Only page-specific overrides go here.         */

.community-empty {
    /* Extra vertical breathing room in the catalog context */
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* ── Overlay polish ──────────────────────────────────────── */

/* Actions row inside the community confirmation overlay */
#communityOverlayActions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* "Modifier le scénario" CTA inside the overlay */
#communityOverlayActions .btn-access,
#communityOverlayActions a[href*="form1.php"] {
    font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────── */

@media screen and (max-width: 768px) {
    /* Stack filter controls vertically */
    .community-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .community-filters select,
    .community-filters input[type="text"] {
        width: 100%;
        min-width: 0;
    }

    /* Author column: allow wrapping if name is long */
    .community-author-cell {
        white-space: normal;
    }
}
