/* ==========================================================================
   PLUGIN RECURSOS OPENGELA - DISEÑO VISUAL (CON IMÁGENES)
   ========================================================================== */

.ro-recursos-wrapper {
    font-family: inherit;
    max-width: 1400px;
    margin: 0 auto;
    color: #333;
}

.ro-knowledge-hub-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* --- SIDEBAR Y CHECKBOXES (ESTILO PÍLDORAS 2 COLUMNAS CON CHECK VISIBLE) --- */
.ro-sidebar {
    flex: 0 0 320px;
}

.ro-filter-group {
    margin-bottom: 30px;
}

.ro-filter-title {
    font-size: 1.1rem;
    color: #003853; /* Azul oscuro Opengela */
    margin-bottom: 15px;
    font-weight: 700;
}

.ro-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columnas exactas */
    gap: 10px;
}

.ro-checkbox-pill {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: #225F99; /* Turquesa muy clarito/Azul Opengela */
    border-radius: 4px;
    padding: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Mostrar el checkbox nativo junto al texto dentro del botón */
.ro-checkbox-pill input[type="checkbox"] {
    position: static;
    opacity: 1;
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    flex-shrink: 0;
}

.ro-pill-text {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

/* Estilo cuando está seleccionado (checkbox checkeado) */
.ro-checkbox-pill:has(input:checked) {
    background: #174570; /* Tono ligeramente más oscuro para resaltar el botón activo */
    border-color: #225F99;
}

.ro-checkbox-pill:has(input:checked) .ro-pill-text {
    color: #ffffff;
    font-weight: 600;
}

/* Fallback para navegadores antiguos que no soportan :has() */
.ro-checkbox-pill input:checked + .ro-pill-text {
    color: #ffffff;
    font-weight: 600;
}

/* Botón Limpiar Todo */
.ro-btn-clear {
    width: 150px;
    background: #225F99; /* Turquesa Opengela */
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.ro-btn-clear:hover {
    background: #174570;
}

/* --- MAIN CONTENT & HEADER MINIMALISTA --- */
.ro-main-content {
    flex: 1;
    min-width: 0;
}

.ro-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.ro-results-count {
    font-size: 1.1rem;
    color: #475569;
}

.ro-search-wrapper {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.ro-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
    pointer-events: none; /* No bloquea el clic del usuario en la lupa */
}

.ro-search-minimal {
    width: 100%;
    padding: 10px 10px 10px 40px !important; /* Forzamos espacio para que no pise la lupa */
    font-size: 1rem;
    border: none;
    border-bottom: 1px solid #cbd5e1;
    background: transparent;
    transition: border-color 0.3s;
    box-sizing: border-box;
    outline: none;
}

.ro-search-minimal:focus {
    border-bottom-color: #009b91;
}

/* --- TARJETAS (CARDS) --- */
.ro-resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.ro-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.2s;
}

.ro-card:hover {
    transform: translateY(-4px);
}

.ro-card-img-link {
    display: block;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.ro-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.ro-card-content {
    padding: 20px 0;
}

/* Etiquetas (Tags estilo Outline) */
.ro-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.ro-tag-outline {
    border: 1px solid #c2e2e0;
    color: #225F9991;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
}

.ro-card-title {
    margin: 0 0 10px 0;
    line-height: 1.3;
    padding-top: 5px !important;
}

.ro-card-title a {
    color: #003853;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
}

.ro-card-title a:hover {
    color: #009b91;
}

.ro-card-excerpt {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==========================================================================
   VISTA INDIVIDUAL DEL RECURSO (SHORTCODE: recurso_opengela_single)
   ========================================================================== */

.ro-single-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
    color: #333;
    padding: 20px 15px;
}

.ro-single-back {
    margin-bottom: 25px;
}

.ro-btn-back {
    display: inline-flex;
    align-items: center;
    color: #225F99;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1rem;
}

.ro-btn-back:hover {
    color: #003853;
    text-decoration: underline;
}

.ro-single-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.ro-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.ro-single-title {
    color: #003853;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.ro-single-image {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.ro-single-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 500px;
}

.ro-single-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #475569;
}

.ro-single-content h2, 
.ro-single-content h3 {
    color: #003853;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    font-weight: 700;
}

.ro-single-content p {
    margin-bottom: 1.5em;
}

.ro-single-content a {
    color: #009b91;
    text-decoration: none;
    border-bottom: 1px solid #009b91;
    transition: all 0.2s;
}

.ro-single-content a:hover {
    color: #003853;
    border-bottom-color: #003853;
}

/* --- Responsive Móvil --- */
@media (max-width: 900px) {
    .ro-knowledge-hub-layout {
        flex-direction: column;
    }
    
    .ro-sidebar {
        flex: none;
        width: 100%;
    }

    .ro-main-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ro-search-wrapper {
        width: 100%;
    }
}

/* ==========================================================================
   VISOR Y DESCARGA DE PDF
   ========================================================================== */

.ro-pdf-container {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
}

.ro-pdf-title {
    color: #003853;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.ro-pdf-actions {
    margin-bottom: 25px;
}

.ro-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #009b91; /* Verde Opengela */
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    transition: background-color 0.3s;
    border: none;
}

.ro-btn-download:hover {
    background-color: #007a72;
}

.ro-pdf-viewer {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ro-pdf-viewer iframe {
    display: block;
    border: none;
}