/* LearnPress / Eduma-style course archive layout
   Pair with fonts link: Open Sans in courses.html */

/* Active nav matches site shell */
.page-courses-archive .nav-desktop a[aria-current="page"],
.page-courses-archive .nav-mobile a[aria-current="page"] {
    color: var(--yellow-dark);
}

/* ----- Eduma page heading (clone of live /courses/ hero strip) ----- */
.thim-top-heading {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Fixed strip height: stays ~constant when the browser width changes */
    height: 228px;
    min-height: 228px;
    max-height: 228px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}
/* Same asset as live Eduma “All Courses” band: themes/eduma/images/bg-page.jpg */
.thim-top-heading__bg {
    position: absolute;
    inset: 0;
    background-color: #4a3d35;
    background-image: url("images/courses-banner-bg.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
.thim-top-heading__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}
.thim-top-heading__inner {
    position: relative;
    z-index: 1;
    padding: 16px 20px;
    width: 100%;
    box-sizing: border-box;
}
.thim-top-heading__title {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    font-family: "Roboto Slab", Georgia, serif;
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.thim-top-heading__accent {
    display: block;
    width: 3px;
    margin-right: 18px;
    background: var(--yellow);
    border-radius: 1px;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 1em;
}

/* Breadcrumb on white strip below hero (not on the image) */
.courses-breadcrumb-bar {
    background: #fff;
    padding: 18px 0 0;
}
.thim-breadcrumb.thim-breadcrumb--below-hero {
    margin: 0;
    padding: 0 0 20px;
    border-bottom: 1px solid #ebebeb;
    font-size: 13px;
    color: #9a9a9a;
}
.thim-breadcrumb.thim-breadcrumb--below-hero a {
    color: #8a8a8a;
}
.thim-breadcrumb.thim-breadcrumb--below-hero a:hover {
    color: var(--yellow-dark);
}
.thim-breadcrumb.thim-breadcrumb--below-hero .sep {
    margin: 0 10px;
    color: #c8c8c8;
    font-weight: 400;
}
.thim-breadcrumb.thim-breadcrumb--below-hero .trail-end {
    color: #a8a8a8;
}

body.page-courses-archive {
    font-family: "Open Sans", Roboto, system-ui, sans-serif;
    font-size: 15px;
    color: #555;
    background: #fff;
}

.courses-archive-wrap {
    padding: 44px 0 60px;
}

.courses-archive-wrap .container {
    max-width: 1170px;
}

/* Breadcrumb (Eduma-style) */
.thim-breadcrumb {
    padding: 18px 0 8px;
    font-size: 13px;
    color: #999;
}
.thim-breadcrumb a {
    color: #666;
}
.thim-breadcrumb a:hover {
    color: var(--yellow-dark);
}
.thim-breadcrumb .sep {
    margin: 0 8px;
    color: #ccc;
}

/* Two columns: main left, sidebar right (typical Eduma course archive) */
.course-archive-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
    align-items: flex-start;
}
/* Stretch sidebar column to match main height so sticky rail can stay visible while left column scrolls */
@media (min-width: 992px) {
    .course-archive-row {
        align-items: stretch;
    }
    .course-archive-sidebar {
        display: flex;
        flex-direction: column;
    }
}
.course-archive-sidebar {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
    box-sizing: border-box;
    order: 2;
}
.course-archive-main {
    flex: 0 0 75%;
    max-width: 75%;
    padding: 0 15px;
    box-sizing: border-box;
    order: 1;
}
@media (max-width: 991px) {
    .course-archive-sidebar,
    .course-archive-main {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .course-archive-sidebar {
        order: 2;
        margin-top: 32px;
    }
    .course-archive-main {
        order: 1;
    }
}

/* Sidebar: rail block below filter (All Courses + Latest Courses — reference layout) */
.course-archive-sidebar > .course-sidebar-sticky .course-sidebar-rail {
    --rail-content-inset: 16px;
    /* Same gap above All Courses and below All Courses (before Latest) */
    --rail-block-gap: calc(28px + 1.75rem);
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    border-left: 1px solid #ccc;
    padding-left: var(--rail-content-inset);
    margin-left: 0;
    box-sizing: border-box;
}

/* Courses archive: nudge rail up; gray rule only on section boxes (no line in margin above “All Courses”) */
body.page-courses-archive .course-filters-panel {
    margin-bottom: 32px;
}
body.page-courses-archive .course-archive-sidebar > .course-sidebar-sticky .course-sidebar-rail {
    border-left: none;
    padding-left: 0;
}
body.page-courses-archive .course-sidebar-rail > .widget.course-sidebar-rail__section {
    border-left: 1px solid #ccc;
    padding-left: calc(var(--rail-content-inset) - 1px);
    box-sizing: border-box;
}
body.page-courses-archive .course-sidebar-rail > .widget.widget_nav_menu {
    margin-top: calc(var(--rail-block-gap) - 14px);
}

/* Independent sticky shell: All Courses + Latest stay in view; scroll inside inner rail */
body.page-courses-archive,
body.page-course-single {
    --course-rail-sticky-top: 104px;
}
@media (max-width: 767px) {
    body.page-courses-archive,
    body.page-course-single {
        --course-rail-sticky-top: 88px;
    }
}
@media (min-width: 992px) {
    .course-archive-sidebar > .course-sidebar-sticky,
    .page-course-single .course-single-sidebar > .course-sidebar-sticky {
        position: sticky;
        top: var(--course-rail-sticky-top);
        z-index: 5;
        align-self: flex-start;
        width: 100%;
    }
    .course-archive-sidebar > .course-sidebar-sticky .course-sidebar-rail,
    .page-course-single .course-single-sidebar > .course-sidebar-sticky .course-sidebar-rail {
        max-height: calc(100vh - var(--course-rail-sticky-top) - 16px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
@media (max-width: 991px) {
    .course-archive-sidebar > .course-sidebar-sticky,
    .page-course-single .course-single-sidebar > .course-sidebar-sticky {
        position: static;
        top: auto;
        z-index: auto;
        max-height: none;
        overflow: visible;
        align-self: stretch;
    }
    .course-archive-sidebar > .course-sidebar-sticky .course-sidebar-rail,
    .page-course-single .course-single-sidebar > .course-sidebar-sticky .course-sidebar-rail {
        max-height: none;
        overflow: visible;
    }
}

.course-sidebar-rail > .widget {
    margin: 0;
    padding: 0;
    border: none;
}
.course-sidebar-rail > .widget.widget_nav_menu {
    margin-top: var(--rail-block-gap, calc(28px + 1.75rem));
}
/*
 * Must chain > .widget so margin-top wins over `.course-sidebar-rail > .widget { margin: 0 }`
 * (that rule was zeroing the gap between All Courses and Latest).
 */
.course-sidebar-rail > .widget.course-sidebar-rail__section--latest {
    margin-top: var(--rail-block-gap, calc(28px + 1.75rem));
    padding-top: 0;
}
/* Section headings: yellow bar in rail gutter beside grey border; title text aligns with body below */
.course-sidebar-rail .widget-title--rail {
    position: relative;
    display: block;
    font-family: "Roboto Slab", Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #111;
    margin: 0 0 14px;
    padding: 0;
    border-bottom: none;
    line-height: 1.25;
}
.course-sidebar-rail .widget-title--rail::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--rail-content-inset, 16px));
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    min-height: 1.1em;
    height: 1.1em;
    margin: 0;
    background: var(--yellow);
    border-radius: 0;
}
/* Match title→first row spacing to inter-item spacing (pad + border + margin on .latest-course-item) */
.course-sidebar-rail .widget-latest-courses > .widget-title--rail {
    margin-bottom: calc(18px + 1px + 18px);
}
/* All Courses block: a bit more air under the heading and between links */
.course-sidebar-rail .widget_nav_menu .widget-title--rail {
    margin-bottom: 24px;
}
/* All Courses list: smaller sans-serif, all-caps */
.course-sidebar-rail__menu li {
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 1.5;
}
.course-sidebar-rail__menu li:last-child {
    margin-bottom: 0;
}
.course-sidebar-rail__menu a {
    font-family: "Open Sans", Roboto, system-ui, sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #444;
}
.course-sidebar-rail__menu a:hover {
    color: var(--yellow-dark);
}
/* Latest courses: course title serif; price orange sans-serif */
.course-sidebar-rail .widget-latest-courses .latest-body h3 {
    font-family: "Roboto Slab", Georgia, serif;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
}
.course-sidebar-rail .widget-latest-courses .latest-body h3 a {
    font-family: inherit;
    color: #222;
}
.course-sidebar-rail .widget-latest-courses .latest-body h3 a:hover {
    color: var(--yellow-dark);
}
.course-sidebar-rail .widget-latest-courses .latest-price {
    font-family: "Open Sans", Roboto, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}
.course-sidebar-rail .widget-latest-courses .latest-price .value,
.course-sidebar-rail .widget-latest-courses .latest-price .unit {
    color: var(--red-band);
}
.course-sidebar-rail .widget-latest-courses .latest-price .unit {
    font-weight: 700;
    margin-left: 0;
}
.course-archive-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.course-archive-sidebar .count {
    color: #999;
    font-weight: 400;
}

/* Filter panel (Course categories / Instructors / Price) — boxed layout */
.course-filters-panel {
    border: 1px solid #ddd;
    background: #fff;
    padding: 22px 18px 24px;
    margin-bottom: 44px;
    box-sizing: border-box;
}
.course-filters-panel .widget {
    margin: 0;
    padding: 0;
    border: none;
}
.course-filters-panel .widget + .widget {
    margin-top: 12px;
    padding-top: 12px;
    border-top: none;
}
.course-filters-panel .widget-title {
    font-family: "Roboto Slab", Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
    color: #333;
    margin: 0 0 14px;
    padding: 0;
    border-bottom: none;
    letter-spacing: 0;
}
.course-filters-panel .sidebar-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.course-filters-panel .sidebar-filter-list li {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.45;
}
.course-filters-panel .sidebar-filter-list li:last-child {
    margin-bottom: 0;
}
.course-filters-panel .sidebar-filter-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: #444;
    font-family: "Open Sans", Roboto, system-ui, sans-serif;
}
.course-filters-panel .sidebar-filter-text {
    flex: 1;
    min-width: 0;
}
.course-filters-panel .sidebar-filter-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    flex-shrink: 0;
    border: 1px solid #bbb;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    overflow: visible;
}
.course-filters-panel .sidebar-filter-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 2px;
    top: -1px;
    width: 6px;
    height: 11px;
    border: solid var(--yellow);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    box-sizing: border-box;
}
.course-filters-panel .sidebar-filter-checkbox:focus-visible {
    outline: 2px solid var(--yellow-dark);
    outline-offset: 2px;
}
.course-filters-panel .sidebar-filter-radio {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    flex-shrink: 0;
    border: 1px solid #bbb;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
}
.course-filters-panel .sidebar-filter-radio:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    margin: 0;
    border-radius: 50%;
    background: var(--yellow);
    transform: translate(-50%, -50%);
}
.course-filters-panel .sidebar-filter-radio:focus-visible {
    outline: 2px solid var(--yellow-dark);
    outline-offset: 2px;
}
.course-filters-panel .widget-learnpress-course-price .sidebar-filter-list--radio li:last-child {
    margin-bottom: 0;
}
.course-filters-panel .btn-filter-results {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 14px 16px;
    font-family: "Open Sans", Roboto, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #333;
    background: var(--yellow);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
}
.course-filters-panel .btn-filter-results:hover {
    background: var(--yellow-dark);
    color: #222;
}

