/* DB Dipartimenti — Frontend */
.dbdip-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }

.dbdip-dipartimento {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.25rem 1.5rem;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.dbdip-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	margin-bottom: .5rem;
}

.dbdip-nome {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: #111827;
}

.dbdip-count {
	font-size: .75rem;
	color: #6b7280;
	background: #f3f4f6;
	border-radius: 99px;
	padding: .1rem .5rem;
	white-space: nowrap;
}

.dbdip-descrizione {
	font-size: .9rem;
	color: #6b7280;
	margin: 0 0 1rem;
	line-height: 1.5;
}

.dbdip-doc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: .4rem;
}

.dbdip-doc-item {}

.dbdip-doc-link {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .5rem .75rem;
	border-radius: 6px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	text-decoration: none;
	color: #1d4ed8;
	font-size: .9rem;
	transition: background .15s, border-color .15s;
}
.dbdip-doc-link:hover { background: #eff6ff; border-color: #bfdbfe; text-decoration: none; }

.dbdip-pdf-icon {
	width: 1.1rem;
	height: 1.1rem;
	flex-shrink: 0;
	color: #dc2626;
}

.dbdip-doc-titolo { flex: 1; line-height: 1.3; }

.dbdip-no-docs, .dbdip-empty { color: #9ca3af; font-size: .875rem; }

@media (max-width: 480px) {
	.dbdip-container { grid-template-columns: 1fr; }
}

/* ---- Elenco dipartimenti ---- */
.dbdip-elenco-lista {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: .35rem;
}

.dbdip-elenco-item {}

.dbdip-elenco-link {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 1rem;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	background: #fff;
	text-decoration: none;
	color: #111827;
	font-weight: 600;
	font-size: .95rem;
	transition: background .15s, border-color .15s, color .15s;
}
.dbdip-elenco-link:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #1d4ed8;
	text-decoration: none;
}

.dbdip-elenco-nome { flex: 1; }

.dbdip-elenco-badge {
	font-size: .75rem;
	font-weight: 600;
	background: #f3f4f6;
	color: #6b7280;
	border-radius: 99px;
	padding: .1rem .55rem;
	white-space: nowrap;
}

.dbdip-elenco-arrow {
	width: 1.1rem;
	height: 1.1rem;
	color: #9ca3af;
	flex-shrink: 0;
}
.dbdip-elenco-link:hover .dbdip-elenco-arrow { color: #1d4ed8; }

.dbdip-elenco-desc {
	margin: .2rem 0 .5rem 1rem;
	font-size: .85rem;
	color: #6b7280;
}

/* ---- Singolo dipartimento ---- */
.dbdip-singolo-header {
	margin-bottom: 1.25rem;
	padding-bottom: .75rem;
	border-bottom: 2px solid #e5e7eb;
}

.dbdip-singolo-titolo {
	margin: 0 0 .25rem;
	font-size: 1.4rem;
	color: #111827;
}

.dbdip-singolo-desc {
	margin: 0;
	color: #374151;
	font-size: 1.05rem;
	line-height: 1.7;
}

.dbdip-doc-list--full { gap: .5rem; }

.dbdip-doc-list--full .dbdip-doc-link {
	padding: .7rem 1rem;
	font-size: .95rem;
}

.dbdip-doc-arrow {
	width: 1rem;
	height: 1rem;
	color: #9ca3af;
	flex-shrink: 0;
	margin-left: auto;
}
.dbdip-doc-list--full .dbdip-doc-link:hover .dbdip-doc-arrow { color: #1d4ed8; }

/* ---- Responsabile ---- */
.dbdip-singolo-responsabile {
	display: flex;
	align-items: center;
	gap: .4rem;
	margin: .25rem 0 .5rem;
	color: #374151;
	font-size: .9rem;
	font-weight: 500;
}
.dbdip-singolo-responsabile svg {
	width: 1rem;
	height: 1rem;
	color: #6b7280;
	flex-shrink: 0;
}

/* ---- Galleria ---- */
.dbdip-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: .5rem;
	margin-bottom: 1.5rem;
}

.dbdip-gallery-item {
	display: block;
	aspect-ratio: 4/3;
	overflow: hidden;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
}

.dbdip-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .2s;
	display: block;
}
.dbdip-gallery-item:hover img { transform: scale(1.04); }

@media (max-width: 480px) {
	.dbdip-gallery { grid-template-columns: repeat(2, 1fr); }
}
