/* Antigravity UI Overrides for Child-Friendly Experience */

/* 1. Clutter Reduction - (Restored by User Request) */
/* Top bar and email are kept visible now. */

/* 2. Typography & Readability */
body {
    font-size: 18px !important;
    line-height: 1.8 !important;
    /* Open spacing */
    color: #333 !important;
}

h1,
h2,
h3 {
    font-family: 'Roboto', 'Arial', sans-serif !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    letter-spacing: -0.5px;
}

/* Hero Heading specifics */
h1.elementor-heading-title,
.hero-content h1 {
    font-size: 3rem !important;
    /* Big & Bold */
    margin-bottom: 20px !important;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    /* Stronger shadow for contrast */
    color: #ffffff !important;
}

/* 3. Buttons (Clean White & Outline System) */

/* General Button Reset first */
button,
input[type="button"],
input[type="submit"],
.btn,
.button,
.wp-block-button__link {
    border-radius: 50px !important;
    padding: 14px 35px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    text-transform: capitalize !important;
}

/* Primary Button (First child or main CTAs) - Solid White */
/* We target specific Elementor/Theme classes for the "Primary" look */
.elementor-button-link:not(.elementor-size-md),
/* Usually the main hero button */
.wp-block-button__link,
.masteriyo-enroll-btn {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

.elementor-button-link:not(.elementor-size-md):hover,
.wp-block-button__link:hover,
.masteriyo-enroll-btn:hover {
    background: #f0f0f0 !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3) !important;
    color: #000 !important;
}

/* Secondary Button (Learn More type) - Transparent Outline */
/* Often the second button in a group, or specific secondary classes */
.elementor-button-link.elementor-size-md,
/* Adjust selector based on inspection if needed */
.btn-secondary {
    background: transparent !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    box-shadow: none !important;
}

.elementor-button-link.elementor-size-md:hover,
.btn-secondary:hover {
    background: #ffffff !important;
    color: #000000 !important;
}


/* FIX: Masteriyo View Toggles (Grid/List) */
/* Reset padding */
.view-mode {
    padding: 0 !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: unset !important;

    /* Make them dark so they stand out against white page bg */
    /* User wants to change orange. Let's make them Dark Blue. */
    background-color: #2c3e50 !important;
    background-image: none !important;
    /* Remove any potential gradients */
    border: none !important;
    border-radius: 50% !important;
    /* Circle */
}

/* Specific override for active state to ensure it doesn't go back to orange */
.view-mode.active,
.view-mode:hover {
    background-color: #34495e !important;
    background-image: none !important;
    transform: scale(1.1);
}

.view-mode svg {
    width: 24px !important;
    height: 24px !important;
    fill: #fff !important;
}

/* 4. Course Cards */
.masteriyo-course-item,
.masteriyo-course--card,
article.post {
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
    overflow: hidden;
}

.masteriyo-course-item:hover,
.masteriyo-course--card:hover,
article.post:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

/* 5. Top Bar */
.header-top,
.top-bar {
    background: #f8f9fa !important;
    border-bottom: 1px solid #eee !important;
    padding: 8px 0 !important;
}

.header-top span,
.header-top a {
    font-size: 0.9rem !important;
    color: #666 !important;
    font-weight: 500;
}

/* 6. Spacing */
.site-content {
    padding-top: 40px !important;
}

section,
article {
    margin-bottom: 60px !important;
}

/* =========================================
   7. FIXED: Footer Compact Styles
   ========================================= */
.site-footer {
    padding: 2rem 0 !important;
    background: #020205 !important;
}

.site-footer .custom-logo {
    max-width: 60px !important;
    height: auto !important;
}

.site-footer .widget {
    margin-bottom: 1.5rem !important;
}

.site-footer p,
.site-footer li,
.site-footer a {
    font-size: 0.9rem !important;
}

/* =========================================
   8. FIXED: Hero Section Styles
   ========================================= */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

/* Primary Button (White) */
.btn-primary {
    background: white !important;
    color: #333 !important;
    border: 2px solid white !important;
}

.btn-primary:hover {
    background: #f0f0f0 !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Secondary Button (Transparent White) */
.btn-secondary {
    background: transparent !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

.btn-secondary:hover {
    background: white !important;
    color: #333 !important;
    border-color: white !important;
}

/* =========================================
   9. FIXED: Masteriyo Course Card Styles
   ========================================= */
.masteriyo-archive-card {
    border-radius: 20px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.4s ease !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.masteriyo-archive-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

.masteriyo-archive-card__image {
    position: relative;
    overflow: hidden;
}

.masteriyo-archive-card__image img {
    transition: transform 0.5s ease !important;
    width: 100%;
    height: 200px;
    /* Force consistent height */
    object-fit: cover;
}

.masteriyo-archive-card:hover .masteriyo-archive-card__image img {
    transform: scale(1.05);
}

.masteriyo-archive-card__content {
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.masteriyo-course-title {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
}

/* Buy Now Button in Card */
/* Buy Now Button in Card - SCOPED TO CARD ONLY */
.masteriyo-archive-card .masteriyo-btn-primary.masteriyo-start-continue-btn,
.masteriyo-archive-card .masteriyo-btn {
    background: #3a72d3 !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    width: 100%;
    text-align: center;
    margin-top: auto;
}

.masteriyo-btn-primary.masteriyo-start-continue-btn:hover,
.masteriyo-archive-card .masteriyo-btn:hover {
    background: #2159ba !important;
    /* Darker Blue */
    color: white !important;
}

/* Price Tag */
.masteriyo-course-price {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #27ae60 !important;
    /* Green for price */
    margin-bottom: 1rem;
}

/* =========================================
   15. Course Card Component Styling (Universal)
   ========================================= */

/* Category Badge */
/* Category Badge - SCOPED */
.masteriyo-archive-card .masteriyo-course-category a,
.masteriyo-archive-card .masteriyo-course-category span {
    display: inline-block !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    border: 1px solid #E2E8F0 !important;
    font-size: 0.75rem !important;
    color: #805AD5 !important;
    background: #fff !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    text-decoration: none !important;
    line-height: normal !important;
}

.masteriyo-course-category a:hover {
    background-color: #f8f8f8 !important;
    color: #6B46C1 !important;
}

/* Title */
/* Title - SCOPED */
.masteriyo-archive-card .masteriyo-course--content__title,
.masteriyo-archive-card .masteriyo-course-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #1A202C !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
}

.masteriyo-course--content__title a,
.masteriyo-course-title a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Author & Rating Wrapper */
.masteriyo-course-author-rating-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    width: 100% !important;
}

/* Author Section */
.masteriyo-course-author {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

/* HIDE the old avatar image that appears before the email link */
.masteriyo-course-author>a:first-child {
    display: none !important;
}

.masteriyo-course-author a.author-email-link {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: #4A5568 !important;
    /* Gray Text */
    font-size: 0.9rem !important;
}

/* Author Icon (The SVG we added) */
.masteriyo-course-author a.author-email-link svg {
    width: 32px !important;
    height: 32px !important;
    padding: 6px !important;
    background-color: #E2E8F0 !important;
    /* Gray Circle Background */
    border-radius: 50% !important;
    fill: #fff !important;
    /* White Icon */
    margin-right: 8px !important;
    flex-shrink: 0 !important;
}

/* Rating Section */
.masteriyo-rating {
    display: flex !important;
    align-items: center !important;
    font-size: 0.9rem !important;
    color: #718096 !important;
}

.masteriyo-rating .masteriyo-icon-svg svg,
.masteriyo-rating svg {
    width: 16px !important;
    height: 16px !important;
    fill: #ECC94B !important;
    /* Yellow Star */
    stroke: #ECC94B !important;
    margin-right: 4px !important;
}

/* Meta Data (Duration, Students, Lessons) */
/* Targeted via likely generic wrapper or list class */
.masteriyo-course-meta,
.masteriyo-course-meta-data {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1px solid #EDF2F7 !important;
    padding-top: 12px !important;
    margin-top: auto !important;
    /* Push to bottom if flex column */
    color: #718096 !important;
    font-size: 0.85rem !important;
}

/* Meta Items */
.masteriyo-course-meta-item,
.masteriyo-meta-item {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.masteriyo-course-meta-item svg,
.masteriyo-meta-item svg {
    width: 16px !important;
    height: 16px !important;
    fill: #A0AEC0 !important;
    /* Light Gray Icon */
    stroke: #A0AEC0 !important;
}

/* Price Formatting (if visible in grid) */
.masteriyo-course-price {
    font-weight: 700 !important;
    color: #2D3748 !important;
    font-size: 1.1rem !important;
}

/* =========================================
   10. FIXED: Home Page Course Card Centering & Truncation Fix
   ========================================= */
.home .masteriyo-courses-wrapper {
    display: flex !important;
    justify-content: center !important;
    gap: 30px !important;
    margin: 0 auto !important;
    width: 100% !important;
    flex-wrap: wrap !important;
}

/* Ensure the columns take up proper space for a list view */
.home .masteriyo-courses-wrapper .masteriyo-col {
    flex: 0 0 100% !important;
    /* Allow full width so it doesn't squash */
    width: 100% !important;
    max-width: 1000px !important;
    /* Reasonable max-width for a list card */
    display: flex !important;
    justify-content: center !important;
}

/* Ensure the inner card is wide enough and content flows properly */
.home .masteriyo-courses-wrapper .masteriyo-course--card {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    /* Take full available space from col */
    margin: 0 auto !important;
    display: flex !important;
    /* Ensure content side-by-side if it's list view */
    flex-direction: row !important;
    /* Force row for list view */
    flex-wrap: wrap !important;
    /* Allow wrapping on small screens */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .home .masteriyo-courses-wrapper .masteriyo-course--card {
        flex-direction: column !important;
    }
}

/* Fix Title Truncation/Overlap - Corrected Selector */
.home .masteriyo-course--content__title,
.home .masteriyo-course-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    /* 'clip' can sometimes look like truncation if overflows container */
    height: auto !important;
    line-height: 1.4 !important;
    margin-bottom: 15px !important;
    padding-right: 15px !important;
    /* Add padding to prevent touching the aside */
    font-size: 1.3rem !important;
    width: 100% !important;
    display: block !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.home .masteriyo-course--content__title a {
    white-space: normal !important;
    display: inline !important;
    /* Inline allows wrapping naturally */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Ensure content wrapper layout */
.home .masteriyo-course--content {
    height: auto !important;
    min-height: 220px !important;
    /* Ensure enough height for everything */
    flex: 1 1 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    /* Keep side-by-side but manage shrinking */
    align-items: flex-start !important;
    /* Align top */
    padding: 20px !important;
}

.home .masteriyo-course--content__wrapper {
    flex: 1 1 auto !important;
    /* Grow and shrink */
    min-width: 0 !important;
    /* Critical for wrapping */
    width: 0 !important;
    /* Also helps force browser to respect flex shrink */
    padding-right: 20px !important;
    max-width: 100% !important;
}

.home .masteriyo-course-archive--aside {
    flex: 0 0 220px !important;
    /* Fixed width for the price/button area */
    width: 220px !important;
    margin-left: auto !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Mobile: Stack them */
@media (max-width: 900px) {
    .home .masteriyo-course--content {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
    }

    .home .masteriyo-course--content__wrapper {
        width: 100% !important;
        padding-right: 0 !important;
        margin-bottom: 20px !important;
    }

    .home .masteriyo-course-archive--aside {
        width: 100% !important;
        flex: 0 0 auto !important;
        margin-left: 0 !important;
    }
}

/* =========================================
   11. FIXED: Masteriyo List View Support
   ========================================= */

/* When List View is active on Archive Pages */
/* When List View is active on Archive Pages */
.masteriyo-courses-wrapper.list-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    /* Removed width: 100% to prevent pushing sidebar down */
}

/* Make columns full width in list view */
.masteriyo-courses-wrapper.list-view .masteriyo-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-bottom: 0 !important;
    /* Managed by gap */
}

/* Switch card to row layout */
/* Switch card to row layout - COMPACT HORIZONTAL (High Specificity) */
body .masteriyo-courses-wrapper.list-view .masteriyo-archive-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    /* Ensure full height stretch */
    min-height: 160px !important;
    /* Reduced Min Height */
    width: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #fff !important;
}

/* Adjust Image in List View - MINIMIZED LEFT */
body .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image {
    width: 150px !important;
    /* Minimized Width */
    flex: 0 0 150px !important;
    height: auto !important;
    min-height: 100% !important;
}

body .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
}

/* Adjust Content in List View - MIDDLE */
body .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__content {
    padding: 25px !important;
    /* Override Force Plugin */
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    width: auto !important;
}

/* Ensure Side Button Area is RIGHT */
body .masteriyo-courses-wrapper.list-view .masteriyo-course-archive--aside {
    flex: 0 0 200px !important;
    /* Standard Sidebar Width */
    width: 200px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    border-left: 1px solid #f0f0f0 !important;
    border-top: none !important;
    background: #fff !important;
    height: auto !important;
    min-height: 100% !important;
    /* Ensure sidebar stretches */
}

body .masteriyo-courses-wrapper.list-view .masteriyo-course-archive--aside .masteriyo-btn {
    width: 100% !important;
    padding: 10px 20px !important;
    /* Standard Button */
    font-size: 0.95rem !important;
    margin-top: 0 !important;
    /* Center alignment handled by flex */
}

/* Ensure Title and Meta wrap properly */
.masteriyo-courses-wrapper.list-view .masteriyo-course-title {
    width: 100% !important;
    margin-bottom: 10px !important;
}

/* Align Author/Rating Row */
.masteriyo-courses-wrapper.list-view .masteriyo-archive-card__content--rating {
    margin-bottom: 15px !important;
}

/* Responsive adjustment for List View */
@media (max-width: 768px) {
    .masteriyo-courses-wrapper.list-view .masteriyo-archive-card {
        flex-direction: column !important;
    }

    .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image {
        width: 100% !important;
        height: 200px !important;
    }
}

/* =========================================
   12. FIXED: Account Page Footer List Alignment
   ========================================= */
/* Target list items in the footer to ensure icon and text are inline */
.site-footer ul li,
.site-footer ol li,
.masteriyo-account-page .site-footer ul li {
    display: flex !important;
    align-items: flex-start !important;
    /* vertical align top in case text wraps */
    gap: 10px !important;
    margin-bottom: 8px !important;
    flex-wrap: nowrap !important;
}

/* Ensure icons (SVG, Image, Icon fonts) don't break lines */
.site-footer ul li svg,
.site-footer ul li img,
.site-footer ul li i,
.site-footer ul li .icon {
    flex-shrink: 0 !important;
    margin-top: 5px !important;
    /* Slight adjust for text baseline */
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    max-width: 20px !important;
    /* Restrict icon size */
}

/* Ensure text stays within bounds */
.site-footer ul li span,
.site-footer ul li a {
    display: inline-block !important;
    /* Or inline */
    flex: 1 1 auto !important;
    width: auto !important;
}

/* Specific fix for Elementor Icon List if used */
.elementor-icon-list-item {
    display: flex !important;
    align-items: flex-start !important;
}


.elementor-icon-list-icon {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    height: auto !important;
    margin-right: 10px !important;
}

/* =========================================
   13. FIXED: Footer Social Icons Horizontal Alignment
   ========================================= */
.site-footer .social-icons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    /* Center align by default, or flex-start */
    align-items: center !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 20px 0 !important;
    width: 100% !important;
}

.site-footer .social-icons li {
    display: inline-flex !important;
    margin-bottom: 0 !important;
    width: auto !important;
}

.site-footer .social-icons li a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    /* Assuming dark footer */
    transition: transform 0.3s ease !important;
}


.site-footer .social-icons li a:hover {
    transform: translateY(-3px) !important;
    color: var(--masteriyo-color-primary) !important;
}

.site-footer .social-icons li a svg {
    width: 24px !important;
    height: 24px !important;
    fill: none !important;
    /* These are outline icons, do not fill */
    stroke: currentColor !important;
    /* Use stroke for color */
    stroke-width: 2 !important;
}

/* =========================================
   14. FIXED: Course View Toggle & List Layout
   ========================================= */

/* Active State for View Buttons */
.view-mode.active,
.view-mode:focus,
.view-mode.current,
.view-switcher button.active,
.masteriyo-view-switcher button.active {
    background-color: #6C5DD3 !important;
    /* Purple/Blue from image */
    color: #fff !important;
    opacity: 1 !important;
    border-color: #6C5DD3 !important;
    transform: none !important;
    /* Remove scale */
    border-radius: 6px !important;
    /* Rounded square */
}

.view-mode,
.view-switcher button,
.masteriyo-view-switcher button {
    background-color: #fff !important;
    /* White background */
    border: 1px solid #e0e0e0 !important;
    /* Light border */
    color: #a0a0a0 !important;
    /* Light Icon */
    border-radius: 6px !important;
    /* Rounded square */
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin-left: 5px !important;
}

.view-mode:hover,
.view-switcher button:hover,
.masteriyo-view-switcher button:hover {
    border-color: #6C5DD3 !important;
    color: #6C5DD3 !important;
    background-color: #fff !important;
}

.view-mode.active svg,
.view-mode:focus svg,
.view-switcher button.active svg,
.masteriyo-view-switcher button.active svg {
    fill: #fff !important;
    /* Ensure icon is white when active */
}

.view-mode svg,
.view-switcher button svg,
.masteriyo-view-switcher button svg {
    fill: currentColor !important;
    /* Use text color */
    width: 20px !important;
    height: 20px !important;
}

/* ------------------------------------------------
   List View Implementation (Targeting course-list-view)
   ------------------------------------------------ */

/* Wrapper: Switch to Block to stack items */
.masteriyo-courses-wrapper.course-list-view,
.masteriyo-courses-wrapper.list-view {
    display: block !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Columns: Full Width */
.masteriyo-courses-wrapper.course-list-view .masteriyo-col,
.masteriyo-courses-wrapper.list-view .masteriyo-col {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 25px !important;
    padding: 0 !important;
    /* Remove col padding */
}

/* Card: Horizontal Flex Layout */
.masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card,
.masteriyo-courses-wrapper.list-view .masteriyo-archive-card {
    flex-direction: row !important;
    height: auto !important;
    min-height: 200px !important;
    border: 1px solid #edf2f7 !important;
    align-items: stretch !important;
    /* Match heights */
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02) !important;
}

/* Image: Left Side, Fixed Width, Padded */
.masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__image,
.masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image {
    width: 280px !important;
    flex: 0 0 280px !important;
    height: auto !important;
    /* Let it fill vertical space */
    position: relative !important;
    padding: 15px !important;
    /* Inner padding like image */
}

.masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__image img,
.masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    /* Rounded image corners inside card */
    position: relative !important;
}

