/* ==========================================================
   Ficha de MOOC (single-mooc_course.php)
   Misma paleta y tipografía que formacion.css
   ========================================================== */

.mooc-page {
    --mooc-cyan: #53AEC3;
    --mooc-cyan-dark: #326B78;
    --mooc-cyan-soft: #BADFE7;
    --mooc-cyan-bg: #EAF6F9;
    --mooc-ink: #141414;
    --mooc-muted: #4b5563;
    --mooc-white: #FFFFFF;
    --mooc-font: "Lato", Arial, Helvetica, sans-serif;

    font-family: var(--mooc-font);
    color: var(--mooc-ink);
    margin-top: 0;
    padding-top: 0;
}

.mooc-page *,
.mooc-page *::before,
.mooc-page *::after {
    box-sizing: border-box;
}

.mooc-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Hero ---------- */

.mooc-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 56px 0 52px;
    background-color: var(--mooc-cyan-dark);
    background-size: cover;
    background-position: center;
    color: var(--mooc-white);
    overflow: hidden;
}

.mooc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(50, 107, 120, .94) 0%, rgba(50, 107, 120, .80) 100%);
}

.mooc-hero .mooc-container {
    position: relative;
    z-index: 1;
}

.mooc-breadcrumb {
    margin-bottom: 18px;
    font-size: 15px;
    color: var(--mooc-cyan-soft);
}

.mooc-breadcrumb a {
    color: var(--mooc-white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mooc-hero__title {
    max-width: 900px;
    margin: 0 0 22px;
    font-family: var(--mooc-font);
    font-size: clamp(32px, 4.4vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    color: var(--mooc-white);
}

.mooc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.mooc-chip {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    background: rgba(255, 255, 255, .08);
}

.mooc-chip--accent {
    border-color: var(--mooc-cyan);
    background: var(--mooc-cyan);
}

/* ---------- Botones ---------- */

.mooc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 32px;
    border-radius: 6px;
    background-color: var(--mooc-cyan);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: var(--mooc-white);
    transition: background-color .2s ease;
}

.mooc-btn:hover,
.mooc-btn:focus-visible {
    background-color: var(--mooc-ink);
    color: var(--mooc-white);
}

.mooc-btn--hero:hover,
.mooc-btn--hero:focus-visible {
    background-color: var(--mooc-white);
    color: var(--mooc-cyan-dark);
}

/* ---------- Layout ---------- */

.mooc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 56px;
    align-items: start;
    padding-top: 56px;
    padding-bottom: 72px;
}

.mooc-section + .mooc-section {
    margin-top: 44px;
}

.mooc-heading {
    margin: 0 0 16px;
    font-family: var(--mooc-font);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mooc-cyan);
}

.mooc-text {
    font-size: 18px;
    line-height: 1.6;
    color: var(--mooc-ink);
}

.mooc-text p {
    margin: 0 0 14px;
}

.mooc-text strong {
    color: var(--mooc-cyan-dark);
}

/* Objetivos */
.mooc-checks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mooc-checks li {
    position: relative;
    padding: 0 0 12px 34px;
    font-size: 18px;
    line-height: 1.5;
}

.mooc-checks li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 1px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--mooc-cyan-bg);
    color: var(--mooc-cyan-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

/* Temario */
.mooc-temario {
    border: 1px solid var(--mooc-cyan-soft);
    border-radius: 12px;
    overflow: hidden;
}

.mooc-temario__unit + .mooc-temario__unit {
    border-top: 1px solid var(--mooc-cyan-soft);
}

.mooc-temario__unit summary {
    position: relative;
    padding: 16px 48px 16px 20px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
    background: var(--mooc-white);
}

.mooc-temario__unit summary::-webkit-details-marker {
    display: none;
}

.mooc-temario__unit summary::after {
    content: "+";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 400;
    color: var(--mooc-cyan-dark);
}

.mooc-temario__unit[open] summary {
    background: var(--mooc-cyan-bg);
}

.mooc-temario__unit[open] summary::after {
    content: "–";
}

.mooc-temario__unit > .mooc-temario__list {
    margin: 0;
    padding: 14px 20px 18px 40px;
}

.mooc-temario__list {
    font-size: 16px;
    line-height: 1.5;
    color: var(--mooc-muted);
}

.mooc-temario__list .mooc-temario__list {
    margin: 4px 0 6px;
    padding-left: 22px;
}

/* Competencias */
.mooc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mooc-tags li {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--mooc-cyan-bg);
    color: var(--mooc-cyan-dark);
    font-size: 15px;
    font-weight: 600;
}

/* ---------- Tarjeta lateral ---------- */

.mooc-aside {
    position: sticky;
    top: 110px;
}

.mooc-card {
    border-radius: 16px;
    background: var(--mooc-white);
    box-shadow: 0 10px 30px rgba(20, 20, 20, .10);
    overflow: hidden;
}

.mooc-card__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.mooc-card__body {
    padding: 22px 24px 24px;
}

.mooc-facts {
    margin: 0 0 20px;
}

.mooc-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f4;
    font-size: 16px;
}

.mooc-facts dt {
    color: var(--mooc-muted);
}

.mooc-facts dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.mooc-card .mooc-btn {
    width: 100%;
}

.mooc-card__note {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--mooc-muted);
}

/* ---------- Relacionados ---------- */

.mooc-related {
    padding: 64px 0 88px;
    background: var(--mooc-cyan-bg);
}

.mooc-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 8px;
}

.mooc-rel {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: var(--mooc-white);
    overflow: hidden;
}

.mooc-rel__media {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--mooc-cyan-soft);
}

.mooc-rel__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mooc-rel__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px 22px 22px;
}

.mooc-rel__title {
    margin: 0 0 10px;
    font-family: var(--mooc-font);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.mooc-rel__title a {
    color: var(--mooc-ink);
    text-decoration: none;
}

.mooc-rel__title a:hover,
.mooc-rel__title a:focus-visible {
    text-decoration: underline;
}

.mooc-rel__meta {
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--mooc-muted);
}

.mooc-rel__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    min-height: 46px;
    border-radius: 6px;
    background: var(--mooc-ink);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    color: var(--mooc-white);
}

.mooc-rel__cta:hover,
.mooc-rel__cta:focus-visible {
    background: var(--mooc-cyan-dark);
    color: var(--mooc-white);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .mooc-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .mooc-aside {
        position: static;
        order: -1;
    }

    .mooc-card {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .mooc-card__img {
        height: 100%;
        aspect-ratio: auto;
    }

    .mooc-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .mooc-hero {
        padding: 40px 0 36px;
    }

    .mooc-btn--hero {
        width: 100%;
    }

    .mooc-layout {
        padding-top: 32px;
        padding-bottom: 48px;
    }

    .mooc-heading {
        font-size: 24px;
    }

    .mooc-text,
    .mooc-checks li {
        font-size: 16px;
    }

    .mooc-card {
        display: block;
    }

    .mooc-card__img {
        aspect-ratio: 16 / 10;
    }

    .mooc-related__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
