/**
 * AHA Lesson Page Cleanup
 * Hides LearnDash UI elements for a cleaner lesson experience.
 *
 * SCOPE: Currently applied to ALL sfwd-lessons pages site-wide.
 *
 * TO LIMIT TO SPECIFIC COURSES:
 *   LearnDash adds body classes like:
 *     .learndash-cpt-sfwd-courses-{COURSE_ID}-parent
 *   So to target only "Ultimate Gut Reset" (ID 100806):
 *     .learndash-cpt-sfwd-courses-100806-parent .ld-progress { display: none; }
 *
 * TO LIMIT TO SPECIFIC LESSONS:
 *   LearnDash adds body classes like:
 *     .learndash-cpt-sfwd-lessons-{LESSON_ID}-current
 *   So to target only lesson 100811:
 *     .learndash-cpt-sfwd-lessons-100811-current .ld-progress { display: none; }
 *
 * TO RE-ENABLE FOR A SPECIFIC COURSE/LESSON:
 *   Add a more specific selector that sets display back:
 *     .learndash-cpt-sfwd-courses-{ID}-parent .ld-progress { display: block !important; }
 */


/* ==========================================================================
   1. PROGRESS BAR (top header bar)
   ========================================================================== */

.single-sfwd-lessons .ld-focus-header .ld-progress {
    display: none !important;
}


/* ==========================================================================
   2. MARK COMPLETE BUTTON - TOP BAR
   The form inside the header content-actions area.
   ========================================================================== */

.single-sfwd-lessons .ld-focus-header .ld-content-actions .sfwd-mark-complete {
    display: none !important;
}

/* Previous/Next Module buttons in the top header bar */
.single-sfwd-lessons .ld-focus-header .ld-content-actions .ld-button {
    display: none !important;
}


/* ==========================================================================
   3. INFOBAR (breadcrumbs + "In Progress" status badge)
   The entire infobar shortcode wrapper including breadcrumbs and status.
   ========================================================================== */

.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_infobar"] {
    display: none !important;
}


/* ==========================================================================
   4. MARK COMPLETE BUTTON - BOTTOM (below lesson content)
   Targets the mark-complete form inside the navigation wrapper.
   ========================================================================== */

.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_navigation"] .sfwd-mark-complete {
    display: none !important;
}


/* ==========================================================================
   5. PREVIOUS / NEXT NAVIGATION BUTTONS (bottom)
   Hides the prev/next module buttons but keeps "Back to Course" link.
   ========================================================================== */

.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_navigation"] .ld-content-action .ld-button {
    display: none !important;
}

/* The first .ld-content-action is "previous" (empty on first lesson). Hide it. */
.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_navigation"] .ld-content-action.ld-empty {
    display: none !important;
}

/* The last .ld-content-action holds the "Next Module" button. Hide buttons inside. */
.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_navigation"] .ld-content-action:last-child {
    display: none !important;
}


/* ==========================================================================
   6. "BACK TO COURSE" -> "COURSE HOME" (text replacement via CSS)
   Uses text-indent to push original text off-screen, ::after for new text.
   ========================================================================== */

.single-sfwd-lessons .ld-course-step-back {
    text-indent: -9999px !important;
    display: block !important;
    position: relative !important;
}

.single-sfwd-lessons .ld-course-step-back::after {
    content: "Course Home";
    text-indent: 0;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
}


/* ==========================================================================
   7. SPACING FIXES
   Prevent layout collapse when elements are hidden.
   ========================================================================== */

/* Keep the bottom navigation area visible so "Course Home" link has breathing room */
.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_navigation"] .ld-content-actions {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

/* Center the remaining "Course Home" link */
.single-sfwd-lessons [class*="learndash-shortcode-wrap-ld_navigation"] .ld-content-action:not(.ld-empty):not(:last-child) {
    display: flex;
    justify-content: center;
    width: 100%;
}


/* ==========================================================================
   8. COURSE STATUS BAR (course overview pages)
   Hides the progress/status bar on course pages.
   ========================================================================== */

.single-sfwd-courses .ld-course-status {
    display: none !important;
}
