.cchdv-archive {
	--cchdv-primary: #1388b8;
	--cchdv-accent: #ff9f1c;
	--cchdv-text: #17202a;
	--cchdv-muted: #667085;
	--cchdv-border: #e4e7ec;
	--cchdv-surface: #f7f9fb;
	--cchdv-radius: 14px;
	font-family: inherit;
	color: var(--cchdv-text);
	width: 100%;
}

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

.cchdv-archive button,
.cchdv-archive input,
.cchdv-archive select {
	font: inherit;
}

.cchdv-toolbar {
	display: flex;
	align-items: center;
	gap: 18px;
	justify-content: space-between;
	margin-bottom: 18px;
}

.cchdv-search {
	position: relative;
	flex: 1 1 640px;
}

.cchdv-search svg {
	position: absolute;
	left: 16px;
	top: 50%;
	width: 20px;
	height: 20px;
	transform: translateY(-50%);
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	color: #667085;
	pointer-events: none;
}

.cchdv-search-input {
	width: 100%;
	min-height: 52px;
	border: 1px solid var(--cchdv-border);
	border-radius: 10px;
	padding: 12px 48px;
	background: #fff;
	color: var(--cchdv-text);
	transition: border-color .2s ease, box-shadow .2s ease;
}

.cchdv-search-input:focus {
	outline: 0;
	border-color: var(--cchdv-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cchdv-primary) 20%, transparent);
}

.cchdv-search-clear {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	border: 0;
	background: transparent;
	border-radius: 50%;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #667085;
}

.cchdv-search-clear:hover,
.cchdv-search-clear:focus-visible {
	background: #f2f4f7;
}

.cchdv-view-controls {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
}

.cchdv-view-controls label {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--cchdv-muted);
	font-size: 14px;
	white-space: nowrap;
}

.cchdv-per-page {
	min-width: 70px;
	height: 42px;
	border: 1px solid var(--cchdv-border);
	border-radius: 8px;
	padding: 0 10px;
	background: #fff;
}

.cchdv-view-buttons {
	display: flex;
	border: 1px solid var(--cchdv-border);
	border-radius: 8px;
	overflow: hidden;
}

.cchdv-view-button {
	width: 42px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 0;
	border-right: 1px solid var(--cchdv-border);
	background: #fff;
	cursor: pointer;
	color: var(--cchdv-text);
}

.cchdv-view-button:last-child {
	border-right: 0;
}

.cchdv-view-button svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.cchdv-view-button[data-view="grid"] svg {
	fill: currentColor;
	stroke: none;
}

.cchdv-view-button.is-active {
	background: var(--cchdv-primary);
	color: #fff;
}

.cchdv-results-summary {
	margin: 0 0 18px;
	color: var(--cchdv-muted);
	font-size: 14px;
}

.cchdv-results-count {
	font-weight: 700;
	color: var(--cchdv-text);
}

.cchdv-section {
	margin-bottom: 18px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--cchdv-primary) 35%, var(--cchdv-border));
	background: #fff;
}

.cchdv-section-heading,
.cchdv-subsection-heading,
.cchdv-group-title,
.cchdv-document-title {
	margin: 0;
}

.cchdv-accordion-button {
	width: 100%;
	border: 0;
	text-align: left;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 13px;
}

.cchdv-section-button {
	min-height: 58px;
	padding: 14px 18px;
	background: var(--cchdv-primary);
	color: #fff;
	font-weight: 700;
	font-size: 17px;
}

.cchdv-accordion-icon {
	position: relative;
	width: 14px;
	height: 14px;
	flex: 0 0 14px;
}

.cchdv-accordion-icon::before,
.cchdv-accordion-icon::after {
	content: "";
	position: absolute;
	background: currentColor;
	border-radius: 2px;
	left: 0;
	top: 6px;
	width: 14px;
	height: 2px;
	transition: transform .2s ease;
}

.cchdv-accordion-icon::after {
	transform: rotate(90deg);
}

.cchdv-accordion-button[aria-expanded="true"] .cchdv-accordion-icon::after {
	transform: rotate(0);
}

.cchdv-section-count {
	margin-left: auto;
	min-width: 32px;
	height: 26px;
	padding: 0 9px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	background: rgba(255,255,255,.18);
	color: currentColor;
}

