/**
 * Estilos para Mostrar Recursos
 * @version 2.0.0
 */

/* ===========================================
   VARIABLES CSS Y UTILIDADES
   =========================================== */

:root {
    --mr-primary-color: #C32942;
    --mr-primary-dark: #a02236;
    --mr-primary-light: #fce8ec;
    --mr-text-color: #333;
    --mr-text-light: #666;
    --mr-text-lighter: #999;
    --mr-bg-color: #f5f5f5;
    --mr-bg-white: #fff;
    --mr-border-color: #ddd;
    --mr-border-light: #e0e0e0;
    --mr-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --mr-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --mr-shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.2);
    --mr-radius-sm: 4px;
    --mr-radius-md: 6px;
    --mr-radius-lg: 8px;
    --mr-radius-full: 30px;
    --mr-transition-fast: 0.2s ease;
    --mr-transition-normal: 0.3s ease;
    --mr-transition-slow: 0.6s ease;
    --mr-excerpt-max-height: 6.4em;
    --mr-excerpt-scroll-duration: 6s;
}

/* Clase para ocultar visualmente pero mantener accesibilidad */
.mr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Anunciador ARIA para lectores de pantalla */
#mr-aria-announcer {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================================
   CONTENEDOR PRINCIPAL
   =========================================== */

/* Contenedor principal */
.mostrar-recursos-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    background: var(--mr-bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
    --mr-card-width: 18%;
    --mr-card-min-width: 320px;
    --mr-card-height: auto;
    --mr-thumb-height: 370px;
    --mr-grid-template: repeat(auto-fit, minmax(var(--mr-card-min-width), 1fr));
    --mr-excerpt-max-height: 120px;
    --mr-excerpt-scroll-duration: 6s;
    --mr-excerpt-distance: 0px;
    --mr-excerpt-duration: 0s;
}

/* Asegurar que todos los elementos se ajusten al contenedor padre */
.mostrar-recursos-container * {
    box-sizing: border-box;
}

/* Foco visible para accesibilidad */
.mostrar-recursos-container *:focus {
    outline: 2px solid var(--mr-primary-color);
    outline-offset: 2px;
}

.mostrar-recursos-container *:focus:not(:focus-visible) {
    outline: none;
}

.mostrar-recursos-container *:focus-visible {
    outline: 2px solid var(--mr-primary-color);
    outline-offset: 2px;
}

/* Pantalla completa */
.mostrar-recursos-container.mr-pantalla-completa {
    height: 100vh; /* Ocupa toda la altura de la ventana */
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita scroll en el contenedor principal */
}

/* En vista de lista, permitir scroll para evitar que se recorte la primera tarjeta */
.mr-view-list.mr-pantalla-completa {
    overflow: auto;
}

/* ===========================================
   MENSAJE DE CARGANDO
   =========================================== */

.mr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.mr-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #C32942;
    border-radius: 50%;
    animation: mr-spin 1s linear infinite;
    margin-right: 10px;
}

.mr-loading-text {
    color: #666;
    font-size: 14px;
}

/* Mensaje de cargando integrado dentro del grid */
.mr-loading-integrated {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    grid-column: 1 / -1;
    background: transparent;
    text-align: center;
    min-height: 200px;
}

.mr-loading-integrated .mr-loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
    margin-right: 12px;
}

.mr-loading-integrated .mr-loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

@keyframes mr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   BARRA DE BÚSQUEDA
   =========================================== */

.mr-search-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
    padding: 15px 30px;
    background: var(--mr-search-bar-color, #C32942);
    border-bottom: 3px solid var(--mr-search-bar-color, #a02236);
    flex-shrink: 0;
    position: relative;
    width: 100%;
    box-sizing: box-sizing;
}

.mr-pantalla-completa .mr-search-bar {
    margin-bottom: 0;
    padding: 25px 30px;
}

.mr-search-input-wrapper {
    position: relative;
    width: 300px;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.mr-search-input {
    width: 100%;
    padding: 16px 50px 16px 24px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    color: #333;
}

.mr-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.mr-search-input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: #fff;
}

.mr-search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
    z-index: 2;
}

.mr-search-clear:hover {
    background: transparent;
    color: #333;
}

