/* ============================================================================
   MEDGATEWAYS — PUBLIC SITE
   ----------------------------------------------------------------------------
   Layered on top of Sneat's core.css (Bootstrap 5 underneath). Everything here
   is scoped to the public site — the admin and provider dashboards are
   untouched.

   Design direction
   ----------------
   Deep teal as the primary, not the default Bootstrap blue. Teal reads as
   clinical and trustworthy without being cold, and it separates the brand from
   the sea of blue in the education-directory space. Amber is used sparingly —
   only for "featured", which is a paid placement, so it should feel like a
   highlight rather than a decoration.

   Mobile first throughout. Every layout starts single-column and gains columns
   at breakpoints; nothing relies on hover to be usable.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------------------ */

:root {
    /* Brand */
    --mg-primary:        #0C6B62;
    --mg-primary-dark:   #084F49;
    --mg-primary-mid:    #0A5D55;
    --mg-primary-soft:   #E7F2F1;
    --mg-primary-tint:   #F3F9F8;

    --mg-accent:         #E08A00;
    --mg-accent-soft:    #FDF2DD;

    /* Neutrals */
    --mg-ink:            #0A1F2C;
    --mg-heading:        #102B3A;
    --mg-body:           #52646F;
    --mg-muted:          #7E8E99;
    --mg-border:         #E2EAED;
    --mg-border-strong:  #CFDCE1;
    --mg-surface:        #F5F9FA;
    --mg-white:          #FFFFFF;

    /* Status */
    --mg-success:        #0E7C55;
    --mg-success-soft:   #E4F4EC;
    --mg-danger:         #B4321F;

    /* Type */
    --mg-font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mg-font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Radius */
    --mg-radius-sm: 8px;
    --mg-radius:    14px;
    --mg-radius-lg: 22px;
    --mg-radius-pill: 999px;

    /* Elevation. Deliberately soft — hard shadows look dated and make a
       content-dense directory feel cluttered. */
    --mg-shadow-sm: 0 1px 2px rgba(10, 31, 44, .05);
    --mg-shadow:    0 4px 16px rgba(10, 31, 44, .07);
    --mg-shadow-lg: 0 16px 40px rgba(10, 31, 44, .11);

    /* Vertical rhythm. One variable so section spacing can't drift. */
    --mg-section-y: 3.5rem;
}

@media (min-width: 992px) {
    :root { --mg-section-y: 5.5rem; }
}

/* ---------------------------------------------------------------------------
   2. BASE
   ------------------------------------------------------------------------ */

.site-body {
    font-family: var(--mg-font-body);
    color: var(--mg-body);
    background: var(--mg-white);
    -webkit-font-smoothing: antialiased;
    font-size: 1rem;
    line-height: 1.65;
}

.site-body h1, .site-body h2, .site-body h3,
.site-body h4, .site-body h5, .site-body h6 {
    font-family: var(--mg-font-heading);
    color: var(--mg-heading);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.site-body a { text-decoration: none; }

.site-body a:hover { text-decoration: none; }

/* Visible focus for keyboard users. Removing outlines without a replacement
   makes the site unusable without a mouse. */
.site-body a:focus-visible,
.site-body button:focus-visible,
.site-body input:focus-visible,
.site-body select:focus-visible {
    outline: 3px solid rgba(12, 107, 98, .35);
    outline-offset: 2px;
}

.mg-section { padding: var(--mg-section-y) 0; }
.mg-section--tint { background: var(--mg-primary-tint); }
.mg-section--surface { background: var(--mg-surface); }

.mg-section--dark {
    background: var(--mg-ink);
    color: rgba(255, 255, 255, .78);
}

.mg-section--dark h1, .mg-section--dark h2,
.mg-section--dark h3, .mg-section--dark h4 { color: #fff; }

/* Section heading block ---------------------------------------------------- */

.mg-eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mg-primary);
    margin-bottom: .625rem;
}

.mg-section--dark .mg-eyebrow { color: #7FD4C8; }

.mg-title {
    font-size: clamp(1.5rem, 3.4vw, 2.125rem);
    margin-bottom: .625rem;
}

.mg-subtitle {
    color: var(--mg-body);
    max-width: 42rem;
    margin-bottom: 0;
}

.mg-section--dark .mg-subtitle { color: rgba(255, 255, 255, .72); }

.mg-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 2.25rem;
}

