/* Course Directory Plugin — Phase 3 Frontend Styles
   Self-contained, prefixed with .cdir- so it never clashes with the theme.
   IMPORTANT: this file never sets font-size or font-family anywhere —
   all text sizing/typography is intentionally left to the active theme,
   so headings, body copy, and buttons always match the rest of the site. */

/* Phase 5 — color settings hook. CDIR_Settings prints the real values
   (from Directory Settings > Primary/Button Color) as a <style> block in
   wp_head; these :root fallbacks only apply if that block is ever missing
   (e.g. a caching edge case), so the site never breaks without them. */
:root {
    --cdir-primary: #0b6cb3;
    --cdir-primary-dark: #085a94;
    --cdir-primary-tint: #eaf4fb;
    --cdir-btn: #0b6cb3;
    --cdir-btn-dark: #085a94;
}

.cdir-wrap, .cdir-wrap * {
    box-sizing: border-box; /* prevents padding/border from ever causing overflow/overlap */
}

.cdir-wrap {
    margin: 0 auto;
    padding: 40px 60px 60px;
    width: 100%;
    max-width: 1600px;
}
.cdir-filter-panel button.cdir-btn.cdir-filter-apply-btn {
    padding: 8px 25px;
    border-radius: 100px !important;
}
.cdir-cpf-stats .cdir-cpf-stat {
    position: relative;
}
.cdir-cpf-stats .cdir-cpf-stat::before {
    content: "";
    position: absolute;
    border: 1px dashed #cccccc;
    height: 100%;
    right: -80px;
}
.cdir-page-header h1 {
    margin-bottom: 6px;
}
.cdir-page-header p {
    color: #5f6b76;
    margin-top: 0;
}
.cdir-modal button.cdir-gate-choice-btn {
    padding: 10px;
}
.cdir-modal button#cdir-gate-continue {
    padding: 15px 0;
}
.cdir-card-body h2 {
    font-size: 30px;
    line-height: 40px;
    font-weight: 600;
    max-width: 80%;
}
.cdir-card-body {
    padding: 30px 20px;
}
.cdir-breadcrumb {
    color: #5f6b76;
    margin-bottom: 24px;
}
.cdir-breadcrumb a { color: var(--cdir-primary); text-decoration: none; }
.cdir-breadcrumb a:hover { text-decoration: underline; }
/* .cdir-finder-box {
    display: none !important;
} */
/* ---------------------------------------------------------------
 * Buttons (shared)
 * ------------------------------------------------------------- */
.cdir-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--cdir-btn);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}
.cdir-btn:hover { background: var(--cdir-btn-dark); color: #fff; }
.cdir-btn-secondary {
    background: #fff;
    color: var(--cdir-primary);
    border: 1px solid var(--cdir-primary);
}
/* .cdir-btn-secondary:hover { background: #eaf4fb; } */
.cdir-btn-clear {
    color: #a4373a;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

#cdir-provider-offer-grid h3 {
    letter-spacing: 0;
    font-size: 25px;
    line-height: 35px;
    font-weight: 600;
    min-height: 70px;
}
#cdir-provider-offer-grid .cdir-offer-card ul.cdir-offer-meta {
    min-height: 250px;
}
/* ---------------------------------------------------------------
 * Filter widget: a trigger button that opens a dropdown panel of
 * pill-style options, grouped by category, with an explicit
 * "Apply Filters" submit button and a "Clear all" link.
 * ------------------------------------------------------------- */
.cdir-filter-widget {
    position: relative;
    display: inline-block;
    margin: 24px 0 32px;
    isolation: isolate; /* own stacking context so the panel never gets buried behind theme/card elements below it */
    z-index: 50;
}
.cdir-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--cdir-primary-tint);
    color: var(--cdir-primary);
    border: 1px solid var(--cdir-primary-tint);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.cdir-filter-trigger:hover { background: #dcedf9; }
.cdir-filter-caret { display: inline-block; transition: transform 0.15s ease; }
.cdir-filter-panel.is-open ~ .cdir-filter-caret,
.cdir-filter-widget.is-open .cdir-filter-caret { transform: rotate(180deg); }
.cdir-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cdir-primary);
    display: inline-block;
}

