/* FDW File List: frontend. Eredita font e colori del tema; i colori propri arrivano da variabili CSS. */

.fdwfl {
	--fdwfl-link: #000000;
	--fdwfl-accent: #0b7285;
	--fdwfl-head-bg: #e9ecef;
	--fdwfl-head-text: #1d2327;
	--fdwfl-line: rgba(0, 0, 0, 0.12);
	--fdwfl-stripe: rgba(0, 0, 0, 0.03);
	font: inherit;
	color: inherit;
	max-width: 100%;
	box-sizing: border-box;
}

.fdwfl *,
.fdwfl *::before,
.fdwfl *::after {
	box-sizing: border-box;
}

.fdwfl-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fdwfl-title {
	margin: 0 0 0.75em;
}

.fdwfl-notice {
	margin: 1em 0;
	padding: 0.75em 1em;
	border-left: 4px solid var(--fdwfl-accent);
	background: var(--fdwfl-stripe);
}

/* Barra strumenti */

.fdwfl-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75em 1em;
	margin: 0 0 0.75em;
}

.fdwfl-search {
	flex: 1 1 14em;
	max-width: 26em;
	margin: 0;
}

.fdwfl-search-input {
	width: 100%;
	margin: 0;
	padding: 0.55em 0.75em;
	font: inherit;
	color: inherit;
	border: 1px solid var(--fdwfl-line);
	border-radius: 4px;
	background: transparent;
}

.fdwfl-search-input:focus-visible,
.fdwfl-sort-select:focus-visible,
.fdwfl-sort-dir:focus-visible,
.fdwfl-sort:focus-visible,
.fdwfl-btn:focus-visible,
.fdwfl-link:focus-visible,
.fdwfl-page-btn:focus-visible {
	outline: 2px solid var(--fdwfl-accent);
	outline-offset: 2px;
}

.fdwfl-count {
	margin-left: auto;
	font-size: 0.9em;
	opacity: 0.75;
}

/* Ordinamento da telefono */

.fdwfl-sortbar {
	display: none;
	align-items: center;
	gap: 0.5em;
	width: 100%;
}

.fdwfl-sortbar label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	flex: 1 1 auto;
	margin: 0;
}

.fdwfl-sort-select {
	flex: 1 1 auto;
	margin: 0;
	padding: 0.5em 0.6em;
	font: inherit;
	color: inherit;
	border: 1px solid var(--fdwfl-line);
	border-radius: 4px;
	background: transparent;
}

.fdwfl-sort-dir {
	margin: 0;
	padding: 0.5em 0.8em;
	font: inherit;
	line-height: 1;
	color: var(--fdwfl-accent);
	border: 1px solid var(--fdwfl-line);
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
}

.fdwfl-sort-dir::before {
	content: "\2191";
}

.fdwfl[data-sort-dir="desc"] .fdwfl-sort-dir::before {
	content: "\2193";
}

/* Tabella. I selettori partono da .fdwfl così vincono sulle regole generiche del tema
   (bordi arrotondati, spaziature, colori dei link). */

.fdwfl-table-wrap {
	overflow-x: auto;
}

.fdwfl .fdwfl-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	border-spacing: 0;
	border: 1px solid var(--fdwfl-line);
	border-radius: 0;
	font-size: 0.95em;
	line-height: 1.4;
}

.fdwfl .fdwfl-table thead,
.fdwfl .fdwfl-table tbody,
.fdwfl .fdwfl-table tr,
.fdwfl .fdwfl-table th,
.fdwfl .fdwfl-table td {
	border-radius: 0;
	box-shadow: none;
}

.fdwfl .fdwfl-table th,
.fdwfl .fdwfl-table td {
	padding: 0.6em 0.85em;
	text-align: left;
	vertical-align: top;
	border: 0;
	border-bottom: 1px solid var(--fdwfl-line);
	background-image: none;
}

/* Lo sfondo sta sulla riga e non sulle singole celle: così non compaiono sottili righe
   chiare tra un'intestazione e l'altra quando le larghezze non sono numeri interi. */

.fdwfl .fdwfl-table thead tr {
	background: var(--fdwfl-head-bg);
}

.fdwfl .fdwfl-table thead th {
	padding: 0;
	background: transparent;
	color: var(--fdwfl-head-text);
	font-weight: 600;
	opacity: 1;
}

.fdwfl .fdwfl-table thead th + th {
	border-left: 1px solid var(--fdwfl-head-bg);
}

.fdwfl .fdwfl-table tbody tr:nth-child(even) {
	background: var(--fdwfl-stripe);
}

.fdwfl .fdwfl-table[hidden],
.fdwfl .fdwfl-noresults[hidden],
.fdwfl .fdwfl-table tbody tr[hidden] {
	display: none !important;
}

