/* CourseBond — af-courses output overrides.
   Targets the actual class names emitted by aflc shortcodes and templates,
   re-skinning them as Udemy-inspired components. Inline plugin styles use
   no specificity boost, so plain selectors here win.

   Loaded after coursebond.css; uses :root tokens defined there. */

/* ==========================================================================
   Featured courses shortcode  →  Udemy course-card grid
   ========================================================================== */

.aflc-featured-courses {
    font-family: var(--cb-font);
    max-width: var(--cb-content-max);
    margin-inline: auto;
}

.aflc-featured-courses .section-title {
    font-size: 22px;
    font-weight: 700;
    text-align: left;
    color: var(--cb-text);
    margin: 32px 0 16px;
}

.aflc-featured-courses .courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
/* Override columns-N → flexible grid */
.aflc-featured-courses .courses-grid.columns-2,
.aflc-featured-courses .courses-grid.columns-3,
.aflc-featured-courses .courses-grid.columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.aflc-featured-courses .course-card {
    background: #fff;
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.aflc-featured-courses .course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cb-shadow-card-hover);
}

.aflc-featured-courses .badge-featured {
    background: var(--cb-purple);
    color: #fff;
    border-radius: var(--cb-radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    top: 12px;
    right: 12px;
}

.aflc-featured-courses .course-image {
    aspect-ratio: 16 / 9;
    background: var(--cb-bg);
}

.aflc-featured-courses .course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aflc-featured-courses .course-content {
    padding: 14px 16px 4px;
    flex: 1;
}

.aflc-featured-courses .course-content h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cb-text);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aflc-featured-courses .course-rating .stars {
    color: var(--cb-star);
    font-size: 13px;
    font-weight: 700;
}

.aflc-featured-courses .course-footer {
    background: transparent;
    border-top: 0;
    padding: 8px 16px 16px;
}

.aflc-featured-courses .course-footer .price {
    font-size: 14px;
    font-weight: 700;
    color: var(--cb-success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Course categories shortcode  →  Pill/tile grid
   ========================================================================== */

.aflc-course-categories,
.aflc-categories-grid {
    max-width: var(--cb-content-max);
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 0;
}

.aflc-course-categories a,
.aflc-categories-grid a,
.aflc-category-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: var(--cb-purple-soft);
    color: var(--cb-text) !important;
    border: 1px solid transparent;
    border-radius: var(--cb-radius-md);
    padding: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
    min-height: 100px;
}

.aflc-course-categories a:hover,
.aflc-categories-grid a:hover,
.aflc-category-card:hover {
    background: #fff;
    border-color: var(--cb-purple);
    color: var(--cb-purple) !important;
}

/* ==========================================================================
   Single course page  →  Udemy-style dark hero + sticky right rail
   ========================================================================== */

.afl-single-course {
    font-family: var(--cb-font);
    color: var(--cb-text);
}

/* --- dark hero --- */
.afl-course-header {
    background: var(--cb-dark);
    color: #fff;
    padding: 40px 0;
    margin: 0 0 32px;
}

.afl-course-header-content {
    max-width: var(--cb-content-max);
    margin-inline: auto;
    padding-inline: 24px;
}

.afl-course-breadcrumb {
    color: #d1d7dc;
    font-size: 13px;
    margin-bottom: 12px;
}
.afl-course-breadcrumb a { color: #d4baff; text-decoration: none; }

.afl-course-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin: 0 0 12px;
}

.afl-course-subtitle {
    color: #d1d7dc;
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.afl-course-subtitle .afl-course-code,
.afl-course-subtitle .afl-course-category {
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: var(--cb-radius-sm);
    font-size: 13px;
    color: #fff;
}

.afl-course-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #d1d7dc;
    font-size: 14px;
}
.afl-course-meta-row .afl-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.afl-course-header-image { display: none; } /* the big image gets re-used in card; hide in dark hero */

/* --- main + sidebar layout --- */
.afl-course-layout {
    max-width: var(--cb-content-max);
    margin-inline: auto;
    padding-inline: 24px;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 980px) {
    .afl-course-layout { grid-template-columns: 1fr; }
}

.afl-course-main { min-width: 0; }

.afl-course-section {
    margin-bottom: 32px;
    padding-bottom: 8px;
}
.afl-course-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--cb-text);
    margin: 0 0 16px;
}

.afl-course-description {
    line-height: 1.7;
    color: var(--cb-text);
    font-size: 16px;
}

.afl-objectives-list,
.afl-prerequisites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.afl-objectives-list li,
.afl-prerequisites-list li {
    position: relative;
    padding-left: 28px;
    line-height: 1.5;
    color: var(--cb-text);
}
.afl-objectives-list li .dashicons,
.afl-prerequisites-list li .dashicons {
    color: var(--cb-purple);
    position: absolute;
    left: 0;
    top: 2px;
}

