/* =========================================================
   EduOrk Academy — course-detail page styles
   ========================================================= */

/* ---------- Sample certificate: shown in place, view-only ---------- */
.cd-cert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .8rem;
}

.cd-cert-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #334155;
}

.cd-cert-title i {
    color: #dc2626;
}

.cd-cert-tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 800;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

/* plain frame around the certificate */
.cd-cert-frame {
    position: relative;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 30px -20px rgba(15, 23, 42, .45);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.cd-cert-paper {
    position: relative;
    overflow: hidden;
    line-height: 0;
    border-radius: calc(1rem - 1px);
    background: #fff;
    aspect-ratio: 1.414 / 1;
}

.cd-cert-paper canvas {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.cd-cert-paper [hidden] {
    display: none !important;
}

.cd-cert-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: 1rem;
    text-align: center;
    line-height: 1.4;
    font-size: .78rem;
    font-weight: 700;
    color: #94a3b8;
}

.cd-cert-empty i {
    font-size: 1.9rem;
}

/* faint repeating watermark; also catches right-click / drag so there is nothing to save */
.cd-cert-shield {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='150'%3E%3Ctext x='110' y='80' text-anchor='middle' font-family='Arial,sans-serif' font-size='17' font-weight='700' fill='%230f172a' fill-opacity='0.09' transform='rotate(-24 110 75)'%3EEduOrk Sample%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
}

.cd-cert-ribbon {
    position: absolute;
    top: -.55rem;
    left: 1rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: .6rem;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .12em;
    color: #fff;
    background: #0f172a;
    box-shadow: 0 6px 12px -6px rgba(15, 23, 42, .6);
}

.cd-cert-ribbon i {
    color: #fbbf24;
}

.cd-cert-note {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-top: 1rem;
    font-size: .78rem;
    line-height: 1.55;
    font-weight: 600;
    color: #475569;
}

.cd-cert-note i {
    margin-top: .2rem;
    color: #16a34a;
}

/* never let the certificate reach a printout / PDF */
@media print {
    [data-cert-box] {
        display: none !important;
    }
}

/* ---------- Student reviews: one moving row ---------- */
.rv-marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: .25rem 0 .75rem;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.rv-track {
    display: flex;
    width: max-content;
    animation: rvScroll var(--rv-dur, 60s) linear infinite;
    will-change: transform;
}

.rv-marquee:hover .rv-track,
.rv-marquee:focus-within .rv-track {
    animation-play-state: paused;
}

.rv-half {
    display: flex;
    flex-shrink: 0;
}

@keyframes rvScroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* reduced motion: no auto-scroll, let the visitor swipe / scroll the row instead */
@media (prefers-reduced-motion: reduce) {
    .rv-marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .rv-track {
        animation: none !important;
    }

    .rv-half[aria-hidden="true"] {
        display: none;
    }
}

/* ---------- Course page structure ---------- */
/* fixed responsive height instead of aspect-ratio + min-height (that combo stretched the width) */
.cd-hero {
    aspect-ratio: auto !important;
    height: clamp(14rem, 26vw, 22rem);
}

.cd-sec {
    scroll-margin-top: 6.5rem;
}

/* ---------- wide layout ---------- */
.cd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 1024px) {
    .cd-grid {
        grid-template-columns: minmax(0, 1fr) 24rem;
        gap: 2.5rem;
        align-items: start;
    }
}

@media (min-width: 1280px) {
    .cd-grid {
        grid-template-columns: minmax(0, 1fr) 27rem;
        gap: 3rem;
    }
}

/* use the extra width in the main column: highlights & roles flow into 2/3 columns */
.cd-main .grid.sm\:grid-cols-2 {
    gap: .9rem;
}

/* ---------- reviews: full-screen-width band (same look as the homepage row) ---------- */
.cd-rv-band {
    width: 100%;
    padding: 3.5rem 0 3.75rem;
    overflow: hidden;
    scroll-margin-top: 5rem;
}

.cd-rv-band[hidden] {
    display: none;
}

