/* Responsive Design - scoped */
@media (max-width: 768px) {
    #content .medical-hero {
        padding: 40px 15px 60px;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
    }

    .medical-hero h1 {
        font-size: 2.5rem;
    }

    #content .hero-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    #content .hero-badge {
        font-size: 12px;
        padding: 6px 16px;
    }

    #content .browse-section {
        padding: 40px 15px;
    }

    #content .browse-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    #content .browse-header h2 {
        font-size: 1.5rem;
    }

    #content .system-accordion-header {
        padding: 16px 20px;
    }

    #content .articles-list {
        grid-template-columns: 1fr;
        padding: 16px 20px;
    }

    #content .medical-library-page .medical-library-article,
    #content .medical-library-page .medical-library-system,
    #content .medical-library-article,
    #content .medical-library-system {
        padding: 15px;
    }

    #content .medical-library-article .back-to-search,
    #content .medical-library-page .medical-library-article .back-to-search {
        font-size: 14px;
        margin-bottom: 20px;
    }

    #content .medical-library-article .back-to-search::before,
    #content .medical-library-page .medical-library-article .back-to-search::before {
        font-size: 16px;
    }

    #content .medical-library-page .systems-grid,
    #content .medical-library-page .articles-grid,
    #content .systems-grid,
    #content .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }

    #content .medical-library-page .system-card,
    #content .medical-library-page .article-card,
    #content .system-card,
    #content .article-card {
        padding: 15px;
    }

    #content .medical-library-page .medical-article,
    #content .medical-article {
        padding: 20px;
    }

    #content .medical-content {
        padding: 15px;
    }

    #content .medical-content .article-meta {
        flex-direction: column;
        gap: 10px;
    }

    #content .medical-content .article-meta span {
        display: block;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    #content .medical-hero h1 {
        font-size: 2rem;
    }

    #content .hero-badge {
        flex-direction: row;
        text-align: center;
        gap: 5px;
    }

    #content .search-input-wrapper {
        border-radius: 20px;
    }

    #content .search-icon {
        padding: 12px 15px;
    }

    #content .search-input {
        padding: 12px 15px 12px 0;
        font-size: 14px;
        border: none;
        background: none;
    }

    #content .browse-section {
        padding: 30px 10px;
    }

    #content .system-accordion-header {
        padding: 18px 20px;
    }

    #content .system-accordion-header:hover {
        transform: none;
    }

    .system-name {
        font-size: 15px;
    }

    .system-icon {
        font-size: 20px;
    }

    #content .accordion-toggle {
        width: 32px;
        height: 32px;
        padding: 8px;
    }

    #content .articles-list {
        padding: 20px;
        gap: 6px 12px;
        grid-template-columns: 1fr;
    }

    #content .article-link {
        padding: 12px 16px;
        font-size: 13px;
    }

    #content .view-all-link {
        padding: 14px 18px;
        font-size: 13px;
        margin-top: 6px;
    }

    #content .medical-library-page .medical-library-article,
    #content .medical-library-page .medical-library-system,
    #content .medical-library-article,
    #content .medical-library-system {
        padding: 10px;
    }

    #content .medical-library-article .back-to-search,
    #content .medical-library-page .medical-library-article .back-to-search {
        font-size: 13px;
        margin-bottom: 16px;
    }

    #content .medical-library-article .back-to-search::before,
    #content .medical-library-page .medical-library-article .back-to-search::before {
        font-size: 14px;
    }

    #content .medical-library-page .medical-article,
    #content .medical-article {
        padding: 15px;
    }

    #content .medical-content {
        padding: 10px;
    }

    #content .medical-library-page .systems-grid,
    #content .systems-grid {
        padding: 0 10px;
    }

    #content .medical-library-page .article-breadcrumb,
    #content .medical-library-page .system-breadcrumb,
    #content .article-breadcrumb,
    #content .system-breadcrumb {
        font-size: 12px;
    }


    #content .continue-learning {
        margin-top: -100px;
        padding: 120px 30px 30px;
        background: white;
        border-radius: 0;
        text-align: center;
        color: #2c3e50;
        position: relative;
        z-index: 1;
        margin-left: -25px;
        padding-left: 2em;
    }
}

