/* ===== Layout ===== */
.educalms-mooc-wrap {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width:980px) {
    .educalms-mooc-wrap {
        grid-template-columns: 1fr;
    }
}

/* ===== Sidebar ===== */
.educalms-mooc-sidebar {
    background: #fff;
    border: 1px solid #e9edf3;
    border-radius: 16px;
    padding: 16px;
    position: sticky;
    top: 20px;
    z-index: 2;
}

@media (max-width:980px) {
    .educalms-mooc-sidebar {
        position: relative;
        top: auto;
    }
}

.educalms-mooc-search input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e9edf3;
    outline: none;
    background: #fff;
}

/* ===== Filter groups (accordion via button) ===== */
.educalms-filter-group {
    margin-top: 14px;
    border: 1px solid #e9edf3;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.educalms-filter-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px;
    background: #fff;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.educalms-filter-title {
    font-weight: 800;
    font-size: 15px;
    color: #111827;
}

.educalms-filter-toggle {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #e9edf3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 auto;
}

.educalms-filter-toggle::before,
.educalms-filter-toggle::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 2px;
    background: #111827;
    border-radius: 2px;
}

.educalms-filter-toggle::after {
    transform: rotate(90deg);
}

.educalms-filter-head[aria-expanded="true"] .educalms-filter-toggle::after {
    transform: rotate(0deg);
    opacity: 0;
}

.educalms-filter-body {
    padding: 10px 12px 14px 12px;
}

.educalms-filter-empty {
    font-size: 13px;
    color: #6b7280;
}

/* ===== Checkboxes list ===== */
.educalms-filter-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow: auto;
    padding-right: 6px;
}

.educalms-chk {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    color: #111827;
}

.educalms-chk input {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* ===== Grid ===== */
.educalms-mooc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width:1200px) {
    .educalms-mooc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width:820px) {
    .educalms-mooc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width:520px) {
    .educalms-mooc-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Card ===== */
.educalms-card {
    background: #fff;
    border: 1px solid #e9edf3;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .06);
    transition: transform .15s ease, box-shadow .15s ease;
    display: block;
}

.educalms-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(17, 24, 39, .10);
}

.educalms-card .img {
    height: 180px;
    background: #eef2f7;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* subtle top gradient like design */
.educalms-card .img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 55%);
    pointer-events: none;
}

.educalms-card .body {
    padding: 14px 14px 16px 14px;
}

.educalms-title {
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
    margin: 0 0 10px 0;
    color: #111827;
}

.educalms-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
}

.educalms-meta strong {
    color: #111827;
    font-weight: 900;
}

/* ===== Badge on image (top-right), colored per group ===== */
.educalms-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: #111827;
}

/* group colors */
.educalms-badge.is-transversal {
    background: #f5c400;
    color: #111827;
}

.educalms-badge.is-sectorial {
    background: #111827;
    color: #ffffff;
}

.educalms-badge.is-corporativo {
    background: #6b7280;
    color: #ffffff;
}

.educalms-badge.is-mooc {
    background: #111827;
    color: #ffffff;
}

/* ===== Load more button ===== */
.educalms-mooc-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.educalms-load-more {
    padding: 12px 18px;
    border-radius: 999px;
    border: 0;
    background: #f5c400;
    font-weight: 900;
    cursor: pointer;
}

.educalms-load-more[disabled] {
    opacity: .6;
    cursor: not-allowed;
}


/* =========================================================
   ASTRA + ELEMENTOR RESET (SCOPED)
   Only affects the MOOC grid widget
   ========================================================= */

/* Stop theme/Elementor from styling our buttons/inputs/labels */
.educalms-mooc-wrap,
.educalms-mooc-wrap * {
    box-sizing: border-box;
}

/* Prevent Elementor text defaults from breaking spacing */
.educalms-mooc-wrap {
    line-height: 1.2;
}

.educalms-mooc-wrap a {
    text-decoration: none !important;
}