/* Content: Center Area */
.masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__content,
.masteriyo-courses-wrapper.list-view .masteriyo-archive-card__content {
    flex: 1 1 auto !important;
    /* Grow to fill space */
    padding: 25px 25px 25px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    border-right: 1px solid #edf2f7 !important;
    /* Separator for price */
}

/* Title in List View */
.masteriyo-courses-wrapper.course-list-view .masteriyo-course-title,
.masteriyo-courses-wrapper.list-view .masteriyo-course-title {
    font-size: 1.3rem !important;
    margin-bottom: 12px !important;
    white-space: normal !important;
    /* Ensure wrapping */
    color: #2D3748 !important;
}

/* Action Area: Right Side (Price + Button) */
/* Targeted by assumption of layout structure or helper classes */
.masteriyo-courses-wrapper.course-list-view .masteriyo-course-action,
.masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__footer,
.masteriyo-courses-wrapper.course-list-view .masteriyo-course-meta-wrapper:last-child {
    /* If this exists as a footer */
    flex: 0 0 220px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    background: #fff !important;
    /* White background matching image */
}

/* Price specific */
.masteriyo-courses-wrapper.course-list-view .masteriyo-course-price,
.masteriyo-courses-wrapper.list-view .masteriyo-course-price {
    font-size: 1.5rem !important;
    color: #2D3748 !important;
    margin-bottom: 15px !important;
    font-weight: 700 !important;
}