/* Larghezze delle colonne secondarie: ordinare o cambiare pagina non le sposta, perché
   il contenuto tipico sta già dentro la larghezza indicata; la colonna del nome prende
   tutto lo spazio che resta. Se un valore fosse più lungo, la colonna si allarga invece
   di tagliarlo. */

.fdwfl .fdwfl-table thead th.fdwfl-c-description {
	width: 14em;
}

.fdwfl .fdwfl-table thead th.fdwfl-c-size {
	width: calc(9ch + 2em);
}

.fdwfl .fdwfl-table thead th.fdwfl-c-date {
	width: calc(var(--fdwfl-date-ch, 10) * 1ch + 2em);
}

.fdwfl .fdwfl-table thead th.fdwfl-c-downloads {
	width: calc(6ch + 2em);
}

.fdwfl .fdwfl-table td.fdwfl-c-name {
	min-width: 10em;
}

.fdwfl .fdwfl-table td.fdwfl-c-size,
.fdwfl .fdwfl-table td.fdwfl-c-date,
.fdwfl .fdwfl-table td.fdwfl-c-downloads {
	white-space: nowrap;
}

.fdwfl .fdwfl-table td.fdwfl-c-name,
.fdwfl .fdwfl-table td.fdwfl-c-description {
	overflow-wrap: anywhere;
}

.fdwfl .fdwfl-table .fdwfl-sort {
	display: flex;
	align-items: center;
	gap: 0.4em;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 0.7em 0.85em;
	font: inherit;
	font-weight: inherit;
	line-height: 1.3;
	text-align: left;
	white-space: normal;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: inherit;
}

.fdwfl .fdwfl-table .fdwfl-sort:hover,
.fdwfl .fdwfl-table .fdwfl-sort:focus-visible {
	background: rgba(0, 0, 0, 0.08);
	color: inherit;
}

.fdwfl-arrow {
	display: inline-block;
	flex: 0 0 auto;
	min-width: 1em;
	opacity: 0.45;
}

.fdwfl-arrow::before {
	content: "\2195";
}

.fdwfl-th[aria-sort="ascending"] .fdwfl-arrow,
.fdwfl-th[aria-sort="descending"] .fdwfl-arrow {
	opacity: 1;
}

.fdwfl-th[aria-sort="ascending"] .fdwfl-arrow::before {
	content: "\2191";
}

.fdwfl-th[aria-sort="descending"] .fdwfl-arrow::before {
	content: "\2193";
}

/* Nomi dei file: colore proprio, anche contro le regole a:visited e a:hover del tema */

.fdwfl .fdwfl-table a.fdwfl-link,
.fdwfl .fdwfl-table a.fdwfl-link:link,
.fdwfl .fdwfl-table a.fdwfl-link:visited {
	color: var(--fdwfl-link);
	font-weight: inherit;
	text-decoration: none;
	border-bottom: 0;
	box-shadow: none;
	background: transparent;
	overflow-wrap: anywhere;
}

.fdwfl .fdwfl-table a.fdwfl-link:hover,
.fdwfl .fdwfl-table a.fdwfl-link:focus,
.fdwfl .fdwfl-table a.fdwfl-link:active {
	color: var(--fdwfl-link);
	text-decoration: underline;
	box-shadow: none;
	background: transparent;
}

.fdwfl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-top: 0.4em;
}

.fdwfl .fdwfl-table a.fdwfl-btn,
.fdwfl .fdwfl-table a.fdwfl-btn:link,
.fdwfl .fdwfl-table a.fdwfl-btn:visited {
	display: inline-block;
	padding: 0.2em 0.65em;
	font-size: 0.82em;
	font-weight: inherit;
	line-height: 1.5;
	color: var(--fdwfl-accent);
	text-decoration: none;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
}

.fdwfl .fdwfl-table a.fdwfl-btn:hover,
.fdwfl .fdwfl-table a.fdwfl-btn:focus {
	background: var(--fdwfl-accent);
	border-color: var(--fdwfl-accent);
	color: #fff;
	text-decoration: none;
}

.fdwfl-noresults {
	margin: 1em 0;
}

/* Paginazione */

.fdwfl-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	margin-top: 0.9em;
}

.fdwfl-pager:empty {
	display: none;
}

.fdwfl-page-btn {
	margin: 0;
	padding: 0.4em 0.9em;
	font: inherit;
	color: var(--fdwfl-accent);
	border: 1px solid var(--fdwfl-accent);
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
}

.fdwfl-page-btn[disabled] {
	opacity: 0.4;
	cursor: default;
}

/* Riquadro di caricamento */

.fdwfl-upload-wrap {
	margin: 0 0 1.5em;
}