.mg-section-head--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mg-section-head--center .mg-subtitle { margin-inline: auto; }

/* ---------------------------------------------------------------------------
   3. BUTTONS
   Overriding Bootstrap rather than inventing a parallel system, so existing
   markup keeps working.
   ------------------------------------------------------------------------ */

.site-body .btn {
    font-family: var(--mg-font-heading);
    font-weight: 600;
    border-radius: var(--mg-radius-pill);
    padding: .625rem 1.375rem;
    transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease;
    border-width: 1.5px;
}

.site-body .btn-lg { padding: .875rem 2rem; font-size: 1rem; }
.site-body .btn-sm { padding: .4375rem 1rem; font-size: .8125rem; }

.site-body .btn-primary {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(12, 107, 98, .22);
}

.site-body .btn-primary:hover,
.site-body .btn-primary:focus {
    background: var(--mg-primary-dark);
    border-color: var(--mg-primary-dark);
    box-shadow: 0 6px 18px rgba(12, 107, 98, .3);
    transform: translateY(-1px);
}

.site-body .btn-outline-primary {
    color: var(--mg-primary);
    border-color: var(--mg-border-strong);
    background: #fff;
}

.site-body .btn-outline-primary:hover {
    background: var(--mg-primary-soft);
    border-color: var(--mg-primary);
    color: var(--mg-primary-dark);
}

.site-body .btn-accent {
    background: var(--mg-accent);
    border-color: var(--mg-accent);
    color: #fff;
}

.site-body .btn-accent:hover { background: #C87A00; border-color: #C87A00; color: #fff; }

.site-body .btn-light-outline {
    color: #fff;
    border-color: rgba(255, 255, 255, .4);
    background: transparent;
}

.site-body .btn-light-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* Text link with a nudging arrow */
.mg-link {
    color: var(--mg-primary);
    font-weight: 600;
    font-family: var(--mg-font-heading);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.mg-link i { transition: transform .15s ease; }
.mg-link:hover { color: var(--mg-primary-dark); }
.mg-link:hover i { transform: translateX(3px); }

/* ---------------------------------------------------------------------------
   4. HEADER
   ------------------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--mg-border);
}

.mg-brand {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    font-family: var(--mg-font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -.03em;
    color: var(--mg-ink);
}

.mg-brand:hover { color: var(--mg-primary); }

.mg-brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--mg-primary) 0%, #17998C 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.mg-nav .nav-link {
    font-family: var(--mg-font-heading);
    font-weight: 600;
    font-size: .9375rem;
    color: var(--mg-heading);
    padding: .5rem .875rem;
    border-radius: var(--mg-radius-sm);
}

.mg-nav .nav-link:hover { color: var(--mg-primary); background: var(--mg-primary-tint); }

.mg-nav .nav-link.active {
    color: var(--mg-primary);
    background: var(--mg-primary-soft);
}

.mg-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--mg-heading);
    font-size: 1.25rem;
}

.mg-header-icon:hover { background: var(--mg-primary-soft); color: var(--mg-primary); }

/* Mobile drawer */
.mg-offcanvas { width: min(88vw, 340px); }
.mg-offcanvas .nav-link { font-size: 1.0625rem; padding: .75rem .5rem; }

/* ---------------------------------------------------------------------------
   5. HERO
   ------------------------------------------------------------------------ */

.mg-hero {
    position: relative;
    background:
        radial-gradient(900px 400px at 12% -10%, rgba(23, 153, 140, .16), transparent 60%),
        radial-gradient(700px 380px at 92% 0%, rgba(224, 138, 0, .1), transparent 60%),
        linear-gradient(180deg, var(--mg-primary-tint) 0%, #fff 78%);
    padding: 3rem 0 var(--mg-section-y);
    overflow: hidden;
}

@media (min-width: 992px) { .mg-hero { padding: 5rem 0 var(--mg-section-y); } }

.mg-hero__title {
    font-size: clamp(2rem, 5.2vw, 3.25rem);
    line-height: 1.12;
    margin-bottom: 1.125rem;
}

.mg-hero__title em {
    font-style: normal;
    color: var(--mg-primary);
    position: relative;
    white-space: nowrap;
}

/* Hand-drawn underline effect, drawn in CSS so there's no image to load. */
.mg-hero__title em::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -.15em;
    height: .18em;
    background: var(--mg-accent);
    opacity: .35;
    border-radius: var(--mg-radius-pill);
}

.mg-hero__lead {
    font-size: 1.0625rem;
    color: var(--mg-body);
    max-width: 34rem;
}

@media (min-width: 992px) { .mg-hero__lead { font-size: 1.1875rem; } }

/* Guided search panel ------------------------------------------------------ */

.mg-search {
    background: #fff;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow-lg);
    padding: 1.25rem;
}

@media (min-width: 768px) { .mg-search { padding: 1.75rem; } }

.mg-search__label {
    font-family: var(--mg-font-heading);
    font-size: .8125rem;
    font-weight: 700;
    color: var(--mg-heading);
    margin-bottom: .375rem;
    display: block;
}

.site-body .mg-search .form-control,
.site-body .mg-search .form-select {
    border: 1.5px solid var(--mg-border);
    border-radius: var(--mg-radius-sm);
    padding: .6875rem .875rem;
    font-size: .9375rem;
    color: var(--mg-heading);
    background-color: #fff;
}

.site-body .mg-search .form-control:focus,
.site-body .mg-search .form-select:focus {
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 4px rgba(12, 107, 98, .1);
}

.mg-search__keyword { position: relative; }

.mg-search__keyword i {
    position: absolute;
    left: .9375rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mg-muted);
    font-size: 1.125rem;
    pointer-events: none;
}

.site-body .mg-search__keyword .form-control { padding-left: 2.75rem; }

/* Hero stats --------------------------------------------------------------- */

.mg-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin-top: 2rem;
}