/* System Articles Page - scoped */
.medical-library-system,
.medical-library-page .medical-library-system {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* System Hero Section */
.medical-library-system .system-hero,
.medical-library-page .medical-library-system .system-hero {
    background:
        linear-gradient(rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
        url('https://medical.uworld.com/wp-content/uploads/2025/07/3d_brains_falling_with_a_light_background_behind_there_needs_to_be_a_large_clear_space_in_the_center_1_1x.webp') lightgray 50% / cover no-repeat;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 60px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

.medical-library-system .system-hero::before,
.medical-library-page .medical-library-system .system-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.medical-library-system .system-hero::after,
.medical-library-page .medical-library-system .system-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.medical-library-system .system-hero-content,
.medical-library-page .medical-library-system .system-hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.medical-library-system .system-hero h1,
.medical-library-page .medical-library-system .system-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
    border: none;
    padding: 0;
}

.medical-library-system .system-hero .hero-description,
.medical-library-page .medical-library-system .system-hero .hero-description {
    font-size: 1.1rem;
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* System Content Section */
.medical-library-system .system-content,
.medical-library-page .medical-library-system .system-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-radius: 16px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.medical-library-system .system-header,
.medical-library-page .medical-library-system .system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 4px;
}

.medical-library-system .system-header h2,
.medical-library-page .medical-library-system .system-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.medical-library-system .articles-count,
.medical-library-page .articles-count {
    color: #5a6c7d;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    font-style: normal;
}

.medical-library-system .articles-grid,
.medical-library-page .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 28px 32px 32px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    position: relative;
}

.medical-library-system .article-card,
.medical-library-page .article-card {
    display: block;
    padding: 16px 20px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e1e8ed;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    min-height: 52px;
    display: flex;
    align-items: center;
}

.medical-library-system .article-card::before,
.medical-library-page .article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #1E88E5, #0056b3);
    transform: scaleY(0);
    transition: transform 0.25s ease;
    transform-origin: bottom;
}

.medical-library-system .article-card:hover,
.medical-library-page .article-card:hover {
    background: linear-gradient(135deg, #1E88E5 0%, #0056b3 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.25);
    border-color: #1E88E5;
}

.medical-library-system .article-card:hover::before,
.medical-library-page .article-card:hover::before {
    transform: scaleY(1);
    background: rgba(255, 255, 255, 0.3);
}

.medical-library-system .article-card h3,
.medical-library-page .article-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: inherit;
}

.medical-library-system .article-card h3 a,
.medical-library-page .article-card h3 a {
    color: inherit;
    text-decoration: none;
}

.medical-library-system .article-card h3 a:hover,
.medical-library-page .article-card h3 a:hover {
    color: inherit;
}

.medical-library-system .article-meta,
.medical-library-page .article-meta {
    display: none;
}

/* Expand All Link for System Pages */
.medical-library-system .system-expand-all,
.medical-library-page .medical-library-system .system-expand-all {
    text-align: right;
    margin-top: 16px;
}

.medical-library-system .system-expand-all-link,
.medical-library-page .medical-library-system .system-expand-all-link {
    color: #1E88E5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.medical-library-system .system-expand-all-link:hover,
.medical-library-page .medical-library-system .system-expand-all-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Individual Article Page - scoped */
.medical-library-article,
#content .medical-library-page .medical-library-article,
.medical-library-page .medical-library-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* Back to Search Button */
.medical-library-article .back-to-search,
.medical-library-page .medical-library-article .back-to-search,
.medical-library-home-button-wrapper {
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1200px;
    width: 100%;
    width: 100%;
}

.medical-library-home-button-wrapper .back-to-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E88E5;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-top: 1.5em;
    margin-left: 0;
    margin-bottom: 0;
}

.medical-library-home-button-wrapper .back-to-search-button:hover {
    color: #0056b3;
    text-decoration: none;
}

.medical-library-article .back-to-search:hover,
.medical-library-page .medical-library-article .back-to-search:hover,
.back-to-search-button:hover {
    color: #0056b3;
    text-decoration: none;
}

.medical-library-article h1,
.medical-library-page .medical-library-article h1 {
    color: #2c3e50;
    border-bottom: 3px solid #27ae60;
    padding-bottom: 10px;
    margin-bottom: 30px;
    margin-top: 0;
}

