/* ==========================================================
   PALETA Y TOKENS (Variables Globales) 🎨
   ========================================================== */
/* Define las variables de color, espaciado y sombra que se usarán en todo el CSS.
   Esto permite cambiar fácilmente el tema corporativo (AZUL) en un solo lugar. */
:root {
	/* Colores corporativos (AZUL) */
	--brand-blue: #2e2c7d;
	/* Color AZUL principal y primario del portal */
	--brand-blue-hover: #3683cb;
	/* Color AZUL usado en estados de 'hover' (ratón sobre el elemento) */

	/* Colores Grises y de Fondo */
	--gray-fg: #2a2a2a;
	/* Gris oscuro para el texto principal (Foreground) */
	--gray-muted: #5B6770;
	/* Gris corporativo para textos secundarios o muted */
	--gray-muted-2: #6b6b6b;
	--gray-line: #eee;
	/* Gris muy claro para bordes y líneas divisorias */
	--badge-bg: #4b5563;
	/* Fondo de las insignias o contadores en las tarjetas */

	/* UI (Variables de Interfaz de Usuario) */
	--card-min-h: 74px;
	/* Altura mínima de las tarjetas de carpeta */
	--radius: 12px;
	/* Radio de esquina para bordes redondeados */
	--shadow-sm: 0 1px 0 rgba(0, 0, 0, .03);
	/* Sombra pequeña */
	--shadow-md: 0 4px 12px rgba(0, 0, 0, .10);
	/* Sombra mediana */
	--shadow-lg: 0 8px 22px rgba(0, 0, 0, .12);
	/* Sombra grande (usada en hover de tarjetas) */
}

/* ==========================================================
   BASE 🌐
   ========================================================== */
/* Reseteo básico (Aplica a todos los elementos, incluyendo pseudo-elementos) */
*,
*::before,
*::after {
	box-sizing: border-box;
	/* Asegura que padding y border se incluyan dentro del ancho/alto del elemento */
}

/* 1. CONSOLIDACIÓN DE LAYOUT BASE */
html,
body {
	height: 100%;
	/* Permite que el body y el html ocupen toda la altura de la ventana */
}

body {
	font-family: "Source Sans 3", "Aptos", "Segoe UI", sans-serif;
	/* Pila de fuentes */
	color: var(--gray-fg);
	/* Color de texto base (Gris oscuro) */
	background: #fff;
	/* Fondo blanco */
	margin: 0;
	font-size: 15px;
	/* Tamaño de fuente base */
}

/* No impone un color global a los enlaces para que cada componente lo defina. */
a {
	text-decoration: none;
	/* Elimina el subrayado por defecto de los enlaces */
}

/* Estilo para la accesibilidad al enfocar enlaces (navegación por teclado) */
a:focus-visible {
	/* Usa color AZUL corporativo en el focus outline, semi-transparente */
	outline: 3px solid rgba(46, 44, 125, .3);
	outline-offset: 2px;
}

/* 4. CONSOLIDACIÓN Y AJUSTE DE LAYOUT WRAP */
/* Contenedor principal del contenido, centrado y con ancho máximo */
.wrap {
	/* Establecemos un ancho máximo uniforme de 1200px (igual que el footer) */
	max-width: 1200px;
	margin: 0px auto;
	padding: 0 16px 6px;
	min-height: auto;
	display: block;
}

/* ==========================================================
   CABECERA Y TÍTULO 🖼️
   ========================================================== */
h1 {
	font-size: 30px;
	margin: 6px 0 6px;
	color: var(--brand-blue);
	/* Usa color corporativo AZUL */
	text-align: center;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
	font-weight: 800;
	/* Extra-negrita */
	letter-spacing: .5px;
}

/* ==========================================================
   TEXTO DE BIENVENIDA (INTRO-TEXT)
   ========================================================== */
/* Estilo para el bloque de texto introductorio, con bordes de color corporativo */
.intro-text {
	padding: 8px;
	background-color: #f8f8f8;
	/* Borde lateral de 6px en color AZUL corporativo para destacar */
	border-left: 6px solid var(--brand-blue);
	border-right: 6px solid var(--brand-blue);
	border-radius: var(--radius);
	color: var(--gray-muted);
	line-height: 1.6;
	font-size: 14px;
	box-shadow: var(--shadow-sm);
	font-weight: 400;
}