.mr-search-results-count {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* ===========================================
   LAYOUT PRINCIPAL
   =========================================== */

.mr-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Botón hamburguesa (solo móvil) */
.mr-hamburger {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    margin: 0 0 12px 0;
}

/* Asegurar que el botón hamburger esté oculto en escritorio */
@media (min-width: 769px) {
    .mr-hamburger {
        display: none !important;
    }
}

.mr-hamburger-box {
    width: 22px;
    height: 16px;
    position: relative;
    display: inline-block;
}

.mr-hamburger-inner,
.mr-hamburger-inner::before,
.mr-hamburger-inner::after {
    position: absolute;
    width: 22px;
    height: 2px;
    background: currentColor;
    left: 0;
    transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.mr-hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.mr-hamburger-inner::before {
    content: '';
    top: -6px;
}

.mr-hamburger-inner::after {
    content: '';
    top: 6px;
}

.mr-hamburger[aria-expanded="true"] .mr-hamburger-inner {
    transform: translateY(-50%) rotate(45deg);
}

.mr-hamburger[aria-expanded="true"] .mr-hamburger-inner::before {
    top: 0;
    transform: rotate(-90deg);
}

.mr-hamburger[aria-expanded="true"] .mr-hamburger-inner::after {
    opacity: 0;
}

.mr-pantalla-completa .mr-content-wrapper {
    gap: 0; /* Sin gap para usar todo el espacio */
    align-items: stretch;
    flex: 1; /* Ocupa todo el espacio restante */
    height: calc(100vh - 120px); /* Altura total menos la barra de búsqueda */
    overflow: hidden;
}

/* ===========================================
   SIDEBAR DE FILTROS
   =========================================== */

.mr-filters-sidebar {
    width: 280px;
    background: #ffffff;
    border-radius: 0;
    padding: 24px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    border-right: none;
    box-sizing: border-box;
}

.mr-pantalla-completa .mr-filters-sidebar {
    width: 300px;
    border-radius: 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
    position: static;
    top: auto;
    overflow-y: auto;
    border-right: none;
}

.mr-filters-title {
    margin: 0 0 24px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-transform: none;
    letter-spacing: -0.02em;
    border-bottom: none;
    padding-bottom: 0;
    position: relative;
    padding-left: 0;
}

.mr-filter-section {
    margin-bottom: 24px;
}

.mr-filter-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 12px 0;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.mr-filter-group-title:hover {
    color: #C32942;
    border-bottom-color: #C32942;
}

.mr-filter-group-title .mr-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    margin-left: 8px;
    opacity: 1;
    flex-shrink: 0;
}

.mr-filter-group-title .mr-toggle-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mr-filter-group-title:hover .mr-toggle-icon {
    color: #C32942;
}

.mr-filter-group-title .mr-toggle-icon.rotated {
    transform: rotate(180deg);
    color: #C32942;
}

.mr-filter-group {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
    margin-top: 8px;
}

.mr-filter-group.open {
    max-height: 500px;
    padding: 0;
}

.mr-filter-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 10px 12px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    margin-bottom: 0;
    font-size: 14px;
    position: relative;
    line-height: 1.6;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
}

.mr-filter-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #C32942;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mr-filter-link:hover {
    background: transparent;
    color: #111827;
    text-decoration: none;
    padding-left: 16px;
}

.mr-filter-link:hover::before {
    opacity: 1;
}

.mr-filter-link.active {
    background: transparent;
    color: var(--mr-active-filter-color, #C32942);
    font-weight: 500;
    border-left: 2px solid #C32942;
    padding-left: 16px;
}

.mr-filter-link.active::before {
    opacity: 1;
}

.mr-filter-link.active:hover {
    background: transparent;
    color: var(--mr-active-filter-color, #C32942);
    padding-left: 16px;
}

.mr-filter-count {
    font-size: 12px;
    opacity: 0.6;
    margin-left: 8px;
    font-weight: 400;
    color: #9ca3af;
}

.mr-filter-link:hover .mr-filter-count {
    opacity: 0.8;
    color: #6b7280;
}

.mr-filter-link.active .mr-filter-count {
    opacity: 0.7;
    color: #C32942;
}

.mr-filter-all {
    font-weight: 500;
    background: #f9fafb;
    border: none;
    margin-bottom: 28px;
    padding: 14px 16px;
    border-radius: 0;
    color: #374151;
    transition: all 0.2s ease;
    box-shadow: none;
    display: block;
    text-align: left;
    position: relative;
    border-left: 3px solid transparent;
}

.mr-filter-all::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #C32942;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mr-filter-all:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
    border-left-color: #C32942;
}

.mr-filter-all:hover::before {
    opacity: 1;
}

.mr-filter-all.active {
    background: #f9fafb;
    color: #C32942;
    border-left-color: #C32942;
    font-weight: 600;
}

.mr-filter-all.active::before {
    opacity: 1;
}

.mr-filter-all.active:hover {
    background: #f3f4f6;
    color: #C32942;
}

.mr-no-custom-fields {
    padding: 20px 16px;
    background: #f9fafb;
    border-radius: 0;
    border: none;
    border-left: 3px solid #fbbf24;
    color: #6b7280;
    font-size: 14px;
    box-shadow: none;
}

.mr-no-custom-fields p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.mr-no-custom-fields p:last-child {
    margin-bottom: 0;
}

.mr-no-custom-fields code {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 12px;
    color: #C32942;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

/* ===========================================
   CONTENIDO PRINCIPAL
   =========================================== */

.mr-main-content {
    flex: 1;
    min-width: 0;
    background: #f5f5f5;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    min-height: 900px; /* aumenta el alto para visualizar más tarjetas */
}

.mr-pantalla-completa .mr-main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f5;
    min-width: 0;
}

/* ===========================================
   BARRA DE CONTROLES
   =========================================== */

.mr-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 18px 25px;
    background: #fff;
    border-radius: 0;
    border-bottom: 1px solid #ddd;
}