.fdwfl-uploader {
	border: 1px solid var(--fdwfl-line);
	border-radius: 4px;
	padding: 1em 1.25em 1.1em;
	background: transparent;
}

.fdwfl-up-title {
	margin: 0 0 0.6em;
}

.fdwfl-drop {
	position: relative;
	padding: 1.25em;
	text-align: center;
	border: 2px dashed var(--fdwfl-line);
	border-radius: 4px;
	transition: border-color 0.15s, background-color 0.15s;
}

.fdwfl-drop.is-over {
	border-color: var(--fdwfl-accent);
	background: var(--fdwfl-stripe);
}

.fdwfl-drop:focus-visible {
	outline: 2px solid var(--fdwfl-accent);
	outline-offset: 2px;
}

.fdwfl-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
}

.fdwfl-drop-text {
	margin: 0 0 0.75em;
}

.fdwfl-browse {
	margin: 0;
	padding: 0.35em 0.9em;
	font: inherit;
	color: var(--fdwfl-accent);
	border: 1px solid var(--fdwfl-accent);
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
}

.fdwfl-browse:hover {
	background: var(--fdwfl-accent);
	color: #fff;
}

.fdwfl-queue {
	list-style: none;
	margin: 0.75em 0;
	padding: 0;
	text-align: left;
}

.fdwfl-queue:empty {
	display: none;
}

.fdwfl-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.2em 0.75em;
	align-items: center;
	margin: 0;
	padding: 0.4em 0;
	border-bottom: 1px solid var(--fdwfl-line);
	font-size: 0.92em;
}

.fdwfl-item-name {
	overflow-wrap: anywhere;
}

.fdwfl-item-status {
	font-size: 0.9em;
	white-space: nowrap;
}

.fdwfl-item.is-error .fdwfl-item-status {
	color: #b32d2e;
}

.fdwfl-item.is-done .fdwfl-item-status {
	color: #1a7f37;
}

.fdwfl-progress {
	grid-column: 1 / -1;
	height: 4px;
	border-radius: 2px;
	background: var(--fdwfl-line);
	overflow: hidden;
}

.fdwfl-progress > span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--fdwfl-accent);
	transition: width 0.15s linear;
}

.fdwfl-item-remove {
	grid-column: 2;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 0.85em;
	color: inherit;
	text-decoration: underline;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.fdwfl-up-msg {
	margin: 0.5em 0;
	min-height: 1.2em;
}

.fdwfl-up-msg.is-error {
	color: #b32d2e;
}

.fdwfl-start {
	margin: 0.25em 0 0;
	padding: 0.55em 1.5em;
	font: inherit;
	font-weight: 600;
	color: #fff;
	border: 0;
	border-radius: 4px;
	background: var(--fdwfl-accent);
	cursor: pointer;
}

.fdwfl-start[disabled] {
	opacity: 0.45;
	cursor: default;
}

.fdwfl-limits {
	margin: 0.75em 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85em;
	opacity: 0.8;
	text-align: right;
}

.fdwfl-limits li {
	margin: 0.1em 0;
}

/* Telefono: ogni riga diventa una scheda */

@media (max-width: 640px) {
	.fdwfl-sortbar {
		display: flex;
	}

	.fdwfl-count {
		margin-left: 0;
		width: 100%;
	}

	.fdwfl-search {
		max-width: none;
		flex-basis: 100%;
	}

	.fdwfl .fdwfl-table,
	.fdwfl .fdwfl-table tbody {
		display: block;
		border: 0;
	}

	.fdwfl .fdwfl-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.fdwfl .fdwfl-table tbody tr {
		display: block;
		margin: 0 0 0.75em;
		padding: 0.25em 0;
		border: 1px solid var(--fdwfl-line);
		border-radius: 6px;
		background: transparent !important;
	}

	.fdwfl .fdwfl-table tbody td {
		display: flex;
		gap: 0.75em;
		justify-content: space-between;
		padding: 0.4em 0.85em;
		border: 0;
		white-space: normal;
		text-align: right;
	}

	.fdwfl .fdwfl-table tbody td::before {
		content: attr(data-label);
		flex: 0 0 auto;
		font-weight: 600;
		text-align: left;
		opacity: 0.7;
	}

	.fdwfl .fdwfl-table tbody td.fdwfl-c-name {
		display: block;
		text-align: left;
		padding-top: 0.6em;
		font-size: 1.02em;
	}

	.fdwfl .fdwfl-table tbody td.fdwfl-c-name::before {
		display: none;
	}

	.fdwfl-limits {
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fdwfl-drop,
	.fdwfl-progress > span {
		transition: none;
	}
}

/* Contenitore neutro che impedisce a wptexturize di alterare i nomi file */
fdwfl-nt {
	display: block;
}
