/* ==========================================================================
   Creative Education Foundation — Course Detail Stylesheet
   Organized, tree-shaken, responsive stylesheet for course detail pages.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page Container & Layout
   -------------------------------------------------------------------------- */
.cd-page {
    background: #fff;
    color: #1f2937;
    padding: 2.5rem 0 4rem;
    overflow-x: hidden;
}

.cd-inner {
    width: min(100% - 2rem, var(--cc-container, 1140px));
    margin: 0 auto;
}

.cd-block + .cd-block {
    margin-top: 2.75rem;
}

.cd-block#course-details,
.cd-block:has(.courses-panel) {
    margin-top: 4.5rem;
}

.cd-title {
    margin: 0 0 1.15rem;
    color: var(--cc-navy);
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    font-family: var(--cc-font-display, inherit);
}

.cd-prose {
    color: #374151;
    font-size: 1rem;
    line-height: 1.75;
}

.cd-prose p {
    margin: 0 0 0.85rem;
}

/* --------------------------------------------------------------------------
   2. Highlights / Key Metrics Grid
   -------------------------------------------------------------------------- */
.cd-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.cd-stat {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: var(--cc-radius-lg, 16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.6rem 1.15rem 1.45rem;
    text-align: center;
    background: var(--cc-deep);
    color: #fff;
    box-shadow: var(--cc-shadow-md, 0 8px 24px -4px rgba(8, 35, 67, 0.14));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cd-stat::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cd-stat:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.cd-stat:hover {
    transform: translateY(-6px);
    box-shadow: var(--cc-shadow-xl, 0 24px 48px -12px rgba(8, 35, 67, 0.28));
}

.cd-stat__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    min-width: 3.25rem;
    min-height: 3.25rem;
    margin: 0 auto 0.85rem;
    font-size: 1.55rem;
    line-height: 1;
    border-radius: var(--cc-radius-md, 12px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    color: #fff;
    transition: transform 0.3s ease, background 0.3s ease;
}
.cd-stat:hover .cd-stat__icon {
    transform: scale(1.08) rotate(2deg);
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.cd-stat__label {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--cc-font);
    line-height: 1.3;
}

.cd-stat__value {
    margin: 0.35rem 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   3. Course Overview & Admission Help Card
   -------------------------------------------------------------------------- */
.cd-about {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 1.5rem;
    align-items: stretch;
}

.cd-help {
    position: relative;
    min-height: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(10, 33, 79, 0.18);
}

.cd-help .adm-help-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.55);
}

.cd-help .adm-help-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 46, 63, 0.55) 0%, rgba(3, 46, 63, 0.9) 100%);
}

.cd-help .adm-help-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.65rem;
    min-height: 320px;
    padding: clamp(1.75rem, 3vw, 2.25rem) 1.35rem;
    color: #fff;
}

.cd-help .adm-help-title {
    margin: 0;
    font-family: var(--cc-font-display, inherit);
    font-size: 1.45rem;
    font-weight: 700;
}

.cd-help .adm-help-phone,
.cd-help .adm-help-email {
    margin: 0;
}

.cd-help .adm-help-phone a,
.cd-help .adm-help-email a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.cd-help .adm-help-phone a:hover,
.cd-help .adm-help-email a:hover {
    color: var(--cc-gold, #c8963e);
}

/* --------------------------------------------------------------------------
   4. Faculty Slider
   -------------------------------------------------------------------------- */
.cd-staff-wrap {
    position: relative;
}

.cd-staff-swiper {
    width: 100%;
    overflow: hidden;
}

.cd-staff-swiper .swiper-slide {
    width: min(280px, 78vw);
    height: auto;
}

.cd-staff-swiper .faculty-member-card {
    height: 100%;
    content-visibility: visible;
}

.cd-staff-wrap .news-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(10, 33, 79, 0.12);
    box-shadow: 0 4px 16px rgba(10, 33, 79, 0.15);
    color: var(--cc-navy);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.cd-staff-wrap .news-arrow:hover {
    background: var(--cc-navy);
    color: #ffffff;
}

.cd-staff-wrap .news-arrow-left {
    left: -18px;
}

.cd-staff-wrap .news-arrow-right {
    right: -18px;
}

/* --------------------------------------------------------------------------
   5. Requirements & Target Audience List
   -------------------------------------------------------------------------- */
.cd-reqs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}