.intro-text p {
	margin: 0 0 1.2em 0;
	text-align: justify;
}

.intro-text p:last-child {
	margin-bottom: 0;
}

/* Regla para destacar (keywords, leyes, etc.) en color AZUL corporativo dentro del texto intro */
.intro-text strong,
.intro-text a {
	color: var(--brand-blue);
	font-weight: 600;
}

/* ==========================================================
   BREADCRUMB (Migas de Pan) 🗺️
   ========================================================== */
/* Navegación jerárquica (Inicio > Sección > Subsección) usando Flexbox */
.bc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	color: var(--gray-muted-2);
	margin: 0 0 6px;
}

.bc a {
	color: var(--gray-muted);
}

.bc a:hover {
	color: var(--brand-blue);
	/* AZUL corporativo al pasar el ratón */
	text-decoration: underline;
}

.bc-sep {
	color: var(--gray-line);
	/* Color de los separadores (ej: '>') */
}

.bc-current {
	font-weight: 500;
	color: var(--gray-fg);
	/* Elemento actual más oscuro */
}

/* ==========================================================
   TARJETAS (CARPETAS) 🗂️
   ========================================================== */
/* Grid de Tarjetas (usa Grid Layout para distribución automática) */
.grid {
	display: grid;
	/* Crea columnas que se auto-ajustan, con un mínimo de 310px por columna */
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 14px;
	margin-top: 15px;
}