.medical-library-article .medical-article,
.medical-library-page .medical-article {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.6;
}

.medical-library-article .medical-article h2,
.medical-library-page .medical-article h2 {
    color: #27ae60;
    margin-top: 30px;
    margin-bottom: 15px;
}

.medical-library-article .medical-article h3,
.medical-library-page .medical-article h3 {
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 12px;
}

.medical-library-article .medical-article p,
.medical-library-page .medical-article p {
    margin-bottom: 15px;
}

.medical-library-article .medical-article ul,
.medical-library-article .medical-article ol,
.medical-library-page .medical-article ul,
.medical-library-page .medical-article ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.medical-library-article .medical-article li,
.medical-library-page .medical-article li {
    margin-bottom: 8px;
}

.medical-library-article .medical-article table,
.medical-library-page .medical-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.medical-library-article .medical-article th,
.medical-library-article .medical-article td,
.medical-library-page .medical-article th,
.medical-library-page .medical-article td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.medical-library-article .medical-article th,
.medical-library-page .medical-article th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.medical-library-article .medical-article blockquote,
.medical-library-page .medical-article blockquote {
    border-left: 4px solid #3498db;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 0 4px 4px 0;
}

/* 404 Page - scoped */
.medical-library-404,
.medical-library-page .medical-library-404 {
    text-align: center;
    padding: 60px 20px;
}

.medical-library-404 h1,
.medical-library-page .medical-library-404 h1 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.medical-library-404 p,
.medical-library-page .medical-library-404 p {
    color: #7f8c8d;
}

.medical-library-404 a,
.medical-library-page .medical-library-404 a {
    color: #3498db;
    text-decoration: none;
}

.medical-library-404 a:hover,
.medical-library-page .medical-library-404 a:hover {
    text-decoration: underline;
}

/* Content inside medical articles - highly specific selectors */
.medical-content {
    max-width: 1000px;
    margin: 0 auto;
    line-height: 1.6;
    color: #333;
}

.medical-content .article-header {
    border-bottom: 3px solid #27ae60;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.medical-content .article-header h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.2em;
}

.medical-content .article-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.medical-content .article-meta span {
    padding: 5px 10px;
    background: #ecf0f1;
    border-radius: 4px;
}

.medical-content .article-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3498db;
}

.medical-content section {
    margin-bottom: 40px;
}

.medical-content h2 {
    color: #27ae60;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

.medical-content h3 {
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.medical-content ul,
.medical-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.medical-content li {
    margin-bottom: 8px;
}

.medical-content .highlight-box {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.medical-content .highlight-box ul {
    margin-bottom: 0;
}

.medical-content .article-footer {
    border-top: 2px solid #ecf0f1;
    padding-top: 30px;
    margin-top: 50px;
}

.medical-content .references {
    margin-bottom: 30px;
}

.medical-content .references ol {
    font-size: 0.9em;
    color: #555;
}

.medical-content .article-tags h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.medical-content .tag {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 8px;
    margin-bottom: 5px;
}

.medical-content strong {
    color: #2c3e50;
}

/* Responsive Design - scoped */
@media (max-width: 768px) {
    .medical-library-page .medical-library-article,
    .medical-library-page .medical-library-system,
    .medical-library-article,
    .medical-library-system {
        padding: 15px;
    }

    .medical-library-page .medical-library-index,
    .medical-library-index {
        padding: 15px 0;
    }

    .medical-library-page .systems-grid,
    .medical-library-page .articles-grid,
    .systems-grid,
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }

    .medical-library-page .system-card,
    .medical-library-page .article-card,
    .system-card,
    .article-card {
        padding: 15px;
    }

    .medical-library-page .medical-article,
    .medical-article {
        padding: 20px;
    }

    .medical-content {
        padding: 15px;
    }

    .medical-content .article-meta {
        flex-direction: column;
        gap: 10px;
    }

    .medical-content .article-meta span {
        display: block;
        margin: 5px 0;
    }

    .medical-library-page .library-stats span,
    .library-stats span {
        display: block;
        margin: 10px 0;
    }

    .medical-library-home-button-wrapper {
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1200px;
}

.medical-library-home-button-wrapper .back-to-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E88E5;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-top: 1.5em;
    margin-left: 0;
    margin-bottom: 0;
}

.medical-library-home-button-wrapper .back-to-search-button:hover {
    color: #0056b3;
    text-decoration: none;
}


}

@media (max-width: 480px) {
    .medical-library-page .medical-library-article,
    .medical-library-page .medical-library-system,
    .medical-library-article,
    .medical-library-system {
        padding: 10px;
    }

    .medical-library-page .medical-library-index,
    .medical-library-index {
        padding: 10px 0;
    }

    .medical-library-page .medical-article,
    .medical-article {
        padding: 15px;
    }

    .medical-content {
        padding: 10px;
    }

    .medical-library-page .systems-grid,
    .systems-grid {
        padding: 0 10px;
    }

    .medical-library-page .article-breadcrumb,
    .medical-library-page .system-breadcrumb,
    .article-breadcrumb,
    .system-breadcrumb {
        font-size: 12px;
    }

    /* Back to Search Button on mobile */
    .medical-library-home-button-wrapper {
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1200px;
}

.medical-library-home-button-wrapper .back-to-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E88E5;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-top: 1.5em;
    margin-left: 0;
    margin-bottom: 0;
}

.medical-library-home-button-wrapper .back-to-search-button:hover {
    color: #0056b3;
    text-decoration: none;
}

    #content .header h1 {
        font-size: 1.4em;
    }

    #content .container {
        padding: 0;
    }
}

