/* Documentos – Árbol de archivos: sección pública */
.hdoc {
	--hdoc-accent: #c0392b;
	--hdoc-border: #e2e4e7;
	--hdoc-soft: #f6f7f8;
	--hdoc-text: inherit;
	max-width: 1000px;
	margin: 0 auto;
	padding: 24px 16px 48px;
	box-sizing: border-box;
	color: var(--hdoc-text);
}
.hdoc *,
.hdoc *::before,
.hdoc *::after {
	box-sizing: border-box;
}
.hdoc-title {
	margin: 0 0 20px;
	line-height: 1.2;
}

/* Migas */
.hdoc-crumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 0;
	margin: 0 0 12px;
	padding: 0;
	font-size: .9em;
}
.hdoc-crumbs li + li::before {
	content: "›";
	margin: 0 8px;
	opacity: .55;
}
.hdoc-crumbs a {
	color: var(--hdoc-accent);
	text-decoration: none;
}
.hdoc-crumbs a:hover {
	text-decoration: underline;
}

/* Buscador */
.hdoc-search {
	margin: 0 0 20px;
}
.hdoc-search__input {
	width: 100%;
	padding: 12px 14px;
	font-size: 1em;
	border: 1px solid var(--hdoc-border);
	border-radius: 6px;
	background: #fff;
}
.hdoc-search__input:focus {
	outline: 2px solid var(--hdoc-accent);
	outline-offset: 1px;
}

/* Tarjetas de carpetas */
.hdoc-cards {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}
.hdoc-card a {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 16px 18px;
	border: 1px solid var(--hdoc-border);
	border-left: 4px solid var(--hdoc-accent);
	border-radius: 6px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s, transform .15s;
}
.hdoc-card a:hover,
.hdoc-card a:focus-visible {
	box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
	transform: translateY(-1px);
}
.hdoc-card__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}
.hdoc-card__count {
	font-size: .85em;
	opacity: .65;
}

/* Documentos: título + vínculo para descargar */
.hdoc-docs {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	border: 1px solid var(--hdoc-border);
	border-radius: 6px;
	background: #fff;
}
.hdoc-doc {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 16px;
}
.hdoc-doc + .hdoc-doc {
	border-top: 1px solid var(--hdoc-border);
}
.hdoc-doc:hover {
	background: var(--hdoc-soft);
}
.hdoc-doc__title {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}
.hdoc-doc__dl {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border-radius: 4px;
	background: var(--hdoc-accent);
	color: #fff;
	font-size: .9em;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.hdoc-doc__dl:hover,
.hdoc-doc__dl:focus-visible {
	filter: brightness(.92);
	color: #fff;
}
.hdoc-doc__type {
	font-size: .75em;
	padding: 1px 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .22);
}
.hdoc-doc__nofile {
	font-size: .85em;
	opacity: .6;
}

/* Árbol desplegable */
.hdoc-tree {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hdoc-tree .hdoc-tree {
	margin: 6px 0 6px 6px;
	padding-left: 14px;
	border-left: 2px solid var(--hdoc-border);
}
.hdoc-node > details > summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	cursor: pointer;
	border-radius: 4px;
	font-weight: 600;
}
.hdoc-node > details > summary:hover {
	background: var(--hdoc-soft);
}
.hdoc-node__count {
	font-size: .75em;
	font-weight: 400;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--hdoc-soft);
	border: 1px solid var(--hdoc-border);
}
.hdoc-node__body {
	padding: 4px 0 8px 8px;
}

/* Vacío */
.hdoc-empty {
	padding: 16px;
	border: 1px dashed var(--hdoc-border);
	border-radius: 6px;
	opacity: .8;
}
.hdoc-empty[hidden] {
	display: none;
}

@media (max-width: 560px) {
	.hdoc-doc {
		flex-direction: column;
		align-items: stretch;
	}
	.hdoc-doc__dl {
		justify-content: center;
	}
}
