/* =========================================================
   PACAD Documents Listing
   ========================================================= */

/* ========== Layout: main grid ========== */

.pacad-docs-listing {
    display: grid;
    /* allow the left column to shrink and overflow */
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}

@media (max-width: 1024px) {
    .pacad-docs-listing {
        grid-template-columns: 1fr;
    }

    /* On mobile, show filters above the table */
    .pacad-docs-listing__filters {
        order: -1;
        position: static;
        max-height: none;
    }
}

/* Left column wrapper: header + table */
.pacad-docs-main {
    display: flex;
    flex-direction: column;
}

/* ========== Add-document header (above table) ========== */

.pacad-docs-main-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 5px 0 8px 0;
}

/* Add-document button */
.pacad-docs-add-link {
    text-decoration: none !important;
    font-size: 20px;
    line-height: 1;
    font-weight: 600;
}

.pacad-docs-add-link:hover,
.pacad-docs-add-link:focus {
    color: #009edb;
}

/* ========== Filters sidebar ========== */

.pacad-docs-listing__filters {
    position: sticky;
    top: 84px; /* sits below main header */
    max-height: calc(100vh - 112px);
    overflow: auto;
}

/* Form wrapper */
.pacad-filter-form {
    display: block;
}

/* “Filtres” heading inside sidebar */
.pacad-docs-filters-heading {
    margin-bottom: 25px;
}

/* Filter groups */

.pf-group {
    margin-bottom: 14px;
    overflow: hidden;
}

.pf-head {
    background: #325C77;
    margin-bottom: 0;
    font-size: 17px;
    color: #ffffff;
    padding: 6px;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

.pf-body {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-top: 0;
}

.pf-body--pad {
    padding: 10px;
}

/* Inputs */

.pf-input,
.pf-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
}

/* Checkbox lists */

.pf-list {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
    overflow: auto;
}

.pf-list li {
    margin: 6px 0;
}

.pf-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.3;
}

.pf-list input[type="checkbox"] {
    transform: translateY(1px);
}

/* Optional filter action buttons (if ever used) */

.pacad-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.pacad-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.pacad-btn--primary {
    background: #2563eb;
    color: #fff;
    border: 1px solid #1d4ed8;
}

.pacad-btn--light {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
}

/* ========== Table / listing ========== */

/* Table scroller: header stays above, table scrolls */
.pacad-docs-table-scroller {
    overflow: auto;
    position: relative;
}

.pacad-docs-table {
    width: 100%;
    min-width: 1600px; /* or 1800/2000 if you want more forced scroll */
    border-collapse: collapse;
    table-layout: auto;
    font-size: 13px;
    line-height: 1.35;
}

/* Table header */

.pacad-docs-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
    font-weight: 600;
    background: #f9fafb;
    text-align: center;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
}

/* Table cells */

.pacad-docs-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    vertical-align: top;
}

/* Zebra rows */

.pacad-docs-table tbody tr:nth-child(odd) {
    background: #fff;
}

/* Column widths */

/* 1st column: Titre */
.pacad-docs-table thead th:first-child,
.pacad-docs-table tbody td:first-child {
    min-width: 220px;
}

/* 2nd column: Description */
.pacad-docs-table thead th:nth-child(2),
.pacad-docs-table tbody td:nth-child(2) {
    min-width: 260px;
}

/* 13th column: Zones géographiques */
.pacad-docs-table thead th:nth-child(13),
.pacad-docs-table tbody td:nth-child(13) {
    min-width: 220px;
}

/* Last column (Lien) */
.pacad-docs-table td:last-child {
    white-space: nowrap;
}

/* General cell alignment */

.pacad-docs-table th,
.pacad-docs-table td {
    vertical-align: top;
}

/* Slightly smaller header text */
.pacad-docs-table .project-listing-header th {
    font-size: 12px;
}

/* Title cell readability */
.pacad-docs-table tbody td:first-child {
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.25;
}
