/* Single Article Template Styles */
.single-post .single-article-container {
    padding: 0 !important;
}

.single-post .single-article-wrapper {
    /* Removed padding as it's handled at a higher level */
}

.single-post .single-article-columns {
    gap: 2rem;
}

/* Article categories */
.single-post .article-category-row {
    display: flex;
    justify-content: space-between;
    color: var(--gray-text);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.single-post .parcours-category {
    margin-right: auto;
}

.single-post .partie-category {
    margin-left: auto;
}

/* Article title */
.single-post .article-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0 1.5rem;
    color: var(--black);
}

/* Article thumbnail */
.single-post .article-thumbnail {
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 8px;
}

.single-post .article-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/1;
    object-fit: cover;
    display: block;
}

/* Article content */
.single-post .article-content {
    margin-bottom: 2rem;
}

.single-post .article-content p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Article navigation buttons */
.single-post .article-navigation {
    margin: 2rem 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 1rem; /* Space between buttons */
}

/* Article navigation buttons */
.single-post .article-navigation {
    margin: 2rem 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 1rem; /* Space between buttons */
}

.single-post .prev-article-button,
.single-post .next-article-button {
    display: flex;
    align-items: center;
    justify-content: center; /* Center text in buttons */
    width: 100%;
    height: 60px; /* Fixed height */
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    padding: 0 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
    line-height: 1; /* Added to fix vertical alignment issues */
}

.single-post .prev-article-button:hover,
.single-post .next-article-button:hover {
    background-color: var(--black);
    opacity: 0.9;
}

/* Course progress in sidebar */
.single-post .single-article-sidebar .course-progress-cards {
    display: block; /* Override grid display when in article sidebar */
}

.single-post .single-article-sidebar .course-card {
    margin-bottom: 1rem;
}

/* Sidebar title */
.single-post .sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--black);
    text-align: right;
}

/* Sticky sidebar styles */
.single-post .single-article-sidebar {
    position: sticky;
    top: 20px; /* Distance from the top of the viewport */
    max-height: 100vh; /* Maximum height of viewport */
    overflow-y: auto; /* Enable scrolling if content is taller than viewport */
    padding-bottom: 20px; /* Add some space at the bottom */
}

/* Add some padding at the bottom of the article content */
.single-post .single-article-content {
    padding-bottom: 2rem;
}

/* Responsive styles for navigation buttons */
@media (max-width: 600px) {
    .single-post .article-navigation {
        flex-direction: column;
        width: 100%; /* Ensure container stays within screen width */
        padding: 0; /* Remove any padding that might cause overflow */
        margin-left: 0;
        margin-right: 0;
        gap: 0; /* Remove gap between buttons */
    }
    
    .single-post .prev-article-button,
    .single-post .next-article-button {
        width: 100%; /* Make buttons full width of their container */
        box-sizing: border-box; /* Include padding in width calculation */
    }
}

/* For smaller screens, disable sticky behavior */
@media (max-width: 900px) {
    .single-post .single-article-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 900px) {
    .single-post .wp-block-columns.single-article-columns {
        display: block !important;
    }
      
    .single-post .wp-block-columns.single-article-columns .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .single-post .single-article-columns {
        flex-wrap: wrap;
    }
    
    .single-post .single-article-content,
    .single-post .single-article-sidebar {
        flex-basis: 100% !important;
    }
    
    .single-post .article-title {
        font-size: 1.75rem;
    }
    
    .single-post .article-thumbnail img {
        aspect-ratio: 2/1;
    }
    
    .single-post .sidebar-title {
        margin-top: 1rem;
        text-align: left;
    }
}