.mr-pantalla-completa .mr-controls-bar {
    margin-bottom: 0;
    background: #fff;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    flex-shrink: 0;
}

.mr-sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mr-sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.mr-sort-select:focus {
    outline: none;
    border-color: #C32942;
}

/* Toggle de vista */
.mr-view-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 25px;
    gap: 12px;
}

.mr-toggle-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

/* Switch toggle - Diseño mejorado */
.mr-toggle-switch {
    position: relative;
    display: inline-block;
}

.mr-toggle-input {
    display: none;
}

.mr-toggle-label-switch {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    position: relative;
    gap: 4px;
    transition: background 0.3s ease;
    border: 1px solid #e0e0e0;
}

.mr-toggle-label-switch:hover {
    background: #ebebeb;
    border-color: #d0d0d0;
}

.mr-toggle-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    color: #666;
    transition: all 0.3s ease;
    font-size: 18px;
    border-radius: 6px;
}

.mr-toggle-grid,
.mr-toggle-list {
    margin: 0;
}

/* Estado activo del toggle - Grid (izquierda) */
.mr-toggle-input:not(:checked) ~ .mr-toggle-label-switch .mr-toggle-grid {
    background: #C32942;
    color: #fff;
    box-shadow: 0 2px 4px rgba(195, 41, 66, 0.3);
}

.mr-toggle-input:not(:checked) ~ .mr-toggle-label-switch .mr-toggle-list {
    color: #999;
}

/* Estado activo del toggle - List (derecha) */
.mr-toggle-input:checked ~ .mr-toggle-label-switch .mr-toggle-list {
    background: #C32942;
    color: #fff;
    box-shadow: 0 2px 4px rgba(195, 41, 66, 0.3);
}

.mr-toggle-input:checked ~ .mr-toggle-label-switch .mr-toggle-grid {
    color: #999;
}

/* Grid de entradas */
.mr-grid {
    display: grid;
    gap: 24px;
    width: 100%;
    padding: 24px;
    padding-top: max(var(--mr-sticky-offset, 0px), 24px);
    box-sizing: border-box;
    align-items: start;
    grid-auto-rows: min-content;
    grid-template-rows: none;
    min-height: 200px;
    grid-row-gap: 24px;
    grid-column-gap: 24px;
}

/* Ajustes específicos para la vista de tarjetas (grid) */
.mr-grid.mr-view-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: var(--mr-grid-template);
    justify-items: stretch;
    align-items: stretch;
    align-content: start;
    overflow: hidden;
}

.mr-pantalla-completa .mr-grid {
    gap: 20px;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
    align-items: start; /* Las tarjetas se ajustan a su contenido */
    box-sizing: border-box;
}

/* Columnas responsive */
.mr-columnas-1 .mr-grid {
    --mr-grid-template: repeat(1, minmax(var(--mr-card-width), 1fr));
    max-width: 600px;
    margin: 0 auto;
}

.mr-columnas-2 .mr-grid {
    --mr-grid-template: repeat(2, minmax(var(--mr-card-width), 1fr));
    gap: 20px;
}

.mr-columnas-3 .mr-grid {
    --mr-grid-template: repeat(3, minmax(var(--mr-card-width), 1fr));
    gap: 18px;
}

.mr-columnas-4 .mr-grid {
    --mr-grid-template: repeat(4, minmax(var(--mr-card-width), 1fr));
    gap: 16px;
}

/* Vista grid: tarjetas con ancho fijo, altura automática */
.mostrar-recursos-container:not(.mr-view-list) .mr-grid .mr-post-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: var(--mr-card-height);
    margin: 0;
}