.mg-stat__value {
    font-family: var(--mg-font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--mg-heading);
    line-height: 1;
    display: block;
}

.mg-stat__label {
    font-size: .8125rem;
    color: var(--mg-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   6. CARDS
   ------------------------------------------------------------------------ */

.mg-card {
    background: #fff;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    box-shadow: var(--mg-shadow-sm);
    transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mg-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--mg-shadow);
    border-color: var(--mg-border-strong);
}

/* Course card -------------------------------------------------------------- */

.mg-course__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--mg-primary-soft);
    overflow: hidden;
}

.mg-course__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.mg-card:hover .mg-course__media img { transform: scale(1.04); }

.mg-course__media--empty {
    display: grid;
    place-items: center;
    color: var(--mg-primary);
    font-size: 2.5rem;
    opacity: .4;
}

.mg-course__flag {
    position: absolute;
    top: .75rem;
    left: .75rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--mg-accent);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .3rem .6rem;
    border-radius: var(--mg-radius-pill);
}

.mg-course__format {
    position: absolute;
    top: .75rem;
    right: .75rem;
    background: rgba(255, 255, 255, .95);
    color: var(--mg-primary-dark);
    font-size: .6875rem;
    font-weight: 700;
    padding: .3rem .6rem;
    border-radius: var(--mg-radius-pill);
}

.mg-course__body {
    padding: 1.125rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mg-course__provider {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mg-primary);
    margin-bottom: .375rem;
}

.mg-course__provider:hover { color: var(--mg-primary-dark); text-decoration: underline; }

.mg-course__title {
    font-size: 1rem;
    margin-bottom: .625rem;
    line-height: 1.4;
}

.mg-course__title a { color: var(--mg-heading); }
.mg-card:hover .mg-course__title a { color: var(--mg-primary); }

.mg-course__meta {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    font-size: .8125rem;
    color: var(--mg-body);
}

.mg-course__meta li {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .3rem;
}

.mg-course__meta i { color: var(--mg-muted); font-size: .9375rem; flex-shrink: 0; }

.mg-course__foot {
    margin-top: auto;
    padding-top: .875rem;
    border-top: 1px solid var(--mg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.mg-course__price {
    font-family: var(--mg-font-heading);
    font-weight: 800;
    font-size: 1.0625rem;
    color: var(--mg-heading);
}

.mg-course__price--free { color: var(--mg-success); }

/* Format card -------------------------------------------------------------- */

.mg-format {
    padding: 1.75rem 1.5rem;
    text-align: left;
}

.mg-format__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--mg-radius);
    background: var(--mg-primary-soft);
    color: var(--mg-primary);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    margin-bottom: 1.125rem;
    transition: background .2s ease, color .2s ease;
}

.mg-card:hover .mg-format__icon { background: var(--mg-primary); color: #fff; }

/* Chips -------------------------------------------------------------------- */

.mg-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: var(--mg-radius-pill);
    border: 1.5px solid var(--mg-border);
    background: #fff;
    color: var(--mg-heading);
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--mg-font-heading);
    transition: all .16s ease;
}