.cchdv-section-panel {
	padding: 18px;
}

.cchdv-subsection {
	border: 1px solid var(--cchdv-border);
	border-radius: 9px;
	overflow: hidden;
	margin-bottom: 12px;
}

.cchdv-subsection-button {
	min-height: 56px;
	padding: 12px 16px;
	background: #fff;
	color: var(--cchdv-text);
	font-weight: 650;
}

.cchdv-subsection-button:hover {
	background: #f8fafc;
}

.cchdv-subsection-button .cchdv-section-count {
	background: #eef2f6;
	color: var(--cchdv-muted);
}

.cchdv-folder-icon {
	width: 28px;
	height: 28px;
	color: var(--cchdv-primary);
	flex: 0 0 28px;
}

.cchdv-folder-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.cchdv-subsection-panel {
	padding: 17px;
	border-top: 1px solid var(--cchdv-border);
	background: #fcfcfd;
}

.cchdv-group-title {
	font-size: 17px;
	margin: 4px 0 14px;
}

.cchdv-documents {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
}

.cchdv-document-card {
	min-width: 0;
	border: 1px solid var(--cchdv-border);
	border-radius: var(--cchdv-radius);
	background: var(--cchdv-surface);
	padding: 24px 18px 18px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-height: 330px;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cchdv-document-card:hover {
	transform: translateY(-3px);
	border-color: color-mix(in srgb, var(--cchdv-primary) 35%, var(--cchdv-border));
	box-shadow: 0 12px 26px rgba(16,24,40,.08);
}

.cchdv-document-icon {
	position: relative;
	width: 58px;
	height: 72px;
	margin-bottom: 18px;
	color: #ed4058;
}

.cchdv-document-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.cchdv-document-icon .cchdv-icon-fold {
	fill: none;
	stroke: rgba(255,255,255,.8);
	stroke-width: 3;
}

.cchdv-document-icon span {
	position: absolute;
	left: 50%;
	bottom: 13px;
	transform: translateX(-50%);
	font-size: 9px;
	line-height: 1;
	font-weight: 800;
	color: #fff;
	max-width: 45px;
	overflow: hidden;
}

.cchdv-document-main {
	flex: 1 1 auto;
	width: 100%;
}

.cchdv-document-title {
	font-size: 15px;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.cchdv-document-description {
	font-size: 13px;
	line-height: 1.5;
	color: var(--cchdv-muted);
	margin: 9px 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cchdv-document-meta {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
	color: #98a2b3;
	font-size: 13px;
	margin-top: 9px;
}

.cchdv-document-meta span + span::before {
	content: "•";
	margin-right: 8px;
}

.cchdv-document-actions {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
	width: 100%;
}

.cchdv-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--cchdv-primary);
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
	transition: filter .18s ease, transform .18s ease;
}

.cchdv-button:hover,
.cchdv-button:focus-visible {
	filter: brightness(.92);
	transform: translateY(-1px);
}

.cchdv-button--secondary {
	background: transparent;
	color: var(--cchdv-primary) !important;
	border: 1px solid var(--cchdv-primary);
}

.cchdv-unavailable {
	font-size: 13px;
	color: var(--cchdv-muted);
}

.cchdv-empty,
.cchdv-no-results {
	min-height: 180px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 10px;
	color: var(--cchdv-muted);
}

.cchdv-empty svg,
.cchdv-no-results svg {
	width: 58px;
	height: 58px;
	fill: none;
	stroke: #b8c2cc;
	stroke-width: 2;
}

.cchdv-no-results svg {
	width: 48px;
	height: 48px;
}

.cchdv-no-results strong {
	color: var(--cchdv-text);
	font-size: 18px;
}

.cchdv-pagination {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 18px;
}

.cchdv-page-button {
	border: 1px solid var(--cchdv-border);
	border-radius: 8px;
	background: #fff;
	color: var(--cchdv-text);
	padding: 8px 12px;
	cursor: pointer;
}

.cchdv-page-button:disabled {
	opacity: .45;
	cursor: not-allowed;
}

.cchdv-page-info {
	color: var(--cchdv-muted);
	font-size: 13px;
}

/* Vista lista */
.cchdv-archive.is-list-view .cchdv-documents {
	grid-template-columns: 1fr;
}

.cchdv-archive.is-list-view .cchdv-document-card {
	min-height: 0;
	flex-direction: row;
	align-items: center;
	text-align: left;
	padding: 16px;
	gap: 16px;
}

.cchdv-archive.is-list-view .cchdv-document-icon {
	width: 42px;
	height: 52px;
	margin: 0;
	flex: 0 0 42px;
}

.cchdv-archive.is-list-view .cchdv-document-title {
	font-size: 15px;
}

.cchdv-archive.is-list-view .cchdv-document-description {
	-webkit-line-clamp: 2;
}

.cchdv-archive.is-list-view .cchdv-document-meta {
	justify-content: flex-start;
}

.cchdv-archive.is-list-view .cchdv-document-actions {
	width: auto;
	margin: 0 0 0 auto;
	flex: 0 0 auto;
}

.cchdv-archive [hidden] {
	display: none !important;
}

.cchdv-archive button:focus-visible,
.cchdv-archive a:focus-visible,
.cchdv-archive select:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--cchdv-accent) 55%, transparent);
	outline-offset: 2px;
}