/* Imagen con tamaño fijo en vista grid */
.mostrar-recursos-container:not(.mr-view-list) .mr-grid .mr-post-thumbnail {
    width: 100%;
    max-width: 100%;
    height: var(--mr-thumb-height);
    position: relative;
    flex-shrink: 0;
}

/* El contenido se ajusta automáticamente sin scroll */
.mostrar-recursos-container:not(.mr-view-list) .mr-grid .mr-post-content {
    overflow: visible;
    flex: 1;
    min-height: 0;
}

/* Imagen ajustada a su contenedor */
.mostrar-recursos-container:not(.mr-view-list) .mr-grid .mr-post-thumbnail img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Grid de tarjetas con tamaño fijo */
.mostrar-recursos-container:not(.mr-view-list) .mr-grid {
    grid-template-columns: var(--mr-grid-template);
    justify-content: center;
    justify-items: stretch;
    align-items: stretch;
    align-content: start;
}

/* ===========================================
   ITEMS DE ENTRADA - OPTIMIZADO POR EXPERTO
   =========================================== */

/* Item principal - Grid */
.mr-post-item {
    background: #fff;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1024px;
    min-height: fit-content;
    max-height: none;
    will-change: transform, box-shadow;
}

.mr-post-card {
    position: relative;
    --mr-excerpt-distance: 0px;
    --mr-excerpt-duration: 0s;
}

.mr-post-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(195, 41, 66, 0.2);
    z-index: 10;
    cursor: pointer;
}

.mr-post-item:focus-within {
    outline: 2px solid #C32942;
    outline-offset: 2px;
}

/* Imagen destacada - Grid */
.mr-post-thumbnail {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 220px;
    background: #fff;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.mr-post-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(195, 41, 66, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.mr-post-item:hover .mr-post-thumbnail::before {
    opacity: 1;
}

.mr-post-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: block;
}

.mr-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.mr-post-item:hover .mr-post-thumbnail img {
    transform: scale(1.08);
}

/* Contenido del post - Grid */
.mr-post-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    min-width: 0;
    box-sizing: border-box;
    height: auto;
    min-height: fit-content;
    position: relative;
    overflow: visible;
    z-index: 10;
}

/* Wrapper del título con icono de información */
.mr-post-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
}

/* Título - Grid */
.mr-post-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    flex: 0 0 auto;
    min-width: 0;
}

.mr-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
}

.mr-post-title a:hover {
    color: #C32942;
}

.mr-post-title a:focus {
    outline: 2px solid #C32942;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Extracto - Grid */
.mr-post-excerpt {
    margin: 0;
    color: #4a5568;
    line-height: 1.7;
    font-size: 15px;
    flex-grow: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    font-weight: 400;
    height: 120px;
    overflow: hidden;
    position: relative;
}

.mr-post-excerpt-inner {
    display: block;
    will-change: transform;
    transform: translateY(0);
    padding-bottom: 8px;
}

/* Enlace de lectura - Grid */
.mr-post-link {
    margin: 0;
    padding-top: 8px;
    margin-top: auto;
}

.mr-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #C32942 0%, #a02236 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 2px 8px rgba(195, 41, 66, 0.3);
    position: relative;
    overflow: hidden;
}

.mr-read-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.mr-read-more:hover {
    background: linear-gradient(135deg, #a02236 0%, #8b1e2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(195, 41, 66, 0.4);
}

.mr-read-more:hover::before {
    left: 100%;
}

.mr-read-more:focus {
    outline: 2px solid #C32942;
    outline-offset: 2px;
}

.mr-read-more::after {
    content: '→';
    font-size: 16px;
    transition: transform 0.3s ease;
}

.mr-read-more:hover::after {
    transform: translateX(4px);
}

/* Mensaje cuando no hay posts */
.mr-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 18px;
}

