/* Sitemap Tree Generator - Styles */

.sitemap-tree-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 20px;
	margin: 20px 0;
	line-height: 1.6;
}

/* Control buttons */
.sitemap-tree-controls {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 2px solid #ddd;
}

.sitemap-tree-controls button {
	display: inline-block;
	margin-right: 10px;
	padding: 8px 16px;
	background: #0066cc;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background 0.3s ease;
}

.sitemap-tree-controls button:hover {
	background: #0052a3;
}

.sitemap-tree-controls button:active {
	transform: scale(0.98);
}

/* Main tree list */
.sitemap-tree {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sitemap-tree .sitemap-item {
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
}

.sitemap-tree .sitemap-children {
	list-style: none;
	padding-left: 20px;
	margin: 8px 0 0 0;
	border-left: 2px solid #ddd;
	padding-left: 20px;
}

/* Individual items */
.sitemap-item {
	padding: 6px 0;
	display: flex;
	align-items: center;
}

.sitemap-item.has-children {
	padding: 8px 0;
}

/* Toggle button */
.sitemap-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-right: 8px;
	cursor: pointer;
	user-select: none;
	font-size: 12px;
	color: #666;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.sitemap-item[data-expanded="true"] .sitemap-toggle {
	transform: rotate(90deg);
}

.sitemap-toggle:hover {
	color: #0066cc;
}

/* Links */
.sitemap-link {
	display: inline;
	color: #0066cc;
	text-decoration: none;
	font-size: 15px;
	transition: color 0.2s ease;
	word-break: break-word;
}

.sitemap-link:hover {
	color: #0052a3;
	text-decoration: underline;
}

/* Type badge */
.sitemap-type {
	display: inline;
	margin-left: 6px;
	color: #666;
	font-size: 13px;
	font-weight: normal;
	white-space: nowrap;
}

/* Section headers (Articoli, Categorie, Tag, etc.) */
.sitemap-item.section-item {
	font-weight: 600;
	margin-top: 12px;
	padding-top: 12px;
}

.sitemap-item.section-item:first-child {
	margin-top: 0;
	padding-top: 0;
}

.sitemap-item.section-item .sitemap-link {
	color: #333;
	font-weight: 600;
	cursor: default;
	pointer-events: none;
}

.sitemap-item.section-item .sitemap-toggle {
	cursor: pointer;
}

/* Page items */
.sitemap-item.page-item .sitemap-link {
	color: #0066cc;
}

/* Post items */
.sitemap-item.post-item .sitemap-link {
	color: #0066cc;
	font-size: 14px;
}

/* Term items (categories, tags) */
.sitemap-item.term-item .sitemap-link {
	color: #0066cc;
}

/* Custom post type items */
.sitemap-item.cpt-item .sitemap-link {
	color: #0066cc;
	font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
	.sitemap-tree-wrapper {
		padding: 15px;
	}

	.sitemap-tree-controls button {
		display: block;
		width: 100%;
		margin-right: 0;
		margin-bottom: 8px;
	}

	.sitemap-tree-controls button:last-child {
		margin-bottom: 0;
	}

	.sitemap-tree .sitemap-children {
		padding-left: 16px;
	}

	.sitemap-link {
		font-size: 14px;
	}

	.sitemap-type {
		font-size: 12px;
	}
}

/* Animation for expand/collapse */
@media (prefers-reduced-motion: no-preference) {
	.sitemap-children {
		transition: max-height 0.3s ease, opacity 0.3s ease;
		overflow: hidden;
	}
}

/* Print styles */
@media print {
	.sitemap-tree-controls {
		display: none;
	}

	.sitemap-tree .sitemap-children {
		display: block !important;
	}

	.sitemap-item[data-expanded] {
		break-inside: avoid;
	}
}
