/* ================================================================
   Documents Publics – Front-end shortcode CSS
   ================================================================ */

.dp-document-list { margin: 1.5em 0; font-family: inherit; }

.dp-list-title {
    font-size: 1.4em;
    margin-bottom: .75em;
    padding-bottom: .4em;
    border-bottom: 2px solid #e2e2e2;
}

.dp-document-list .dp-file-list {
    list-style: none !important;  /* neutralise les puces Elementor/thème */
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Alias sans wrapper pour le shortcode fichier seul */
.dp-single-file .dp-file-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2-3 columns */
.dp-cols-2 .dp-file-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dp-cols-3 .dp-file-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.dp-document-list .dp-file-item,
.dp-single-file .dp-file-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 5px;
    padding: 10px 14px;
    transition: box-shadow .15s, border-color .15s;
    /* reset styles li hérités */
    margin: 0 !important;
    list-style: none !important;
    text-indent: 0 !important;
}
.dp-file-item:hover {
    border-color: #c3c4c7;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.dp-file-icon.dashicons {
    font-size: 26px !important;
    width: 26px !important;
    height: 26px !important;
    flex-shrink: 0;
}

.dp-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dp-file-name {
    font-size: .95em;
    font-weight: 600;
    color: #1d2327;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.dp-file-meta {
    font-size: .78em;
    color: #8c8f94;
}

.dp-document-list .dp-dl-btn,
.dp-single-file .dp-dl-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
    white-space: nowrap;
    background: #2271b1 !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: .82em !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    flex-shrink: 0;
    transition: background .15s;
    line-height: 1.4 !important;
    border: none !important;
    box-shadow: none !important;
}
.dp-document-list .dp-dl-btn:hover,
.dp-single-file .dp-dl-btn:hover {
    background: #135e96 !important;
    color: #fff !important;
}
.dp-dl-btn .dashicons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
}

.dp-empty { color: #8c8f94; font-style: italic; }

/* Responsive */
@media (max-width: 640px) {
    .dp-cols-2 .dp-file-list,
    .dp-cols-3 .dp-file-list { grid-template-columns: 1fr; }
    .dp-dl-btn span.dashicons + * { display: none; }
    .dp-dl-btn { padding: 6px 10px; }
}

/* ================================================================
   Onglets
   ================================================================ */

.dp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #e2e2e2;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.dp-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    font-size: .9em;
    font-weight: 600;
    color: #50575e;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    margin-bottom: -2px;
    transition: background .15s, color .15s;
    font-family: inherit;
    line-height: 1.4;
}

.dp-tab:hover {
    background: #fff;
    color: #1d2327;
}

.dp-tab-active {
    background: #fff;
    color: #0071bc;
    border-color: #e2e2e2;
    border-bottom-color: #fff;
    position: relative;
    z-index: 1;
}

/* Onglet racine ⮬ légèrement plus compact */
.dp-tab[data-folder=""] {
    font-size: 1.1em;
    padding: 6px 13px;
}

/* Panneau caché */
.dp-panel-hidden {
    display: none;
}

/* La liste dans un panneau n'a pas besoin de marge top */
.dp-panel > .dp-file-list {
    margin-top: 0;
}

/* Colonnes portées par dp-file-list directement (plus sur le wrapper) */
.dp-file-list.dp-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dp-file-list.dp-cols-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 640px) {
    .dp-file-list.dp-cols-2,
    .dp-file-list.dp-cols-3 { grid-template-columns: 1fr; }
}