.cd-rv-band .rv-marquee {
    padding: .75rem 0 1.5rem;
}

/* Review card — ONE design used on the homepage and on every course page.
   A speech bubble (quote icon + 5 stars + the review) whose tail points to
   the reviewer's name, so each card reads clearly as student feedback. */
.cd-rv-band .feedback-card {
    width: 22rem;
    height: auto;
    min-height: 0;
    margin: 0 .8rem;
    padding: 0;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.cd-rv-band .feedback-card:hover {
    box-shadow: none;
    border-color: transparent;
    transform: translateY(-4px);
}

.cd-rv-band .feedback-card-bubble {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.5rem 1.6rem 1.7rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    box-shadow: 0 10px 26px -16px rgba(15, 23, 42, .25);
    transition: border-color .25s ease, box-shadow .25s ease;
}

.cd-rv-band .feedback-card:hover .feedback-card-bubble {
    border-color: #fca5a5;
    box-shadow: 0 18px 32px -16px rgba(220, 38, 38, .3);
}

/* colour accent along the top edge */
.cd-rv-band .feedback-card-bubble::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 1.6rem;
    width: 3.25rem;
    height: .22rem;
    border-radius: 0 0 .4rem .4rem;
    background: linear-gradient(90deg, #dc2626, #f59e0b);
}

/* speech-bubble tail pointing down to the name */
.cd-rv-band .feedback-card-bubble::after {
    content: "";
    position: absolute;
    left: 2.1rem;
    bottom: -.6rem;
    width: 1.1rem;
    height: 1.1rem;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0 0 .3rem 0;
    transform: rotate(45deg);
    transition: border-color .25s ease;
}

.cd-rv-band .feedback-card:hover .feedback-card-bubble::after {
    border-color: #fca5a5;
}

.cd-rv-band .feedback-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.cd-rv-band .feedback-card-mark {
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    color: #dc2626;
    background: #fee2e2;
}

.cd-rv-band .feedback-card-stars {
    display: flex;
    gap: .18rem;
    margin: 0;
    font-size: .95rem;
    letter-spacing: 0;
    color: #f59e0b;
}

.cd-rv-band .feedback-card-quote {
    display: block;
    flex: 1;
    margin: 0;
    overflow: visible;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    font-size: .93rem;
    line-height: 1.72;
    color: #475569;
}

.cd-rv-band .feedback-card-name {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1.35rem 0 0;
    padding: 0 0 0 1.4rem;
    border: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
}

.cd-rv-band .feedback-card-name::before {
    content: "";
    flex-shrink: 0;
    width: .95rem;
    height: .2rem;
    border-radius: 999px;
    background: #dc2626;
}

@media (max-width: 640px) {
    .cd-rv-band .feedback-card {
        width: 19rem;
    }
}

/* hero title row: stack title + rating on phones so nothing is clipped */
@media (max-width: 560px) {
    .cd-hero-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
        padding: 1rem 1.1rem;
    }

    .cd-hero-row h1 {
        font-size: 1.5rem;
    }
}

/* consistent vertical rhythm between the course sections */
.cd-main>.cd-sec+.cd-sec {
    margin-top: 2.75rem;
}

.cd-h2 {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.3;
    color: #0f172a;
}

.cd-h2::before {
    content: "";
    flex-shrink: 0;
    width: .28rem;
    height: 1.2rem;
    border-radius: 999px;
    background: #dc2626;
}