.mg-chip:hover {
    border-color: var(--mg-primary);
    background: var(--mg-primary-soft);
    color: var(--mg-primary-dark);
}

.mg-chip__count {
    font-size: .75rem;
    color: var(--mg-muted);
    font-weight: 600;
}

.mg-chip:hover .mg-chip__count { color: var(--mg-primary); }

/* Provider tile ------------------------------------------------------------ */

.mg-provider-tile {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    background: #fff;
    transition: all .16s ease;
    height: 100%;
}

.mg-provider-tile:hover {
    border-color: var(--mg-primary);
    box-shadow: var(--mg-shadow);
    transform: translateY(-2px);
}

/* Initials stand in for a logo. Providers don't upload one, and an empty
   placeholder box looks broken where a wordmark works. */
.mg-provider-tile__mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--mg-primary) 0%, #17998C 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--mg-font-heading);
    font-weight: 800;
    font-size: .9375rem;
    flex-shrink: 0;
    letter-spacing: -.02em;
}

.mg-provider-tile__name {
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: .9375rem;
    color: var(--mg-heading);
    line-height: 1.35;
}

.mg-provider-tile__meta { font-size: .8125rem; color: var(--mg-muted); }

/* Step card ---------------------------------------------------------------- */

.mg-step { position: relative; padding: 1.75rem 1.5rem; }

.mg-step__num {
    font-family: var(--mg-font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--mg-primary);
    opacity: .16;
    margin-bottom: .5rem;
}

/* Benefit ------------------------------------------------------------------ */

.mg-benefit { display: flex; gap: 1rem; }

.mg-benefit__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #7FD4C8;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Testimonial -------------------------------------------------------------- */

.mg-quote { padding: 1.75rem 1.5rem; }

.mg-quote__stars { color: var(--mg-accent); font-size: .9375rem; margin-bottom: .875rem; }

.mg-quote__text {
    color: var(--mg-heading);
    font-size: .9375rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.mg-quote__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--mg-primary-soft);
    color: var(--mg-primary);
    display: grid;
    place-items: center;
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: .875rem;
    flex-shrink: 0;
}

/* Post card ---------------------------------------------------------------- */

.mg-post__media { aspect-ratio: 16 / 9; display: block; overflow: hidden; background: var(--mg-primary-soft); }
.mg-post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mg-card:hover .mg-post__media img { transform: scale(1.04); }

.mg-post__tag {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mg-primary);
    margin-bottom: .5rem;
}

/* ---------------------------------------------------------------------------
   7. FAQ
   ------------------------------------------------------------------------ */

.mg-faq .accordion-item {
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius) !important;
    margin-bottom: .75rem;
    overflow: hidden;
    background: #fff;
}

.mg-faq .accordion-button {
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--mg-heading);
    padding: 1.125rem 1.25rem;
    background: #fff;
    box-shadow: none;
}

.mg-faq .accordion-button:not(.collapsed) { color: var(--mg-primary); background: var(--mg-primary-tint); }
.mg-faq .accordion-button:focus { box-shadow: none; border-color: transparent; }
.mg-faq .accordion-body { padding: 0 1.25rem 1.25rem; color: var(--mg-body); font-size: .9375rem; }

/* ---------------------------------------------------------------------------
   8. CTA BAND
   ------------------------------------------------------------------------ */

.mg-cta {
    background:
        radial-gradient(600px 300px at 85% 20%, rgba(23, 153, 140, .35), transparent 65%),
        linear-gradient(135deg, var(--mg-primary-dark) 0%, var(--mg-ink) 100%);
    border-radius: var(--mg-radius-lg);
    padding: 2.5rem 1.75rem;
    color: rgba(255, 255, 255, .82);
}

@media (min-width: 992px) { .mg-cta { padding: 3.5rem 3.5rem; } }

.mg-cta h2 { color: #fff; }

/* ---------------------------------------------------------------------------
   9. FOOTER
   ------------------------------------------------------------------------ */

.site-footer {
    background: var(--mg-ink);
    color: rgba(255, 255, 255, .62);
    padding-top: var(--mg-section-y);
    font-size: .9375rem;
}

.site-footer h5, .site-footer h6 { color: #fff; }

.site-footer__heading {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .45);
    margin-bottom: 1rem;
}

.site-footer a { color: rgba(255, 255, 255, .68); }
.site-footer a:hover { color: #fff; }

.site-footer__links { list-style: none; padding: 0; margin: 0; }
.site-footer__links li { margin-bottom: .625rem; }

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 2.5rem;
    padding: 1.5rem 0;
    font-size: .875rem;
}

.site-footer__social {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .75);
    font-size: 1.125rem;
}

