/* ==========================================================================
   PWP Portal Helpers — All Styles
   v1.0.0
   ========================================================================== */


/* ─────────────────────────────────────────────────────────────────────────
   CURRENT MODULE CARD
   ───────────────────────────────────────────────────────────────────────── */

.pwp-current-card {
    position: relative;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    padding: 18px;
}

.pwp-current-card__media img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
}

.pwp-current-card__eyebrow {
    color: #e4572e;
    font-family: adobe-handwriting-ernie, sans-serif;
    margin-bottom: 2px;
}

.pwp-current-card__module {
    margin: .15rem 0 .35rem;
    font-weight: 700;
}

.pwp-current-card__tagline {
    margin: 0 0 .8rem;
    color: #575757;
}

.pwp-current-card__progress {
    margin: .4rem 0 .8rem;
}

.pwp-current-card__actions {
    display: flex;
    gap: 12px;
    margin-top: .4rem;
    flex-wrap: wrap;
}

.pwp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #1e73be;
    text-decoration: none;
}

.pwp-btn--primary {
    background: #1e73be;
    color: #fff;
}

.pwp-empty {
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.pwp-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    opacity: .85;
}

@media (max-width: 800px) {
    .pwp-current-card {
        grid-template-columns: 1fr;
    }
    .pwp-current-card__media img {
        height: 180px;
    }
}

/* Program Complete state */
.pwp-current-card--complete {
    display: block;
    text-align: center;
    padding: 32px 28px;
}

.pwp-current-card__body--complete {
    max-width: 520px;
    margin: 0 auto;
}

.pwp-current-card--complete .pwp-current-card__module {
    font-size: 1.5em;
    margin: 0.3rem 0 0.6rem;
}

.pwp-current-card--complete .pwp-current-card__tagline {
    font-size: 1.05em;
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.pwp-current-card--complete .pwp-current-card__actions {
    justify-content: center;
}


/* ─────────────────────────────────────────────────────────────────────────
   CURRICULUM NAV (sidebar accordion)
   ───────────────────────────────────────────────────────────────────────── */

/* Container */
.curriculum-nav {
    background: #fff;
    border-radius: 18px;
    max-width: 350px;
    margin: 0 auto;
    font-family: inherit;
}

/* Header */
.curriculum-nav-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.curriculum-nav .overview-title {
    font-family: 'adobe-handwriting-ernie';
    font-size: 1.7em;
    color: #E95332;
    font-weight: 400;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

/* Module list */
.curriculum-nav .module-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.curriculum-nav .module-item {
    margin-bottom: 7px;
    padding: 0;
    overflow: visible;
    font-size: 18px;
}

/* Module header button */
.curriculum-nav .module-header {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    font-size: 1.16em;
    font-weight: 400;
    padding: 5px 16px 5px 10px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    color: #3d3d3d;
    transition: background 0.15s;
    text-align: left;
    align-items: center;
}

/* Locked module headers */
.curriculum-nav .module-item.is-locked .module-header {
    cursor: default;
    opacity: 0.55;
}

/* Module number circle */
.curriculum-nav .module-num {
    display: inline-block;
    width: 32px;
    height: 32px;
    color: #3d3d3d;
    font-weight: 400;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    margin-right: 5px;
    letter-spacing: 1px;
}

/* Module title */
.curriculum-nav .module-title {
    font-weight: 400;
    color: #3d3d3d;
    font-size: 1.09em;
    flex: 1;
    padding-right: 8px;
}

/* Toggle chevron */
.curriculum-nav .module-toggle {
    margin-left: 10px;
    font-size: 15px;
    color: #2669A9;
    transition: transform 0.2s;
}

.curriculum-nav .module-header[aria-expanded="true"] .module-toggle {
    transform: rotate(180deg);
}


/* ── Lesson list (animated accordion) ──
   Elementor may inject style="display:none" on list elements.
   We force display:block and animate via max-height + opacity instead. */

.curriculum-nav .lesson-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;

    display: block !important;   /* override inline display:none */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* Open state */
.curriculum-nav .lesson-list.is-open {
    max-height: 1000px;  /* comfortably larger than any module */
    opacity: 1;
}

/* Vertical progress line */
.curriculum-nav .lesson-list::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 11px;
    bottom: 11px;
    width: 1.5px;
    background: #D9D9D9;
}

/* Lesson item */
.curriculum-nav .lesson-item {
    display: flex;
    align-items: center;
    background: none;
    border-radius: 8px;
    padding: 4px 4px 4px 11px;
    margin: 3px 0;
    color: #8e5e22;
    font-size: 1em;
    font-weight: 500;
}

/* Play icon circle */
.curriculum-nav .lesson-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: #D9D9D9;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    position: relative;
    flex: 0 0 auto;
}

/* White triangle inside circle */
.curriculum-nav .lesson-icon::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 7px solid #ffffff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    position: absolute;
    top: 6px;
    left: 8px;
}