/* --- curriculum accordion --- */
.afl-curriculum-accordion .afl-module-item {
    border: 1px solid var(--cb-border);
    border-bottom: 0;
    background: #fff;
}
.afl-curriculum-accordion .afl-module-item:last-child {
    border-bottom: 1px solid var(--cb-border);
}
.afl-curriculum-accordion .afl-module-header {
    background: var(--cb-bg);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.afl-curriculum-accordion .afl-module-number {
    background: var(--cb-purple);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.afl-curriculum-accordion .afl-module-title { flex: 1; }
.afl-curriculum-accordion .afl-module-toggle {
    transition: transform 0.15s;
}
.afl-curriculum-accordion .afl-module-item.is-open .afl-module-toggle {
    transform: rotate(180deg);
}
.afl-curriculum-accordion .afl-module-content {
    padding: 12px 16px;
}

/* --- instructor card --- */
.afl-instructor-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    background: #fff;
}
.afl-instructor-card img,
.afl-instructor-card .afl-instructor-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--cb-purple-soft);
}
.afl-instructor-info { flex: 1; }
.afl-instructor-info h3,
.afl-instructor-info .afl-instructor-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--cb-text);
}

/* --- sticky right rail --- */
.afl-course-sidebar {
    position: sticky;
    top: 24px;
    background: #fff;
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    box-shadow: var(--cb-shadow-card);
    padding: 24px;
}

.afl-course-sidebar .price,
.afl-course-sidebar .afl-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--cb-text);
    margin-bottom: 12px;
    display: block;
}
.afl-course-sidebar .free-label {
    color: var(--cb-success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.afl-course-sidebar .button,
.afl-course-sidebar .btn,
.afl-course-sidebar [type="submit"],
.afl-course-sidebar a.afl-enroll-btn,
.afl-course-sidebar a.button-primary {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--cb-purple);
    color: #fff !important;
    border: 0;
    padding: 14px 20px;
    border-radius: var(--cb-radius-sm);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    margin-bottom: 12px;
}
.afl-course-sidebar .button:hover,
.afl-course-sidebar .btn:hover,
.afl-course-sidebar a.afl-enroll-btn:hover {
    background: var(--cb-purple-hover);
}

.afl-course-sidebar ul,
.afl-course-sidebar .afl-includes {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--cb-text);
}
.afl-course-sidebar ul li,
.afl-course-sidebar .afl-includes li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Catalog (courses-catalog-page) shared rules
   ========================================================================== */
.aflc-courses-catalog,
.afl-courses-catalog {
    max-width: var(--cb-content-max);
    margin-inline: auto;
    padding: 24px;
}

/* ==========================================================================
   Student dashboard
   ========================================================================== */
.afl-student-dashboard {
    max-width: var(--cb-content-max);
    margin-inline: auto;
    padding: 24px;
    font-family: var(--cb-font);
}
.afl-student-dashboard h1,
.afl-student-dashboard h2 {
    color: var(--cb-text);
}
.afl-student-dashboard .afl-tab-nav {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--cb-border);
    margin-bottom: 24px;
}
.afl-student-dashboard .afl-tab-nav a {
    padding: 14px 4px;
    color: var(--cb-text-light);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.afl-student-dashboard .afl-tab-nav a.is-active,
.afl-student-dashboard .afl-tab-nav a.active {
    color: var(--cb-text);
    border-bottom-color: var(--cb-purple);
}

/* ==========================================================================
   Instructor profile
   ========================================================================== */
.aflc-instructor-profile,
.afl-instructor-profile {
    max-width: var(--cb-content-max);
    margin-inline: auto;
    padding: 24px;
    font-family: var(--cb-font);
}
.aflc-instructor-profile .afl-instructor-hero,
.afl-instructor-profile .hero {
    background: var(--cb-purple-soft);
    border-radius: var(--cb-radius-md);
    padding: 32px;
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}

/* ==========================================================================
   Buttons (generic af-courses primary buttons)
   ========================================================================== */
.aflc-btn-primary,
.afl-btn-primary,
.afl-button-primary {
    background: var(--cb-purple);
    color: #fff;
    border: 0;
    padding: 12px 20px;
    border-radius: var(--cb-radius-sm);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.aflc-btn-primary:hover,
.afl-btn-primary:hover,
.afl-button-primary:hover {
    background: var(--cb-purple-hover);
    color: #fff;
}

/* ---------- Instructor grid (cb_instructor_grid) ---------- */
.cb-instructor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin: 32px 0;
}
.cb-instructor-card {
    display: block;
    padding: 24px 16px;
    background: #fff;
    border: 1px solid var(--cb-border);
    border-radius: 6px;
    text-align: center;
    color: var(--cb-text);
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.cb-instructor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
}
.cb-instructor-photo {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--cb-bg);
}
.cb-instructor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cb-instructor-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--cb-dark);
}
.cb-instructor-title {
    font-size: 13px;
    color: var(--cb-text-light);
    margin: 0 0 8px;
}
.cb-instructor-bio {
    font-size: 14px;
    color: var(--cb-text);
    line-height: 1.5;
    margin: 0;
}
.cb-empty-state {
    padding: 48px 24px;
    text-align: center;
    background: var(--cb-bg);
    border-radius: 6px;
    margin: 32px 0;
}
.cb-empty-state .cb-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--cb-purple);
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 16px;
    text-decoration: none;
}
.cb-empty-state .cb-btn:hover { background: var(--cb-purple-hover); }
.cb-section-lead {
    font-size: 18px;
    color: var(--cb-text-light);
    margin: 0 0 32px;
    max-width: 720px;
}