/* Latest courses widget (mini cards) */
.widget-latest-courses .latest-course-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}
.widget-latest-courses .latest-course-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.widget-latest-courses .latest-thumb {
    display: block;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    overflow: hidden;
    background: #f0f0f0;
}
.widget-latest-courses .latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.widget-latest-courses .latest-body {
    flex: 1;
    min-width: 0;
}
.widget-latest-courses .latest-body h3 {
    font-family: "Open Sans", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
}
.widget-latest-courses .latest-body h3 a {
    color: #333;
}
.widget-latest-courses .latest-body h3 a:hover {
    color: var(--yellow-dark);
}
.widget-latest-courses .latest-price {
    font-size: 13px;
}
.widget-latest-courses .latest-price .value {
    color: var(--red-band);
    font-weight: 700;
}
.widget-latest-courses .latest-price .unit {
    color: #999;
    font-size: 12px;
    margin-left: 6px;
}

/* Course grid (Eduma thim-course-grid) */
.thim-course-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}
.lpr_course {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 15px 30px;
    box-sizing: border-box;
}
@media (max-width: 991px) {
    .lpr_course {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
@media (max-width: 600px) {
    .lpr_course {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.course-item {
    border: 1px solid #e5e5e5;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.course-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Thumbnail + READ MORE: compact, centered; width fits label; dim overlay on hover */
.course-thumbnail {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}
/* Dim overlay when hovering — slightly darker so the yellow CTA pops */
.course-thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(22, 20, 18, 0.62);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}
.course-thumbnail:hover::after,
.course-thumbnail:focus-within::after {
    opacity: 1;
}
.course-thumbnail .thumb {
    display: block;
    position: relative;
    z-index: 0;
    aspect-ratio: 1;
    overflow: hidden;
}
.course-thumbnail .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.course-item:hover .course-thumbnail .thumb img {
    transform: scale(1.04);
}
.course-thumbnail .course-readmore {
    display: inline-block;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 7px 16px;
    white-space: nowrap;
    text-align: center;
    font-family: "Open Sans", Roboto, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2a2a2a;
    background: var(--yellow);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 6px));
    transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease, background 0.2s, color 0.2s;
}
.course-thumbnail:hover .course-readmore,
.course-thumbnail:focus-within .course-readmore {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}
.course-thumbnail .course-readmore:hover {
    background: var(--yellow-dark);
    color: #111;
}

/* Content block */
.thim-course-content {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-author {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.course-author .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}
.course-author .author-contain label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin: 0 0 4px;
}
.course-author .author-contain .value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.course-title {
    font-family: "Roboto Slab", Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 14px;
}
.course-title a {
    color: #111;
}
.course-title a:hover {
    color: var(--yellow-dark);
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #ddd;
}
.course-meta > div label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin: 0 0 4px;
}
.course-meta > div .value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.course-meta .course-price {
    flex: 1 1 auto;
    min-width: 80px;
    text-align: right;
    margin-left: auto;
}
.course-meta .course-price .value {
    color: var(--red-band);
    font-size: 18px;
    font-weight: 800;
}
.course-meta .course-price .unit-price {
    display: none;
}

.course-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: #777;
    margin: 0 0 14px;
    flex-grow: 1;
}