/* Responsive - Tablets */
@media (max-width: 1024px) {
    .mostrar-recursos-container {
        --mr-card-width: min(340px, 100%);
        --mr-grid-template: repeat(auto-fit, minmax(var(--mr-card-width), 1fr));
    }
    
    .mr-content-wrapper {
        gap: 20px;
    }
    
    .mr-filters-sidebar {
        width: 250px;
        padding: 20px 15px;
    }
    
    .mr-columnas-4 .mr-grid {
        --mr-grid-template: repeat(3, minmax(var(--mr-card-width), 1fr));
        gap: 18px;
    }
    
    .mr-columnas-3 .mr-grid {
        --mr-grid-template: repeat(2, minmax(var(--mr-card-width), 1fr));
        gap: 20px;
    }
    
    .mr-grid {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .mostrar-recursos-container {
        --mr-card-width: 100%;
        --mr-card-height: auto;
        --mr-thumb-height: 280px;
        --mr-grid-template: 1fr;
    }
    
    .mostrar-recursos-container:not(.mr-view-list) .mr-grid .mr-post-item,
    .mostrar-recursos-container:not(.mr-view-list) .mr-grid .mr-post-thumbnail {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .mr-content-wrapper {
        flex-direction: column;
        gap: 0;
    }
    
    .mr-filters-sidebar {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #ddd;
        position: static;
        order: 2;
    }
    
    .mr-main-content {
        order: 1;
        min-height: auto;
    }
    
    .mr-columnas-2 .mr-grid,
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        --mr-grid-template: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    
    .mr-grid {
        gap: 16px;
        padding: 16px;
    }
    
    .mr-post-content {
        padding: 18px;
        gap: 12px;
    }
    
    .mr-post-title {
        font-size: 17px;
    }
    
    .mr-post-excerpt {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* Responsive - Móviles */
@media (max-width: 480px) {
    .mr-filters-sidebar {
        padding: 15px;
    }
    
    .mr-columnas-1 .mr-grid,
    .mr-columnas-2 .mr-grid,
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        --mr-grid-template: 1fr;
        gap: 12px;
    }
    
    .mr-grid {
        gap: 12px;
        padding: 12px;
    }
    
    .mr-post-content {
        padding: 16px;
        gap: 10px;
    }
    
    .mr-post-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .mr-post-excerpt {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .mr-category {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .mr-post-meta {
        font-size: 12px;
        gap: 10px;
    }
    
    .mr-read-more {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ===========================================
   VISTA DE LISTA
   =========================================== */

.mr-view-list .mr-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 32px;
    grid-template-columns: none;
    grid-auto-rows: none;
    margin: 0 auto 0 0;
    align-self: flex-start;
}

.mr-view-list .mr-post-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1024px;
    margin: 0;
    padding: 14px 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    gap: 16px;
    min-width: 0;
}

.mr-view-list .mr-post-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: #C32942;
    cursor: pointer;
}

.mr-view-list .mr-post-thumbnail {
    position: relative;
    flex: 0 0 auto;
    width: min(160px, 32vw);
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.mr-view-list .mr-post-thumbnail a {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 8px;
}

.mr-view-list .mr-post-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.mr-view-list .mr-post-thumbnail:hover img {
    transform: scale(1.02);
}

.mr-view-list .mr-post-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    box-sizing: border-box;
    height: auto;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mr-view-list .mr-post-title {
    font-size: 16px;
    margin: 0;
    line-height: 1.4;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.mr-view-list .mr-post-excerpt {
    margin: 0;
    line-height: 1.6;
    font-size: 14px;
    color: #666;
    flex-grow: 0;
    height: auto;
    overflow: visible;
}

.mr-view-list .mr-post-meta {
    margin: 0;
    font-size: 14px;
    color: #7a7a7a;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.mr-view-list .mr-post-categories {
    gap: 8px;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

.mr-view-list .mr-category {
    display: inline-block;
    padding: 5px 10px;
    background: #fce8ec;
    color: #C32942;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mr-view-list .mr-category:hover {
    background: #C32942;
    color: #fff;
}

.mr-view-list .mr-post-link {
    margin: 0;
    padding-top: 8px;
}

.mr-view-list .mr-read-more {
    display: inline-block;
    padding: 10px 20px;
    background: #C32942;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mr-view-list .mr-read-more:hover {
    background: #a02236;
    transform: translateX(3px);
}

.mr-custom-fields-display {
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.mr-custom-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.mr-custom-field-icon {
    color: #A0A0A0;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.mr-custom-field:last-child {
    margin-bottom: 0;
}

.mr-custom-field-value {
    color: #A0A0A0;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    line-height: 1.6;
}

/* Campos personalizados en vista lista */
.mr-view-list .mr-custom-fields-display {
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    width: 100%;
}

.mr-view-list .mr-custom-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.mr-view-list .mr-custom-field-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.mr-view-list .mr-custom-field-value {
    font-size: 13px;
    color: #777;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===========================================
   ICONO DE INFORMACIÓN Y TOOLTIP
   =========================================== */

.mr-info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: #6B7280;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
    transition: color 0.2s ease;
    z-index: 100000;
}

.mr-info-icon:hover {
    color: #C32942;
}

.mr-info-icon i {
    display: block;
}

.mr-info-icon .mr-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    margin-bottom: 8px;
    padding: 10px 14px;
    background-color: #1F2937;
    color: #FFFFFF;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10000000;
    max-width: 280px;
    min-width: 200px;
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
}

.mr-info-icon .mr-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1F2937;
}

.mr-info-icon:hover .mr-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Ajuste para vista de lista */
.mr-view-list .mr-info-icon {
    font-size: 20px;
    margin-top: 4px;
}

.mr-view-list .mr-info-icon .mr-tooltip {
    max-width: 320px;
}

/* ===========================================
   RESPONSIVE DESIGN - OPTIMIZADO POR EXPERTO
   =========================================== */

/* Tablets grandes */
@media (max-width: 1200px) {
    .mr-content-wrapper {
        gap: 24px;
    }
    
    .mr-filters-sidebar {
        width: 260px;
    }
    
    .mr-columnas-4 .mr-grid {
        grid-template-columns: repeat(3, minmax(200px, 1fr));
        gap: 20px;
    }
}

/* Tablets */
@media (max-width: 1600px) {
    .mostrar-recursos-container {
        --mr-card-min-width: 300px;
    }
}

@media (max-width: 1400px) {
    .mostrar-recursos-container {
        --mr-card-min-width: 280px;
    }
}

@media (max-width: 1200px) {
    .mostrar-recursos-container {
        --mr-card-min-width: 270px;
    }
}

@media (max-width: 1024px) {
    .mostrar-recursos-container {
        --mr-card-min-width: 260px;
    }
    
    .mr-content-wrapper {
        gap: 20px;
    }
    
    .mr-filters-sidebar {
        width: 240px;
        padding: 20px 16px;
    }
    
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
        gap: 18px;
    }
    
    .mr-post-item {
        min-height: 300px;
    }
    
    .mr-post-thumbnail {
        height: 200px;
    }
    
    .mr-post-content {
        padding: 20px;
        gap: 14px;
    }
    
    .mr-post-title {
        font-size: 18px;
    }
    
    .mr-post-excerpt {
        font-size: 14px;
    }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
    /* Eliminar padding del elemento Elementor en móvil */
    .elementor-element.elementor-element-37e004d.e-con-full.e-flex.e-con.e-child {
        padding: 0 !important;
    }
    
    .mr-hamburger {
        display: inline-flex;
    }
    
    .mr-filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        overflow-y: auto;
        background: #fff;
        z-index: 100000;
        padding: 20px;
        box-shadow: 4px 0 20px rgba(0,0,0,0.12);
    }
    
    .mr-sidebar-open .mr-filters-sidebar {
        display: block;
    }
    
    /* En móvil, todas las posiciones se comportan igual (columna) */
    .mr-content-wrapper {
        flex-direction: column;
        gap: 0;
    }
    
    .mr-filters-sidebar {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #ddd;
        position: static;
        order: 2;
    }
    
    .mr-main-content {
        order: 1;
        min-height: auto;
    }
    
    .mr-columnas-2 .mr-grid,
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .mr-grid {
        gap: 16px;
        padding: 16px;
    }
    
    .mr-post-item {
        min-height: 280px;
    }
    
    .mr-post-thumbnail {
        height: 180px;
    }
    
    .mr-post-content {
        padding: 18px;
        gap: 12px;
    }
    
    .mr-post-title {
        font-size: 17px;
    }
    
    .mr-post-excerpt {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .mr-read-more {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* Vista lista en tablets */
    .mr-view-list .mr-post-item {
        flex-direction: column;
        min-height: auto;
    }
    
    .mr-view-list .mr-post-thumbnail {
        width: 100%;
        height: 200px;
        border-radius: 16px 16px 0 0;
    }
    
    .mr-view-list .mr-post-thumbnail a {
        border-radius: 16px 16px 0 0;
    }
    
    .mr-view-list .mr-post-thumbnail img {
        border-radius: 16px 16px 0 0;
    }
    
    .mr-view-list .mr-post-content {
        padding: 24px;
        gap: 16px;
        min-height: auto;
    }
    
    .mr-view-list .mr-post-title {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .mr-view-list .mr-post-excerpt {
        font-size: 15px;
    }
    
    .mr-view-list .mr-read-more {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Móviles */
@media (max-width: 480px) {
    /* Eliminar padding del elemento Elementor en móvil */
    .elementor-element.elementor-element-37e004d.e-con-full.e-flex.e-con.e-child {
        padding: 0 !important;
    }
    
    .mr-search-bar {
        padding: 20px 16px;
    }
    
    .mr-filters-sidebar {
        padding: 16px;
    }
    
    .mr-columnas-1 .mr-grid,
    .mr-columnas-2 .mr-grid,
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .mr-grid {
        gap: 16px;
        padding: 16px;
    }
    
    .mr-post-item {
        min-height: 260px;
        border-radius: 12px;
    }
    
    .mr-post-thumbnail {
        height: 160px;
        border-radius: 12px 12px 0 0;
    }
    
    .mr-post-content {
        padding: 16px;
        gap: 10px;
    }
    
    .mr-post-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .mr-post-excerpt {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .mr-read-more {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* Vista lista en móviles */
    .mr-view-list .mr-post-thumbnail {
        height: 160px;
    }
    
    .mr-view-list .mr-post-content {
        padding: 20px;
        gap: 12px;
    }
    
    .mr-view-list .mr-post-title {
        font-size: 20px;
    }
    
    .mr-view-list .mr-post-excerpt {
        font-size: 14px;
    }
    
    .mr-view-list .mr-read-more {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* Campos personalizados en móviles */
    .mr-custom-field {
        padding: 6px 10px;
        margin-bottom: 6px;
    }
    
    .mr-custom-field-value {
        font-size: 12px;
    }
    
    .mr-view-list .mr-custom-field {
        padding: 8px 12px;
        margin-bottom: 8px;
    }
    
    .mr-view-list .mr-custom-field-value {
        font-size: 13px;
    }
}

/* ===========================================
   LOADING INDICATOR
   =========================================== */

.mr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.mr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C32942;
    border-radius: 50%;
    animation: mr-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes mr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mr-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

/* Tablets */
@media (max-width: 1024px) {
    .mr-columnas-4 .mr-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mr-content-wrapper {
        gap: 20px;
    }
    
    .mr-filters-sidebar {
        width: 220px;
    }
}

/* Móvil grande */
@media (max-width: 768px) {
    .mr-pantalla-completa.mostrar-recursos-container {
        height: 100vh; /* Mantener altura completa en móvil */
    }
    
    .mr-content-wrapper {
        flex-direction: column;
    }
    
    .mr-pantalla-completa .mr-content-wrapper {
        height: calc(100vh - 100px); /* Ajustar altura en móvil */
    }
    
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mr-grid {
        gap: 15px;
        padding: 15px;
    }
    
    .mr-grid.mr-view-grid {
        grid-template-columns: 1fr !important;
        justify-items: stretch;
    }
    
    .mr-post-title {
        font-size: 18px;
    }
    
    .mr-post-content {
        padding: 20px;
    }
    
    /* Sidebar en móviles */
    .mr-filters-sidebar {
        width: 100%;
        position: static;
        order: 2;
        margin-top: 20px;
    }
    
    .mr-pantalla-completa .mr-filters-sidebar {
        height: auto;
        max-height: 50vh; /* Máximo 50% de la altura en móvil */
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        margin-top: 0;
    }
    
    .mr-main-content {
        order: 1;
    }
    
    .mr-pantalla-completa .mr-main-content {
        flex: 1;
        min-height: 0; /* Permitir que se encoja */
    }
    
    .mr-controls-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 10px 15px;
    }
    
    .mr-view-toggle {
        justify-content: center;
    }
    
    .mr-sort-controls {
        justify-content: center;
    }
    
    .mr-search-input-wrapper {
        max-width: 100%;
    }
    
    .mr-search-bar {
        padding: 15px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .mr-columnas-2 .mr-grid,
    .mr-columnas-3 .mr-grid,
    .mr-columnas-4 .mr-grid {
        grid-template-columns: 1fr;
    }
    
    .mr-grid {
        gap: 10px;
        padding: 10px;
    }
    
    .mr-post-content {
        padding: 15px;
    }
    
    .mr-post-title {
        font-size: 16px;
    }
    
    .mr-post-excerpt {
        font-size: 14px;
    }
    
    .mr-filters-sidebar {
        padding: 15px;
        max-height: 40vh; /* Menos altura en móviles pequeños */
    }
    
    .mr-search-input {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }
    
    .mr-search-clear {
        right: 12px;
        width: 25px;
        height: 25px;
        font-size: 16px;
    }
    
    .mr-search-bar {
        padding: 10px;
    }
    
    .mr-controls-bar {
        padding: 8px 10px;
    }
}

/* ===========================================
   BOTÓN CARGAR MÁS (PAGINACIÓN)
   =========================================== */

.mr-load-more-wrapper {
    text-align: center;
    padding: 30px 0;
    margin-top: 20px;
}

.mr-load-more-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--mr-primary-color);
    color: var(--mr-bg-white);
    border: none;
    border-radius: var(--mr-radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--mr-transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--mr-shadow-sm);
}

.mr-load-more-btn:hover:not(:disabled) {
    background: var(--mr-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--mr-shadow-md);
}

.mr-load-more-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--mr-shadow-sm);
}

.mr-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mr-load-more-btn.mr-loading-state {
    position: relative;
    color: transparent;
}

.mr-load-more-btn.mr-loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--mr-bg-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: mr-spin 0.8s linear infinite;
}

.mr-load-more-btn.mr-no-more {
    background: var(--mr-text-lighter);
    cursor: default;
}

.mr-load-more-btn.mr-error-state {
    background: #dc3232;
}

/* ===========================================
   ANIMACIONES
   =========================================== */

/* Animación de entrada para posts */
@keyframes mr-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mr-post-item.mr-animate-in {
    animation: mr-fade-in-up var(--mr-transition-slow) ease-out;
}

/* Animación de pulso para loading */
@keyframes mr-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.mr-loading-pulse {
    animation: mr-pulse 1.5s ease-in-out infinite;
}

/* Animación de deslizamiento suave */
@keyframes mr-slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mr-filter-link {
    animation: mr-slide-in 0.3s ease-out backwards;
}

.mr-filter-link:nth-child(1) { animation-delay: 0.05s; }
.mr-filter-link:nth-child(2) { animation-delay: 0.1s; }
.mr-filter-link:nth-child(3) { animation-delay: 0.15s; }
.mr-filter-link:nth-child(4) { animation-delay: 0.2s; }
.mr-filter-link:nth-child(5) { animation-delay: 0.25s; }

/* ===========================================
   ESTADOS DE INTERACCIÓN MEJORADOS
   =========================================== */

/* Efecto hover mejorado para tarjetas */
.mr-post-item {
    transition: transform var(--mr-transition-normal), 
                box-shadow var(--mr-transition-normal),
                border-color var(--mr-transition-normal);
}

.mr-post-item:hover {
    transform: translateY(-4px) scale(1.01);
}

/* Efecto de ripple en botones (opcional, puedes quitarlo si prefieres) */
.mr-read-more {
    position: relative;
    overflow: hidden;
}

.mr-read-more::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mr-read-more:hover::before {
    width: 300px;
    height: 300px;
}

/* ===========================================
   MEJORAS DE ACCESIBILIDAD
   =========================================== */

/* Skip link para navegación por teclado */
.mr-skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--mr-primary-color);
    color: var(--mr-bg-white);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.mr-skip-to-content:focus {
    top: 0;
}

/* Estados de foco mejorados para elementos interactivos */
.mr-filter-link:focus,
.mr-search-input:focus,
.mr-sort-select:focus,
.mr-toggle-input:focus + .mr-toggle-label-switch,
.mr-load-more-btn:focus {
    outline: 2px solid var(--mr-primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(195, 41, 66, 0.1);
}

/* Indicador visual cuando un elemento tiene foco pero no por mouse */
.mr-post-item a:focus-visible {
    outline: 2px solid var(--mr-primary-color);
    outline-offset: 2px;
}


/* ===========================================
   COMPATIBILIDAD CON TEMAS
   =========================================== */

.mr-post-item article {
    margin: 0;
    padding: 0;
}

.mr-post-item .entry-header,
.mr-post-item .entry-content,
.mr-post-item .entry-footer {
    margin: 0;
    padding: 0;
}

/* Resetear estilos de WordPress que puedan interferir */
.mr-grid img {
    max-width: 100%;
    height: 100%;
}

/* Asegurar que los elementos del grid no se superpongan */
.mr-grid > * {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.mr-grid > *:hover {
    z-index: 2;
}

/* Forzar que cada elemento del grid ocupe su espacio completo */
.mr-grid .mr-post-item {
    grid-row: auto;
    grid-column: auto;
    display: flex;
    flex-direction: column;
    height: auto;
}

/* Vista de lista - override de las reglas del grid */
.mr-view-list .mr-grid .mr-post-item {
    display: flex;
    flex-direction: row;
    grid-row: none;
    grid-column: none;
}

.mr-post-content h1,
.mr-post-content h2,
.mr-post-content h3,
.mr-post-content h4,
.mr-post-content h5,
.mr-post-content h6 {
    margin: 0;
    padding: 0;
}

/* ===========================================
   OPTIMIZACIÓN DE RENDIMIENTO
   =========================================== */

/* Usar will-change para animaciones que se repiten */
.mr-post-item:hover {
    will-change: transform;
}

.mr-toggle-input:checked ~ .mr-toggle-label-switch .mr-toggle-list,
.mr-toggle-input:not(:checked) ~ .mr-toggle-label-switch .mr-toggle-grid {
    will-change: background-color, box-shadow;
}

/* Mejorar el renderizado de fuentes */
.mostrar-recursos-container {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