.cdir-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e3e7ea;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
    padding: 26px;
    width: 440px;
    max-width: calc(100vw - 40px);
    max-height: 70vh;
    overflow-y: auto;
    margin: 0;
    /* Keeps mouse-wheel scrolling inside the panel instead of leaking out
       and scrolling the page underneath once the panel content ends. */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.cdir-filter-panel.is-open { display: block; }

.cdir-filter-panel-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6b76;
    line-height: 1;
    padding: 4px;
}

.cdir-filter-group { margin-bottom: 22px; }
.cdir-filter-group-title { margin: 0 0 10px; font-weight: 600; }

.cdir-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cdir-filter-pill {
    padding: 9px 16px;
    background: #f1f2f4;
    border: 1px solid #f1f2f4;
    border-radius: 999px;
    cursor: pointer;
    color: #23282d;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cdir-filter-pill:hover { background: #e5e7ea; }
.cdir-filter-pill.is-active {
    background: var(--cdir-primary-tint);
    border-color: var(--cdir-primary);
    color: var(--cdir-primary);
    font-weight: 600;
}

.cdir-filter-select {
    padding: 10px 12px;
    border: 1px solid #d3d9de;
    border-radius: 6px;
    background: #fff;
}

.cdir-filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d3d9de;
    border-radius: 6px;
    background: #fff;
}

.cdir-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #edf0f2;
}
.cdir-filter-apply-btn { flex: 0 0 auto; }

.cdir-filter-widget.cdir-filter-widget-cdir_course {
    position: relative;
    top: -15px;
    left: 0;
}
/* ---------------------------------------------------------------
 * Card grid — 3 per row on desktop, adjusts down cleanly at each
 * breakpoint further below.
 * ------------------------------------------------------------- */