/* "on this page" pills */
.cd-jump {
    display: flex;
    gap: .5rem;
    margin-top: 1.5rem;
    padding-bottom: .25rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cd-jump::-webkit-scrollbar {
    display: none;
}

.cd-jump a {
    flex: 0 0 auto;
    padding: .5rem .95rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    color: #334155;
    background: #fff;
    border: 1px solid #cbd5e1;
    transition: color .2s ease, border-color .2s ease;
}

.cd-jump a:hover {
    color: #b91c1c;
    border-color: #f87171;
}

/* quick facts + actions: phones and tablets only (desktop uses the sidebar) */
.cd-quick {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 22px -16px rgba(15, 23, 42, .35);
}

.cd-quick-facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

.cd-fact {
    padding: .65rem .8rem;
    border-radius: .9rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.cd-fact small {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: #64748b;
}

.cd-fact b {
    display: block;
    margin-top: .15rem;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1.3;
    color: #0f172a;
}

.cd-quick-cta {
    display: grid;
    gap: .6rem;
    margin-top: 1rem;
}

.cd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .8rem 1rem;
    border-radius: .9rem;
    font-size: .85rem;
    font-weight: 800;
    color: #fff;
    border: 0;
    cursor: pointer;
    transition: background .2s ease;
}

.cd-btn-dark {
    background: #0f172a;
}

.cd-btn-dark:hover {
    background: #dc2626;
}

.cd-btn-red {
    background: #dc2626;
}

.cd-btn-red:hover {
    background: #b91c1c;
}

@media (min-width: 640px) {
    .cd-quick-facts {
        grid-template-columns: repeat(4, 1fr);
    }

    .cd-quick-cta {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .cd-quick {
        display: none;
    }
}

@media (max-width: 1023px) {

    /* on small screens the certificate is the only thing left in the sidebar */
    .cd-side-actions {
        display: none;
    }

    .cd-side-card {
        position: static !important;
    }
}

/* sidebar fact rows: label and value never touch */
.cd-fact-row {
    gap: .9rem;
}

.cd-fact-label {
    flex-shrink: 0;
}

.cd-fact-val {
    text-align: right;
    min-width: 0;
}

/* "learned in the environment" cards (courses with no syllabus download) */
.cd-learn-intro {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1.1rem;
}

.cd-learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: .9rem;
    margin-bottom: 1.6rem;
}

.cd-learn-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.1rem;
    padding: 1.1rem;
}

.cd-learn-ico {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .8rem;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .7rem;
}

.cd-learn-card h3 {
    font-weight: 900;
    color: #0f172a;
    font-size: .98rem;
    margin-bottom: .3rem;
}

.cd-learn-card p {
    color: #64748b;
    font-size: .86rem;
    line-height: 1.55;
}

.cd-learn-sub {
    font-weight: 900;
    color: #0f172a;
    font-size: 1.05rem;
    margin: 0 0 .7rem;
}

/* syllabus accordion */
.cd-syl-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .9rem;
    font-size: .85rem;
    font-weight: 700;
    color: #475569;
}

.cd-syl-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    color: #b91c1c;
    background: #fff1f2;
    border: 1px solid #fca5a5;
    cursor: pointer;
}

.cd-syl-toggle:hover {
    background: #fee2e2;
}

.cd-syl {
    display: grid;
    gap: .75rem;
}

.cd-mod {
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.cd-mod[open] {
    border-color: #fca5a5;
    box-shadow: 0 10px 24px -18px rgba(220, 38, 38, .45);
}

.cd-mod-sum {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .95rem 1.1rem;
    list-style: none;
    cursor: pointer;
}

.cd-mod-sum::-webkit-details-marker {
    display: none;
}

.cd-mod-sum:focus-visible {
    outline: 3px solid #dc2626;
    outline-offset: -3px;
    border-radius: 1rem;
}

.cd-mod-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 900;
    color: #dc2626;
    background: #fee2e2;
}

.cd-mod-title {
    flex: 1;
    min-width: 0;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
}

.cd-mod-count {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
}

.cd-mod-chev {
    flex-shrink: 0;
    font-size: .75rem;
    color: #94a3b8;
    transition: transform .25s ease;
}

.cd-mod[open] .cd-mod-chev {
    transform: rotate(180deg);
}

.cd-mod-list {
    margin: 0;
    padding: 0 1.1rem 1.1rem 3.85rem;
    display: grid;
    gap: .4rem;
    list-style: disc;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.55;
    color: #475569;
}

.cd-mod-list li::marker {
    color: #dc2626;
}

@media (max-width: 480px) {
    .cd-mod-count {
        display: none;
    }

    .cd-mod-list {
        padding-left: 2.6rem;
    }
}