/*
 * NutEx Cursos — estilos del frontend.
 * Todas las reglas están dentro de .ncm-cursos: no se modifican body, h1, button, input ni table del sitio.
 * Tipografía, colores de enlaces, botones y campos se heredan del tema activo (los botones usan las clases
 * "button wp-element-button" del propio WordPress). Las variables --ncm-* toman los colores del tema cuando existen.
 */
.ncm-cursos {
	--ncm-acento: var(--wp--preset--color--primary, var(--wp--preset--color--vivid-purple, currentColor));
	--ncm-borde: rgba(0, 0, 0, 0.12);
	--ncm-fondo: var(--wp--preset--color--base, #fff);
	--ncm-suave: rgba(0, 0, 0, 0.04);
	--ncm-espacio: clamp(12px, 2vw, 20px);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	box-sizing: border-box;
	width: 100%;
}
.ncm-cursos *, .ncm-cursos *::before, .ncm-cursos *::after { box-sizing: border-box; }

.ncm-cursos .ncm-tarjeta { background: var(--ncm-fondo); border: 1px solid var(--ncm-borde); border-radius: 10px; padding: var(--ncm-espacio); margin: 0 0 var(--ncm-espacio); }
.ncm-cursos .ncm-tarjeta > h3:first-child { margin-top: 0; }
.ncm-cursos .ncm-intro { margin-bottom: var(--ncm-espacio); }
.ncm-cursos .ncm-note, .ncm-cursos .ncm-hint { font-size: 0.9em; opacity: 0.8; margin: 4px 0 0; }
.ncm-cursos .ncm-note { margin-bottom: 12px; opacity: 1; }
.ncm-cursos .ncm-req { color: var(--ncm-acento); }

/* Formularios: los controles conservan el estilo del tema; sólo se ordena el layout. */
.ncm-cursos .ncm-formulario fieldset { border: 1px solid var(--ncm-borde); border-radius: 10px; padding: var(--ncm-espacio); margin: 0 0 var(--ncm-espacio); min-width: 0; }
.ncm-cursos .ncm-formulario legend { padding: 0 8px; font-weight: 600; }
.ncm-cursos .ncm-field { margin: 0 0 14px; }
.ncm-cursos .ncm-field > label { display: block; font-weight: 600; margin-bottom: 4px; }
.ncm-cursos .ncm-field input[type="text"],
.ncm-cursos .ncm-field input[type="email"],
.ncm-cursos .ncm-field input[type="password"],
.ncm-cursos .ncm-field input[type="tel"],
.ncm-cursos .ncm-field input[type="date"],
.ncm-cursos .ncm-field input[type="time"],
.ncm-cursos .ncm-field select,
.ncm-cursos .ncm-field textarea { width: 100%; max-width: 100%; }
.ncm-cursos .ncm-field textarea { resize: vertical; }
.ncm-cursos .ncm-counter { display: block; text-align: right; font-size: 0.8em; opacity: 0.7; }
.ncm-cursos .ncm-counter.is-limit { color: #b32d2e; opacity: 1; }
.ncm-cursos .ncm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 var(--ncm-espacio); }
.ncm-cursos .ncm-phone { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 8px; }
.ncm-cursos .ncm-check { display: block; margin: 8px 0 16px; }
.ncm-cursos .ncm-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.ncm-cursos .ncm-btn-secundario { opacity: 0.85; }
.ncm-cursos .ncm-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.ncm-cursos .has-error input, .ncm-cursos .has-error textarea, .ncm-cursos .has-error select { border-color: #b32d2e; }
.ncm-cursos .ncm-error { color: #b32d2e; font-size: 0.9em; margin: 4px 0 0; }
.ncm-cursos .ncm-alert { border: 1px solid #b32d2e; border-left-width: 4px; border-radius: 6px; padding: 10px 14px; margin: 0 0 var(--ncm-espacio); background: var(--ncm-fondo); }
.ncm-cursos .ncm-alert ul { margin: 6px 0 0; padding-left: 20px; }
.ncm-cursos .ncm-alert.ncm-ok { border-color: #2e7d32; }
.ncm-cursos .ncm-cover-preview img, .ncm-cursos .ncm-cover-current { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--ncm-borde); margin-top: 8px; }

.ncm-cursos .ncm-bloque { border: 1px dashed var(--ncm-borde); border-radius: 10px; padding: var(--ncm-espacio); margin: 0 0 var(--ncm-espacio); }
.ncm-cursos .ncm-bloque[hidden], .ncm-cursos [hidden] { display: none !important; }
.ncm-cursos .ncm-bloque > h4 { margin-top: 0; }
.ncm-cursos .ncm-radios { border: 0; padding: 0; margin: 0 0 6px; }
.ncm-cursos .ncm-radios legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.ncm-cursos .ncm-radio { display: inline-block; margin: 0 16px 6px 0; font-weight: 400; }
.ncm-cursos .ncm-estado-changes_requested, .ncm-cursos .ncm-estado-pending_review { border-style: dashed; }
.ncm-cursos .ncm-pub-published { border-color: var(--ncm-acento); }
.ncm-cursos .ncm-pub-suspended { border-color: #b32d2e; }

/* Panel */
.ncm-cursos .ncm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--ncm-espacio); padding: 0 0 8px; border-bottom: 1px solid var(--ncm-borde); }
.ncm-cursos .ncm-tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; }
.ncm-cursos .ncm-tabs a:hover { border-color: var(--ncm-borde); }
.ncm-cursos .ncm-tabs a.is-active { border-color: var(--ncm-acento); font-weight: 600; }
.ncm-cursos .ncm-tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: var(--ncm-espacio); }
.ncm-cursos .ncm-metrica { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ncm-cursos .ncm-etiqueta { font-size: 0.85em; opacity: 0.75; }
.ncm-cursos .ncm-cifra { font-size: 1.8em; line-height: 1.1; }
.ncm-cursos .ncm-proximamente { font-size: 0.9em; opacity: 0.65; font-style: italic; }
.ncm-cursos .ncm-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: var(--ncm-espacio); }
.ncm-cursos .ncm-filtros label { display: flex; flex-direction: column; font-size: 0.9em; }
.ncm-cursos .ncm-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.85em; background: var(--ncm-suave); border: 1px solid var(--ncm-borde); white-space: nowrap; }
.ncm-cursos .ncm-estado-approved, .ncm-cursos .ncm-estado-published { border-color: var(--ncm-acento); }
.ncm-cursos .ncm-estado-rejected, .ncm-cursos .ncm-estado-suspended { border-color: #b32d2e; }
.ncm-cursos .ncm-tabla-wrap { overflow-x: auto; }
.ncm-cursos .ncm-tabla { width: 100%; border-collapse: collapse; }
.ncm-cursos .ncm-tabla th, .ncm-cursos .ncm-tabla td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--ncm-borde); vertical-align: top; }
.ncm-cursos .ncm-datos { margin: 0; }
.ncm-cursos .ncm-dato { padding: 8px 0; border-bottom: 1px solid var(--ncm-borde); }
.ncm-cursos .ncm-dato dt { font-weight: 600; font-size: 0.9em; opacity: 0.8; }
.ncm-cursos .ncm-dato dd { margin: 2px 0 0; }
.ncm-cursos .ncm-historial { list-style: none; padding: 0; margin: 0; }
.ncm-cursos .ncm-historial li { padding: 8px 0; border-bottom: 1px solid var(--ncm-borde); }
.ncm-cursos .ncm-fecha { font-size: 0.85em; opacity: 0.7; }

@media (max-width: 640px) {
	.ncm-cursos .ncm-phone { grid-template-columns: 1fr; }
	.ncm-cursos .ncm-acciones .button { width: 100%; }
	.ncm-cursos .ncm-tabla thead { display: none; }
	.ncm-cursos .ncm-tabla tr { display: block; border: 1px solid var(--ncm-borde); border-radius: 8px; margin-bottom: 10px; padding: 6px; }
	.ncm-cursos .ncm-tabla td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 6px; }
	.ncm-cursos .ncm-tabla td[data-label]::before { content: attr(data-label); font-weight: 600; opacity: 0.75; }
}