/* Estilo base de cada tarjeta/carpeta */
.card {
	position: relative;
	display: flex;
	align-items: center;
	gap: .75rem;
	min-height: var(--card-min-h);
	/* Padding ajustado para dejar espacio a la derecha para el badge */
	padding: 8px 115px 8px 10px;
	background: #fff;
	border: 1px solid var(--gray-line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	/* Transiciones suaves para los efectos de hover */
	transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .06s ease;
}

/* Efecto de hover (interacción) en la tarjeta */
.card:hover {
	background: #FBEEDC;
	/* Fondo ligeramente anaranjado/amarillo */
	border-color: #D8A600;
	/* Borde más oscuro */
	box-shadow: var(--shadow-lg);
	transform: translateY(-1px);
	/* Elevación sutil */
	cursor: pointer;
	text-decoration: none;
}

/* Accesibilidad: Estilo al enfocar con el teclado */
.card:focus-visible {
	outline: none;
	background: #FBEEDC;
	border-color: #D8A600;
	/* Sombra de focus visible y combinada con la sombra grande */
	box-shadow: 0 0 0 3px rgba(216, 166, 0, .25), var(--shadow-lg);
}

.card:active {
	transform: translateY(0);
	box-shadow: var(--shadow-md);
}

.icon {
	flex: 0 0 28px;
	/* El icono mantiene un ancho fijo de 28px */
	display: inline-flex;
}

.title {
	flex: 1 1 auto;
	/* El título ocupa el espacio restante */
	min-width: 0;
	font-weight: 500;
	color: var(--gray-muted);
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
	word-break: break-word;
	line-height: normal;
}

/* Badge (Insignia de Contadores) */
.badge {
	/* Contenedor del badge principal (caja con fondo gris) */
	position: absolute;
	/* Posicionamiento absoluto para flotar sobre la tarjeta */
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	/* Centrado vertical perfecto */
	background: var(--badge-bg);
	color: #fff;
	border-radius: var(--radius);
	padding: 4px 4px;
	font-size: 12px;
	line-height: 1.2;
	pointer-events: none;
	/* No interfiere con el click de la tarjeta */
	display: flex;
	flex-direction: column;
	/* Apila las líneas (Documentos/Secciones) verticalmente */
	align-items: flex-end;
}

/* Estilo para cada línea de contenido (Documentos / Secciones) */
.badge-line {
	display: block;
	font-size: 12px;
	line-height: 1.2;
	white-space: nowrap;
	padding: 2px 0;
}

/* Estilo para el número (más peso) */
.badge-count {
	font-weight: 700;
	min-width: 15px;
	display: inline-block;
	text-align: right;
}

/* Estilo para la etiqueta (menos peso) */
.badge-label {
	font-weight: 400;
}

/* ==========================================================
   LISTA DE DOCUMENTOS 📜
   ========================================================== */
.docs h3 {
	margin: 16px 0 8px;
}

/* Estilo para cada fila de documento */
.doc {
	display: flex;
	align-items: center;
	/* icono + texto centrados verticalmente */
	gap: .5rem;
	padding: 8px 10px;
	border: 1px dashed #e1e1e1;
	border-radius: 10px;
}

.docs a {
	color: var(--gray-muted);
	/* gris corporativo */
	text-decoration: none;
	font-weight: 500;
}

.docs a:hover {
	color: var(--brand-blue);
	/* AZUL corporativo al hover */
	text-decoration: underline;
}

.empty {
	color: #9aa0a6;
	margin: 8px 2px;
}

/* Separador horizontal (gradiente) */
.sep {
	height: 1px;
	background: linear-gradient(90deg, var(--gray-line), transparent);
	margin: 18px 0;
}

/* ==========================================================
   BOTONES (VOLVER AL INICIO / SUBIR UN NIVEL) ⬆️
   ========================================================== */
/* Estilos generales para botones de navegación */
.toplink,
.footerlink a {
	display: inline-block;
	background-color: var(--brand-blue);
	/* Fondo AZUL corporativo */
	color: #fff;
	font-weight: 700;
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 14px;
	text-decoration: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	transition: background .2s, transform .2s, box-shadow .2s;
}

/* Efecto de hover */
.toplink:not(.is-disabled):hover,
.footerlink a:not(.is-disabled):hover {
	background-color: var(--brand-blue-hover);
	/* AZUL de hover */
	box-shadow: 0 4px 8px rgba(0, 0, 0, .25);
	transform: translateY(-1px);
	color: white;
}

/* Estilo para botones deshabilitados (menos opacidad y sin interacción) */
.toplink.is-disabled,
.footerlink a.is-disabled {
	opacity: .45;
	filter: grayscale(20%);
	cursor: default;
	pointer-events: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

/* Contenedor del botón inferior (ej: "Subir Nivel") */
.footerlink {
	margin-top: 20px;
	text-align: center;
	margin-bottom: 8px;
}

/* ==========================================================
   BARRA DE BÚSQUEDA (alineada a la derecha) 🔍
   ========================================================== */
.searchbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	/* Alinea el contenido a la derecha */
	gap: 10px;
	max-width: 100%;
	margin: 6px 0 10px 0;
}

.searchbar input[type="text"] {
	flex: 0 0 20%;
	min-width: 200px;

	/* --- CAMBIOS CLAVE PARA RECUADRO --- */
	background: #fff;
	/* Fondo blanco */
	border: 2px solid;
	border-color: #cfcaca;
	/* Borde gris claro (el mismo que las tarjetas) */
	/*border-bottom: none; /* Eliminamos la regla de la línea inferior */
	border-radius: 6px;
	/* Esquinas redondeadas (puedes usar var(--radius) si es muy grande) */
	padding: 6px 10px;
	/* Más padding para hacerlo más alto y con más espacio */
	box-shadow: var(--shadow-sm);
	/* Sombra ligera para destacarlo */

	/* --- Mantenemos --- */
	font-size: 14px;
	outline: none;
	transition: border-color .1s, box-shadow .1s;
	/* Añadimos la transición para la sombra */
}

.searchbar input[type="text"]:focus {
	border-color: var(--brand-blue);
	/* Borde AZUL corporativo al enfocar */
	box-shadow: 0 0 0 1px var(--brand-blue);
	/* Opción: Añade un halo azul alrededor */
}

.searchbar button {
	border: none;
	background: transparent;
	font-size: 16px;
	cursor: pointer;
	color: #2f4f4f;
	transition: color .2s;
}

.searchbar button:hover {
	color: var(--brand-blue);
	/* AZUL corporativo al hover */
}

/* ==========================================================
   RESPONSIVE / PREFERENCIAS 📱
   ========================================================== */
/* Ajustes para pantallas pequeñas (móviles) */
@media (max-width: 640px) {
	.grid {
		grid-template-columns: 1fr;
		/* Una sola columna para el grid de tarjetas */
	}

	.searchbar input[type="text"] {
		flex-basis: 60%;
		/* El input de búsqueda ocupa más espacio en móvil */
	}
}

/* Prefiere movimiento reducido (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		transition: none !important;
		/* Desactiva todas las animaciones y transiciones */
	}
}