/* ---------- Instructor profile shortcode notice ---------- */
.afl-ip-notice {
    padding: 32px 24px;
    text-align: center;
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 6px;
    color: var(--cb-text-light);
    font-size: 16px;
}

/* ---------- Contact page grid ---------- */
.cb-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin: 32px 0;
}
.cb-contact-card {
    padding: 32px 24px;
    background: #fff;
    border: 1px solid var(--cb-border);
    border-radius: 6px;
}
.cb-contact-card h3 {
    margin: 0 0 8px;
    color: var(--cb-dark);
    font-size: 20px;
    font-weight: 700;
}
.cb-contact-card p { margin: 8px 0; }
.cb-btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    color: var(--cb-purple);
    border: 2px solid var(--cb-purple);
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}
.cb-btn-secondary:hover {
    background: var(--cb-purple);
    color: #fff;
}

/* ===========================================================
 * Homepage hero & layout fixes (Udemy-styled)
 * =========================================================== */

/* Hide duplicate page title above the dark hero on home & on pages
 * whose primary content opens with our hero/grid components. */
body.home .hero-section,
body.home .entry-header,
body.page-id-6 .hero-section,
body.page-id-6 .entry-header { display: none !important; }

/* Trim the gap that Blocksy reserves for the missing entry-header. */
body.home .ct-container,
body.home .entry-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.home .entry-content > .cb-hero-dark:first-child { margin-top: 0 !important; }

