/* Non-critical CSS - Below the fold styles */

/* Image optimization and lazy loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

img[loading="lazy"]:not([src]) {
    opacity: 0;
}

.img-placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
    font-style: italic;
}

.responsive-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Extended typography */
h3 {
    color: #4a7c59;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.2em;
}

h4 {
    color: #5d8a66;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Lists */
ul, ol {
    margin-bottom: 16px;
    padding-left: 30px;
}

li {
    margin-bottom: 8px;
}

strong {
    color: #2c5530;
    font-weight: 600;
}

/* Code and preformatted text */
code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 16px;
}

/* Banner patterns */
.homepage-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="80" r="2.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="60" r="1.2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

/* Banner links */
.homepage-banner a {
    color: #fff3cd;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.homepage-banner a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.25);
    border-bottom-color: #fff3cd;
}

/* Extended breadcrumb styles */
.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #999;
    margin: 0 8px;
    font-size: 1.1em;
}

.breadcrumb-item a {
    color: #4a7c59;
    text-decoration: none;
    border-bottom: none;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #2d5f3f;
    border-bottom: 1px solid #2d5f3f;
}

.breadcrumb-item.active {
    color: #666;
    font-weight: 500;
}

.breadcrumb-item.active span {
    color: #333;
}

/* Related content section */
.related-content {
    margin-top: 40px;
    padding: 25px;
    background: #f8faf9;
    border-left: 4px solid #4a7c59;
    border-radius: 6px;
}

.related-content h3 {
    color: #2c5530;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-left: none;
    padding-left: 0;
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: grid;
    gap: 10px;
}

.related-item {
    margin: 0;
}

.related-link {
    display: block;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e0e6e2;
    border-radius: 4px;
    color: #2d5f3f;
    text-decoration: none;
    border-bottom: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.related-link:hover {
    background: #2d5f3f;
    color: white;
    border-color: #2d5f3f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.2);
}

.related-cta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e6e2;
}

.related-home-link {
    color: #4a7c59;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}

.related-home-link:hover {
    color: #2d5f3f;
    border-bottom: 1px solid #2d5f3f;
}

/* Content Freshness Indicator */
.content-freshness {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9em;
}

.freshness-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.publish-date, .last-updated {
    margin: 0;
    color: #495057;
}

.freshness-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 8px;
}

.freshness-badge.fresh {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.freshness-badge.current {
    background: #e2f3ff;
    color: #0c5460;
    border: 1px solid #b3d7ff;
}

.freshness-badge.stable {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.freshness-badge.review {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.accuracy-note {
    margin: 12px 0 0 0;
    color: #6c757d;
    line-height: 1.4;
}

.accuracy-note small {
    font-size: 0.85em;
}

/* Table of Contents */
.table-of-contents {
    background: #f4f7f5;
    border: 1px solid #d4e6d7;
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0 35px 0;
    max-width: 400px;
}

.toc-title {
    color: #2c5530;
    font-size: 1.1em;
    margin: 0 0 15px 0;
    border: none;
    padding: 0;
}

.toc-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9em;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list ol {
    margin-top: 8px;
    margin-bottom: 0;
    padding-left: 20px;
}

.toc-list ol li {
    margin-bottom: 5px;
}

.toc-list a {
    color: #4a7c59;
    text-decoration: none;
    border-bottom: none;
    display: inline-block;
    padding: 2px 0;
    line-height: 1.4;
}

.toc-list a:hover {
    color: #2d5f3f;
    border-bottom: 1px solid #2d5f3f;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    .homepage-banner h1 {
        font-size: 2em;
    }
    
    .homepage-banner p {
        font-size: 1.1em;
    }
    
    .breadcrumb {
        font-size: 0.85em;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 6px;
    }
    
    .related-content {
        margin-top: 30px;
        padding: 20px;
    }
    
    .related-link {
        padding: 10px 14px;
        font-size: 0.95em;
    }
    
    .table-of-contents {
        max-width: 100%;
        margin: 20px 0 30px 0;
        padding: 15px;
    }
    
    .toc-list {
        font-size: 0.85em;
        padding-left: 16px;
    }
    
    .toc-list ol {
        padding-left: 16px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    main {
        box-shadow: none;
        padding: 0;
    }
    
    a {
        color: #333;
        border-bottom: none;
    }
    
    .homepage-banner {
        background: #2c5530 !important;
        color: white;
        box-shadow: none;
    }
}