/* Button specific */
.masteriyo-courses-wrapper.course-list-view .masteriyo-btn,
.masteriyo-courses-wrapper.list-view .masteriyo-btn {
    width: 100% !important;
    max-width: 160px !important;
    background-color: #4285F4 !important;
    /* Blue button */
    border-radius: 6px !important;
}

/* Responsive adjustments for List View */
@media (max-width: 900px) {

    .masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card,
    .masteriyo-courses-wrapper.list-view .masteriyo-archive-card {
        flex-direction: column !important;
    }

    .masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__image,
    .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image {
        width: 100% !important;
        height: 200px !important;
        position: relative !important;
    }

    .masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__image img,
    .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__image img {
        position: relative !important;
        height: 200px !important;
    }

    .masteriyo-courses-wrapper.course-list-view .masteriyo-archive-card__content,
    .masteriyo-courses-wrapper.list-view .masteriyo-archive-card__content {
        border-right: none !important;
    }
}

/* HIDE COURSE VIEW SWITCHER (Select View Option) */
.masteriyo-course-archive-toolbar .layout-view-switch,
.masteriyo-view-switcher,
.masteriyo-course-filter .view-switcher,
.masteriyo-course-layout-view-changer,
.view-switcher-list,
.view-switcher-grid,
.masteriyo-archive-header-wrapper .view-switches {
    display: none !important;
}