/* Print Styles for Articles - scoped */
@media print {
    .medical-library-page .article-breadcrumb,
    .medical-library-page .system-breadcrumb,
    .article-breadcrumb,
    .system-breadcrumb {
        display: none;
    }

    .medical-library-page .medical-article,
    .medical-article {
        box-shadow: none;
        padding: 0;
    }

    .medical-library-page .medical-library-article,
    .medical-library-article {
        padding: 0;
    }

    .medical-content {
        padding: 0;
    }
}

/**
 * Minimalist Explicit Content Warning
 * Simple icon-only overlay for medical images
 */

/* Container with rounded corners */
/* Base explicit photo styles */
.medical-library-page .explicit-photo,
.medical-article-page .explicit-photo {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Modal-specific explicit photo styles */
.explicit-photo.modal-explicit {
    display: block;
    border-radius: 0;
    height: auto;
}

.explicit-photo.modal-explicit img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

/* Blurred preview state */
.medical-library-page .explicit-photo img,
.medical-article-page .explicit-photo img {
    filter: blur(12px);
    transition: filter 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* Revealed state */
.medical-library-page .explicit-photo.revealed img,
.medical-article-page .explicit-photo.revealed img {
    filter: none;
}

/* Simple blue overlay with icon */
.medical-library-page .explicit-photo .explicit-overlay,
.medical-article-page .explicit-photo .explicit-overlay {
    position: absolute;
    inset: 0;
    background: #0000004f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
}

/* Centered icon */
.medical-library-page .explicit-photo .explicit-icon,
.medical-article-page .explicit-photo .explicit-icon {
    width: 50px;
    height: 50px;
    color: #ffffff;
}

/* Hide overlay on reveal */
/* Modal Explicit Content Warning */
.explicit-photo.modal-explicit {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0;
}

.explicit-photo.modal-explicit img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.explicit-photo.modal-explicit .explicit-overlay {
    position: absolute;
    inset: 0;
    background: #0000004f;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.explicit-photo.modal-explicit .explicit-message {
    text-align: center;
    color: #ffffff;
    padding: 2rem;
}

.explicit-photo.modal-explicit .explicit-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
}

.explicit-photo.modal-explicit p {
    font-size: 1.125rem;
    margin: 0 0 1.5rem;
    max-width: 400px;
}

.explicit-photo.modal-explicit .see-photo-btn {
    background: #ffffff;
    color: #0e5fb8;
    border: none;
    border-radius: 24px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.explicit-photo.modal-explicit .see-photo-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.medical-library-page .explicit-photo.revealed .explicit-overlay,
.medical-article-page .explicit-photo.revealed .explicit-overlay,
.explicit-photo.modal-explicit.revealed .explicit-overlay {
    display: none;
}

/* Hide breadcrumbs completely from all medical library pages */
.medical-library-page .article-breadcrumb,
.medical-library-page .system-breadcrumb,
.article-breadcrumb,
.system-breadcrumb,
.medical-breadcrumb-wrapper {
    display: none !important;
}

/* Responsive styles for system pages */
@media (max-width: 768px) {
    .medical-library-system .system-hero,
    .medical-library-page .medical-library-system .system-hero {
        padding: 40px 15px 60px;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
    }

    .medical-library-system .system-hero h1,
    .medical-library-page .medical-library-system .system-hero h1 {
        font-size: 2.5rem;
    }

    .medical-library-system .system-content,
    .medical-library-page .medical-library-system .system-content {
        padding: 40px 16px;
    }

    .medical-library-system .system-header,
    .medical-library-page .medical-library-system .system-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .medical-library-system .articles-grid,
    .medical-library-page .articles-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 20px 24px 24px;
    }
}

@media (max-width: 480px) {
    .medical-library-system .system-hero h1,
    .medical-library-page .medical-library-system .system-hero h1 {
        font-size: 2rem;
    }

    .medical-library-system .system-content,
    .medical-library-page .medical-library-system .system-content {
        padding: 30px 12px;
    }

    .medical-library-system .articles-grid,
    .medical-library-page .articles-grid {
        padding: 16px 20px 20px;
    }
}

/* Print Styles for System Pages */
@media print {
    .medical-library-system .system-hero,
    .medical-library-page .medical-library-system .system-hero {
        background: none !important;
        padding: 20px 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: auto !important;
    }

    .medical-library-system .system-content,
    .medical-library-page .medical-library-system .system-content {
        box-shadow: none;
        margin-top: 0;
        padding: 0;
    }
}


/* Article pages - overriding styles */
.blur-from-here::after {
    content: '';
    position: absolute;
    top: 0;
    left: -25px;
    right: -5px;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.5) 99%, rgba(248, 249, 250, 1) 84%, #F8F9FA 100%);
    pointer-events: none;
    z-index: 2;
}


