/* ==============================================
   MEP COURSES – OPEN UNIVERSITY OPENLEAN EXACT REPLICA
   Version 3.1 – With Beautiful Recommendations Box
   ============================================== */

/* ------------------------------
   1. GLOBAL CONTAINER & TYPOGRAPHY
   ------------------------------ */
.mep-course-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #fff;
}

.mep-course-main-content {
    flex: 1;
    min-width: 0;
    background: #fff;
}

/* ------------------------------
   2. COURSE HEADER
   ------------------------------ */
.mep-course-header {
    background: #fff;
    padding: 0 0 30px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e9f0;
}

.mep-course-title {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    font-weight: 300;
    color: #1e2f44;
    line-height: 1.2;
    font-family: 'Open Sans', Arial, sans-serif;
}

.mep-course-description {
    font-size: 1.25em;
    color: #2c3e50;
    line-height: 1.7;
    font-weight: 350;
    background: linear-gradient(145deg, #f6fafd 0%, #f1f7fc 100%);
    padding: 2.2em 2.5em;
    border-radius: 12px;
    border: 1px solid rgba(74,144,226,0.25);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.8);
    margin-bottom: 2em;
}

/* ------------------------------
   3. SIDEBAR NAVIGATION – OpenLearn exact
   ------------------------------ */
.mep-course-sidebar {
    flex: 0 0 300px;
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    padding: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.mep-sidebar-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e2f44;
    padding: 1.2em 1.5em;
    margin: 0;
    border-bottom: 1px solid #e5e9f0;
    background: #fafbfc;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 8px 8px 0 0;
}

