.course-details-custom {
    line-height: 1.6;
}

.course-details-custom p {
    margin-bottom: 1.25rem;
}

.course-details-custom h1,
.course-details-custom h2,
.course-details-custom h3,
.course-details-custom h4,
.course-details-custom h5,
.course-details-custom h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.course-details-custom h1 { font-size: 2.25rem; }
.course-details-custom h2 { font-size: 1.875rem; }
.course-details-custom h3 { font-size: 1.5rem; }
.course-details-custom h4 { font-size: 1.25rem; }
.course-details-custom h5 { font-size: 1.125rem; }
.course-details-custom h6 { font-size: 1rem; }

.course-details-custom ul,
.course-details-custom ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.course-details-custom ul {
    list-style-type: disc;
}

.course-details-custom ol {
    list-style-type: decimal;
}

.course-details-custom li {
    margin-bottom: 0.5rem;
}

.course-details-custom li > ul,
.course-details-custom li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.course-details-custom blockquote {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #3b82f6;
    background-color: #eff6ff;
    font-style: italic;
    color: #1e40af;
    border-radius: 0 0.5rem 0.5rem 0;
}

.course-details-custom pre {
    padding: 1.25rem;
    margin: 1.5rem 0;
    background-color: #1f2937;
    color: #f9fafb;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
    line-height: 1.7;
}

.course-details-custom code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    background-color: #f3f4f6;
    color: #eb5757;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

.course-details-custom pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
    border-radius: 0;
    font-size: inherit;
}

.course-details-custom table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.course-details-custom th,
.course-details-custom td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.course-details-custom th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.course-details-custom tr:nth-child(even) {
    background-color: #fbfbfb;
}

.course-details-custom img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.course-details-custom a {
    color: #2563eb;
    text-decoration: underline;
}

.course-details-custom a:hover {
    color: #1d4ed8;
}

.course-details-custom strong, .course-details-custom b {
    font-weight: 700;
    color: #111827;
}

.course-details-custom em, .course-details-custom i {
    font-style: italic;
}

.course-details-custom hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

/* Responsive Table Updates */
@media screen and (max-width: 767px) {
    .course-details-custom table {
        display: block;
        max-height: 500px; /* Limits height for vertical scrolling */
        overflow: auto; /* Adds scrollbars automatically when needed */
        border: 1px solid #e5e7eb; /* Optional: standard border around the viewport */
        width: 100%; /* Stretches table to fill the wrapper width */
    }
    .course-details-custom table {
        font-size: 10px;
    }

    .course-details-custom table th {
        position: sticky; /* Keeps header locked at the top */
        top: 0; /* Attaches to the absolute top of the container */
        background-color: #f9fafb; /* Mandatory: prevents underlying data from peeking through */
        z-index: 10; /* Keeps headers layered safely above body text */
    }
}

/* The "+N categories" overflow badge (x-category-badges component) lives in
   custom.css now, not here , it's used on every course card platform-wide
   (student dashboard, enrolled courses, course listing, course details),
   not just this page. See custom.css for the rule and why it moved. */