.course-bottom-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #eee;
}
.course-bottom-row .price-repeat .value {
    color: var(--red-band);
    font-weight: 800;
    font-size: 16px;
}
.course-bottom-row .price-repeat .unit {
    display: none;
}
.course-bottom-row .read-more-footer {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--yellow-dark);
}
.course-bottom-row .read-more-footer:hover {
    text-decoration: underline;
}

/* ----- Accessibility ----- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Toolbar: view toggle, sort, search (reference layout) ----- */
.courses-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 48px;
    padding: 16px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 0;
}
.courses-top-bar__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
}
.courses-top-bar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-left: auto;
}
.course-index {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.courses-no-results-alert {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 24px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.4;
    color: #7a2e2e;
    background: #fce8e8;
    border: none;
    border-radius: 2px;
}
.courses-no-results-alert[hidden] {
    display: none !important;
}

.course-view-toggle {
    display: inline-flex;
    gap: 4px;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}
.course-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: #fff;
    color: #999;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.course-view-btn + .course-view-btn {
    border-left: none;
}
.course-view-btn:hover {
    color: #666;
    background: #fafafa;
}
.course-view-btn.is-active {
    color: var(--yellow);
    background: #fffef5;
}
.course-archive-main[data-course-view="list"] .course-view-btn--list.is-active,
.course-archive-main[data-course-view="grid"] .course-view-btn--grid.is-active {
    color: var(--yellow-dark);
    background: #fff8e6;
}