/* Metadatos de Fecha en Tarjetas y Documentos */
.card .meta-date {
	position: absolute;
	right: 12px;
	bottom: 8px;
	font-size: 12px;
	color: var(--gray-muted-2);
	opacity: .9;
}

.doc .meta-date {
	margin-left: auto;
	/* Empuja la fecha completamente a la derecha */
	color: var(--gray-muted-2);
	font-size: 12px;
	white-space: nowrap;
	opacity: .9;
}

/* === Cabecera superior (topbar) === */
.topbar {
	display: flex;
	justify-content: space-between;
	/* El buscador y el botón se separan */
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 12px;
}

.topbar .searchbar {
	justify-content: flex-end;
	margin: 0;
}

/* Resultados de Búsqueda */
.search-results .doc .pipe {
	margin: 0 8px;
	color: #c7c7c7;
}

.search-results .doc .parentlink a {
	/* 3. CORRECCIÓN DE ALIAS DE VARIABLE */
	color: var(--gray-muted);
	text-decoration: none;
	font-weight: 600;
	letter-spacing: .3px;
}

.search-results .doc .parentlink a:hover {
	/* 2. CORRECCIÓN DE COLOR CORPORATIVO FIJO */
	color: var(--brand-blue);
	text-decoration: underline;
}

/* --- Resultados de búsqueda: layout 60/40 --- */
.search-results .search-group .doc {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 6px 12px 6px 12px;
	border-bottom: 1px dashed var(--gray-line);
}

/* Permite que el texto se envuelva en las columnas */
.search-results .doc .col-name,
.search-results .doc .col-folder {
	overflow: visible;
	white-space: normal;
	text-overflow: clip;
	word-break: break-word;
	overflow-wrap: anywhere;
	/* Permite saltos de línea más agresivos */
}

/* 1. Nombre del Contenido (columna 1) */
.search-results .doc .col-name {
	flex: 0 0 60%;
	/* Ocupa el 60% del ancho */
	max-width: 60%;
	min-width: 0;
}

/* 2. Carpeta Contenedora (columna 2) */
.search-results .doc .col-folder {
	flex: 0 0 40%;
	/* Ocupa el 40% del ancho */
	max-width: 40%;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	color: var(--gray-muted);
	font-weight: 500;
	font-size: 14px;
	line-height: 1.4;
}

/* Separador visual entre columnas (vertical) */
.search-results .doc .col-folder::before {
	content: "";
	display: block;
	width: 1px;
	height: 100%;
	margin: 0 8px;
	background: #cfd4d9;
}

/* Estilo del enlace de la carpeta */
.search-results .doc .col-folder a {
	display: block;
	max-width: 100%;
	overflow: visible;
	white-space: normal;
	text-decoration: none;
	color: var(--gray-muted);
	font-weight: 500;
	text-align: center;
}

.search-results .doc .col-folder a:hover {
	color: var(--brand-blue);
	/* AZUL corporativo al hover */
	text-decoration: underline;
}

/* Estilo del enlace del documento */
.search-results .doc .col-name a {
	font-weight: 500;
	color: var(--gray-muted);
	text-decoration: none;
}

.search-results .doc .col-name a:hover {
	color: var(--brand-blue);
	/* AZUL corporativo al hover */
	text-decoration: underline;
}

/* Icono del documento */
.search-results .doc .s-ico {
	margin-right: 6px;
	font-size: 16px;
}

/* --- Estilo de Cabeceras para Resultados de Búsqueda --- */
.search-results .search-header-row {
	border-bottom: 2px solid #ddd;
	padding-top: 10px;
	padding-bottom: 10px;
}

/* Formato de texto de las cabeceras (más negrita) */
.search-results .search-header-row .col-name,
.search-results .search-header-row .col-folder {
	font-weight: 700;
	color: var(--gray-fg);
}