/* ----- Force-white text inside dark hero (Blocksy h1 color override) ----- */
.cb-hero-dark,
.cb-hero-dark *,
.cb-hero-dark .cb-hero-dark__title,
.cb-hero-dark h1,
.cb-hero-dark h2 {
    color: #fff !important;
}
.cb-hero-dark .cb-hero-dark__tagline,
.cb-hero-dark p { color: #d1d7dc !important; }
.cb-hero-dark a { color: #d4baff !important; }
.cb-hero-dark .cb-btn--primary,
.cb-hero-dark a.cb-btn--primary {
    color: #fff !important;
    background: var(--cb-purple) !important;
    display: inline-block;
    padding: 14px 32px;
    font-weight: 700;
    font-size: 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s;
}
.cb-hero-dark a.cb-btn--primary:hover { background: var(--cb-purple-hover) !important; }

/* ----- Make the home dark hero feel like Udemy: bigger, full-width, real visual weight ----- */
body.home .cb-hero-dark {
    padding: 96px 24px 112px !important;
    margin-bottom: 64px !important;
    background:
        radial-gradient(ellipse at 80% 0%, rgba(107, 47, 179, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 0% 100%, rgba(107, 47, 179, 0.25) 0%, transparent 55%),
        var(--cb-dark) !important;
    border-radius: 0;
}
body.home .cb-hero-dark__inner {
    grid-template-columns: 1fr !important;
    text-align: left !important;
    max-width: 1200px;
}
body.home .cb-hero-dark__title {
    font-size: 56px !important;
    line-height: 1.1 !important;
    max-width: 720px;
    margin-bottom: 20px !important;
}
body.home .cb-hero-dark__tagline {
    font-size: 19px !important;
    line-height: 1.55;
    max-width: 620px;
    margin-bottom: 28px !important;
}

@media (max-width: 720px) {
    body.home .cb-hero-dark { padding: 56px 20px 64px !important; }
    body.home .cb-hero-dark__title { font-size: 36px !important; }
    body.home .cb-hero-dark__tagline { font-size: 16px !important; }
}

/* ----- Center home hero on small screens; left-align on desktop ----- */
body.home .cb-hero-dark__inner > div {
    width: 100%;
}

/* ----- Section headings (h2 spacing & weight to match Udemy "What students are learning") ----- */
body.home .cb-section-heading,
body.home h2.cb-section-heading {
    font-size: 28px !important;
    font-weight: 700 !important;
    margin: 48px 0 24px !important;
    color: var(--cb-dark) !important;
}

/* ----- Category cards: tone down the bright gradients, use Udemy-flat with hover ----- */
.aflc-course-categories .categories-grid.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}
.aflc-course-categories .category-card {
    background: #fff !important;
    color: var(--cb-text) !important;
    border: 1px solid var(--cb-border);
    border-radius: 6px;
    padding: 32px 24px !important;
    text-align: left !important;
    text-decoration: none;
    display: flex !important;
    flex-direction: column;
    min-height: 200px;
    justify-content: space-between;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.aflc-course-categories .category-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--cb-purple);
}
.aflc-course-categories .category-card h3 {
    color: var(--cb-dark) !important;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}
.aflc-course-categories .category-card p {
    color: var(--cb-text-light) !important;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
}
.aflc-course-categories .category-card .course-count {
    color: var(--cb-purple) !important;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 980px) {
    .aflc-course-categories .categories-grid.columns-4 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 540px) {
    .aflc-course-categories .categories-grid.columns-4 { grid-template-columns: 1fr !important; }
}

/* ----- Header: trim weight, give nav breathing room ----- */
[data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a {
    --theme-text-transform: none;
    --theme-font-weight: 500;
    --theme-font-size: 14px;
    --theme-link-initial-color: var(--cb-text);
}
[data-header*="type-1"] .ct-header [data-id="menu"] > ul > li > a:hover {
    color: var(--cb-purple) !important;
}

/* ----- Logo color ----- */
[data-header*="type-1"] .ct-header [data-id="logo"] .site-title {
    --theme-link-initial-color: var(--cb-purple);
}

/* ----- Header height tighter (Udemy-like) ----- */
[data-header*="type-1"] .ct-header [data-row*="middle"] { --height: 72px !important; }
[data-header*="type-1"] { --header-height: 72px !important; }

/* ----- Footer: dark like Udemy ----- */
[data-footer*="type-1"] .ct-footer { background-color: #1C1D1F !important; }
[data-footer*="type-1"] .ct-footer * { color: rgba(255,255,255,0.85); }
[data-footer*="type-1"] .ct-footer a { color: #fff !important; }
[data-footer*="type-1"] .ct-footer a:hover { color: #d4baff !important; }
[data-footer*="type-1"] .ct-footer .ct-footer-copyright { color: rgba(255,255,255,0.65) !important; }

/* ===========================================================
 * Header Login / Sign Up CTAs
 * =========================================================== */
.ct-header [data-id="menu"] .menu-item.cb-nav-cta { margin-left: 12px; }
.ct-header [data-id="menu"] .menu-item.cb-nav-cta > a {
    padding: 10px 18px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: none !important;
    line-height: 1 !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ct-header [data-id="menu"] .menu-item.cb-nav-cta--ghost > a {
    color: var(--cb-purple) !important;
    border: 1.5px solid var(--cb-purple) !important;
    background: #fff !important;
}
.ct-header [data-id="menu"] .menu-item.cb-nav-cta--ghost > a:hover {
    background: rgba(107, 47, 179, 0.08) !important;
    color: var(--cb-purple) !important;
}
.ct-header [data-id="menu"] .menu-item.cb-nav-cta--solid > a {
    color: #fff !important;
    background: var(--cb-purple) !important;
    border: 1.5px solid var(--cb-purple) !important;
}
.ct-header [data-id="menu"] .menu-item.cb-nav-cta--solid > a:hover {
    background: var(--cb-purple-hover) !important;
    color: #fff !important;
    border-color: var(--cb-purple-hover) !important;
}

/* Push the CTAs to the far right */
.ct-header [data-id="menu"] > ul {
    align-items: center;
}
.ct-header [data-id="menu"] > ul > li.cb-nav-cta:first-of-type {
    margin-left: auto !important;
}

/* Ensure the CTA dot or hover bar Blocksy adds doesn't interfere */
.ct-header [data-id="menu"] .menu-item.cb-nav-cta > a::after,
.ct-header [data-id="menu"] .menu-item.cb-nav-cta > a::before { display: none !important; }

@media (max-width: 999px) {
    .ct-header [data-id="menu"] .menu-item.cb-nav-cta > a {
        padding: 12px 16px !important;
    }
}

/* ===========================================================
 * Break cb-container out of WordPress's constrained-content layout
 * =========================================================== */
.entry-content.is-layout-constrained > .cb-container,
.entry-content.is-layout-constrained > .cb-hero-dark {
    max-width: var(--cb-content-max) !important;
    margin-inline: auto !important;
    width: 100% !important;
}

/* The dark hero on home should go FULL bleed, not just to 1340px */
body.home .entry-content.is-layout-constrained > .cb-hero-dark {
    max-width: none !important;
    margin-inline: 0 !important;
    width: auto !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Ensure the inner hero content stays centered to the 1200px column */
body.home .cb-hero-dark__inner {
    max-width: 1200px !important;
    margin-inline: auto !important;
}

/* Categories area inside cb-container should fill */
.cb-container .aflc-course-categories,
.cb-container .aflc-course-categories .categories-grid {
    width: 100% !important;
    max-width: none !important;
}

/* ===========================================================
 * Force full-width content area on home (override Blocksy's narrow
 * single-page constraint).
 * =========================================================== */
body.home article,
body.home article.post,
body.home .entry-content,
body.home .entry-content.is-layout-constrained {
    --wp--style--global--content-size: 1340px !important;
    --wp--style--global--wide-size: 1340px !important;
    max-width: 100% !important;
    width: 100% !important;
}

body.home .ct-container {
    max-width: 1340px !important;
    width: 100% !important;
    padding-inline: 24px !important;
    margin-inline: auto !important;
}

/* Make sure cb-container fills the available space */
body.home .entry-content > .cb-container {
    max-width: 1340px !important;
    width: 100% !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

/* WP layout constraint blocks override */
body.home .is-layout-constrained > * {
    max-width: 1340px !important;
}
body.home .is-layout-constrained > .cb-hero-dark {
    max-width: 100% !important;
}

/* Strip the inline gradient from category cards via attribute selector */
.aflc-course-categories .category-card[style*="linear-gradient"] {
    background: #fff !important;
    background-image: none !important;
}

/* ===========================================================
 * NUCLEAR OVERRIDE — pure descendant + !important + 5x specificity
 * Fix the squashed category grid no matter what the plugin emits.
 * =========================================================== */
html body.home main#main article div.entry-content div.cb-container,
html body.home main#main article div.entry-content div.cb-container .aflc-course-categories,
html body.home main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
html body.home div.cb-container .aflc-course-categories,
html body.home div.cb-container .aflc-course-categories .categories-grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}
html body.home div.cb-container .aflc-course-categories .categories-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}
html body.home div.cb-container .aflc-course-categories .categories-grid .category-card {
    min-width: 0 !important;
    width: auto !important;
    min-height: 200px !important;
    padding: 28px 24px !important;
    background: #fff !important;
    background-image: none !important;
    background-color: #fff !important;
    color: var(--cb-text) !important;
    border: 1px solid var(--cb-border) !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}
html body.home div.cb-container .aflc-course-categories .categories-grid .category-card h3 {
    color: var(--cb-dark) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
}
html body.home div.cb-container .aflc-course-categories .categories-grid .category-card p {
    color: var(--cb-text-light) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin: 0 0 12px !important;
    opacity: 1 !important;
}
html body.home div.cb-container .aflc-course-categories .categories-grid .category-card .course-count {
    background: rgba(107, 47, 179, 0.1) !important;
    color: var(--cb-purple) !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    display: inline-block !important;
}

@media (max-width: 980px) {
    html body.home div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 540px) {
    html body.home div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================================
 * Bring back the grid display — earlier nuclear rule wins on
 * specificity with display:block; this rewrites the grid
 * specifically with the same long selector.
 * =========================================================== */
html body.home main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
html body.home div.cb-container .aflc-course-categories .categories-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 980px) {
    html body.home main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
    html body.home div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 540px) {
    html body.home main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
    html body.home div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================================================
 * af-courses standalone catalog page (/courses/) — brand override
 * The plugin renders its own template at templates/public/courses-catalog-page.php
 * with namespace .afl-cat-*; we re-skin it to match CourseBond/Udemy purple.
 * =========================================================== */

/* ----- Page background ----- */
.afl-cat-body { background: #F7F9FA !important; color: var(--cb-text, #2D2F31) !important; }

/* ----- Top nav: dark + brand purple Sign Up ----- */
.afl-cat-nav { background: #1C1D1F !important; }
.afl-cat-nav__logo { color: #fff !important; }
.afl-cat-nav__signup,
.afl-cat-nav__links a.afl-cat-nav__signup {
    background: #6B2FB3 !important;
    color: #fff !important;
}
.afl-cat-nav__signup:hover,
.afl-cat-nav__links a.afl-cat-nav__signup:hover { background: #5A2497 !important; }

/* ----- Hero: dark with purple gradient (matches home hero) ----- */
.afl-cat-hero {
    background:
        radial-gradient(ellipse at 80% 0%, rgba(107, 47, 179, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 0% 100%, rgba(107, 47, 179, 0.25) 0%, transparent 55%),
        #1C1D1F !important;
    padding: 80px 0 64px !important;
}
.afl-cat-hero__title { color: #fff !important; font-size: 48px !important; }
.afl-cat-hero__sub { color: rgba(255,255,255,0.85) !important; }

/* ----- Search bar ----- */
.afl-cat-search-form { box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important; border-radius: 8px !important; }
.afl-cat-search-input { padding: 16px 20px !important; font-size: 16px !important; }
.afl-cat-search-btn,
.afl-cat-search-form button[type="submit"] {
    background: #6B2FB3 !important;
    color: #fff !important;
    padding: 16px 28px !important;
    font-weight: 700 !important;
    border-radius: 0 8px 8px 0 !important;
    border: none !important;
}
.afl-cat-search-btn:hover { background: #5A2497 !important; }

/* ----- Quick stats row under hero ----- */
.afl-cat-hero__stats { color: rgba(255,255,255,0.85) !important; }
.afl-cat-hero__stats strong { color: #fff !important; }

/* ----- Category pills ----- */
.afl-cat-pills__pill,
.afl-cat-pill {
    background: #fff !important;
    color: var(--cb-text, #2D2F31) !important;
    border: 1px solid #D1D7DC !important;
    border-radius: 999px !important;
    padding: 8px 18px !important;
    font-weight: 500 !important;
    transition: all 0.15s !important;
}
.afl-cat-pills__pill:hover,
.afl-cat-pill:hover {
    border-color: #6B2FB3 !important;
    color: #6B2FB3 !important;
    background: #fff !important;
}
.afl-cat-pills__pill--active,
.afl-cat-pill--active,
.afl-cat-pills__pill[aria-pressed="true"] {
    background: #1C1D1F !important;
    color: #fff !important;
    border-color: #1C1D1F !important;
}

/* ----- Sidebar filter labels ----- */
.afl-cat-filters h3,
.afl-cat-filter__label,
.afl-cat-filter__title {
    color: var(--cb-dark, #1C1D1F) !important;
    font-weight: 700 !important;
}
.afl-cat-filter__option input[type="radio"]:checked + span,
.afl-cat-filter__option input[type="checkbox"]:checked + span { color: #6B2FB3 !important; font-weight: 600 !important; }

/* ----- Course cards (Udemy-styled) ----- */
.afl-cat-course-card {
    background: #fff !important;
    border: 1px solid #D1D7DC !important;
    border-radius: 6px !important;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s !important;
}
.afl-cat-course-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px) !important;
}
.afl-cat-course-card__title { color: var(--cb-dark, #1C1D1F) !important; font-weight: 700 !important; }
.afl-cat-course-card__price,
.afl-cat-course-card__free {
    background: #6B2FB3 !important;
    color: #fff !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}
.afl-cat-course-card__rating { color: #E59819 !important; }

/* ----- Empty state ----- */
.afl-cat-empty,
.afl-cat-no-results {
    background: #fff !important;
    border: 1px solid #D1D7DC !important;
    border-radius: 6px !important;
    padding: 64px 24px !important;
    text-align: center !important;
}
.afl-cat-empty h3,
.afl-cat-no-results h3 { color: var(--cb-dark, #1C1D1F) !important; }

/* ----- Pagination ----- */
.afl-cat-pagination__page,
.afl-cat-pagination a {
    border: 1px solid #D1D7DC !important;
    border-radius: 4px !important;
    color: var(--cb-text, #2D2F31) !important;
    background: #fff !important;
}
.afl-cat-pagination__page--current,
.afl-cat-pagination a[aria-current="page"] {
    background: #6B2FB3 !important;
    color: #fff !important;
    border-color: #6B2FB3 !important;
}

/* ----- Generic plugin button color overrides ----- */
.afl-cat-body .btn-primary,
.afl-cat-body .button-primary,
.afl-cat-body button[type="submit"]:not(.afl-cat-pill),
.afl-cat-body .afl-btn-primary {
    background: #6B2FB3 !important;
    color: #fff !important;
    border-color: #6B2FB3 !important;
}
.afl-cat-body .btn-primary:hover,
.afl-cat-body .button-primary:hover {
    background: #5A2497 !important;
}

/* ===========================================================
 * Apply the same width-breakout rules sitewide (not just home).
 * Any page that uses .cb-container or .aflc-course-categories
 * should get full grid width, not the narrow constrained column.
 * =========================================================== */

/* Universal cb-container width breakout */
html body article div.entry-content div.cb-container,
html body article div.entry-content div.cb-container .aflc-course-categories,
html body article div.entry-content div.cb-container .aflc-course-categories .categories-grid {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

html body article div.entry-content div.cb-container {
    max-width: 1340px !important;
    margin-inline: auto !important;
    padding-inline: 24px !important;
}

/* Categories grid stays a 4-col grid sitewide */
html body article div.entry-content div.cb-container .aflc-course-categories .categories-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}

@media (max-width: 980px) {
    html body article div.entry-content div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 540px) {
    html body article div.entry-content div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Card itself stays Udemy-flat sitewide */
html body article div.entry-content div.cb-container .aflc-course-categories .category-card {
    background: #fff !important;
    background-image: none !important;
    color: var(--cb-text, #2D2F31) !important;
    border: 1px solid #D1D7DC !important;
    border-radius: 6px !important;
    padding: 28px 24px !important;
    min-height: 200px !important;
    text-decoration: none !important;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s !important;
}
html body article div.entry-content div.cb-container .aflc-course-categories .category-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px) !important;
    border-color: #6B2FB3 !important;
}
html body article div.entry-content div.cb-container .aflc-course-categories .category-card h3 {
    color: var(--cb-dark, #1C1D1F) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
}
html body article div.entry-content div.cb-container .aflc-course-categories .category-card p {
    color: var(--cb-text-light, #6A6F73) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin: 0 0 12px !important;
    opacity: 1 !important;
}
html body article div.entry-content div.cb-container .aflc-course-categories .category-card .course-count {
    background: rgba(107, 47, 179, 0.1) !important;
    color: #6B2FB3 !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    display: inline-block !important;
}

/* Make narrow content layout wider for ALL CourseBond pages, not just home */
body article,
body article.post,
body .entry-content.is-layout-constrained {
    --wp--style--global--content-size: 1340px !important;
    --wp--style--global--wide-size: 1340px !important;
}

/* Page title h1 (Blocksy entry-header) — keep, but tighten on category-list pages */
body.page-id-9 .entry-header { padding-bottom: 0 !important; margin-bottom: 0 !important; }
body.page-id-9 .entry-header .page-title { font-size: 36px !important; margin-bottom: 8px !important; }
body.page-id-9 .entry-content > h2:first-child { display: none !important; }

/* ===========================================================
 * UNIVERSAL FINAL WIDTH FIX — apply the same body.home width
 * breakout to EVERY page. Mirror the working homepage rules
 * but drop the body.home scope.
 * =========================================================== */

/* Force-wide content area on every page */
body article,
body article.post,
body .entry-content,
body .entry-content.is-layout-constrained {
    --wp--style--global--content-size: 1340px !important;
    --wp--style--global--wide-size: 1340px !important;
    max-width: 100% !important;
    width: 100% !important;
}

body .ct-container {
    max-width: 1340px !important;
    width: 100% !important;
    padding-inline: 24px !important;
    margin-inline: auto !important;
}

body .entry-content > .cb-container {
    max-width: 1340px !important;
    width: 100% !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

body .is-layout-constrained > * {
    max-width: 1340px !important;
}

/* Categories grid — same nuclear specificity as homepage (no body.home) */
html body main#main article div.entry-content div.cb-container,
html body main#main article div.entry-content div.cb-container .aflc-course-categories,
html body main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
html body div.cb-container .aflc-course-categories,
html body div.cb-container .aflc-course-categories .categories-grid {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

html body main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
html body div.cb-container .aflc-course-categories .categories-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 980px) {
    html body main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
    html body div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 540px) {
    html body main#main article div.entry-content div.cb-container .aflc-course-categories .categories-grid,
    html body div.cb-container .aflc-course-categories .categories-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Strip the inline gradient from category cards via attribute selector — universal */
html body .aflc-course-categories .category-card[style*="linear-gradient"] {
    background: #fff !important;
    background-image: none !important;
}

/* ===========================================================
 * [cb_categories_grid] — Udemy-style flat card grid
 * =========================================================== */
.cb-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 32px 0;
}
.cb-category-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid #D1D7DC;
    border-radius: 6px;
    text-decoration: none;
    color: #2D2F31;
    min-height: 200px;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.cb-category-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #6B2FB3;
    text-decoration: none;
}
.cb-category-card__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1C1D1F;
}
.cb-category-card__desc {
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
    color: #6A6F73;
    flex: 1;
}
.cb-category-card__count {
    background: rgba(107, 47, 179, 0.1);
    color: #6B2FB3;
    font-weight: 600;
    font-size: 12px;
    border-radius: 4px;
    padding: 4px 10px;
    align-self: flex-start;
}

@media (max-width: 980px) { .cb-categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .cb-categories-grid { grid-template-columns: 1fr; } }

/* ===========================================================
 * Hide Blocksy's auto page-title entry-header on all our static
 * pages so content can provide its own clean H1.
 * Skip on blog posts and insights articles where we want the title.
 * =========================================================== */
body.page .hero-section,
body.page .entry-header { display: none !important; }
body.page .ct-container > article > .entry-content,
body.page .ct-container > article {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Tighten section heading on pages that previously had a duplicate */
body.page .entry-content > h1,
body.page .entry-content > .cb-container > h1:first-child {
    font-size: 36px !important;
    margin: 0 0 24px !important;
    color: var(--cb-dark, #1C1D1F) !important;
}

/* Single blog posts keep their entry-header */
body.single-post .hero-section,
body.single-post .entry-header { display: block !important; }

/* ===========================================================
 * Clean page H1 (.cb-page-title) — Udemy-styled
 * =========================================================== */
.cb-page-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    color: #1C1D1F;
    margin: 32px 0 12px;
    letter-spacing: -0.5px;
}
.cb-section-lead {
    font-size: 18px;
    line-height: 1.6;
    color: #6A6F73;
    max-width: 720px;
    margin: 0 0 32px;
}
.cb-container .cb-page-title:first-child {
    margin-top: 32px;
}

@media (max-width: 720px) {
    .cb-page-title { font-size: 30px !important; }
    .cb-section-lead { font-size: 16px !important; }
}

/* ===========================================================
 * Udemy-style multi-column footer
 * =========================================================== */
.cb-footer-cols {
    background: #1C1D1F;
    color: rgba(255, 255, 255, 0.85);
    padding: 56px 24px 32px;
}
.cb-footer-cols__inner {
    max-width: 1340px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px;
}
.cb-footer-col h4 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: 0.2px;
}
.cb-footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.15s;
}
.cb-footer-col a:hover { color: #fff !important; }

.cb-footer-col--brand .cb-footer-logo {
    color: #fff !important;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}
.cb-footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.55;
    margin: 8px 0 0;
}

@media (max-width: 980px) {
    .cb-footer-cols__inner { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (max-width: 540px) {
    .cb-footer-cols__inner { grid-template-columns: 1fr; gap: 24px; }
    .cb-footer-cols { padding: 40px 20px 24px; }
}

/* Make Blocksy's footer bottom row sit on top of our cols */
[data-footer*="type-1"] .ct-footer { background-color: #1C1D1F !important; padding-top: 0 !important; }
[data-footer*="type-1"] .ct-footer [data-row*="bottom"] {
    background-color: #1C1D1F !important;
    padding-top: 16px !important;
    padding-bottom: 24px !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
}
[data-footer*="type-1"] [data-id="copyright"] {
    color: rgba(255,255,255,0.5) !important;
    font-size: 13px !important;
    text-align: center !important;
}
[data-footer*="type-1"] .ct-footer-copyright {
    color: rgba(255,255,255,0.5) !important;
}
[data-footer*="type-1"] .ct-footer-copyright a {
    color: rgba(255,255,255,0.7) !important;
}
[data-footer*="type-1"] .ct-footer-copyright a:hover {
    color: #fff !important;
}

/* =========================================================================
   Course landing — tame the floating purchase card
   The plugin pulls the rail up by -320px so the card hovers over the hero
   (Udemy effect). On our marketplace we show the cb-marketplace-header
   strip on top, then the plugin's afl-cp-nav directly under it (with a
   glass blur background). The card pulled up overlaps both, looking like
   a broken layout where the menu items bleed through the card image.
   Fix: keep the card visually anchored to the top of the hero (no negative
   margin), make the plugin nav solid + lower so it doesn't fight the
   header, and clamp the card max-height so it doesn't exceed the hero
   on tall layouts.
   ========================================================================= */
.afl-cp-page-grid__rail {
    /* Stop pulling the card above the hero — it was dragging up into the
       marketplace header + plugin nav region. */
    margin-top: 0 !important;
    /* Sit just below the marketplace header (which is sticky at top:0
       with z-index 90). The plugin nav sits between, so the card's
       sticky offset has to clear both. */
    top: calc(64px + 56px + 12px) !important;
    z-index: 5 !important;
}

/* Plugin's translucent in-page nav — make it solid white so the card
   doesn't show through it as a ghost image. Also lower its z-index
   below the marketplace header so the header always wins the stack. */
.afl-cp-nav {
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    /* Sticky offset matches header height so it parks under the
       marketplace header, not over it. */
    top: 64px !important;
    z-index: 80 !important;
}
@media (max-width: 760px) {
    .afl-cp-nav { top: 56px !important; }
    .afl-cp-page-grid__rail { top: calc(56px + 56px + 12px) !important; }
}

/* Hero "purchase-card style" sidebar should not extend above the page
   itself — bound the height so the curriculum below isn't pushed into
   the rail's wake. */
.afl-cp-pcard {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}
