/* Copyright 2025 Shota FUJI <pockawoooh@gmail.com>
 * SPDX-License-Identifier: MIT
 */

.tree-list {
	display: flex;
	flex-direction: column;
	list-style: none;
	padding: 0;
	margin: 0;
}

.tree-row {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
	grid-template-areas:
		"icon name name name"
		". . mode size";
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm) 0;
	border-block-end: 1px solid var(--color-border-subtle);
}

@media (any-hover: hover) {
	.tree-row:hover {
		text-decoration: none;
	}
	.tree-row:hover > .tree-row--name {
		text-decoration: underline;
	}
}

.tree-row--dir-icon, .tree-row--file-icon {
	grid-area: icon;
	width: auto;
	height: 1em;
}

.tree-row--dir-icon {
	color: var(--color-decoration);
}

.tree-row--file-icon {
	color: var(--color-fg-subtle);
}

.tree-row--name {
	grid-area: name;
	line-height: 1.3;

	color: var(--color-fg);
}

.tree-row--mode {
	grid-area: mode;
	font-size: var(--font-sm);
	line-height: 1.1;

	color: var(--color-fg-subtle);
}

.tree-row--size {
	grid-area: size;
	font-size: var(--font-sm);
	line-height: 1.1;

	color: var(--color-fg-weak);
}
