/* Single CPT Styles (Formation & Formateur) */
.single-cpt-container {
    width: 92vw;
    max-width: 1280px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 3fr 1fr;
    grid-template-areas:
        "header sidebar"
        "content sidebar";
    gap: 40px;
    align-items: start;
}

/* Header */
.single-cpt-header {
    grid-area: header;
    margin-bottom: 30px;
    padding: 50px;
    background-color: #765285;
    color: #fff;
    border-radius: 20px;
}

/* Typography */
.cpt-subtitle-pill {
    display: inline-block;
    padding: 6px 14px;
    background-color: #fff;
    color: #765285;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.single-cpt-title {
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #ffffff;
    line-height: 1.2;
}

.single-cpt-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Metrics Grid Row */
.single-cpt-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

/* Meta Row */
.single-cpt-meta-row {
    display: flex;
    gap: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-formateur-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: -2px;
    /* Slight adjustment since gap deals with spacing */
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.meta-formateur-link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s;
    gap: 10px;
}

.meta-formateur-link:hover {
    color: #ffffff;
}

/* Sidebar (Floating Card) */
.single-cpt-sidebar {
    grid-area: sidebar;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    position: sticky;
    top: 120px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
}

/* Sidebar Image Widget */
.cpt-sidebar-image-widget {
    margin: -24px -24px 24px -24px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.cpt-sidebar-image-widget img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Generic Sidebar Widgets */
.sidebar-widget-title {
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #111;
}

.cpt-sidebar-widget {
    margin-bottom: 30px;
}

.cpt-sidebar-widget:last-child {
    margin-bottom: 0;
}

.cpt-btn-action {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--theme-button-text-initial-color);
    background: var(--theme-button-background-hover-color);
    padding: 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.cpt-btn-action:hover {
    color: var(--theme-button-text-hover-color);
    background: var(--theme-button-background-initial-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Details List (Simplified) */
.cpt-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cpt-details-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.cpt-details-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-icon {
    width: 32px;
    height: 32px;
    background: #f4f4f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #444;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.detail-content {
    display: flex;
    flex-direction: column;
}

.detail-content strong {
    font-size: 0.9rem;
    color: #111;
    margin-bottom: 2px;
    display: block;
}

.detail-content div {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* Content */
.single-cpt-content {
    grid-area: content;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

/* Fix nested grid width */
.single-cpt-content .my-cpt-grid-container {
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    padding: 0;
}


/* Formateur Specific Styles */
.formateur-sidebar-card {
    text-align: center;
}

.formateur-profile-image-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    position: relative;
}

.formateur-profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.formateur-name {
    margin: 0 0 5px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.formateur-role {
    display: inline-block;
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.formateur-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
    /* Keep contact info readable */
    display: inline-block;
    /* Center block inside parent */
    width: 100%;
}

.formateur-contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #555;
    font-size: 0.95rem;
    justify-content: center;
    /* Center items in card */
}

.formateur-contact-list a {
    color: inherit;
    text-decoration: none;
}

.formateur-contact-list a:hover {
    text-decoration: underline;
}

.cpt-section-title {
    font-size: 1.8rem;
    margin: 40px 0 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}


/* Formateur Stats Grid */
.formateur-stats-grid {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
}

.stat-value small {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}


/* Mobile Responsive */
@media (max-width: 900px) {
    .single-cpt-container {
        display: flex;
        flex-direction: column;
        max-width: 92vw;
        gap: 30px;
    }

    .single-cpt-header {
        order: 1;
    }

    .single-cpt-sidebar {
        order: 2;
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }

    .single-cpt-content {
        order: 3;
    }

    .single-cpt-metrics-grid {
        grid-template-columns: 1fr;
        /* Stack metrics on small mobile? Or 2 col? */
        gap: 15px;
    }

    .single-cpt-meta-row {
        flex-direction: column;
        gap: 15px;
    }

    .formateur-stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 20px;
        margin-top: 20px;
    }
}

/* Turn into shared utility if reused often, but for now group selectors */
.cpt-contact-card,
.cpt-join-card {
    background: #fbfbfb;
    padding: 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 50px;
    border: 1px solid #eee;
    gap: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
}

.cpt-contact-content h3,
.cpt-join-content h3 {
    font-size: 1.3rem;
    margin: 0 0 5px;
    font-weight: 700;
    color: #1a1a1a;
}

.cpt-contact-content p,
.cpt-join-content p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.cpt-btn-counselor,
.cpt-btn-join {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
    background: #765285;
    /* Brand color */
    color: #fff;
}

.cpt-btn-counselor:hover,
.cpt-btn-join:hover {
    background: #5a3d66;
    color: #fff;
}

@media (max-width: 600px) {

    .cpt-contact-card,
    .cpt-join-card {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .cpt-btn-counselor,
    .cpt-btn-join {
        width: 100%;
    }
}

/* Mobile Sticky Footer */
.cpt-mobile-sticky-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-top: 1px solid #eee;

    /* Animation defaults */
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cpt-mobile-sticky-footer.is-visible {
    transform: translateY(0);
}

.cpt-mobile-sticky-footer .sticky-btn {
    margin: 0;
    background: #FF6B00;
    /* Orange */
    color: #fff;
    border: none;
}

.cpt-mobile-sticky-footer .sticky-btn:hover {
    background: #e56000;
    color: #fff;
}

@media (max-width: 900px) {
    .cpt-mobile-sticky-footer {
        display: block;
    }

    /* Ensure content doesn't get hidden behind footer */
    body {
        padding-bottom: 80px;
    }
}