@media (max-width: 1024px) {
	.cchdv-documents {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.cchdv-toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.cchdv-search {
		flex-basis: auto;
	}

	.cchdv-view-controls {
		justify-content: space-between;
	}

	.cchdv-view-controls label span {
		display: none;
	}

	.cchdv-documents {
		grid-template-columns: 1fr;
	}

	.cchdv-section-panel,
	.cchdv-subsection-panel {
		padding: 12px;
	}

	.cchdv-section-button {
		font-size: 15px;
	}

	.cchdv-subsection-button {
		font-size: 14px;
		align-items: flex-start;
	}

	.cchdv-archive.is-list-view .cchdv-document-card {
		align-items: flex-start;
		flex-wrap: wrap;
	}

	.cchdv-archive.is-list-view .cchdv-document-main {
		flex: 1 1 calc(100% - 62px);
	}

	.cchdv-archive.is-list-view .cchdv-document-actions {
		width: 100%;
		margin-left: 58px;
		justify-content: flex-start;
	}

	.cchdv-pagination {
		justify-content: center;
		flex-wrap: wrap;
	}
}


/* Compatibilidad con Elementor y temas que imponen estilos globales a botones/SVG. */
.cchdv-archive svg {
	display: block;
	max-width: none !important;
}

.cchdv-archive .cchdv-section-button {
	background: var(--cchdv-primary) !important;
	background-color: var(--cchdv-primary) !important;
	color: #fff !important;
	border: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	text-decoration: none !important;
}

.cchdv-archive .cchdv-section-button:hover,
.cchdv-archive .cchdv-section-button:focus,
.cchdv-archive .cchdv-section-button:active {
	background: var(--cchdv-primary) !important;
	background-color: var(--cchdv-primary) !important;
	color: #fff !important;
}

.cchdv-archive .cchdv-subsection-button {
	background: #fff !important;
	background-color: #fff !important;
	color: var(--cchdv-text) !important;
	border: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
}

.cchdv-archive .cchdv-subsection-button:hover,
.cchdv-archive .cchdv-subsection-button:focus {
	background: #f8fafc !important;
	background-color: #f8fafc !important;
	color: var(--cchdv-text) !important;
}

.cchdv-archive .cchdv-view-button {
	background: #fff !important;
	background-color: #fff !important;
	color: var(--cchdv-text) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.cchdv-archive .cchdv-view-button.is-active,
.cchdv-archive .cchdv-view-button.is-active:hover,
.cchdv-archive .cchdv-view-button.is-active:focus {
	background: var(--cchdv-primary) !important;
	background-color: var(--cchdv-primary) !important;
	color: #fff !important;
}

.cchdv-archive .cchdv-page-button,
.cchdv-archive .cchdv-search-clear {
	text-transform: none !important;
	box-shadow: none !important;
}

/* =========================================================
   CCHDV Archivo Digital 1.0.3
   Ajuste puntual sobre el diseño estable de la versión 1.0.1.
   Conserva barras azules y estructura original; solo refina
   tipografía, altura, espacios y estados frente al tema.
   ========================================================= */

/* Evita que el tema cambie las barras a naranja o agrande el texto. */
.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button,
.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button:hover,
.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button:focus,
.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button[aria-expanded="true"],
.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button[aria-expanded="false"] {
	min-height: 50px !important;
	padding: 11px 16px !important;
	background: var(--cchdv-primary) !important;
	background-color: var(--cchdv-primary) !important;
	color: #ffffff !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: -0.01em !important;
	text-transform: none !important;
}

/* El texto real está dentro de un span: lo fijamos para neutralizar
   reglas globales del tema sobre h2, botones o spans. */
.cchdv-archive .cchdv-section-button > span:not(.cchdv-accordion-icon):not(.cchdv-section-count) {
	color: #ffffff !important;
	font-family: inherit !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: -0.01em !important;
	text-transform: none !important;
}

/* Acordeón más compacto, sin perder la identidad visual anterior. */
.cchdv-archive .cchdv-section {
	margin-bottom: 11px !important;
	border-radius: 9px !important;
	box-shadow: 0 3px 10px rgba(16, 24, 40, 0.035) !important;
}

.cchdv-archive .cchdv-section-count {
	min-width: 27px !important;
	height: 24px !important;
	padding: 0 8px !important;
	background: rgba(255, 255, 255, 0.18) !important;
	color: #ffffff !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
}

.cchdv-archive .cchdv-accordion-icon {
	width: 13px !important;
	height: 13px !important;
	flex-basis: 13px !important;
	color: #ffffff !important;
}

.cchdv-archive .cchdv-accordion-icon::before,
.cchdv-archive .cchdv-accordion-icon::after {
	width: 13px !important;
	background: #ffffff !important;
}

/* Panel y estado vacío más proporcionados. */
.cchdv-archive .cchdv-section-panel {
	padding: 14px !important;
}

.cchdv-archive .cchdv-empty {
	min-height: 125px !important;
	padding: 20px 16px !important;
	gap: 7px !important;
	font-size: 14px !important;
}

.cchdv-archive .cchdv-empty svg {
	width: 43px !important;
	height: 43px !important;
}

/* Subsecciones: jerarquía más fina y legible. */
.cchdv-archive .cchdv-subsection-button,
.cchdv-archive .cchdv-subsection-button:hover,
.cchdv-archive .cchdv-subsection-button:focus {
	min-height: 50px !important;
	padding: 10px 14px !important;
	background: #ffffff !important;
	color: var(--cchdv-text) !important;
	border: 0 !important;
	box-shadow: none !important;
	font-size: 15px !important;
	font-weight: 650 !important;
	line-height: 1.3 !important;
	text-transform: none !important;
}

.cchdv-archive .cchdv-subsection-button > span:not(.cchdv-folder-icon):not(.cchdv-section-count) {
	font-size: 15px !important;
	line-height: 1.3 !important;
	font-weight: 650 !important;
	text-transform: none !important;
}

.cchdv-archive .cchdv-subsection-button .cchdv-section-count {
	background: #eef2f6 !important;
	color: var(--cchdv-muted) !important;
}

/* Mantiene corregida la separación de la lupa y el texto. */
.cchdv-archive .cchdv-search svg {
	left: 17px !important;
	width: 17px !important;
	height: 17px !important;
	z-index: 2 !important;
	pointer-events: none !important;
}

.cchdv-archive .cchdv-search-input {
	padding-left: 49px !important;
}

/* Responsive */
@media (max-width: 1024px) {
	.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button,
	.cchdv-archive .cchdv-section-button > span:not(.cchdv-accordion-icon):not(.cchdv-section-count) {
		font-size: 17px !important;
	}
}

@media (max-width: 767px) {
	.cchdv-archive .cchdv-section .cchdv-section-heading .cchdv-section-button {
		min-height: 46px !important;
		padding: 10px 13px !important;
		font-size: 16px !important;
	}

	.cchdv-archive .cchdv-section-button > span:not(.cchdv-accordion-icon):not(.cchdv-section-count) {
		font-size: 16px !important;
	}

	.cchdv-archive .cchdv-section-panel {
		padding: 10px !important;
	}
}