.courses-sort-wrap {
    display: inline-block;
}
.courses-sort-select {
    min-width: 160px;
    padding: 6px 28px 6px 10px;
    font-family: inherit;
    font-size: 14px;
    color: #444;
    background: #fff;
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

.courses-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.courses-search-input {
    width: min(220px, 42vw);
    padding: 6px 34px 6px 10px;
    font-family: inherit;
    font-size: 14px;
    border: none;
    border-radius: 2px;
    background: #fff;
}
.courses-search-input::placeholder {
    color: #aaa;
}
.courses-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
    display: flex;
}

@media (max-width: 991px) {
    .courses-top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .courses-top-bar__right {
        margin-left: 0;
        justify-content: flex-start;
    }
    .courses-search-input {
        width: 100%;
        min-width: 0;
    }
    .courses-search-wrap {
        flex: 1;
        min-width: 140px;
    }
}

/* ----- Course track: tinted thumb area (grid / list) ----- */
.course-track-beginners .course-thumbnail {
    background: #e4f0dc;
}
.course-track-intermediate .course-thumbnail {
    background: #ddeaf5;
}

/* ----- Grid view (橱窗): title → Teacher line → G/Y/R rule → one meta row; no excerpt/footer ----- */
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .thim-course-content {
    display: flex;
    flex-direction: column;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-title {
    margin: 0 0 10px;
    padding-bottom: 0;
    border-bottom: none;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-title::after {
    display: none;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-author {
    margin: 0 0 0;
    padding-bottom: 0;
}
/* Three equal bands: green | yellow | red — between Teacher row and CLASS SIZE / meta row */
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--green-band) 0%,
        var(--green-band) 33.33%,
        var(--yellow) 33.33%,
        var(--yellow) 66.66%,
        var(--red-band) 66.66%,
        var(--red-band) 100%
    );
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-author .author-contain {
    display: block;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-author .author-contain label {
    display: inline;
    margin: 0 6px 0 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #999;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-author .author-contain .value {
    display: inline;
    font-size: 14px;
    font-weight: 700;
    color: #444;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 12px;
    margin-bottom: 0;
    padding: 14px 0 0;
    border-bottom: none;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta > div {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
    border-left: 1px dashed #efefef;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta > div:first-child {
    border-left: none;
    padding-left: 0;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta > div:last-child {
    padding-right: 0;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta > div label {
    margin-bottom: 4px;
}
/* Keep “CLASS SIZE” / “YEARS OLD” on one line; number stays on the row below */
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .class-size label,
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .year-old label {
    white-space: nowrap;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .course-price {
    flex: 1 1 0;
    text-align: right;
    margin-left: 0;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .course-price::before {
    content: "";
    display: block;
    height: 15px;
    margin-bottom: 4px;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .course-price .value {
    font-size: 18px;
    font-weight: 800;
    color: var(--red-band);
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-excerpt,
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-bottom-row {
    display: none;
}
/* Let title / author / meta follow original column flow in grid (meta no longer in third column) */
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-list-meta-actions {
    display: contents;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .class-size .value {
    color: var(--green-band);
    font-weight: 700;
}
:is(.course-archive-main,.course-single-related)[data-course-view="grid"] .course-meta .year-old .value {
    color: #e67e22;
    font-weight: 700;
}

/* ----- List view (列表): row layout, excerpt + CTA ----- */
.course-archive-main[data-course-view="list"] .thim-course-grid {
    margin: 0;
}
.course-archive-main[data-course-view="list"] .lpr_course {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}
.course-archive-main[data-course-view="list"] .lpr_course + .lpr_course {
    margin-top: 0;
}
.course-archive-main[data-course-view="list"] .course-item {
    display: grid;
    grid-template-columns: min(260px, 32vw) minmax(0, 1fr);
    gap: 0 22px;
    align-items: start;
    height: auto;
    padding: 22px 16px 22px 0;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 0;
    margin-bottom: 0;
}
.course-archive-main[data-course-view="list"] .lpr_course:first-child .course-item {
    border-top: 1px solid #e5e5e5;
}
.course-archive-main[data-course-view="list"] .thim-course-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    min-width: 0;
    padding: 0 8px 0 0;
    margin: 0;
    box-sizing: border-box;
}
.course-archive-main[data-course-view="list"] .course-list-text-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    min-width: 0;
}
.course-archive-main[data-course-view="list"] .course-list-text-stack .course-title {
    margin: 0 0 8px;
    font-size: clamp(18px, 2.5vw, 24px);
}
.course-archive-main[data-course-view="list"] .course-list-text-stack .course-author {
    margin: 0 0 10px;
}
.course-archive-main[data-course-view="list"] .course-list-text-stack .course-excerpt {
    margin: 0 0 12px;
    color: #777;
}
.course-archive-main[data-course-view="list"] .course-list-meta-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    width: 100%;
}
.course-archive-main[data-course-view="list"] .course-list-meta-actions .course-meta {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    border: none;
    min-width: 0;
}
.course-archive-main[data-course-view="list"] .course-list-meta-actions .course-bottom-row {
    flex: 0 0 auto;
    margin: 36px 0 0;
    padding: 0;
    border: none;
    justify-content: flex-end;
}
.course-archive-main[data-course-view="list"] .course-thumbnail {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    background: #eef2f0;
}
.course-archive-main[data-course-view="list"] .course-track-beginners .course-thumbnail {
    background: #e4f0dc;
}
.course-archive-main[data-course-view="list"] .course-track-intermediate .course-thumbnail {
    background: #ddeaf5;
}
.course-archive-main[data-course-view="list"] .course-thumbnail .thumb {
    height: 100%;
    min-height: 200px;
    aspect-ratio: 1;
}
.course-archive-main[data-course-view="list"] .course-readmore {
    display: none;
}
.course-archive-main[data-course-view="list"] .course-author .avatar {
    display: none;
}
.course-archive-main[data-course-view="list"] .course-author .author-contain {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    align-items: baseline;
}
.course-archive-main[data-course-view="list"] .course-author .author-contain label {
    margin: 0;
}
.course-archive-main[data-course-view="list"] .class-size,
.course-archive-main[data-course-view="list"] .year-old {
    display: none;
}
.course-archive-main[data-course-view="list"] .course-meta .course-price {
    text-align: left;
    margin-left: 0;
}
.course-archive-main[data-course-view="list"] .course-meta .course-price .value {
    font-size: 18px;
    color: var(--red-band);
}
.course-archive-main[data-course-view="list"] .course-bottom-row .price-repeat {
    display: none;
}
.course-archive-main[data-course-view="list"] .read-more-footer {
    display: inline-block;
    padding: 12px 24px;
    background: var(--yellow);
    color: #333 !important;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.course-archive-main[data-course-view="list"] .read-more-footer:hover {
    background: var(--yellow-dark);
    color: #222 !important;
    text-decoration: none;
}

@media (max-width: 767px) {
    .course-archive-main[data-course-view="list"] .course-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 18px 12px 18px 0;
    }
    .course-archive-main[data-course-view="list"] .thim-course-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        grid-column: auto;
        grid-row: auto;
        padding: 0;
    }
    .course-archive-main[data-course-view="list"] .course-list-text-stack {
        justify-content: flex-start;
    }
    .course-archive-main[data-course-view="list"] .course-thumbnail {
        grid-column: auto;
        grid-row: auto;
        max-width: none;
        width: 100%;
    }
    .course-archive-main[data-course-view="list"] .course-thumbnail .thumb {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
    .course-archive-main[data-course-view="list"] .course-list-meta-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .course-archive-main[data-course-view="list"] .course-list-meta-actions .course-bottom-row {
        align-self: flex-start;
    }
    .course-archive-main[data-course-view="list"] .course-author .avatar {
        display: block;
    }
}