/* Medical Library Index - Hero Section */
.medical-library-index {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.medical-hero {
    background:
        linear-gradient(rgba(255,255,255,0.72), rgba(255,255,255,0.72)),
        url('https://medical.uworld.com/wp-content/uploads/2025/07/3d_brains_falling_with_a_light_background_behind_there_needs_to_be_a_large_clear_space_in_the_center_1_1x.webp') lightgray 50% / cover no-repeat;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 60px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

.medical-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.medical-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.medical-hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 20px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #2c3e50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.badge-icon {
    margin-right: 8px;
}

.learn-more {
    color: #1E88E5;
    text-decoration: none;
    font-weight: 500;
}

.learn-more:hover {
    text-decoration: underline;
}

.badge-arrow {
    margin-left: 8px;
    color: #1E88E5;
}

.medical-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.1rem;
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    border: 2px solid #1E88E5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-wrapper:hover,
.search-input-wrapper:focus-within {
    box-shadow: 0 6px 30px rgba(0, 124, 186, 0.15);
    border-color: #0056b3;
}

.search-icon {
    padding: 15px 20px;
    color: #999;
    font-size: 18px;
}

.search-input {
    flex: 1;
    border: none;
    padding: 15px 20px 15px 0;
    font-size: 16px;
    color: #2c3e50;
    background: transparent;
    outline: none;
}

.search-container input.search-input {
    border: none;
    background: none;
}

.search-input::placeholder {
    color: #999;
}

/* Browse Systems Section */
.browse-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 24px;
    background: #fff;
    border-radius: 16px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.browse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 4px;
}

.browse-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.expand-all-btn {
    background: white;
    border: 2px solid #1E88E5;
    color: #1E88E5;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
}

.expand-all-btn:hover {
    background: #1E88E5;
    color: white;
    border-color: #1E88E5;
}

/* Systems Accordion */
.systems-accordion {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.system-accordion-item {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.system-accordion-item:last-child {
    border-bottom: none;
}

.system-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #e9ecef;
    min-height: 70px;
}

.system-accordion-header:hover {
    background: #f8f9fa;
}

.system-accordion-item.expanded .system-accordion-header {
    background: #ffffff;
    color: #1F88E5;
    border-bottom-color: #1E88E5;
}

.system-accordion-item.expanded .system-name {
    color: #0D1A26;
    font-weight: 600;
}

.system-accordion-item.expanded .accordion-toggle {
    color: #0D1A26;
    background: rgba(255, 255, 255, 0.1);
}

.system-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.system-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 28px;
    display: flex;
    justify-content: center;
}