/* =========================================
   13. HOME PAGE FEATURE BLOCKS GRID (User Request)
   ========================================= */

/* The Grid Container - Target Home Columns */
.home .wp-block-columns {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    /* 4 Columns */
    gap: 24px !important;
    /* Horizontal Gap */
    row-gap: 40px !important;
    /* Vertical Gap between row 1 and 2 */
    margin-bottom: 40px !important;
    align-items: start !important;
    /* Prevent stretching if content differs */
}

/* The Feature Card */
.home .wp-block-column {
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
    text-align: center !important;

    /* Reset Gutenberg Column widths to let Grid handle it */
    width: auto !important;
    max-width: 100% !important;
    flex-basis: auto !important;
    margin: 0 !important;
    /* Grid handles spacing */
    min-width: 0 !important;

    /* Flex content for inner vertical alignment */
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    transition: transform 0.2s ease !important;
    height: 100% !important;
    /* Equal heights */
}

/* Hover Lift */
.home .wp-block-column:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
    border-color: #e2e8f0 !important;
}

/* Preserve Icons/Content */
.home .wp-block-column figure,
.home .wp-block-column img {
    margin: 0 auto 16px auto !important;
    display: block !important;
    height: auto !important;
    /* Ensure icon isn't distorted */
}

.home .wp-block-column h3,
.home .wp-block-column h4,
.home .wp-block-column strong {
    margin-bottom: 12px !important;
    color: #1a202c !important;
    width: 100% !important;
    display: block !important;
}