/* Alineación específica para el texto "Sección" (40%) */
.search-results .search-header-row .col-folder {
	justify-content: center;
}

/* Escondemos el icono del documento en la fila de cabeceras */
.search-results .search-header-row .s-ico {
	display: none;
}

/* Ajusta el padding izquierdo para alineación */
.search-results .search-header-row .col-name {
	padding-left: 28px;
}

/* Responsive: en móviles apilamos 100/100 */
@media (max-width: 768px) {
	.search-results .doc {
		flex-direction: column;
		/* Apila las columnas verticalmente */
		align-items: flex-start;
	}

	.search-results .doc .col-name,
	.search-results .doc .col-folder {
		color: var(--gray-muted);
		font-weight: 500;
		max-width: 100%;
		flex: 0 0 100%;
	}

	.search-results .doc .col-folder {
		justify-content: flex-start;
	}

	.search-results .doc .col-folder::before {
		display: none;
		/* Oculta el separador vertical en móvil */
	}
}

/* === Cabecera Portal de Transparencia === */
.portal-header {
	width: 100%;
	padding: 0px 0 30px 0;
	background: #fff;
	position: relative;
}

/* La línea separadora del header se dibuja con un pseudo-elemento */
.portal-header::after {
	content: "";
	display: block;
	height: 2px;
	background: var(--brand-blue);
	max-width: 1200px;
	/* Igual que el nuevo .wrap */
	margin: 10px auto 0 auto;
	/* Centrar horizontalmente */
	padding: 0 16px;
	/* Mantiene la separación lateral de 16px */
	box-sizing: content-box;
	border-radius: 1px;
}


.portal-header .logo-avaf {
	display: block;
	height: 60px;
	width: auto;
	max-width: 100%;
	/* AÑADIMOS: Centrado y padding para alinearse con .wrap */
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
}

/* ====== Estilos del pie de página (Footer) ====== */
.portal-footer {
	margin-top: 12px;
	background: #ffffff;
	padding: 12px 0 16px 0;
	position: relative;
}

/* SOLUCIÓN: Línea separadora superior del footer */
.portal-footer::before {
	content: "";
	display: block;
	height: 2px;
	background: var(--brand-blue);

	/* 1. LIMITAMOS EL ANCHO MÁXIMO (Alineación con el contenido principal) */
	max-width: 1200px;
	/* 2. CENTRAMOS HORIZONTALMENTE y separamos del contenido */
	margin: 0 auto 10px auto;
	/* 3. AÑADIMOS EL MARGEN LATERAL DE 16PX (Para simular el padding del wrap) */
	padding: 0 16px;
	/* 4. Aseguramos que padding no aumente el max-width */
	box-sizing: border-box;
	border-radius: 1px;
}

/* Contenedor interno del footer (Logo + Textos) */
.portal-footer .footer-inner {
	position: relative;
	/* Usar Flexbox para alinear el logo y el texto horizontalmente */
	display: flex;
	align-items: center;
	/* Centra el logo y el texto verticalmente */
	gap: 12px;
	/* Espacio entre el logo y el texto */
	padding: 0 16px;
}

.portal-footer .footer-logo {
	height: 40px;
	width: auto;
	display: inline-block;
	flex-shrink: 0;
	/* Evita que el logo se encoja */
}

.portal-footer .footer-text {
	line-height: 1;
	/* El texto en líneas adyacentes está muy junto */
}

.portal-footer .footer-title {
	font-weight: 600;
	color: #5e778b;
	margin-bottom: 2px;
}

.portal-footer .footer-sub {
	color: #8e9398;
	font-size: 0.90rem;
}

/* Opcional: limitar ancho máximo del contenido del portal (CENTRADO) */
.wrap,
.portal-footer .footer-inner {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* Responsivo: si el ancho es pequeño, apila el logo y el texto verticalmente */
@media (max-width: 560px) {
	.portal-footer .footer-inner {
		flex-direction: column;
		/* Apila el logo y el texto */
		align-items: flex-start;
	}

	.portal-footer .footer-logo {
		height: 24px;
		/* Logo más pequeño en móvil */
	}
}





/* Ocultamos el título de la página de Wordpress */
.blog-content h3.entry-title {
    display: none;
}