/* ── Course card list ────────────────────────────────── */
.cc-wrap {
    margin: 20px auto;
}

.cc-heading-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cc-heading {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.cc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--category-color, #0288d1) 12%, transparent);
    color: var(--category-color, #0288d1);
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--category-color, #0288d1) 25%, transparent);
}

.cc-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* ── Individual card ─────────────────────────────────── */
.cc-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 11px 16px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: var(--ac6-radius-lg);
    color: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: border-color .15s, box-shadow .15s;
    cursor: pointer;
}

.cc-card:hover {
    border-color: var(--category-color, #0288d1);
    box-shadow: 0 3px 12px rgba(0,0,0,.09);
    text-decoration: none;
    color: inherit;
}

.cc-card-hidden { display: none; }

/* Single main row: ref · title · duration · badge · toggle */
.cc-card-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cc-ref {
    flex-shrink: 0;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--category-color, #0288d1);
    background: color-mix(in srgb, var(--category-color, #0288d1) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--category-color, #0288d1) 22%, transparent);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
    line-height: 1.65;
}

.cc-title {
    flex: 1;
    min-width: 0;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--ac6-text-strong) !important;
    line-height: 1.35;
    text-decoration: none !important;
}

.cc-title:hover {
    text-decoration: underline !important;
}

/* View outline pill button */
.cc-cta-btn {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff !important;
    background: var(--category-color, #0288d1);
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background .15s, box-shadow .15s;
}

.cc-card:hover .cc-cta-btn {
    background: color-mix(in srgb, var(--category-color, #0288d1) 85%, black);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    color: #fff !important;
}

/* Placeholder keeps title column aligned on rows with no description */
.cc-expand-placeholder {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: block;
}

/* Expand chevron */
.cc-expand-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 6px;
    cursor: pointer;
    color: #94a3b8;
    transition: border-color .15s, color .15s, background .15s;
    padding: 0;
}

.cc-expand-btn:hover {
    border-color: var(--category-color, #0288d1);
    color: var(--category-color, #0288d1);
    background: color-mix(in srgb, var(--category-color, #0288d1) 6%, transparent);
}

.cc-expand-icon {
    display: block;
    transition: transform .2s ease;
}

.cc-expand-btn-open .cc-expand-icon { transform: rotate(180deg); }

/* Description — hidden by default */
.cc-desc {
    font-size: 0.92rem;
    color: var(--ac6-text-strong);
    line-height: 1.6;
    padding-top: 9px;
    margin-top: 8px;
    border-top: 1px solid rgba(0,0,0,.06);
}

.cc-desc.cc-desc-hidden { display: none; }

/* Show More */
.cc-more-wrap {
    margin-top: 14px;
    text-align: center;
}

.cc-more-btn {
    padding: 8px 24px;
    background: var(--category-color, #0288d1);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .12s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.cc-more-btn:hover {
    background: color-mix(in srgb, var(--category-color, #0288d1) 85%, black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.16);
}


/* Category Card Styles */
.category-card {
    background-color: #fff;
    border-radius: var(--ac6-radius-lg);
    border: 2px solid;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    margin: 1rem auto;
    display: block;
    width: fit-content;
    text-align: center;
    padding: 1rem;
}

.category-title {
    font-weight: bold;
    font-size: 1.1rem;
    font-family: "Open Sans", "Segoe UI", Tahoma, Geneva, Verdana, Arial, sans-serif;
}

.category-separator {
    margin: 0 1rem;
    border-left: 2px solid;
}

.category-image {
    margin-top: 0.5rem;
}

.category-subtitle {
    margin-top: 0.5rem;
    font-size: 1rem;
    text-align: center;
}

.category-subtitle-spacer {
    margin-bottom: 2rem;
}

.description_box {
    margin: 20px auto;
    padding: 20px 28px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    line-height: 1.65;
}

/* Override any inline/global centering that comes from DB content */
.description_box h1:not(.cat-title),
.description_box h2:not(.cat-title),
.description_box h3 {
    text-align: left !important;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ac6-secondary);
    margin-top: 0;
    margin-bottom: 0.6rem;
}

/* "Available Courses" section heading — matches Featured Courses h3 style */
.category-courses-heading {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-align: left;
    margin: 0 0 0.75em;
}

/* Group page — category cards */
/* Group page — category sections inside unified card */
.group-category-section {
    padding: 0.5rem 0 0.75rem;
}

.group-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
}

.group-cat-title-link {
    color: var(--category-color, #0288d1);
    text-decoration: none;
}

.group-cat-title-link:hover {
    text-decoration: underline;
}

/* Legacy standalone card — kept for any other use */
.group-category-card {
    background: #fff;
    border: 2px solid var(--category-color, #8a3fa0);
    border-radius: var(--ac6-radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    margin: 1.5rem 0;
    padding: 1.5rem;
    text-align: left;
    transition: box-shadow 0.2s ease;
}

.group-category-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.group-category-card .group-category-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 0.4rem 0;
    color: var(--category-color, #8a3fa0);
}

.group-category-subtitle {
    font-size: 0.94rem;
    color: #555;
    margin-bottom: 1rem;
    font-style: italic;
}

.group-category-description {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--ac6-text);
    margin-bottom: 1rem;
}

.group-category-footer {
    margin-top: 1rem;
    text-align: right;
}


.title {
    flex: 1;
}

.course-buttons {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

/* Ref fixed width on desktop */
.ref {
    flex: 0 0 auto;
    min-width: 4em;
}

/* Mobile Responsiveness */
@media (max-width: 1038px) {
    .course_summary_box {
        padding: 12px;
        border-radius: 8px;
    }

    .course-row {
        padding: 6px 0;
        border-bottom: 1px solid var(--ac6-border);
    }

    .ref {
        display: none;
    }

    .title {
        flex: 1;
        font-size: 0.9rem;
    }

    .course-buttons {
        flex: 0 0 auto;
    }

}

/* ══════════════════════════════════════════════════════
   New component styles for enhanced categorie.php
   (hero header + rc-card grid)
   ══════════════════════════════════════════════════════ */

/* ── Page title (inside description_box card) ─────────── */
.cat-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.15;
    text-align: left;
}

.cat-subtitle {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    color: var(--ac6-text) !important;
    line-height: 1.5;
    text-align: left;
}

.cat-title-sep {
    border: none;
    border-top: 1px solid rgba(0,0,0,.08);
    margin: 0.9rem 0;
}

/* ── Description box ──────────────────────────────────── */
.cat-description {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--ac6-surface-subtle);
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--ac6-text);
}

.cat-description p:first-child { margin-top: 0; }
.cat-description p:last-child  { margin-bottom: 0; }

/* ── Course section ───────────────────────────────────── */
.cat-courses {
    margin-bottom: 2rem;
}

.cat-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--category-color, #0288d1);
}

.cat-section-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ac6-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cat-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--category-color, #0288d1) 12%, transparent);
    color: var(--category-color, #0288d1);
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--category-color, #0288d1) 25%, transparent);
}

/* ── Course card grid ─────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

/* ── rc-card ──────────────────────────────────────────── */
.rc-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    padding: 9px 11px;
    min-height: 72px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: var(--ac6-radius-lg);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, border-color .15s, transform .12s;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.rc-card:hover {
    border-color: var(--category-color, #0288d1);
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.rc-card-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rc-card-ref {
    align-self: flex-start;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--category-color, #0288d1);
    background: color-mix(in srgb, var(--category-color, #0288d1) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--category-color, #0288d1) 22%, transparent);
    border-radius: 3px;
    padding: 1px 5px;
    white-space: nowrap;
    line-height: 1.5;
}

.rc-card-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ac6-secondary);
    line-height: 1.35;
}

.rc-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 4px;
}

.rc-card-arrow {
    color: #cbd5e1;
    transition: color .15s, transform .15s;
    display: block;
}
.rc-card:hover .rc-card-arrow {
    color: var(--category-color, #0288d1);
    transform: translateX(3px);
}

/* ── cat / rc responsive ──────────────────────────────── */
@media (max-width: 700px) {
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
    .cat-hero-body { padding: 0.9rem 1rem; }
}
@media (max-width: 420px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .rc-card { padding: 7px 9px; min-height: 60px; }
}