/* Lesson title (default = locked gray) */
.curriculum-nav .lesson-title {
    flex: 1;
    color: #B0B0B0;
    font-weight: 400;
    font-size: 18px;
    margin-left: 5px;
    text-decoration: none;
}


/* ── Lesson states ── */

/* Locked */
.curriculum-nav .lesson-item.is-locked            { cursor: default; }
.curriculum-nav .lesson-item.is-locked .lesson-title { color: #B0B0B0; }
.curriculum-nav .lesson-item.is-locked .lesson-icon  { background: #D9D9D9; }

/* Unlocked (not current) */
.curriculum-nav .lesson-item.is-unlocked .lesson-title { color: #2669A9; }
.curriculum-nav .lesson-item.is-unlocked .lesson-icon  { background: #2669A9; }

/* Current */
.curriculum-nav .lesson-item.is-current .lesson-title {
    color: #2E7D32;
    font-weight: 600;
}
.curriculum-nav .lesson-item.is-current .lesson-icon { background: #2E7D32; }


/* Duration label */
.curriculum-nav .lesson-duration {
    margin-left: 1em;
    color: #B0B0B0;
    border-radius: 8px;
    padding: 2px 9px 2px 7px;
    font-size: 0.98em;
    font-weight: 400;
    min-width: 2.3em;
    text-align: right;
}

/* ─────────────────────────────────────────────────────────────────────────
   LESSON PAGE — RESPONSIVE LAYOUT
   Targets the two-column section on every lesson page.
   ───────────────────────────────────────────────────────────────────────── */

/* ══════════════════════════════════════════════════════════════════════════
   TABLET (≤ 1024px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

    /* -- Column stacking & reordering -- */
    .elementor-container:has(.curriculum-nav) {
        flex-wrap: wrap;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-column {
        width: 100% !important;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-column:last-child {
        order: -1;                /* content column on top */
    }
    .elementor-container:has(.curriculum-nav) > .elementor-column:first-child {
        order: 1;                 /* sidebar below content */
        margin-top: 32px;
    }

    /* -- Content column spacing -- */
    .elementor-container:has(.curriculum-nav) > .elementor-column:last-child > .elementor-widget-wrap {
        margin-left: 0 !important;
    }

    /* -- Lesson title -- */
    .elementor-container:has(.curriculum-nav) .elementor-heading-title {
        font-size: 32px !important;
    }

    /* -- Module subtitle ("Module: Welcome to PWP") -- */
    .elementor-container:has(.curriculum-nav) .elementor-widget-text-editor p {
        /* text-align: center; */
        /* font-size: 14px; */
    }

    /* -- Next button -- */
    .accessally-course-navigation-container {
        /* text-align: center; */
    }

    /* -- Video container -- */
    .progressally-video-container {
        /* max-width: 100%; */
    }

    /* -- Content tabs (Description / Audio / Assignments) -- */
    .ue-tabs.uc_tab_nav .r-tabs-tab::after {
        display: none !important; /* hide circle decorations */
    }
    .ue-tabs.uc_tab_nav .r-tabs-tab a {
        /* font-size: 14px; */
        /* padding: 8px 12px; */
    }

    /* -- Tab content area -- */
    .tab-container {
        /* padding: 20px 16px !important; */
    }
    .ue-content-text {
        /* font-size: 15px; */
        /* line-height: 1.6; */
    }

    /* -- Sidebar: nav + resources side by side -- */
    .elementor-container:has(.curriculum-nav) > .elementor-column:first-child > .elementor-widget-wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-column:first-child > .elementor-widget-wrap > .e-con {
        flex: 1 1 45%;
        min-width: 280px;
        margin-top:0 !important;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-column:first-child > .elementor-widget-wrap > .e-con > .e-con-inner {
        gap:10px;
    }
    .curriculum-nav {
        max-width: 100%;
    }

    /* -- Module Resources section -- */
    .module-resources-list {
        padding: 20px 40px;
    }

    /* -- Current module card -- */
    .pwp-current-card__body {
        text-align: center;
    }
    .pwp-current-card__actions {
        justify-content: center;
    }
}


/* ══════════════════════════════════════════════════════════════════════════
   MOBILE (≤ 767px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    .elementor-section:first-child {
        padding-top: 20px !important;
    }

    .elementor-container:has(.curriculum-nav) > .elementor-widget-container > .elementor > .elementor-section:nth-child(2) {
        padding:60px 20px 0 20px;
    }

    /* -- Column spacing -- */
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:first-child {
        margin-top: 24px;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:last-child > .elementor-widget-wrap {
        padding: 40px 20px;
    }

    .elementor-container:has(.curriculum-nav) > .elementor-col-50:last-child > .elementor-widget-wrap > .e-con-full > .elementor-widget:first-child {
        width: 100% !important;
    }

    /* -- Lesson title -- */
    .elementor-container:has(.curriculum-nav) .elementor-heading-title {
        font-size: 24px !important;
        text-align: center;
        width: 100%;
        line-height: 32px;
    }

    /* -- Module subtitle -- */
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:last-child > .elementor-widget-wrap > .elementor-element:nth-child(2) {
        display: none;
    }

    /* -- Next button -- */
    .elementor-widget:has(.accessally-course-navigation-container) {
        width: 100%;
    }
    .accessally-course-navigation-container {
        width: 100%;
        text-align: right;
        margin: 20px 0 30px 0;
    }

    /* -- Content tabs -- */
    .ue-tabs.uc_tab_nav .r-tabs-tab a {
        
    }
    .r-tabs-anchor {
        color: #3d3d3d !important;
        font-weight: 600 !important;
    }

    /* -- Tab content area -- */
    .tab-container {
        /* padding: 16px 12px !important; */
    }
    .ue-content-text {
        /* font-size: 14px; */
    }

    /* -- Forminator forms inside tabs -- */
    .forminator-custom-form {
        /* padding: 0 4px; */
    }
    .forminator-label {
        /* font-size: 14px; */
    }

    /* -- Curriculum nav -- */
    .curriculum-nav {
        max-width: 100%;
        padding: 14px 8px 12px 8px;
    }

    /* -- Resources above nav on mobile -- */
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:first-child > .elementor-widget-wrap {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap !important;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:first-child > .elementor-widget-wrap > .e-con {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:first-child > .elementor-widget-wrap > .e-con:has(.curriculum-nav) {
        order: 2;
    }
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:first-child > .elementor-widget-wrap > .e-con:has(.module-resources-list) {
        order: 1;
    }

    /* -- Download button -- */
    .download-button {
        padding: 10px 24px;
        font-size: 16px;
    }

    /* -- Current module card -- */
    .pwp-current-card__media img {
        max-height: 220px;
        object-position: center;
    }
    .elementor-absolute.elementor-widget-image {
        display: none !important;
    }

    /* -- Remove content column margin/padding on mobile -- */
    .elementor-container:has(.curriculum-nav) > .elementor-col-50:last-child > .elementor-element-populated {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 20px 16px !important;
    }

    /* -- Reduce section side padding on mobile -- */
    .elementor-section:has(.curriculum-nav) {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* -- Tips text: let it shrink to fit -- */
    .elementor-absolute + .elementor-widget-text-editor {
        max-width: 100% !important;
    }
}


/* ══════════════════════════════════════════════════════════════════════════
   SMALL MOBILE (≤ 480px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* -- Lesson title -- */
    .elementor-container:has(.curriculum-nav) .elementor-heading-title {
        /* font-size: 20px; */    /* even smaller if needed */
    }

    /* -- Curriculum nav refinements -- */
    .curriculum-nav {
        max-width: 100%;
        padding: 14px 4px 12px 4px;
    }
    .curriculum-nav .module-header {
        font-size: 1em;
        padding: 10px 10px 10px 6px;
    }
    .curriculum-nav .module-num {
        width: 27px;
        height: 27px;
        line-height: 27px;
        font-size: 1em;
    }

    /* -- Download button -- */
    .download-button {
        /* width: 100%; */
        /* font-size: 14px; */
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   LESSON NAVIGATION BUTTON (custom replacement for AA "Next" button)
   ───────────────────────────────────────────────────────────────────────── */

/* Hide the native AccessAlly navigation button — we use it as a data source only */
[progressally-objective-completion-update] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
}

/* Container */
.pwp-lesson-nav {
    text-align: right;
    margin: 8px 0;
}

/* Button wrapper (holds disabled btn + tooltip) */
.pwp-nav-btn-wrap {
    display: inline-block;
    position: relative;
}

/* Shared button base */
.pwp-nav-btn {
    display: inline-block;
    font-family: "proxima-nova", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 32px;
    border-radius: 10px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

/* Disabled state */
.pwp-nav-btn--disabled {
    background: #ccc;
    color: #fff;
    cursor: not-allowed;
    user-select: none;
}

/* Active state */
.pwp-nav-btn--active {
    background: #2669A9;
    color: #fff;
}
.pwp-nav-btn--active:hover {
    background: #1e5490;
    color: #fff;
}

/* CTA state (Book Call) */
.pwp-nav-btn--cta {
    background: #E95332;
}
.pwp-nav-btn--cta:hover {
    background: #c7422a;
}

/* Tooltip */
.pwp-nav-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #3d3d3d;
    color: #fff;
    font-family: "proxima-nova", sans-serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

/* Tooltip arrow */
.pwp-nav-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 24px;
    border: 6px solid transparent;
    border-top-color: #3d3d3d;
}

/* Show tooltip on hover of disabled button */
.pwp-nav-btn-wrap:hover .pwp-nav-tooltip {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .pwp-lesson-nav {
        text-align: center;
    }
    .pwp-nav-tooltip {
        right: 50%;
        transform: translateX(50%);
        white-space: normal;
        min-width: 200px;
        text-align: center;
    }
    .pwp-nav-tooltip::after {
        right: calc(50% - 6px);
    }
}