/* Reset the filter head button (Astra styles buttons aggressively) */
.educalms-mooc-wrap .educalms-filter-head {
    appearance: none;
    -webkit-appearance: none;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-height: auto !important;
    line-height: 1.1 !important;
}

/* Ensure the toggle circle never floats or gets pseudo styles */
.educalms-mooc-wrap .educalms-filter-toggle {
    box-shadow: none !important;
    background: transparent !important;
}

/* Astra sometimes adds focus outlines/shadows */
.educalms-mooc-wrap .educalms-filter-head:focus,
.educalms-mooc-wrap .educalms-filter-head:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(245, 196, 0, .25) !important;
    border-radius: 12px;
}

/* Reset labels/checkbox spacing (some themes add margins/paddings) */
.educalms-mooc-wrap label.educalms-chk {
    margin: 0 !important;
    padding: 0 !important;
}

.educalms-mooc-wrap .educalms-chk span {
    line-height: 1.2;
}

/* Avoid Astra/Elementor input styles bleeding */
.educalms-mooc-wrap .educalms-mooc-search input {
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    line-height: 1.2 !important;
}

/* Fix Elementor setting anchor display inline-block etc */
.educalms-mooc-wrap .educalms-card {
    display: block !important;
}

/* Ensure the badge stays top-right and doesn't inherit weird positioning */
.educalms-mooc-wrap .educalms-badge {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* If Elementor sets img backgrounds or overlays weirdly, enforce ours */
.educalms-mooc-wrap .educalms-card .img {
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Ensure filter body hidden works even if theme uses display rules */
.educalms-mooc-wrap .educalms-filter-body[hidden] {
    display: none !important;
}

/* =========================================================
   ASTRA + ELEMENTOR RESET (SCOPED)
   Only affects the MOOC grid widget
   ========================================================= */

/* Stop theme/Elementor from styling our buttons/inputs/labels */
.educalms-mooc-wrap,
.educalms-mooc-wrap * {
    box-sizing: border-box;
}

/* Prevent Elementor text defaults from breaking spacing */
.educalms-mooc-wrap {
    line-height: 1.2;
}

.educalms-mooc-wrap a {
    text-decoration: none !important;
}

/* Reset the filter head button (Astra styles buttons aggressively) */
.educalms-mooc-wrap .educalms-filter-head {
    appearance: none;
    -webkit-appearance: none;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-height: auto !important;
    line-height: 1.1 !important;
}

/* Ensure the toggle circle never floats or gets pseudo styles */
.educalms-mooc-wrap .educalms-filter-toggle {
    box-shadow: none !important;
    background: transparent !important;
}

/* Astra sometimes adds focus outlines/shadows */
.educalms-mooc-wrap .educalms-filter-head:focus,
.educalms-mooc-wrap .educalms-filter-head:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(245, 196, 0, .25) !important;
    border-radius: 12px;
}

/* Reset labels/checkbox spacing (some themes add margins/paddings) */
.educalms-mooc-wrap label.educalms-chk {
    margin: 0 !important;
    padding: 0 !important;
}

.educalms-mooc-wrap .educalms-chk span {
    line-height: 1.2;
}

/* Avoid Astra/Elementor input styles bleeding */
.educalms-mooc-wrap .educalms-mooc-search input {
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    line-height: 1.2 !important;
}

/* Fix Elementor setting anchor display inline-block etc */
.educalms-mooc-wrap .educalms-card {
    display: block !important;
}

/* Ensure the badge stays top-right and doesn't inherit weird positioning */
.educalms-mooc-wrap .educalms-badge {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* If Elementor sets img backgrounds or overlays weirdly, enforce ours */
.educalms-mooc-wrap .educalms-card .img {
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Ensure filter body hidden works even if theme uses display rules */
.educalms-mooc-wrap .educalms-filter-body[hidden] {
    display: none !important;
}