/* WP Andolsheim — module TableFile. Styles du tableau de fichiers FileBird.

   Les couleurs d'accent sont injectées inline par PHP depuis les réglages
   (variables --wpa-tablefile-accent et --wpa-tablefile-accent-fg).
   Valeurs de repli ci-dessous si l'inline-style n'est pas chargé. */

.wpa-tablefile-folders,
.wpa-tablefile-wrap {
	--wpa-tablefile-accent: #799e1d;
	--wpa-tablefile-accent-fg: #ffffff;
}

.wpa-tablefile-wrap {
	overflow-x: auto;
}

table.wpa-tablefile {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	font-size: 0.95em;
}

table.wpa-tablefile th,
table.wpa-tablefile td {
	padding: 0.6em 0.8em;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

table.wpa-tablefile thead th {
	background: var(--wpa-tablefile-accent);
	color: var(--wpa-tablefile-accent-fg);
	font-weight: 700;
	border-bottom: 0;
	white-space: nowrap;
}

/* Les flèches de tri DataTables doivent rester visibles sur le fond accent. */
table.wpa-tablefile.dataTable thead th,
table.wpa-tablefile.dataTable thead th.dt-orderable-asc,
table.wpa-tablefile.dataTable thead th.dt-orderable-desc,
table.wpa-tablefile.dataTable thead th.dt-ordering-asc,
table.wpa-tablefile.dataTable thead th.dt-ordering-desc {
	color: var(--wpa-tablefile-accent-fg);
}

table.wpa-tablefile tbody tr:hover {
	background: rgba(0, 0, 0, 0.035);
}

table.wpa-tablefile .wpa-tablefile-col-type,
table.wpa-tablefile .wpa-tablefile-col-size,
table.wpa-tablefile .wpa-tablefile-col-date {
	white-space: nowrap;
}

table.wpa-tablefile .wpa-tablefile-name-link {
	font-weight: 600;
	text-decoration: none;
	word-break: break-word;
}

table.wpa-tablefile .wpa-tablefile-name-link:hover {
	text-decoration: underline;
}

table.wpa-tablefile .wpa-tablefile-col-download {
	white-space: nowrap;
}

.wpa-tablefile-download {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	text-decoration: none;
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 0.25em 0.7em;
	line-height: 1.4;
	font-size: 0.9em;
}

.wpa-tablefile-download:hover {
	text-decoration: none;
	opacity: 0.8;
}

.wpa-tablefile-download::before {
	content: "\2193"; /* flèche vers le bas */
	font-weight: 700;
}

.wpa-tablefile-empty {
	font-style: italic;
	opacity: 0.8;
}

/* Aperçu dans l'éditeur Gutenberg. */
.wpa-tablefile-editor-placeholder {
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	padding: 1.5em;
	text-align: center;
	color: rgba(0, 0, 0, 0.6);
}

.wpa-tablefile-editor-placeholder .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.wpa-tablefile-editor-placeholder p {
	margin: 0.4em 0 0;
}

.wpa-tablefile-editor-hint {
	font-size: 0.9em;
	opacity: 0.8;
}

/* ---- Conteneur d'accordéons (mode multi-dossiers) ---- */
.wpa-tablefile-folders {
	margin: 1.5em 0;
}

.wpa-tablefile-section {
	margin: 0 0 0.6em;
	background: #fff;
}

.wpa-tablefile-section:last-child {
	margin-bottom: 0;
}

/* En-tête cliquable (<summary>) — rendu aligné sur le module Flipbooks. */
.wpa-tablefile-section__header {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.85em 1.1em;
	background: var(--wpa-tablefile-accent);
	color: var(--wpa-tablefile-accent-fg);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	user-select: none;
	transition: filter 0.15s ease;
}

.wpa-tablefile-section__header:hover {
	filter: brightness(0.92);
}

.wpa-tablefile-section__header::-webkit-details-marker {
	display: none;
}
.wpa-tablefile-section__header::marker {
	content: "";
}

.wpa-tablefile-section__header:focus-visible {
	outline: 2px solid var(--wpa-tablefile-accent-fg);
	outline-offset: -5px;
}

.wpa-tablefile-section__icon {
	display: inline-flex;
	flex: 0 0 auto;
	line-height: 0;
}

.wpa-tablefile-section__icon svg {
	display: block;
	width: 1.4em;
	height: 1.4em;
	color: inherit;
}

.wpa-tablefile-section__title {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
	color: var(--wpa-tablefile-accent-fg) !important;
	font-weight: 700;
	font-size: 22px !important;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.wpa-tablefile-section__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	line-height: 0;
	color: inherit;
	transition: transform 0.25s ease;
}

.wpa-tablefile-section__toggle svg {
	display: block;
	width: 1.3em;
	height: 1.3em;
	color: inherit;
}

.wpa-tablefile-section[open] > .wpa-tablefile-section__header .wpa-tablefile-section__toggle {
	transform: rotate(180deg);
}

.wpa-tablefile-section__content {
	padding: 1.25em 1.1em;
}

/* ---- Bloc « breadcrumb + tableau » (un par dossier dans l'arborescence) ---- */
.wpa-tablefile-folder {
	margin-top: 1.5em;
}

.wpa-tablefile-folder:first-child {
	margin-top: 0;
}

.wpa-tablefile-folder__path {
	margin: 0 0 0.4em;
	font-weight: 600;
	font-size: 0.95em;
	opacity: 0.85;
}

.wpa-tablefile-folder__sep {
	display: inline-block;
	margin: 0 0.15em;
	opacity: 0.7;
}

/* Quand le tableau est dans un dossier-bloc, on retire la marge supérieure native. */
.wpa-tablefile-folder table.wpa-tablefile {
	margin-top: 0;
	margin-bottom: 0;
}