.cd-reqs li {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    color: #374151;
    line-height: 1.55;
}

.cd-reqs__num {
    color: var(--cc-gold, #c8963e);
    font-weight: 700;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   6. Career Opportunities Tables
   -------------------------------------------------------------------------- */
.cd-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(10, 33, 79, 0.06);
    background: #fff;
    margin-bottom: 1rem;
}

.cd-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.cd-table th,
.cd-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #ece7dc;
    font-size: 0.95rem;
    line-height: 1.45;
}

.cd-table caption,
.cd-table__caption {
    background: var(--cc-deep);
    color: #fff;
    font-weight: 700;
    border-bottom: 0;
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.95rem;
    caption-side: top;
}

.cd-table tbody tr:last-child td {
    border-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Interactive FAQ Accordion
   -------------------------------------------------------------------------- */
.cd-faq {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.cd-faq .faq-item {
    border: 1px solid rgba(8, 35, 67, 0.1);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(8, 35, 67, 0.05);
    overflow: hidden;
    transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cd-faq .faq-item.active {
    border-color: var(--cc-red, #e11d2e);
    box-shadow: 0 8px 24px rgba(225, 29, 46, 0.1);
}

.cd-faq .faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.cd-faq .question-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--cc-deep);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 0.3s ease, transform 0.3s ease;
}

.cd-faq .faq-item.active .question-number {
    background: linear-gradient(135deg, var(--cc-red, #e11d2e) 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(225, 29, 46, 0.3);
}

.cd-faq .question-text {
    flex: 1;
    font-family: var(--cc-font-display, inherit);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--cc-navy);
    line-height: 1.35;
}

.cd-faq .faq-question i {
    color: var(--cc-navy);
    font-size: 0.85rem;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.cd-faq .faq-item.active .faq-question i {
    color: var(--cc-red, #e11d2e);
    transform: rotate(180deg);
}

.cd-faq .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.cd-faq .faq-answer p {
    margin: 0;
    padding: 0 1.15rem 1.15rem 4.2rem;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.65;
}

@media (max-width: 640px) {
    .cd-faq .faq-answer p {
        padding: 0 1rem 1rem 1rem;
    }
}

/* --------------------------------------------------------------------------
   8. Other Courses Panel
   -------------------------------------------------------------------------- */
.cd-block .courses-panel {
    background: var(--cc-deep);
    border-radius: 28px;
    padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 3rem) clamp(2.5rem, 4vw, 3.5rem);
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(12, 31, 63, 0.45);
}

.cd-block .courses-panel-header {
    margin: 0 0 1.15rem;
}

.cd-block .courses-panel-title {
    margin: 0;
    color: #fff;
    font-family: var(--cc-font-display, inherit);
    font-size: clamp(1.85rem, 3.5vw, 2.65rem);
    font-weight: 700;
    line-height: 1.2;
}

.cd-block .course-split-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
}

.cd-block .course-split {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    background: var(--cc-navy);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cd-block .course-split:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.cd-block .course-split img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}

.cd-block .course-split:hover img {
    transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   9. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
    .cd-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cd-about,
    .cd-reqs {
        grid-template-columns: 1fr;
    }
    .cd-block .courses-panel {
        padding: 32px 24px 40px;
    }
    .cd-block .course-split-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cd-stats {
        grid-template-columns: 1fr;
    }
    .cd-block .courses-panel {
        padding: 24px 16px 28px;
        border-radius: 20px;
    }
    .cd-block .course-split-grid {
        grid-template-columns: 1fr;
    }
    .cd-staff-wrap .news-arrow {
        display: none;
    }
}