.site-footer__social:hover { background: var(--mg-primary); color: #fff; }

/* ---------------------------------------------------------------------------
   10. INNER PAGES
   Directory, detail and provider pages inherit the same system.
   ------------------------------------------------------------------------ */

.mg-page-head {
    background: linear-gradient(180deg, var(--mg-primary-tint) 0%, #fff 100%);
    padding: 2rem 0 2.5rem;
    border-bottom: 1px solid var(--mg-border);
}

.site-body .breadcrumb { font-size: .8125rem; margin-bottom: .75rem; }
.site-body .breadcrumb a { color: var(--mg-body); }
.site-body .breadcrumb a:hover { color: var(--mg-primary); }
.site-body .breadcrumb-item.active { color: var(--mg-muted); }

/* Filter sidebar */
.site-body .filter-scroll {
    max-height: 220px;
    overflow-y: auto;
    padding-right: .25rem;
}

.site-body .filter-scroll::-webkit-scrollbar { width: 6px; }
.site-body .filter-scroll::-webkit-scrollbar-thumb {
    background: var(--mg-border-strong);
    border-radius: var(--mg-radius-pill);
}

.site-body .form-check-input:checked {
    background-color: var(--mg-primary);
    border-color: var(--mg-primary);
}

.site-body .card {
    border: 1px solid var(--mg-border);
    border-radius: var(--mg-radius);
    box-shadow: var(--mg-shadow-sm);
}

.site-body .card-header {
    background: #fff;
    border-bottom: 1px solid var(--mg-border);
    padding: 1.125rem 1.25rem;
}

/* Course detail */
.course-detail__image { max-height: 380px; object-fit: cover; width: 100%; }
.course-detail__description { line-height: 1.75; color: var(--mg-body); word-break: break-word; }
.course-detail__description h2,
.course-detail__description h3 { margin-top: 1.75rem; margin-bottom: .75rem; }

@media (min-width: 992px) {
    .course-detail__cta { position: sticky; top: 6rem; }
}

/* Pagination */
.site-body .pagination { gap: .25rem; }

.site-body .page-link {
    border-radius: var(--mg-radius-sm);
    border: 1px solid var(--mg-border);
    color: var(--mg-heading);
    font-weight: 600;
    font-size: .875rem;
}

.site-body .page-item.active .page-link {
    background: var(--mg-primary);
    border-color: var(--mg-primary);
    color: #fff;
}

.site-body .page-link:hover { background: var(--mg-primary-soft); color: var(--mg-primary-dark); }

/* Badges reused from the admin theme, retinted for the public palette */
.site-body .badge.bg-label-primary { background: var(--mg-primary-soft); color: var(--mg-primary-dark); }
.site-body .badge.bg-label-secondary { background: var(--mg-surface); color: var(--mg-body); }
.site-body .badge.bg-label-info { background: #E8F1F6; color: #17607F; }

/* ---------------------------------------------------------------------------
   11. UTILITIES
   ------------------------------------------------------------------------ */

.mg-scroller {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .75rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.mg-scroller > * { scroll-snap-align: start; flex: 0 0 82%; }

@media (min-width: 576px) { .mg-scroller > * { flex-basis: 46%; } }
@media (min-width: 992px) { .mg-scroller { display: none; } }

.mg-scroller::-webkit-scrollbar { height: 5px; }
.mg-scroller::-webkit-scrollbar-thumb { background: var(--mg-border-strong); border-radius: var(--mg-radius-pill); }

/* Desktop grid counterpart to .mg-scroller */
.mg-grid-lg { display: none; }
@media (min-width: 992px) { .mg-grid-lg { display: flex; } }

.mg-divider { height: 1px; background: var(--mg-border); border: 0; }

/* Respect the OS setting. Vestibular disorders are common enough that motion
   should never be mandatory. */
@media (prefers-reduced-motion: reduce) {
    .site-body *,
    .site-body *::before,
    .site-body *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .mg-card:hover { transform: none; }
}
