/**
 * Widget "CUME Tabla de RVOE".
 *
 * Tabla de transparencia: programa, nivel, tipo de registro, campus, folio,
 * estado y verificación. Se apoya en los tokens de tema de CUME Core para
 * seguir el modo claro/oscuro; los controles de Elementor sobreescriben las
 * custom properties.
 */

.cume-rvoe {
	--cume-rvoe-radius: 8px;
	--cume-rvoe-pad: 14px 16px;

	--cume-rvoe-surface: var(--cume-surface, #ffffff);
	--cume-rvoe-border: var(--cume-border, #e6e6ec);
	--cume-rvoe-color: var(--cume-text-muted, #5b5b6e);
	--cume-rvoe-strong: var(--cume-text, #2c2c3a);
	--cume-rvoe-head-bg: transparent;
	--cume-rvoe-head-color: var(--cume-text, #2c2c3a);
	--cume-rvoe-alt-bg: transparent;
	--cume-rvoe-hover-bg: transparent;
	--cume-rvoe-link: var(--cume-primary-light, #6c63b5);

	--cume-rvoe-transition: 200ms;
	--cume-rvoe-modal-btn-bg: #ffa800;
	--cume-rvoe-modal-btn-color: #1a1636;

	--cume-rvoe-badge-radius: 4px;
	--cume-rvoe-badge-federal: #e0a020;
	--cume-rvoe-badge-estatal: #7b6cf6;
	--cume-rvoe-badge-vigente: #22c55e;
	--cume-rvoe-badge-en-tramite: #e0a020;
	--cume-rvoe-badge-no-vigente: #ef4444;
}

.cume-rvoe__title {
	margin: 0 0 20px;
	color: var(--cume-rvoe-strong);
	line-height: 1.2;
}

/* La tabla desborda dentro de su propio contenedor: la página nunca hace
 * scroll horizontal por su culpa. */
.cume-rvoe__scroll {
	overflow-x: auto;
	border: 1px solid var(--cume-rvoe-border);
	border-radius: var(--cume-rvoe-radius);
	-webkit-overflow-scrolling: touch;
}

/* Cualificado con la etiqueta: los temas y los addons estilan `table` a saco. */
.cume-rvoe table.cume-rvoe__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: var(--cume-rvoe-surface);
	color: var(--cume-rvoe-color);
	font-size: 0.95rem;
	text-align: left;
}

.cume-rvoe table.cume-rvoe__table th,
.cume-rvoe table.cume-rvoe__table td {
	padding: var(--cume-rvoe-pad);
	border: 0;
	border-bottom: 1px solid var(--cume-rvoe-border);
	vertical-align: middle;
	text-align: left;
}

.cume-rvoe table.cume-rvoe__table th {
	background: var(--cume-rvoe-head-bg);
	color: var(--cume-rvoe-head-color);
	font-weight: 700;
	white-space: nowrap;
}

.cume-rvoe table.cume-rvoe__table tbody tr:last-child td {
	border-bottom: 0;
}

.cume-rvoe table.cume-rvoe__table tbody tr:nth-child(even) {
	background: var(--cume-rvoe-alt-bg);
}

.cume-rvoe table.cume-rvoe__table tbody tr:hover {
	background: var(--cume-rvoe-hover-bg);
}

/* Primera columna: es el nombre del programa, manda visualmente. */
.cume-rvoe__cell--first {
	color: var(--cume-rvoe-strong);
	font-weight: 600;
}

.cume-rvoe__cell--first a {
	color: inherit;
	text-decoration: none;
}

.cume-rvoe__cell--first a:hover,
.cume-rvoe__cell--first a:focus {
	text-decoration: underline;
}

/* Los folios se leen mejor en monoespaciada: son cadenas de dígitos. */
.cume-rvoe__folio,
.cume-rvoe__cell--rvoe-folio {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.88em;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.cume-rvoe__dash {
	opacity: 0.45;
}

/* --- Emblemas --- */
.cume-rvoe__badge {
	display: inline-block;
	padding: 3px 10px;
	border: 1px solid currentColor;
	border-radius: var(--cume-rvoe-badge-radius);
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

.cume-rvoe__badge--federal {
	color: var(--cume-rvoe-badge-federal);
}

.cume-rvoe__badge--estatal {
	color: var(--cume-rvoe-badge-estatal);
}

.cume-rvoe__badge--vigente {
	color: var(--cume-rvoe-badge-vigente);
}

.cume-rvoe__badge--en-tramite {
	color: var(--cume-rvoe-badge-en-tramite);
}

.cume-rvoe__badge--no-vigente {
	color: var(--cume-rvoe-badge-no-vigente);
}

/* El emblema de estado lleva una marca de verificación por delante. */
.cume-rvoe__badge--vigente::before {
	content: "\2713";
	margin-right: 6px;
}

/* --- Verificación --- */
a.cume-rvoe__verify {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--cume-rvoe-link);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

a.cume-rvoe__verify:hover,
a.cume-rvoe__verify:focus {
	text-decoration: underline;
}

.cume-rvoe__verify-icon {
	font-size: 0.85em;
}

/* Confirmación de copiado: se activa desde el JS. */
a.cume-rvoe__verify.is-copiado .cume-rvoe__verify-text {
	visibility: hidden;
}

a.cume-rvoe__verify.is-copiado {
	position: relative;
}

a.cume-rvoe__verify.is-copiado::after {
	content: attr(data-cume-copiado);
	position: absolute;
	left: 0;
	white-space: nowrap;
}

/* --- Ventana de verificación ---
 * El buscador de la SEP pide pegar el folio a mano, así que antes de mandar
 * allá al visitante se le explica qué va a encontrar. */
.cume-rvoe__modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cume-rvoe__modal[hidden] {
	display: none;
}

.cume-rvoe__modal-fondo {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
}

.cume-rvoe__modal-caja {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 32px;
	background: var(--cume-rvoe-surface);
	border: 1px solid var(--cume-rvoe-border);
	border-radius: 12px;
	color: var(--cume-rvoe-strong);
}

.cume-rvoe button.cume-rvoe__modal-cerrar {
	position: absolute;
	top: 14px;
	right: 16px;
	padding: 4px 8px;
	background: none;
	border: 0;
	color: var(--cume-rvoe-color);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.cume-rvoe__modal-title {
	margin: 0 0 10px;
	padding-right: 30px;
	color: var(--cume-rvoe-link);
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.25;
}

.cume-rvoe__modal-text {
	margin: 0 0 20px;
	color: var(--cume-rvoe-color);
	font-size: 0.98rem;
	line-height: 1.5;
}

.cume-rvoe__modal-folio {
	margin: 0 0 22px;
	padding: 18px 20px;
	border: 1px solid var(--cume-rvoe-border);
	border-radius: 8px;
}

.cume-rvoe__modal-folio-label {
	display: block;
	margin-bottom: 6px;
	color: var(--cume-rvoe-color);
	font-size: 0.92rem;
}

.cume-rvoe__modal-folio-valor {
	color: var(--cume-rvoe-strong);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.2rem;
	letter-spacing: 0.02em;
}

.cume-rvoe__modal-pasos {
	margin: 0 0 26px;
	padding-left: 1.3em;
	color: var(--cume-rvoe-strong);
	font-size: 1rem;
	line-height: 1.5;
}

.cume-rvoe__modal-pasos li {
	margin-bottom: 10px;
}

.cume-rvoe__modal-pasos li:last-child {
	margin-bottom: 0;
}

.cume-rvoe__modal-acciones {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
}

/* Cualificados con la etiqueta para ganar a los estilos del tema. */
.cume-rvoe button.cume-rvoe__modal-btn,
.cume-rvoe a.cume-rvoe__modal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 24px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity var(--cume-rvoe-transition, 200ms) ease;
}

.cume-rvoe button.cume-rvoe__modal-btn--ghost {
	background: transparent;
	border-color: var(--cume-rvoe-border);
	color: var(--cume-rvoe-color);
}

.cume-rvoe a.cume-rvoe__modal-btn--primary {
	background: var(--cume-rvoe-modal-btn-bg, #ffa800);
	color: var(--cume-rvoe-modal-btn-color, #1a1636);
	font-weight: 700;
}

.cume-rvoe button.cume-rvoe__modal-btn:hover,
.cume-rvoe a.cume-rvoe__modal-btn:hover {
	opacity: 0.9;
}

/* Con la ventana abierta, la página de detrás no debe desplazarse. */
body.cume-rvoe-abierto {
	overflow: hidden;
}

/* --- Nota y estado vacío --- */
.cume-rvoe__note {
	margin: 16px 0 0;
	color: var(--cume-rvoe-color);
	font-size: 0.85rem;
	line-height: 1.5;
	opacity: 0.85;
}

.cume-rvoe__empty {
	margin: 0;
	padding: 28px;
	border: 1px dashed var(--cume-rvoe-border);
	border-radius: var(--cume-rvoe-radius);
	color: var(--cume-rvoe-color);
	text-align: center;
}

/* --- Responsive --- */
@media (max-width: 767px) {
	.cume-rvoe__cell--hide-mobile {
		display: none;
	}

	.cume-rvoe table.cume-rvoe__table {
		font-size: 0.88rem;
	}
}
