/* ============================================
   COURSE CONTENT STYLING - Enhanced Typography
   Theme: Green (#28a745)
   ============================================ */

.cours {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-bottom: 2em;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* ============================================
   HEADING HIERARCHY
   ============================================ */

/* H1 - Main Page Title */
.cours .title {
    font-size: 1.85em !important;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.8em;
    margin-top: 0.3em;
    color: #1a202c;
    letter-spacing: -0.03em;
}

/* H2 - Major Section Headers */
.cours h2 {
    font-size: 1.55em !important;
    font-weight: 700;
    color: #2d3748;
    margin-top: 2em;
    margin-bottom: 0.75em;
    padding-bottom: 0.3em;
    border-bottom: 3px solid #e2e8f0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* First H2 - reduce top margin for better spacing */
.cours h2:first-of-type {
    margin-top: 15px;
}

/* H3 - Subsection Headers */
.cours h3 {
    font-size: 1.2em !important;
    font-weight: 600;
    color: #374151;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* H4 - Sub-subsection Headers */
.cours h4 {
    font-size: 1.1em !important;
    font-weight: 600;
    color: #4b5563;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    line-height: 1.4;
}

/* H5 - Minor Headers */
.cours h5 {
    font-size: 1em !important;
    font-weight: 600;
    color: #6b7280;
    margin-top: 1em;
    margin-bottom: 0.4em;
}

/* ============================================
   TABLE OF CONTENTS - Compact Green Theme
   ============================================ */

.toc-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4f8 100%);
    padding: 1.5em;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2em;
}

.toc-header {
    font-size: 1em;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.8em;
    display: flex;
    align-items: center;
    padding-bottom: 0.4em;
    border-bottom: 2px solid #28a745;
}

.toc-header .icon {
    margin-right: 0.4em;
    color: #28a745;
    font-size: 1.1em;
}

.toc-container ol {
    margin-left: 1.2em;
    counter-reset: item;
    list-style-type: none !important;
    padding-left: 0;
    line-height: 1.4;
}

/* Also apply to sommaire ol specifically */
.sommaire ol {
    list-style-type: none !important;
    counter-reset: item;
}

.toc-container ol li,
.sommaire ol li {
    margin-bottom: 0.5em;
    counter-increment: item;
    position: relative;
    padding-left: 1.8em;
    line-height: 1.4;
    font-size: 0.95em;
    transition: all 0.2s ease;
    list-style-type: none !important;
}

.toc-container ol li::before,
.sommaire ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #28a745;
    font-size: 1em;
    width: 1.5em;
}

.toc-container ol li:hover,
.sommaire ol li:hover {
    padding-left: 2em;
    color: #28a745;
}

.toc-container ol li:last-child {
    margin-bottom: 0;
}

/* Sommaire styling */
.cours .sommaire {
    font-size: 0.95em;
}

.cours .sommaire strong {
    color: #1a202c;
    font-size: 1.1em;
    display: block;
    margin-bottom: 0.5em;
}

/* ============================================
   CONTENT ELEMENTS
   ============================================ */

/* Paragraphs */
.cours p {
    margin-bottom: 1.2em;
    line-height: 1.7;
}

/* Lists */
.cours ul,
.cours ol {
    margin-left: 1.8em;
    margin-bottom: 1.2em;
    line-height: 1.6;
}

.cours li {
    margin-bottom: 0.5em;
    padding-left: 0.3em;
}

.cours ul li {
    list-style-type: disc;
}

.cours ol li {
    list-style-type: decimal;
}

/* Nested lists */
.cours ul ul,
.cours ol ol,
.cours ul ol,
.cours ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Text formatting */
.cours strong {
    font-weight: 700;
    color: #1a202c;
}

.cours em {
    font-style: italic;
}

.cours code {
    background-color: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
    color: #e74c3c;
}

.cours pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.2em;
    font-size: 0.9em;
    line-height: 1.5;
}

.cours pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.cours blockquote {
    border-left: 4px solid #28a745;
    padding-left: 1em;
    margin-left: 0;
    margin-bottom: 1.2em;
    color: #4b5563;
    font-style: italic;
    background-color: #f8fafc;
    padding: 1em;
    border-radius: 4px;
}

/* ============================================
   COURSE META CARDS - Modern Grid Layout
   ============================================ */

.section-divider {
    margin: 2em 0;
    border: none;
    height: 1px;
    background: #e5e7eb;
}

.meta-cards-grid {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin: 2em 0;
}

.meta-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.2em 1em;
    background: #ffffff;
    transition: all 0.2s ease;
    position: relative;
}

.meta-card:first-child {
    border-radius: 8px 0 0 8px;
}

.meta-card:last-child {
    border-radius: 0 8px 8px 0;
}

.meta-card:hover {
    background: #f0f9ff;
    transform: scale(1.05);
    z-index: 1;
}

.meta-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #28a745;
    border-radius: 50%;
    color: white;
    font-size: 1em;
    margin-bottom: 0.6em;
}

.meta-content {
    text-align: center;
}

.meta-label {
    font-size: 0.65em;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.3em;
}

.meta-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

@media screen and (max-width: 768px) {
    .meta-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
    }
    
    .meta-card:first-child {
        border-radius: 8px 0 0 0;
    }
    
    .meta-card:nth-child(2) {
        border-radius: 0 8px 0 0;
    }
    
    .meta-card:nth-child(3) {
        border-radius: 0 0 0 8px;
    }
    
    .meta-card:last-child {
        border-radius: 0 0 8px 0;
    }
}

/* ============================================
   DOWNLOAD SECTION
   ============================================ */

.download-section {
    text-align: center;
    margin: 2.5em 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8em;
    padding: 1em 2.5em;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(32, 156, 238, 0.2);
}

.download-btn:hover {
    background: #1067a8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(32, 156, 238, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.3em;
}

.btn-text {
    font-size: 1em;
    letter-spacing: 0.3px;
}

.download-info {
    margin-top: 1em;
    font-size: 0.85em;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
}

.download-info i {
    color: #10b981;
    font-size: 0.9em;
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS (Legacy)
   ============================================ */

.button.is-info {
    background-color: #28a745 !important;
    color: #fff;
    border: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button.is-info:hover {
    background-color: #1067a8 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(32, 156, 238, 0.2);
}

.button.is-info:active {
    transform: translateY(0);
}

/* ============================================
   COURSE INFO ITEMS
   ============================================ */

.course-info-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0;
    font-size: 0.95em;
}

.course-info-item .icon {
    margin-right: 0.7rem;
    color: #28a745;
    font-size: 1.1em;
}

.course-info-item strong {
    margin-right: 0.5rem;
    color: #1a202c;
}

/* ============================================
   SIDEBAR - Related Content
   ============================================ */