.cdir-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 8px;
}
.cdir-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e3e7ea;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    min-width: 0; /* lets long titles/text wrap instead of forcing the card wider than its column */
}
.cdir-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    color: inherit;
}
.cdir-card-thumb img { width: 100%; height: 160px; object-fit: cover; display: block; }
.cdir-provider-logo img { object-fit: contain; background: #f6f8fa; padding: 10px; }
.cdir-card-body { padding: 16px; overflow-wrap: break-word; word-break: break-word; }
.cdir-card-body h2, .cdir-card-body h3 { margin: 0 0 8px; }
.cdir-card-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--cdir-primary);
    font-weight: 600;
}
.cdir-provider-count {
    display: block;
    color: #5f6b76;
    margin-top: 6px;
}
.cdir-modal a.cdir-btn.cdir-btn-ghost {
    color: black;
    border-radius: 100px;
}
/* Pills / tags shown on cards (State, Study Mode) */
.cdir-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cdir-pill {
    background: var(--cdir-primary-tint);
    color: var(--cdir-primary);
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}
.cdir-pill-alt { background: #f1eafb; color: #6b3fa0; }
button.cdir-pill {
    border: none;
    cursor: pointer;
    line-height: 1.4;
}
button.cdir-mode-pill.is-active {
    background: var(--cdir-primary);
    color: #fff;
}

/* ---------------------------------------------------------------
 * Single page header
 * ------------------------------------------------------------- */
.cdir-single-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}
.cdir-single-thumb img { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; }
.cdir-single-thumb.cdir-provider-logo img { object-fit: contain; background: #f6f8fa; padding: 10px; }
.cdir-single-header h1 { margin: 0 0 8px; }
.cdir-course-code, .cdir-related-career-link { color: #5f6b76; margin: 4px 0; }
.cdir-related-career-link a { color: var(--cdir-primary); }

.cdir-single-content {
    line-height: 1.7;
    margin-bottom: 24px;
    width: 100% !important;
}
/* ---------------------------------------------------------------
 * Single Career page — AI Exposure / Shortage hero box + "View all
 * courses" button (sits above the existing Career Pathway / Salary /
 * Demand info boxes, which are untouched).
 * ------------------------------------------------------------- */
.cdir-single-hero-box {
    border: 1px solid #e3e7ea;
    border-radius: 10px;
    max-width: 800px;
    margin: 20px 0 10px;
    overflow: hidden;
    background: #fff;
}
.cdir-single-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
}
.cdir-single-hero-row + .cdir-single-hero-row { border-top: 1px solid #edf0f2; }
.cdir-single-hero-label { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.cdir-single-hero-label .cdir-cpf-arrow { color: #16a34a; }
.cdir-single-hero-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cdir-single-hero-source { color: #6b7280; font-size: 0.85em; max-width: 480px; margin: 4px 0 22px; }

.cdir-view-courses-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 26px;
    margin-bottom: 32px;
}

/* ---------------------------------------------------------------
 * Single Career page — course directory list under "How do I
 * become a [Career]" (course code, description, career-opportunity
 * tags, and a fee/duration/study-mode sidebar with a Find a Provider
 * button that opens the same gate popup as "View all courses").
 * ------------------------------------------------------------- */
.cdir-related-courses > p { color: #5f6b76; margin-top: 4px; }
.cdir-course-directory-list { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }

.cdir-course-directory-card {
    position: relative;
    border: 1px solid #e3e7ea;
    border-radius: 12px;
    overflow: visible;
    background: #fff;
    padding-top: 14px;
}
.cdir-recommended-badge {
    position: absolute;
    top: -14px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #16a34a;
    color: #fff;
    font-size: 16px;
    padding: 7px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
    transform: scale(0.7);
    transform-origin: left top;
}
.cdir-course-directory-main {
    padding: 20px 28px 28px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 28px;
    align-items: start;
}
.cdir-course-directory-body { min-width: 0; }
.cdir-course-directory-code {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 0;
    letter-spacing: 0;
    padding-bottom: 0;
}
.cdir-course-directory-body h3 {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 40px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0;
    max-width: 70%;
}
.cdir-course-directory-body h3 a { color: #1a1a1a; text-decoration: none; }
.cdir-course-directory-body h3 a:hover { text-decoration: underline; }
.cdir-course-directory-desc {
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 18px;
    max-width: 90%;
}
.cdir-course-directory-tags-label {
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 0;
}
.cdir-course-directory-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cdir-tag-pill {
    display: inline-block;
    border: 1px solid #d7dbe0;
    background: #fff;
    color: var(--cdir-primary);
    font-size: 12px;
    padding: 6px 20px;
    border-radius: 999px;
}

.cdir-course-directory-side {
    border-left: 1px solid #edf0f2;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
}
.cdir-course-directory-stat { padding: 12px 0; border-bottom: 1px solid #edf0f2; }
.cdir-course-directory-stat:first-child { padding-top: 0; }
.cdir-course-directory-stat-label {
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 0;
    text-transform: capitalize;
}
.cdir-course-directory-stat-value {
    color: #1a1a1a;
    font-size: 14px;
}
.cdir-find-provider-btn {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 700;
}
.cdir-find-provider-btn svg { flex-shrink: 0; }

@media (max-width: 600px) {
    /* This divider is positioned with a fixed right:-80px offset that
       assumes the wide desktop stat spacing — once stats stack/narrow
       on mobile that offset just floats off into unrelated content, so
       it's cleaner to drop the decorative line at this width. */
    .cdir-cpf-stats .cdir-cpf-stat::before { display: none; }
}

@media (max-width: 900px) {
    .cdir-course-directory-main { grid-template-columns: 1fr; }
    .cdir-course-directory-side { border-left: none; border-top: 1px solid #edf0f2; padding-left: 0; padding-top: 18px; }
	.cdir-cpf-stats .cdir-cpf-stat::before {
    display: none;
}
.cdir-cpf {
    padding: 20px !important;
}
.cdir-single-content {
    width: 100% !important;
}
	.cdir-info-boxes {
    grid-template-columns: repeat(1, 1fr) !important;
}
}

/* ---------------------------------------------------------------
 * Citizen/PR gate popup — reuses the .cdir-overlay/.cdir-modal shell
 * from the Enquiry Modal below, just with its own content styling.
 * ------------------------------------------------------------- */
.cdir-gate-modal { max-width: 460px; text-align: center; padding: 40px 32px; }
.cdir-gate-question { font-size: 1.3em; margin: 0 0 26px; }
.cdir-gate-choice { display: flex; gap: 14px; justify-content: center; margin-bottom: 22px; }
.cdir-gate-choice-btn {
    flex: 1;
    max-width: 180px;
    padding: 14px 20px;
    border-radius: 999px;
    border: 1.5px solid #d7dbe0;
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    color: #23282d;
}
.cdir-gate-choice-btn:hover { background: #f4f5f6; }
.cdir-gate-choice-btn.is-active {
    border-color: var(--cdir-primary);
    background: var(--cdir-primary-tint);
    color: var(--cdir-primary);
}
.cdir-gate-field { display: none; text-align: left; margin-bottom: 20px; }
.cdir-gate-field label { display: block; font-weight: 600; margin-bottom: 10px; text-align: center; }
.cdir-gate-hint { color: #6b7280; font-size: 0.85em; text-align: center; margin: 10px 0 0; }
.cdir-gate-error { color: #a4373a; background: #fdecea; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.cdir-gate-continue { width: 100%; padding: 12px; border-radius: 999px; }
.cdir-gate-subquestion { font-weight: 600; text-align: center; margin: 0 0 10px; }
.cdir-gate-autocomplete { position: relative; }
.cdir-gate-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
}
.cdir-gate-suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 0.95em;
    color: #23282d;
    cursor: pointer;
}
.cdir-gate-suggestion-item:hover,
.cdir-gate-suggestion-item:focus { background: var(--cdir-primary-tint); color: var(--cdir-primary); }
.cdir-gate-suggestion-item + .cdir-gate-suggestion-item { border-top: 1px solid #f0f1f2; }

@media (max-width: 480px) {
    .cdir-gate-choice { flex-direction: column; align-items: stretch; }
    .cdir-gate-choice-btn { max-width: none; }
	.cdir-single-header h1 {
    font-size: 25px;
    line-height: 35px;
}
}

/* Info boxes */
.cdir-info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.cdir-info-box {
    background: #f6f8fa;
    border: 1px solid #e3e7ea;
    border-radius: 8px;
    padding: 16px;
}
.cdir-info-box h3 { margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--cdir-primary); }
.cdir-info-box p { margin: 0; }

/* ---------------------------------------------------------------
 * Provider offer cards (on single course page + single provider page)
 * ------------------------------------------------------------- */
.cdir-offers-heading h2, .cdir-related-courses h2, .cdir-provider-courses h2 { margin-bottom: 16px; }
.cdir-finder-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #f6f8fa;
    border: 1px solid #e3e7ea;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.cdir-finder-box .cdir-filter-select,
.cdir-finder-box .cdir-filter-input { flex: 1 1 200px; }
.cdir-offer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.cdir-offer-card {
    background: #fff;
    border: 1px solid #e3e7ea;
    border-radius: 10px;
    padding: 18px;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.cdir-offer-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cdir-offer-logo img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #f6f8fa; }
.cdir-offer-card-head h3 { margin: 0; }
.cdir-offer-card-head h3 a { color: #23282d; text-decoration: none; }
.cdir-offer-meta { list-style: none; margin: 0 0 14px; padding: 0; }
.cdir-offer-meta li { padding: 3px 0; border-bottom: 1px dashed #edf0f2; }
.cdir-offer-meta li:last-child { border-bottom: none; }
.cdir-enquire-btn { width: 100%; text-align: center; }
.cdir-offer-empty-msg { color: #5f6b76; font-style: italic; }

.cdir-contact-box p { margin: 4px 0; }

/* ---------------------------------------------------------------
 * Phase 5 — distance badge on offer cards, finder box tweaks,
 * and the auto-generated State landing pages.
 * ------------------------------------------------------------- */
.cdir-distance-badge {
    display: inline-block;
    margin-left: auto;
    padding: 3px 10px;
    background: var(--cdir-primary-tint);
    color: var(--cdir-primary);
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}
.cdir-offer-card-head { flex-wrap: wrap; }

.cdir-finder-hint { color: #5f6b76; margin: 0 0 16px; }
.cdir-finder-error {
    background: #fdecea;
    color: #a4373a;
    padding: 8px 14px;
    border-radius: 6px;
    margin: 0 0 16px;
}

.cdir-state-section { margin-bottom: 44px; }
.cdir-state-section .cdir-offers-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.cdir-empty {
    text-align: center;
    padding: 40px 20px;
    color: #5f6b76;
    background: #f6f8fa;
    border-radius: 8px;
}

.cdir-pagination { margin-top: 32px; text-align: center; }
.cdir-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #d3d9de;
    border-radius: 6px;
    text-decoration: none;
    color: #23282d;
}
.cdir-pagination .page-numbers.current { background: var(--cdir-primary); color: #fff; border-color: var(--cdir-primary); }

/* ---------------------------------------------------------------
 * Responsive breakpoints
 * ------------------------------------------------------------- */
@media (max-width: 1280px) {
    .cdir-wrap { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 1024px) {
    .cdir-grid, .cdir-offer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .cdir-info-boxes { grid-template-columns: repeat(2, 1fr); }
    .cdir-card-body h2 { font-size: 26px; line-height: 34px; }
    .cdir-course-directory-body h3 { font-size: 26px; line-height: 34px; }
}

@media (max-width: 760px) {
    .cdir-wrap { padding: 28px 20px 44px; }
    .cdir-grid, .cdir-offer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .cdir-info-boxes { grid-template-columns: 1fr; }
    .cdir-single-header { flex-direction: column; align-items: flex-start; }
    .cdir-finder-box { flex-direction: column; align-items: stretch; }
    .cdir-filter-panel { width: 100%; left: 0; right: 0; }
    .cdir-filter-actions { flex-direction: column; align-items: stretch; }
    .cdir-filter-apply-btn { width: 100%; text-align: center; }

    /* Fixed percentage-width text blocks only make sense once the layout
       has real room either side; below this width they just force
       premature wrapping, so let them use the full column instead. */
    .cdir-card-body h2 { max-width: 100%; font-size: 22px; line-height: 30px; }
    .cdir-course-directory-body h3 { max-width: 100%; font-size: 22px; line-height: 30px; }
    .cdir-course-directory-main { padding: 18px 18px 22px; }
    .cdir-course-directory-tags-label { margin-bottom: 8px; }

    /* Label left / pills right only has room to sit side-by-side on
       wider screens — stack them so long pill lists don't get squeezed
       into a sliver of space next to the label. */
    .cdir-single-hero-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .cdir-single-hero-pills { justify-content: flex-start; }

    .cdir-offer-card ul.cdir-offer-meta { min-height: 0; }
}

@media (max-width: 480px) {
    .cdir-wrap { padding: 20px 14px 32px; }
    .cdir-single-thumb img { width: 96px; height: 96px; }
    .cdir-single-header { gap: 14px; }
    .cdir-card-body { padding: 14px; }
    .cdir-course-directory-tags { gap: 6px; }
    .cdir-tag-pill { padding: 5px 12px; font-size: 11px; }
    .cdir-gate-modal { padding: 28px 20px; }
    .cdir-modal-provider-header { gap: 10px; }
    .cdir-modal-provider-logo { width: 46px; height: 46px; }
}

@media (max-width: 360px) {
    .cdir-wrap { padding: 16px 12px 28px; }
    .cdir-card-body h2 { font-size: 19px; line-height: 26px; }
    .cdir-course-directory-body h3 { font-size: 19px; line-height: 26px; }
    .cdir-course-directory-main { padding: 16px 14px 18px; }
    .cdir-single-thumb img { width: 76px; height: 76px; }
    .cdir-filter-trigger { padding: 10px 14px; font-size: 0.95em; }
    .cdir-btn { padding: 10px 14px; }
}

/* ---------------------------------------------------------------
 * Phase 4 — Enquiry Modal
 * (No font-size/font-family set here either — same rule as the rest
 * of this file, so the form text matches the theme automatically.)
 * ------------------------------------------------------------- */
.cdir-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 26, 33, 0.55);
    z-index: 100000;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 16px;
    overflow: hidden;
    overscroll-behavior: contain;
}
.cdir-overlay.is-open { display: flex; }
html.cdir-modal-open,
body.cdir-modal-open { overflow: hidden !important; }

.cdir-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    padding: 32px;
    position: relative;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.cdir-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6b76;
    line-height: 1;
    padding: 4px;
}
.cdir-modal-close:hover { color: #1a1a1a; }

.cdir-modal-logo-wrap {
    margin-bottom: 18px;
    text-align: left;
}
.cdir-modal-logo-wrap img,
.cdir-modal-logo { max-width: 160px; height: auto; display: block; }
.cdir-modal-logo-text { font-weight: 700; }

/* Phase 6 — per-provider branding header (logo + name + course context) */
.cdir-modal-provider-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e7e9ec;
}
.cdir-modal-provider-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f5f6f7;
}
.cdir-modal-provider-info { min-width: 0; }
.cdir-modal-provider-name { font-weight: 700; font-size: 1.05em; color: #1a1a1a; }
.cdir-modal-provider-meta { color: #5f6b76; font-size: 0.92em; margin-top: 2px; }

.cdir-modal h2 {
    font-size: 18px;
    line-height: 28px;
    margin-bottom: 25px;
}
.cdir-modal-sub { color: #5f6b76; margin: 0 0 20px; }

.cdir-form-row { margin-bottom: 14px; }
.cdir-form-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.cdir-form-row input[type="text"],
.cdir-form-row input[type="email"],
.cdir-form-row select,
.cdir-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d7dbe0;
    border-radius: 6px;
    background: #fbfbfa;
}
.cdir-form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cdir-form-2col > div label { display: block; font-weight: 600; margin-bottom: 6px; }
.cdir-form-2col input { width: 100%; padding: 10px 12px; border: 1px solid #d7dbe0; border-radius: 6px; background: #fbfbfa; }

.cdir-honeypot { position: absolute; left: -9999px; top: -9999px; }

.cdir-consent-row { margin: 16px 0; color: #5f6b76; }
.cdir-consent-row label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.cdir-consent-row input[type="checkbox"] { margin-top: 3px; }

.cdir-form-error {
    background: #fdecea;
    color: #a4373a;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
}

/* Standalone "Enquire Now" page (templates/page-cdir-enquiry.php) reuses
   .cdir-modal for the same card look, but it's normal page content now —
   not a floating popup — so the popup-only height/scroll clamp is reset
   here and it just sits centered on the page like any other content. */
.cdir-enquiry-page-card {
    max-width: 520px;
    max-height: none;
    overflow: visible;
    margin: 24px auto 60px;
}

.cdir-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.cdir-modal-actions .cdir-btn { flex: 1; text-align: center; }
.cdir-btn-primary { background: var(--cdir-btn); color: #fff; border: none; }
.cdir-btn-primary:hover { background: var(--cdir-btn-dark); }
.cdir-btn-ghost {
    background: transparent;
    color: #5f6b76;
    border: 1px solid #d7dbe0;
}
.cdir-btn-ghost:hover { background: #f4f5f6; }

.cdir-success-box { text-align: center; padding: 10px 0; }
.cdir-success-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #e4f2ea;
    color: #0d6b3f;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.cdir-success-box h2 { margin: 0 0 8px; }
.cdir-success-box p { color: #5f6b76; margin: 0 0 20px; }
.cdir-success-box .cdir-btn { max-width: 200px; margin: 0 auto; display: block; }

@media (max-width: 480px) {
    .cdir-form-2col { grid-template-columns: 1fr; }
    .cdir-modal { padding: 24px; }
}