.home .wp-block-column p {
    font-size: 0.95rem !important;
    color: #4a5568 !important;
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
}

/* Responsive: Tablet (2 Cols) */
@media (max-width: 1024px) {
    .home .wp-block-columns {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

/* Responsive: Mobile (1 Col) */
@media (max-width: 600px) {
    .home .wp-block-columns {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* =========================================
   14. SEARCH & FILTER ALIGNMENT (Course Page)
   ========================================= */

/* The Toolbar Container */
.masteriyo-archive-header-wrapper,
.masteriyo-course-archive-toolbar,
.masteriyo-search-section {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 20px !important;
    margin: 64px 0 !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

/* Hide empty phantoms */
.masteriyo-search-section>*:empty,
.masteriyo-course-archive-toolbar>*:empty {
    display: none !important;
}

/* Search Wrapper - Expands */
.masteriyo-search {
    flex: 1 1 auto !important;
    max-width: 600px !important;
    min-width: 300px !important;
}

/* Sort Section - Far Right */
.masteriyo-courses-sorting-section,
.masteriyo-course-filter {
    margin-left: auto !important;
    flex: 0 0 240px !important;
    display: flex !important;
    align-items: center !important;
    height: 52px !important;
}

form.masteriyo-course-search,
.masteriyo-course-search {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    background: #fff !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Search Icon */
.masteriyo-course-search__icon {
    position: absolute !important;
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    pointer-events: none !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
}

form.masteriyo-course-search input[type="search"],
form.masteriyo-course-search input[type="text"],
.masteriyo-course-search input {
    flex: 1 !important;
    order: 1 !important;
    border-radius: 10px 0 0 10px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0 20px 0 50px !important;
    /* Left space for icon */
    font-size: 15px !important;
    background-color: #fff !important;
    color: #1e293b !important;
    margin: 0 !important;
    height: 52px !important;
    box-sizing: border-box !important;
    width: auto !important;
    outline: none !important;
}

form.masteriyo-course-search input::placeholder,
.masteriyo-course-search input::placeholder,
form.masteriyo-course-search input[type="search"]::placeholder,
form.masteriyo-course-search input[type="text"]::placeholder {
    color: #000000 !important;
    /* Absolute Black for max visibility */
    opacity: 1 !important;
    font-weight: 500 !important;
    line-height: normal !important;
}

/* Chrome, Safari, Edge */
form.masteriyo-course-search input::-webkit-input-placeholder,
.masteriyo-course-search input::-webkit-input-placeholder {
    color: #000000 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

/* Firefox 19+ */
form.masteriyo-course-search input::-moz-placeholder,
.masteriyo-course-search input::-moz-placeholder {
    color: #000000 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

/* IE 10-11 */
form.masteriyo-course-search input:-ms-input-placeholder,
.masteriyo-course-search input:-ms-input-placeholder {
    color: #000000 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

/* Edge 12-18 */
form.masteriyo-course-search input::-ms-input-placeholder,
.masteriyo-course-search input::-ms-input-placeholder {
    color: #000000 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

/* Search Button */
form.masteriyo-course-search button {
    order: 2 !important;
    position: relative !important;
    height: 52px !important;
    padding: 0 30px !important;
    border-radius: 0 10px 10px 0 !important;
    background: #4175FC !important;
    color: white !important;
    font-weight: 600 !important;
    border: 1px solid #4175FC !important;
    cursor: pointer !important;
    z-index: 2 !important;
    line-height: normal !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

/* Sort Dropdown styling */
.masteriyo-courses-order-by,
.masteriyo-course-filter select {
    height: 52px !important;
    width: 100% !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0 40px 0 15px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 15px center !important;
    background-size: 16px !important;
    color: #1e293b !important;
    font-size: 15px !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .masteriyo-archive-header-wrapper,
    .masteriyo-course-archive-toolbar,
    .masteriyo-search-section {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    .masteriyo-search,
    .masteriyo-courses-sorting-section,
    .masteriyo-course-filter {
        width: 100% !important;
        max-width: none !important;
        flex: 1 1 auto !important;
        margin-left: 0 !important;
    }
}

/* Bold Navigation for Logged Out users on Account Page ONLY */
body:not(.logged-in).masteriyo-account-page .site-header #main-navigation a,
body:not(.logged-in).masteriyo-account-page .site-header .main-navigation a,
body:not(.logged-in).woocommerce-account:not(.logged-in) .site-header a {
    font-weight: 800 !important;
}

/* -------------------------------------------------------------------------
   HEADER ALIGNMENT SYNC (LOCATION & LOGO)
   Targets: Courses Page, Explore Courses, Contact
   Strictly excludes Home, Blog, and Account pages per user request.
   ------------------------------------------------------------------------- */

/* 1. Page Scoping (Only applied to Courses and Contact) */
body.post-type-archive-mto-course,
body.mto-course-archive,
body.single-mto-course,
body.mto-single-course,
body.contact {
    --header-sync-active: true;
}

/* 2. Precision Alignment Implementation */
@media (min-width: 992px) {

    body.post-type-archive-mto-course,
    body.mto-course-archive,
    body.single-mto-course,
    body.mto-single-course,
    body.contact {

        /* Step 1: Force Edge-to-Edge Container for perfect starting line */
        #top-navigation .header-content-wrapper,
        .site-header .header-content-wrapper {
            max-width: 100% !important;
            margin: 0 !important;
            padding-left: 60px !important;
            /* Unified Left Alignment Start */
            padding-right: 60px !important;
            display: flex !important;
            justify-content: space-between !important;
            width: 100% !important;
        }

        /* Step 2: Remove internal padding/margins from 1st items */
        /* Top Bar: Location */
        #top-navigation ul,
        #top-navigation li.location,
        #top-navigation li:first-child {
            padding-left: 0 !important;
            margin-left: 0 !important;
            display: flex !important;
            align-items: center !important;
        }

        /* Main Header: Branding */
        .site-branding,
        .custom-logo-link {
            padding-left: 0 !important;
            margin-left: 0 !important;
            display: flex !important;
            align-items: center !important;
        }

        /* Support for text "EdVal" if logo is separate */
        .site-title {
            margin-left: 10px !important;
            /* Small gap between logo and text */
        }

        /* Step 3: Keep other elements on the right */
        #main-navigation {
            margin-left: auto !important;
        }

        .social-navigation,
        #top-navigation .header-social-icons {
            margin-left: auto !important;
        }
    }
}

/* Revert/Clean up for previous pages (Home, Blog) */
body.home .header-content-wrapper,
body.blog .header-content-wrapper {
    max-width: 1200px !important;
    /* Restore standard container */
    margin: 0 auto !important;
    padding-left: 15px !important;
}

/* 3. Explicit Protection for Courses Pages (Override) */
body.post-type-archive-mto-course .header-content-wrapper,
body.single-mto-course .header-content-wrapper {
    max-width: 1400px !important;
    /* Original width for courses */
}

/* End Precision Alignment */