.system-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.accordion-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.accordion-toggle:hover {
    background: rgba(0, 124, 186, 0.1);
    color: #1E88E5;
}

.accordion-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
}

.toggle-icon {
    font-size: 16px;
    font-weight: bold;
}

.system-accordion-content {
    background: #f8f9fa;
    display: none;
    border-left: 3px solid #1E88E5;
}

.system-accordion-item.expanded .system-accordion-content {
    display: block;
}

.articles-list {
    padding: 28px 32px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px 18px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #dee2e6;
}

.article-link {
    display: block;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    border: 1px solid #e1e8ed;
    min-height: 52px;
    display: flex;
    align-items: center;
}

.article-link:hover {
    background: #f0f8ff;
    color: #1E88E5;
    border-color: #1E88E5;
}

.view-all-link {
    grid-column: 1 / -1;
    display: block;
    text-align: center;
    padding: 16px 24px;
    background: white;
    border: 2px solid #1E88E5;
    border-radius: 8px;
    color: #1E88E5;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.view-all-link:hover {
    background: #1E88E5;
    color: white;
    border-color: #1E88E5;
}

/* Medical Library Index - scoped and full width */
.medical-library-index h1,
.medical-library-page .medical-library-index h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
    width: 100%;
}

.medical-library-index .library-stats,
.medical-library-page .library-stats {
    text-align: center;
    margin-bottom: 40px;
    color: #7f8c8d;
    width: 100%;
}

.medical-library-index .library-stats span,
.medical-library-page .library-stats span {
    margin: 0 15px;
    padding: 8px 16px;
    background: #ecf0f1;
    border-radius: 4px;
    font-weight: 500;
}

/* Systems Grid - scoped and constrained within full width */
.medical-library-index .systems-grid,
.medical-library-page .systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px auto 0;
    max-width: 1400px;
    padding: 0 20px;
}

.medical-library-index .system-card,
.medical-library-page .system-card {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.medical-library-index .system-card:hover,
.medical-library-page .system-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.medical-library-index .system-card h3,
.medical-library-page .system-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.medical-library-index .system-card h3 a,
.medical-library-page .system-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.medical-library-index .system-card h3 a:hover,
.medical-library-page .system-card h3 a:hover {
    color: #3498db;
}

.medical-library-index .system-meta,
.medical-library-page .system-meta {
    color: #7f8c8d;
    font-size: 14px;
}

/* Breadcrumbs - scoped to medical library only */
.medical-library-page .article-breadcrumb,
.medical-library-page .system-breadcrumb,
.article-breadcrumb,
.system-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.medical-library-page .article-breadcrumb a,
.medical-library-page .system-breadcrumb a,
.article-breadcrumb a,
.system-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.medical-library-page .article-breadcrumb a:hover,
.medical-library-page .system-breadcrumb a:hover,
.article-breadcrumb a:hover,
.system-breadcrumb a:hover {
    text-decoration: underline;
}

/* JavaScript functionality for accordion */
.medical-library-accordion-script {
    display: none;
}

/* Standalone Article Styles */
.standalone-article-wrapper {
    margin: 0;
    padding: 0 20px;
    width: 100%;
    overflow-x: hidden;
}

.standalone-article-wrapper * {
    box-sizing: border-box;
}

/* TOC styling, remove the left margin */
.standalone-article-wrapper .toc ul {
    margin-left: 0em;
}

/* Breadcrumb styling */
.medical-breadcrumb-wrapper {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    max-width: 1200px;
    max-width: 1200px;
}

.medical-breadcrumb-wrapper .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.content .continue-learning {
    margin-top: -100px;
    padding: 120px 30px 30px;
    background: white;
    border-radius: 0;
    text-align: center;
    color: #2c3e50;
    position: relative;
    z-index: 1;
    margin-left: -25px;
    margin-right: -5px;
    margin-top: -70px !important;
        padding-top: 130px !important;
}
@media (min-width: 768px) {
    #content .continue-learning {
        margin-top: -100px;
        padding: 120px 30px 30px;
        background: white;
        border-radius: 0;
        text-align: center;
        color: #2c3e50;
        position: relative;
        z-index: 1;
        margin-left: -25px;
        margin-right: -5px;
        margin-top: -70px !important;
        padding-top: 130px !important;
    }
}

