/* ==========================================================================
   SINGLE PROGRAM
   Page-specific layout and elements only.
   Shared pieces live in global.css, components.css and sidebar-cards.css.
   File: assets/css/single-program.css
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. PAGE LAYOUT
   -------------------------------------------------------------------------- */

.single-program-page {
    padding-bottom: clamp(2rem, 5vw, 4rem);
}

.single-program-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
}

.single-program-main,
.single-program-sidebar {
    min-width: 0;
}

.single-program-sidebar-inner {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.program-article {
    gap: 2rem;
}


/* --------------------------------------------------------------------------
   2. PROGRAM HEADER
   -------------------------------------------------------------------------- */

.program-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.program-header__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.program-title {
    flex: 1 1 320px;
    max-width: none;
    margin: 0;
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    line-height: var(--line-height-snug);
}

.program-status {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    font-size: var(--font-size-sm);
}

.program-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.program-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.program-meta__item svg {
    width: 1.05rem;
    height: 1.05rem;
    color: var(--color-primary);
}

.program-meta__item strong {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.program-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}


/* --------------------------------------------------------------------------
   3. PROGRAM CONTENT (the_content)
   -------------------------------------------------------------------------- */

.program-content,
.program-richtext {
    line-height: 1.8;
    overflow-wrap: break-word;
}

.program-content > :first-child,
.program-richtext > :first-child {
    margin-top: 0;
}

.program-content > :last-child,
.program-richtext > :last-child {
    margin-bottom: 0;
}

.program-content h2,
.program-content h3,
.program-content h4 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.program-content p,
.program-richtext p {
    margin-bottom: 1rem;
}

.program-content ul,
.program-content ol,
.program-richtext ul,
.program-richtext ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.program-content li,
.program-richtext li {
    margin-bottom: 0.45rem;
}

.program-content a,
.program-richtext a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.program-content img {
    border-radius: var(--radius-md);
}

.program-content table,
.program-richtext table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.program-content th,
.program-content td,
.program-richtext th,
.program-richtext td {
    padding: 0.7rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.program-content th,
.program-richtext th {
    background: var(--color-background);
    font-weight: var(--font-weight-bold);
}


/* --------------------------------------------------------------------------
   4. SECTIONS (at a glance, eligibility, fee structure, related)
   -------------------------------------------------------------------------- */

.program-section {
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.program-section__header {
    margin-bottom: 1.25rem;
}

.program-section__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    line-height: 1.35;
}

.program-section__title svg {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--color-primary);
}

.program-section__intro {
    margin: 0.5rem 0 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.7;
}

.program-richtext {
    font-size: var(--font-size-base);
}


/* --------------------------------------------------------------------------
   5. AT A GLANCE
   -------------------------------------------------------------------------- */

.program-glance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.program-glance__item {
    padding: 0.9rem 1rem;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.program-glance__item dt {
    margin-bottom: 0.25rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.program-glance__item dd {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
}

.program-glance__item dd a {
    color: var(--color-primary);
}


/* --------------------------------------------------------------------------
   6. RELATED PROGRAMS
   -------------------------------------------------------------------------- */

.program-related-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.35rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.program-related-meta svg {
    width: 1rem;
    height: 1rem;
    color: var(--color-primary);
}

.program-related-meta:last-child {
    margin-bottom: 0;
}

.single-program-page .card__title a:hover {
    color: var(--color-primary);
}


/* --------------------------------------------------------------------------
   7. SIDEBAR: PROGRAM DETAILS LIST
   -------------------------------------------------------------------------- */

.program-details-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 1.15rem;
    list-style: none;
}

.program-details-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.program-details-item > svg {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    color: var(--color-primary);
}

.program-details-item strong {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.program-details-item a {
    color: var(--color-primary);
}

.program-details-item .badge {
    margin-left: 0.25rem;
}


/* --------------------------------------------------------------------------
   8. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {

    .single-program-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .single-program-sidebar-inner {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

@media (max-width: 640px) {

    .program-glance,
    .single-program-sidebar-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .program-actions {
        flex-direction: column;
    }

    .program-actions .cta-btn {
        width: 100%;
    }

    .program-article {
        gap: 1.5rem;
    }
}