/**
 * Course Board – Course-Specific Styles
 * Extends the core job-board styles with course card UI.
 *
 * Depends on: job-board-base.css, job-board-layout.css,
 *             job-board-cards.css, job-board-filters.css
 */

/* ============================================================================
   PAGE WRAPPER & HEADER SPACING FIX
   ============================================================================ */

body.page-template-template-courses-page #main,
body.page-courses #main,
body.page-template-template-courses-page .ct-container,
body.page-template-template-courses-page .entry-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    max-width: none !important;
}

/* Match /jobs page header wrapper layout */
#job-board-wrapper.course-board-page,
body.page-template-template-courses-page #job-board-wrapper,
body.page-courses #job-board-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Page header spacing matching /jobs page (120px top padding fills area behind header) */
body.page-template-template-courses-page .job-board-main-header,
body.page-courses .job-board-main-header {
    padding: 120px 20px 30px 20px !important;
    margin-top: 0 !important;
}

body.page-template-template-courses-page .discover-header h1,
body.page-courses .discover-header h1 {
    padding-top: 50px !important;
    margin: 0 0 20px 0 !important;
}

body.page-template-template-courses-page #course-search-form,
body.page-courses #course-search-form {
    margin-top: 28px !important;
}

/* Ensure subtitle description stays on a single line on desktop */
@media (min-width: 769px) {
    .discover-header .category-description {
        max-width: 900px !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 768px) {
    body.page-template-template-courses-page #course-search-form,
    body.page-courses #course-search-form {
        margin-top: 22px !important;
    }
}

/* ============================================================================
   COURSES GRID
   ============================================================================ */

.courses-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .courses-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================================
   COURSE CARD
   ============================================================================ */

.course-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    list-style: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.course-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ── Thumbnail ────────────────────────────────────────────────────────────── */

.course-card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #0d2a1f 0%, #1a5c3a 50%, #4ecca3 100%);
    flex-shrink: 0;
}

.course-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.course-card:hover .course-card-thumbnail img {
    transform: scale(1.04);
}

.course-card-thumbnail--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-card-thumbnail--placeholder span {
    font-family: 'Louize', serif;
    font-size: 56px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
    text-transform: uppercase;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1, "onum" 0;
}

/* ── Card Body ────────────────────────────────────────────────────────────── */

.course-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

/* ── Provider Row ─────────────────────────────────────────────────────────── */

.course-provider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-provider-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: #f4f4f4;
    flex-shrink: 0;
}

.course-provider-initial {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #4ecca3;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}

.course-provider-name {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Rating ───────────────────────────────────────────────────────────────── */

.course-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    flex-shrink: 0;
}

.course-rating .stars-icon {
    color: #f59e0b;
    font-size: 13px;
    line-height: 1;
}

.course-rating .stars-value {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.course-rating .review-count {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #888;
}

/* ── Course Title ─────────────────────────────────────────────────────────── */

.course-card-title {
    font-family: 'Louize', serif;
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1, "onum" 0;
}

/* ── Badges Row ───────────────────────────────────────────────────────────── */

.course-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.course-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.course-badge--cert {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* ── Experience Levels ────────────────────────────────────────────────────── */

.course-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.course-level-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
}

/* ── Card Footer ──────────────────────────────────────────────────────────── */

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.course-card-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.course-price {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.price-free {
    color: #059669;
}

.price-paid {
    color: #1a1a1a;
}

.course-fin-aid {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    padding: 2px 7px;
    border-radius: 999px;
}

.course-duration {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.course-cta-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4ecca3;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.course-cta-arrow svg {
    display: block;
    transition: transform 0.25s ease, stroke 0.25s ease;
}

.course-card:hover .course-cta-arrow svg {
    transform: translateX(4px);
    stroke: #3bbf98;
}

/* ============================================================================
   NO COURSES FOUND
   ============================================================================ */

.no-courses-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

/* ============================================================================
   COURSE CONTENT HEADER
   ============================================================================ */

.course-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.course-content-title {
    font-family: 'Louize', serif;
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1, "onum" 0;
}

/* ============================================================================
   LOADING OVERLAY
   ============================================================================ */

.ajax-loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #666;
}

.loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #4ecca3;
    border-radius: 50%;
    animation: gfi-spin 0.7s linear infinite;
}

@keyframes gfi-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   COURSE CTA BOX (sidebar)
   ============================================================================ */

.course-cta-box {
    background: linear-gradient(135deg, #0d2a1f 0%, #1a4a2e 100%) !important;
    border: none !important;
}

.course-cta-box .employer-cta-title {
    color: #4ecca3 !important;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.course-board-pagination {
    margin-top: 32px;
}

.course-board-pagination .pagination-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.course-board-pagination .pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.course-board-pagination .pagination-button:hover {
    background: #f9fafb;
    border-color: #4ecca3;
    color: #059669;
}

.course-board-pagination .pagination-button.current {
    background: #4ecca3;
    color: #000;
    border-color: #4ecca3;
    font-weight: 700;
    cursor: default;
}

.course-board-pagination .pagination-button.dots {
    border: none;
    background: transparent;
    cursor: default;
    color: #9ca3af;
}

/* ============================================================================
   MOBILE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .course-card-title {
        font-size: 15px;
    }

    .course-card-thumbnail {
        aspect-ratio: 16 / 7;
    }

    .course-board-pagination .pagination-button {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

/* ============================================================================
   MOBILE FILTER BUTTON (in search bar)
   ============================================================================ */

.mobile-search-icon-btn {
    display: none !important;
    background: none !important;
    border: none !important;
    width: 44px !important;
    height: 44px !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow: none !important;
    position: relative !important;
}

.mobile-search-icon-btn::before {
    content: '🔍';
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mobile-inline-filter-btn {
    display: none !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

@media (max-width: 768px) {
    .mobile-search-icon-btn {
        display: inline-flex !important;
    }

    .mobile-inline-filter-btn {
        display: inline-flex !important;
    }

    .desktop-only {
        display: none !important;
    }
}