@media (min-width: 769px) and (max-width: 1364px) {
    #content .back-to-search-button, .back-to-search-button {
        margin-left: 1em;
    }
}


/* Move breadcrumb above article on desktop */
@media (min-width: 1109px) {
    .site-content .ast-container {
        display: flex;
        flex-direction: column;
    }
}

/* === SYSTEM PAGE STYLES === */
.system-content-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 40px auto;
    max-width: 1200px;
    padding: 40px;
}

/* === SEARCH RESULTS PAGE STYLES === */
.search-content-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 40px auto;
    max-width: 1200px;
    padding: 40px;
}

.search-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.search-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.search-breadcrumb a:hover {
    text-decoration: underline;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.search-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
}

.search-header .results-count {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
    align-self: center;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.search-result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.search-result-card:hover {
    border-color: #1E88E5;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.search-result-card h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.search-result-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-result-card:hover h3 a {
    color: #1E88E5;
}

.search-result-card .result-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-card .result-system {
    font-size: 14px;
    color: #1E88E5;
    font-weight: 600;
}

.search-result-card .result-id {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    margin-top: 30px;
}

.no-results-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-results h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 16px;
    font-weight: 600;
}

.no-results p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.no-results a {
    color: #1E88E5;
    text-decoration: none;
    font-weight: 500;
}

.no-results a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for search results */
@media (max-width: 768px) {
    .search-content-section {
        margin: 20px;
        padding: 20px;
        border-radius: 8px;
    }

    .search-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .search-header h2 {
        font-size: 24px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }

    .search-result-card {
        padding: 15px;
    }

    .no-results {
        padding: 40px 15px;
    }

    .no-results h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .search-content-section {
        margin: 10px;
        padding: 15px;
    }

    .search-header h2 {
        font-size: 20px;
    }

    .search-results-grid {
        gap: 12px;
    }

    .search-result-card {
        padding: 12px;
    }

    .search-result-card h3 {
        font-size: 16px;
    }

    .no-results {
        padding: 30px 10px;
    }

    .no-results h3 {
        font-size: 18px;
    }

    .no-results p {
        font-size: 14px;
    }

    .expand-all-btn {
        margin: 0 auto;
        width: 100%;
    }
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.system-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
}

.system-header .articles-count {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
    align-self: center;
}

.system-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.system-article-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.system-article-card:hover {
    border-color: #1E88E5;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.system-article-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.system-article-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.system-article-card:hover h3 a {
    color: #1E88E5;
}

.system-article-card .article-meta {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Responsive adjustments for system pages */
@media (max-width: 768px) {
    .system-content-section {
        margin: 20px;
        padding: 20px;
        border-radius: 8px;
    }

    .system-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .system-header h2 {
        font-size: 24px;
    }

    .system-articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }

    .system-article-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .system-content-section {
        margin: 0px;
        margin-top: 12px;
        margin-left: -20px;
        margin-right: -20px;
        padding: 15px;
    }

    .system-header h2 {
        font-size: 20px;
    }

    .system-articles-grid {
        gap: 12px;
    }

    .system-article-card {
        padding: 12px;
    }

    .system-article-card h3 {
        font-size: 15px;
    }
}

/* Print Styles for Articles - scoped */
@media print {
    .medical-library-page .article-breadcrumb,
    .medical-library-page .system-breadcrumb,
    .article-breadcrumb,
    .system-breadcrumb {
        display: none;
    }

    .medical-library-page .medical-article,
    .medical-article {
        box-shadow: none;
        padding: 0;
    }

    .medical-library-page .medical-library-article,
    .medical-library-article {
        padding: 0;
    }

    .medical-content {
        padding: 0;
    }

    .medical-hero {
        background: none !important;
        padding: 20px 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: auto !important;
    }

    .systems-accordion {
        display: none;
    }

        .system-content-section {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .system-article-card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .search-content-section {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .search-result-card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}
