/**
 * Portada de cursos LearnDash LD30 de Expresion Musical.
 * Todo selector queda limitado a .em-course-shell o a la clase de body.
 */

body.em-template-learndash-course .entry-header,
body.em-template-learndash-course .entry-hero-container-inner {
    display: none;
}

body.em-template-learndash-course .content-area {
    margin-top: 0;
    margin-bottom: 0;
}

body.em-template-learndash-course .content-container,
body.em-template-learndash-course .site-main,
body.em-template-learndash-course .entry-content,
body.em-template-learndash-course .entry-content-wrap {
    max-width: none;
}

body.em-template-learndash-course .entry-content-wrap {
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

body.em-template-learndash-course .entry-content {
    margin: 0;
}

.learndash-wrapper .em-course-shell {
    --em-course-radius: 16px;
    --em-course-radius-small: 10px;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 56px 0 72px;
    color: var(--em-text-primary, #18253a);
    font-family: 'Fredoka', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.em-course-shell *,
.em-course-shell *::before,
.em-course-shell *::after {
    box-sizing: border-box;
}

.em-course-hero {
    max-width: 820px;
    margin-bottom: 36px;
}

.em-course-eyebrow,
.em-course-section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0 0 12px;
    color: var(--em-primary, #046bd2);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.em-course-eyebrow {
    padding: 7px 12px;
    border: 1px solid color-mix(in srgb, var(--em-primary, #046bd2) 32%, transparent);
    border-radius: 999px;
    background: var(--em-primary-soft, rgba(4, 107, 210, .15));
}

.em-course-title {
    margin: 0;
    color: var(--em-text-primary, #18253a);
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.em-course-subtitle {
    max-width: 760px;
    margin: 18px 0 0;
    color: var(--em-text-secondary, #5f6f82);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.65;
}

.em-course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 22px;
    color: var(--em-text-secondary, #5f6f82);
    font-size: .95rem;
    font-weight: 600;
}

.em-course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.em-course-meta svg {
    width: 18px;
    height: 18px;
    fill: var(--em-primary, #046bd2);
}

.em-course-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 40px;
    align-items: start;
}

.em-course-main {
    min-width: 0;
}

.em-course-section {
    margin: 0 0 34px;
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid var(--em-border, #cddbe8);
    border-radius: var(--em-course-radius);
    background: var(--em-surface, #fff);
    box-shadow: var(--em-shadow-card, 0 12px 32px rgba(4, 107, 210, .08));
}

.em-course-section h2,
.em-course-certificate h2 {
    margin: 0;
    color: var(--em-text-primary, #18253a);
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
}

.em-course-rich-text {
    margin-top: 20px;
    color: var(--em-text-secondary, #5f6f82);
    font-size: 1.02rem;
    line-height: 1.75;
}

.em-course-rich-text > :first-child {
    margin-top: 0;
}

.em-course-rich-text > :last-child {
    margin-bottom: 0;
}

.em-course-rich-text :is(h2, h3, h4, h5, h6, strong) {
    color: var(--em-text-primary, #18253a);
}

.em-course-rich-text a {
    color: var(--em-primary, #046bd2);
}

.em-course-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 24px;
}

.em-course-section-kicker {
    margin-bottom: 7px;
}

.em-course-shell .em-course-expand-all {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 9px 15px;
    border: 1px solid var(--em-border, #cddbe8);
    border-radius: 999px;
    background: var(--em-surface-soft, #e4eef7) !important;
    color: var(--em-text-primary, #18253a) !important;
    box-shadow: none;
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
}

.em-course-shell .em-course-expand-all:hover {
    border-color: var(--em-primary, #046bd2);
    color: var(--em-primary, #046bd2) !important;
}

.em-course-shell :is(button, a):focus-visible {
    outline: none;
    box-shadow: var(--em-focus, 0 0 0 3px rgba(4, 107, 210, .24));
}

/* Listado nativo LD30: conserva permisos, muestras, goteo y paginacion. */
.em-course-shell .ld-item-list {
    margin: 0;
}

.em-course-shell .ld-item-list .ld-item-list-items {
    margin: 0;
}

.em-course-shell .ld-item-list-section-heading {
    margin: 22px 0 0;
    padding: 16px 20px;
    border: 1px solid var(--em-border, #cddbe8);
    border-bottom: 0;
    border-radius: var(--em-course-radius-small) var(--em-course-radius-small) 0 0;
    background: var(--em-surface-elevated, #fff);
}

.em-course-shell .ld-item-list-section-heading:first-child {
    margin-top: 0;
}

.em-course-shell .ld-lesson-section-heading {
    color: var(--em-text-primary, #18253a);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.em-course-shell .ld-item-list-item {
    margin: 10px 0 0;
    border: 1px solid var(--em-border, #cddbe8) !important;
    border-radius: var(--em-course-radius-small) !important;
    background: var(--em-surface, #fff);
    box-shadow: none;
    overflow: hidden;
}

.em-course-shell .ld-item-list-section-heading + .ld-item-list-item {
    margin-top: 0;
    border-radius: 0 0 var(--em-course-radius-small) var(--em-course-radius-small) !important;
}

.em-course-shell .ld-item-list-item-preview {
    min-height: 64px;
    padding: 14px 16px;
    background: transparent;
}

.em-course-shell .ld-item-list-item-preview:hover {
    background: var(--em-surface-soft, #e4eef7);
}

.em-course-shell .ld-item-name,
.em-course-shell .ld-item-title,
.em-course-shell .ld-item-components,
.em-course-shell .ld-item-component {
    color: var(--em-text-primary, #18253a) !important;
}

.em-course-shell .ld-item-name {
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.em-course-shell .ld-item-title {
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.45;
}

.em-course-shell .ld-item-components {
    margin-top: 4px;
    color: var(--em-text-secondary, #5f6f82) !important;
    font-size: .8rem;
    font-weight: 500;
}

.em-course-shell .ld-status-icon {
    flex: 0 0 auto;
}

.em-course-shell .ld-status-complete,
.em-course-shell .ld-status-icon.ld-status-complete {
    background-color: var(--em-success, #0f8a5f) !important;
}

.em-course-shell .ld-status-in-progress,
.em-course-shell .ld-status-icon.ld-status-in-progress {
    background-color: var(--em-primary, #046bd2) !important;
}

.em-course-shell .ld-item-details .ld-expand-button {
    min-width: 40px;
    color: var(--em-primary, #046bd2) !important;
}

.em-course-shell .ld-item-details .ld-expand-button .ld-icon {
    background: var(--em-primary, #046bd2) !important;
}

.em-course-shell .ld-item-list-item-expanded {
    border-top-color: var(--em-border, #cddbe8);
    background: var(--em-surface-soft, #e4eef7);
}

.em-course-shell .ld-table-list-header,
.em-course-shell .ld-table-list-item {
    border-color: var(--em-border, #cddbe8) !important;
    background: transparent !important;
    color: var(--em-text-primary, #18253a) !important;
}

.em-course-shell .ld-table-list-item a,
.em-course-shell .ld-table-list-item .ld-topic-title,
.em-course-shell .ld-table-list-item .ld-quiz-title {
    color: var(--em-text-primary, #18253a) !important;
}

.em-course-shell .ld-pagination {
    margin-top: 24px;
    color: var(--em-text-secondary, #5f6f82);
}

.em-course-shell .ld-pagination a {
    color: var(--em-primary, #046bd2) !important;
}

.em-course-empty-state {
    margin: 0;
    padding: 22px;
    border: 1px dashed var(--em-border, #cddbe8);
    border-radius: var(--em-course-radius-small);
    color: var(--em-text-secondary, #5f6f82);
    text-align: center;
}

/* Certificado oficial asignado al curso en LearnDash. */
.em-course-certificate {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: clamp(24px, 3vw, 32px);
    border: 1px solid color-mix(in srgb, var(--em-warning, #b77900) 42%, var(--em-border, #cddbe8));
    border-radius: var(--em-course-radius);
    background: color-mix(in srgb, var(--em-warning, #b77900) 10%, var(--em-surface, #fff));
}

.em-course-certificate.is-earned {
    border-color: color-mix(in srgb, var(--em-success, #0f8a5f) 45%, var(--em-border, #cddbe8));
    background: color-mix(in srgb, var(--em-success, #0f8a5f) 10%, var(--em-surface, #fff));
}

.em-course-certificate-icon {
    display: grid;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    place-items: center;
    border-radius: 50%;
    background: var(--em-surface, #fff);
    box-shadow: var(--em-shadow-card, 0 12px 32px rgba(4, 107, 210, .08));
}

.em-course-certificate-icon svg {
    width: 34px;
    height: 34px;
    fill: var(--em-warning, #b77900);
}

.em-course-certificate.is-earned .em-course-certificate-icon svg {
    fill: var(--em-success, #0f8a5f);
}

.em-course-certificate-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.em-course-certificate-copy p {
    margin: 8px 0 0;
    color: var(--em-text-secondary, #5f6f82);
    line-height: 1.6;
}

.em-course-certificate-copy .em-course-button {
    width: fit-content;
    margin-top: 16px;
}

/* Tarjeta lateral. */
.em-course-sidebar {
    position: sticky;
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 100px);
}

.em-course-card {
    border: 1px solid var(--em-border, #cddbe8);
    border-radius: var(--em-course-radius);
    background: var(--em-surface, #fff);
    box-shadow: var(--em-shadow-card, 0 12px 32px rgba(4, 107, 210, .08));
    overflow: hidden;
}

.em-course-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--em-surface-soft, #e4eef7);
    overflow: hidden;
}

.em-course-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-course-card-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, var(--em-primary-soft, rgba(4, 107, 210, .15)), transparent 42%),
        var(--em-surface-soft, #e4eef7);
}

.em-course-card-placeholder svg {
    width: 72px;
    height: 72px;
    fill: var(--em-primary, #046bd2);
    opacity: .78;
}

.em-course-card-body {
    padding: 26px;
}

.em-course-plan-label {
    margin: 0;
    color: var(--em-text-primary, #18253a);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}

.em-course-plan-copy,
.em-course-progress-copy,
.em-course-login-copy {
    color: var(--em-text-secondary, #5f6f82);
    line-height: 1.55;
}

.em-course-plan-copy {
    margin: 10px 0 20px;
}

.em-course-progress-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    color: var(--em-text-primary, #18253a);
    font-size: 1rem;
}

.em-course-progress-heading span {
    color: var(--em-primary, #046bd2);
    font-weight: 700;
}

.em-course-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--em-surface-soft, #e4eef7);
    overflow: hidden;
}

.em-course-progress span {
    display: block;
    width: var(--em-course-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--em-primary, #046bd2);
    transition: width .35s ease;
}

.em-course-progress-copy {
    margin: 10px 0 20px;
    font-size: .88rem;
}

.em-course-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.em-course-button:hover {
    transform: translateY(-1px);
}

.em-course-button-primary {
    width: 100%;
    background: var(--em-primary, #046bd2);
    color: var(--em-button-primary-text, #fff) !important;
}

.em-course-button-primary:hover {
    background: var(--em-primary-hover, #0353a4);
    color: var(--em-button-primary-text, #fff) !important;
}

.em-course-button-secondary {
    border-color: var(--em-primary, #046bd2);
    background: transparent;
    color: var(--em-primary, #046bd2) !important;
}

.em-course-button-secondary:hover {
    background: var(--em-primary, #046bd2);
    color: var(--em-button-primary-text, #fff) !important;
}

.em-course-login-copy {
    margin: 14px 0 0;
    font-size: .9rem;
    text-align: center;
}

.em-course-login-copy a {
    color: var(--em-primary, #046bd2);
    font-weight: 700;
    text-decoration: none;
}

.em-course-features {
    display: grid;
    gap: 13px;
    margin: 24px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--em-border, #cddbe8);
    list-style: none;
}

.em-course-features li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 9px;
    margin: 0;
    color: var(--em-text-secondary, #5f6f82);
    font-size: .91rem;
    line-height: 1.45;
}

.em-course-features li span {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--em-success, #0f8a5f) 14%, transparent);
    color: var(--em-success, #0f8a5f);
    font-size: .75rem;
    font-weight: 700;
}

@media (max-width: 991px) {
    .learndash-wrapper .em-course-shell {
        width: min(760px, calc(100% - 32px));
        padding-top: 40px;
    }

    .em-course-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .em-course-sidebar {
        position: static;
        order: -1;
    }

    .em-course-card {
        display: grid;
        grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
    }

    .em-course-card-media {
        height: 100%;
        min-height: 280px;
        aspect-ratio: auto;
    }
}

@media (max-width: 700px) {
    .learndash-wrapper .em-course-shell {
        width: min(calc(100% - 24px), 620px);
        padding: 30px 0 48px;
    }

    .em-course-hero {
        margin-bottom: 26px;
    }

    .em-course-layout {
        gap: 22px;
    }

    .em-course-card {
        display: block;
    }

    .em-course-card-media {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .em-course-section {
        margin-bottom: 22px;
        padding: 22px 18px;
        border-radius: 13px;
    }

    .em-course-section-heading {
        display: block;
    }

    .em-course-shell .em-course-expand-all {
        margin-top: 16px;
    }

    .em-course-certificate {
        display: block;
        text-align: center;
    }

    .em-course-certificate-icon {
        margin: 0 auto 16px;
    }

    .em-course-certificate-copy .em-course-button {
        width: 100%;
    }

    .em-course-shell .ld-item-list-item-preview {
        padding: 13px 12px;
    }

    .em-course-shell .ld-item-components {
        display: block;
    }
}

@media (max-width: 430px) {
    .em-course-card-body {
        padding: 22px 18px;
    }

    .em-course-shell .ld-item-list-item-preview {
        align-items: flex-start;
    }

    .em-course-shell .ld-item-details .ld-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .em-course-shell *,
    .em-course-shell *::before,
    .em-course-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