.mep-content-nav {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.mep-nav-section {
    border-bottom: 1px solid #e5e9f0;
    margin: 0;
}

.mep-nav-section:last-child {
    border-bottom: none;
}

.mep-content-nav-link {
    display: flex;
    align-items: flex-start;
    padding: 1em 1.5em;
    text-decoration: none;
    font-weight: 450;
    color: #1e4b7a;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    background: #fff;
    font-size: 0.95em;
    line-height: 1.4;
}

.mep-content-nav-link:hover {
    background: #f2f7ff;
    border-left: 3px solid #4a90e2;
    color: #0a3147;
}

.mep-content-nav-link.active,
.mep-content-nav-link.current {
    background: #eef6ff;
    border-left: 3px solid #4a90e2;
    color: #0a3147;
    font-weight: 600;
}

.mep-nav-title {
    flex: 1;
    line-height: 1.4;
}

/* No numbers – .mep-nav-number is completely removed */

/* ------------------------------
   4. MAIN CONTENT – SINGLE SECTION
   ------------------------------ */
.mep-course-contents {
    background: #fff;
}

.mep-content-item {
    background: #fff;
    padding: 0.5em 0 1.5em 0;
    margin-bottom: 2em;
    border-bottom: 1px solid #e5e9f0;
}

.mep-content-item:last-child {
    border-bottom: none;
}

.mep-content-title {
    font-size: 1.8em;
    font-weight: 350;
    color: #2c3e50;
    margin: 0 0 0.8em 0;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #4a90e2;
    font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.mep-content-description {
    color: #5f6a72;
    margin-bottom: 25px;
    font-size: 1.1em;
    line-height: 1.6;
    background: #f8fafc;
    padding: 20px;
    border-left: 4px solid #4a90e2;
    border-radius: 0 8px 8px 0;
    font-weight: 350;
}

.mep-content-body {
    line-height: 1.7;
    font-size: 1.05em;
    color: #2c3e50;
}

.mep-content-body p {
    margin-bottom: 1.6em;
    line-height: 1.7;
    font-size: 1.05em;
    color: #2c3e50;
}

.mep-content-body h3 {
    color: #1e4b7a;
    font-size: 1.5em;
    margin: 30px 0 15px 0;
    font-weight: 400;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 8px;
}

.mep-content-body h4 {
    color: #2c3e50;
    font-size: 1.3em;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.mep-content-body h5 {
    color: #5f6a72;
    font-size: 1.1em;
    margin: 20px 0 10px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mep-content-body ul,
.mep-content-body ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.mep-content-body li {
    margin-bottom: 0.6em;
    line-height: 1.7;
}

.mep-content-body blockquote {
    border-left: 4px solid #4a90e2;
    padding: 1.2em 1.5em;
    margin: 1.8em 0;
    background: #f8fafc;
    font-style: italic;
    color: #4a5568;
    border-radius: 0 8px 8px 0;
}

.mep-content-footer {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid #e5e9f0;
    font-size: 0.95em;
    color: #5f6a72;
    background: #f8fafc;
    border-radius: 8px;
}

/* ------------------------------
   5. ACTIVITY BOXES – exact OpenLearn
   ------------------------------ */
.mep-content-body .activity,
.mep-content-body .mep-activity {
    background: #f9fbfd;
    border-left: 6px solid #4a90e2;
    border-top: 1px solid #e1e9f0;
    border-right: 1px solid #e1e9f0;
    border-bottom: 1px solid #e1e9f0;
    border-radius: 0 8px 8px 0;
    padding: 1.8em 2.2em;
    margin: 2.2em 0 2.5em 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.mep-content-body .activity h4,
.mep-content-body .mep-activity h4 {
    font-size: 1.3em;
    font-weight: 600;
    color: #1a4b77;
    margin-top: 0;
    margin-bottom: 0.5em;
    letter-spacing: -0.01em;
    font-family: 'Open Sans', Arial, sans-serif;
}

.mep-content-body .activity p:first-of-type,
.mep-content-body .mep-activity p:first-of-type {
    font-size: 0.95em;
    color: #5f6a72;
    margin-bottom: 1.2em;
    padding-bottom: 0.8em;
    border-bottom: 1px dashed #cbd5e0;
    font-style: italic;
}

/* ------------------------------
   6. KEY POINTS & DEFINITIONS
   ------------------------------ */
.mep-key-point {
    background: #fffbf0;
    border-left: 6px solid #f5b042;
    border-radius: 0 8px 8px 0;
    padding: 1.5em 2em;
    margin: 2em 0;
}

.mep-key-point h4 {
    color: #8a6d3b;
    margin-top: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.mep-definition {
    background: #f8fafc;
    border-left: 6px solid #6c8c9c;
    border-radius: 0 8px 8px 0;
    padding: 1.5em 2em;
    margin: 2em 0;
}

.mep-definition h4 {
    color: #1e4b7a;
    margin-top: 0;
    font-size: 1.1em;
    font-weight: 600;
}

/* ------------------------------
   7. PREVIOUS / NEXT NAVIGATION – OpenLearn exact
   ------------------------------ */
.mep-section-navigation {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid #e5e9f0;
    gap: 1.5em;
}

.mep-section-navigation a {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2em 1.5em;
    background: #f8fafc;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    text-decoration: none;
    color: #1e4b7a;
    transition: all 0.2s ease;
}

.mep-section-navigation a:hover {
    background: #fff;
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74,144,226,0.12);
    color: #0a3147;
}

.mep-nav-prev {
    align-items: flex-start;
    text-align: left;
}

.mep-nav-next {
    align-items: flex-end;
    text-align: right;
}

.mep-nav-direction {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #5f6a72;
    margin-bottom: 0.3em;
    font-weight: 600;
}

.mep-section-navigation .mep-nav-title {
    font-size: 1.1em;
    font-weight: 500;
    line-height: 1.4;
    color: #1e4b7a;
}

.mep-section-navigation a:hover .mep-nav-title {
    color: #0a3147;
}

.mep-section-navigation a:only-child {
    max-width: 50%;
}

.mep-nav-disabled {
    display: none;
}

/* ------------------------------
   8. COURSE META / FOOTER
   ------------------------------ */
.mep-course-meta {
    background: #f8fafc;
    color: #2c3e50;
    padding: 30px;
    margin-top: 40px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
}

.mep-meta-title {
    font-size: 1.3em;
    margin: 0 0 20px 0;
    font-weight: 350;
    color: #1e4b7a;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 10px;
}

.mep-meta-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.mep-meta-item {
    background: #fff;
    padding: 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.95em;
}

.mep-meta-label {
    font-weight: 600;
    font-size: 0.85em;
    color: #5f6a72;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mep-meta-value {
    font-size: 1em;
    color: #1e2f44;
    font-weight: 400;
}

/* ------------------------------
   9. CODE / PRE
   ------------------------------ */
.mep-content-body pre {
    background: #f1f5f9;
    border: 1px solid #e1e8ed;
    padding: 1.2em;
    margin: 1.5em 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    border-radius: 6px;
}

.mep-content-body code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d14;
}

/* ------------------------------
   10. TABLES
   ------------------------------ */
.mep-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
    font-size: 0.95em;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
}

.mep-content-body th {
    background: #f1f5f9;
    color: #1e2f44;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e1e8ed;
}

.mep-content-body td {
    padding: 10px 15px;
    border-bottom: 1px solid #e1e8ed;
    vertical-align: top;
}

.mep-content-body tr:last-child td {
    border-bottom: none;
}

.mep-content-body tr:nth-child(even) {
    background: #fafcfc;
}

/* ------------------------------
   11. LINKS
   ------------------------------ */
.mep-content-body a {
    color: #1e4b7a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.mep-content-body a:hover {
    color: #0a3147;
    border-bottom: 1px solid #4a90e2;
}

/* ------------------------------
   12. RECOMMENDED BOOKS & REFERENCES – Beautiful OpenLearn Style
   ------------------------------ */
.mep-course-recommendations {
    background: #faf6ed;        /* Warm, bookish background */
    border-left: 8px solid #b68b5c; /* Rich leather-bound accent */
    border-radius: 0 12px 12px 0;
    padding: 2.2em 2.5em;
    margin: 3em 0 1.5em 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
}

.mep-course-recommendations:hover {
    box-shadow: 0 10px 24px rgba(182,139,92,0.12);
}

.mep-recommendations-title {
    font-family: 'Georgia', 'Times New Roman', serif; /* Scholarly serif */
    font-size: 1.5em;
    font-weight: 600;
    color: #5e4b3c;            /* Deep brown */
    margin-top: 0;
    margin-bottom: 0.8em;
    letter-spacing: -0.01em;
    border-bottom: 1px solid #e2d6c4;
    padding-bottom: 0.4em;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

/* Optional: subtle book icon – pure CSS, no external assets */
.mep-recommendations-title::before {
    content: "📘";
    font-size: 1.2em;
    margin-right: 0.3em;
    opacity: 0.9;
}

.mep-recommendations-content {
    font-size: 1.05em;
    line-height: 1.7;
    color: #3e3a36;
}

.mep-recommendations-content p {
    margin-bottom: 1.2em;
}

.mep-recommendations-content ul,
.mep-recommendations-content ol {
    margin-bottom: 0.8em;
    padding-left: 1.8em;
}

.mep-recommendations-content li {
    margin-bottom: 0.5em;
}

.mep-recommendations-content a {
    color: #7a5a3e;
    text-decoration: none;
    border-bottom: 1px dotted #b68b5c;
    transition: color 0.2s, border-bottom 0.2s;
}

.mep-recommendations-content a:hover {
    color: #4a3729;
    border-bottom: 1px solid #7a5a3e;
}

/* ------------------------------
   13. RESPONSIVE DESIGN
   ------------------------------ */
@media (max-width: 768px) {
    .mep-course-container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    .mep-course-sidebar {
        position: static;
        max-height: none;
        flex: none;
        width: 100%;
        order: 2;
    }

    .mep-course-main-content {
        order: 1;
    }

    .mep-course-title {
        font-size: 2em;
    }

    .mep-content-title {
        font-size: 1.6em;
    }

    .mep-content-item {
        padding: 1.8em 0 1.2em 0;
    }

    .mep-meta-info {
        grid-template-columns: 1fr;
    }
    
    .mep-course-recommendations {
        padding: 1.8em 1.8em;
    }
    
    .mep-recommendations-title {
        font-size: 1.3em;
    }
}

@media (max-width: 600px) {
    .mep-section-navigation {
        flex-direction: column;
        gap: 1em;
    }

    .mep-section-navigation a {
        width: 100%;
        max-width: 100% !important;
    }

    .mep-nav-prev,
    .mep-nav-next {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .mep-course-container {
        padding: 10px;
    }

    .mep-course-title {
        font-size: 1.8em;
    }

    .mep-content-title {
        font-size: 1.4em;
    }

    .mep-content-body {
        font-size: 1em;
    }

    .mep-content-body p {
        font-size: 1em;
    }
    
    .mep-course-recommendations {
        padding: 1.5em 1.2em;
    }
}

/* ------------------------------
   14. PRINT STYLES
   ------------------------------ */
@media print {
    .mep-course-sidebar {
        display: none;
    }

    .mep-course-container {
        display: block;
        padding: 0;
    }

    .mep-course-header {
        border-bottom: 2px solid #1e4b7a;
    }

    .mep-content-item {
        break-inside: avoid;
        border-bottom: 1px solid #ccc;
    }

    .mep-content-title {
        color: #000;
    }

    .mep-section-navigation {
        display: none;
    }
    
    .mep-course-recommendations {
        border-left: 4px solid #999;
        background: #f9f9f9;
        box-shadow: none;
    }
    
    .mep-recommendations-title::before {
        content: "📘 ";
    }
}

/* ------------------------------
   15. ACCESSIBILITY
   ------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .mep-content-nav-link,
    .mep-section-navigation a,
    .mep-course-recommendations,
    .mep-recommendations-content a {
        transition: none;
    }
}

.mep-content-nav-link:focus,
.mep-section-navigation a:focus,
.mep-content-body a:focus,
.mep-recommendations-content a:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* WordPress caption styling */
.mep-content-body .wp-caption {
    max-width: 100%;
    margin: 1.5em 0;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 10px;
    border-radius: 4px;
}

.mep-content-body .wp-caption img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.mep-content-body .wp-caption-text {
    margin: 0.5em 0 0;
    padding: 0;
    font-size: 0.9em;
    color: #666;
    text-align: center;
    font-style: italic;
}