/* ============================================
   MPAP Document Styles - Updated to match mpap.au
   Make Peace a Priority - Document Display
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* ============================================
   Header Bar
   ============================================ */
.document-header {
    background: linear-gradient(135deg, #3B7FB8 0%, #2E6A9E 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-container {
    /* No max-width - allow full browser width */
    margin: 0;
    padding: 0 30px;
}

.document-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.document-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 20px;
    line-height: 1.5;
}

.document-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.btn-download {
    background: #E53935;
    color: white;
}

.btn-download:hover {
    background: #C62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-pdf {
    background: #E53935;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-pdf:hover {
    background: #C62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-pdf svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Document Body Layout - UPDATED FOR BETTER PROPORTIONS
   ============================================ */
.document-body {
    display: flex;
    /* No max-width - allow full browser width */
    margin: 0;
    min-height: calc(100vh - 400px);
}

/* ============================================
   Sidebar Navigation - NARROWER LIKE MPAP.AU
   ============================================ */
.document-sidebar {
    width: 200px; /* Much narrower for more content space */
    background: #F5F5F5;
    padding: 25px 12px; /* Minimal padding */
    border-right: 1px solid #E0E0E0;
    position: sticky;
    top: 0;
    height: fit-content;
    max-height: 100vh;
    overflow-y: auto;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.sidebar-title {
    font-size: 16px; /* Slightly smaller */
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3B7FB8;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 12px; /* Better spacing between items */
}

.sidebar-nav a {
    color: #3B7FB8;
    text-decoration: none;
    font-size: 14px; /* Slightly smaller */
    display: block;
    padding: 6px 10px; /* Reduced padding */
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.sidebar-nav a .bullet {
    color: #3B7FB8;
    margin-right: 6px;
    font-weight: bold;
}

.sidebar-nav a:hover {
    background: #E3F2FD;
    color: #2E6A9E;
    padding-left: 14px;
}

.sidebar-nav a.active {
    background: #3B7FB8;
    color: white;
    font-weight: 600;
}

/* ============================================
   Main Content Area - WIDER FOR BETTER READABILITY
   ============================================ */
.document-content {
    flex: 1;
    padding: 40px 80px; /* More horizontal padding for wider content */
    background: white;
    min-width: 0; /* Allow flex item to shrink if needed */
}

.document-content.no-sidebar {
    max-width: 900px;
    margin: 0 auto;
}

/* Content Sections */
.content-section,
section[id] {
    margin-bottom: 40px; /* Slightly reduced */
}

/* ============================================
   HEADINGS - ALL BOLD LIKE MPAP.AU
   ============================================ */
.content-section h1,
.document-content h1 {
    color: #3B7FB8;
    font-size: 32px;
    font-weight: 700; /* BOLD */
    margin-bottom: 20px;
    margin-top: 30px;
    padding-bottom: 12px;
    border-bottom: 3px solid #E3F2FD;
    line-height: 1.3;
}

.content-section h2,
.document-content h2 {
    color: #3B7FB8;
    font-size: 26px; /* Slightly smaller */
    font-weight: 700; /* BOLD */
    margin-bottom: 18px;
    margin-top: 35px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E3F2FD;
    line-height: 1.3;
}

.content-section h3,
.document-content h3 {
    color: #2E6A9E;
    font-size: 21px;
    font-weight: 700; /* BOLD - was 600 */
    margin-bottom: 15px;
    margin-top: 28px;
    line-height: 1.3;
}

.content-section h4,
.document-content h4 {
    color: #444;
    font-size: 18px;
    font-weight: 700; /* BOLD - was 600 */
    margin-bottom: 12px;
    margin-top: 22px;
    line-height: 1.3;
}

.content-section h5,
.document-content h5 {
    color: #555;
    font-size: 16px;
    font-weight: 700; /* BOLD */
    margin-bottom: 10px;
    margin-top: 18px;
    line-height: 1.3;
}

.content-section h6,
.document-content h6 {
    color: #666;
    font-size: 15px;
    font-weight: 700; /* BOLD */
    margin-bottom: 10px;
    margin-top: 16px;
    line-height: 1.3;
}

/* ============================================
   TEXT CONTENT - IMPROVED READABILITY
   ============================================ */
.content-section p,
.document-content p {
    margin-bottom: 18px;
    font-size: 16px;
    line-height: 1.75; /* Slightly increased */
    color: #444;
    /* No max-width - let content use full width */
}

.content-section ul,
.content-section ol,
.document-content ul,
.document-content ol {
    margin-bottom: 20px;
    margin-left: 30px;
    /* No max-width - let lists use full width */
}

.content-section li,
.document-content li {
    margin-bottom: 10px; /* Increased spacing */
    line-height: 1.7;
    font-size: 16px;
}

.content-section strong,
.document-content strong {
    font-weight: 700; /* Stronger bold */
    color: #222;
}

.content-section em,
.document-content em {
    font-style: italic;
}

/* ============================================
   Highlighted Boxes
   ============================================ */
.highlight-box,
.document-content blockquote {
    background: #E3F2FD;
    border-left: 4px solid #3B7FB8;
    padding: 25px;
    margin: 30px 0;
    border-radius: 4px;
    /* No max-width - let boxes use full width */
}

.highlight-box p,
.document-content blockquote p {
    margin-bottom: 10px;
}

.highlight-box p:last-child,
.document-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Tables - Better Styling
   ============================================ */
.document-content table {
    width: 100%;
    /* No max-width - let tables use full width */
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
}

.document-content table th {
    background: #3B7FB8;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 700;
}

.document-content table td {
    padding: 10px 12px;
    border-bottom: 1px solid #E0E0E0;
}

.document-content table tr:hover {
    background: #F5F5F5;
}

/* ============================================
   Statistics Boxes
   ============================================ */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    /* No max-width - let stats use full width */
}

.stat-box {
    background: #3B7FB8;
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(59, 127, 184, 0.3);
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

/* ============================================
   Footer
   ============================================ */
.document-footer {
    background: linear-gradient(135deg, #1A4D7E 0%, #0D3A5F 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

.footer-content {
    /* No max-width - allow full browser width */
    margin: 0;
    padding: 0 30px;
}

.footer-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-tagline {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #81C4F5;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .header-container,
    .footer-content {
        padding: 0 20px;
    }
    
    .document-content {
        padding: 30px 40px;
    }
    
    .document-sidebar {
        width: 180px;
        padding: 20px 10px;
    }
    
    .document-content {
        padding: 30px 50px;
    }
}

@media (max-width: 768px) {
    .document-body {
        flex-direction: column;
    }
    
    .document-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #E0E0E0;
        position: static;
        max-height: none;
    }
    
    .document-content {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .document-title {
        font-size: 28px;
    }
    
    .document-subtitle {
        font-size: 16px;
    }
    
    .content-section h2,
    .document-content h2 {
        font-size: 22px;
    }
    
    .stats-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-number {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 15px;
    }
    
    .document-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .document-content {
        padding: 20px 15px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .document-header,
    .document-sidebar,
    .document-footer,
    .document-actions {
        display: none;
    }
    
    .document-body {
        display: block;
    }
    
    .document-content {
        padding: 0;
        max-width: 100%;
    }
    
    .content-section h2,
    .document-content h2 {
        page-break-after: avoid;
    }
    
    .content-section,
    section[id] {
        page-break-inside: avoid;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.sidebar-nav a:focus,
.btn:focus {
    outline: 2px solid #3B7FB8;
    outline-offset: 2px;
}

.sidebar-nav a:focus:not(:focus-visible),
.btn:focus:not(:focus-visible) {
    outline: none;
}

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3B7FB8;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #E3F2FD;
    border-top-color: #3B7FB8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Sidebar PDF Download Button
   ============================================ */
.sidebar-download {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

.btn-pdf-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #E53935;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-pdf-download:hover {
    background: #C62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-pdf-download svg {
    flex-shrink: 0;
}

/* ============================================
   Document Images
   ============================================ */
.document-image {
    margin: 30px 0;
    text-align: center;
}

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

/* Header images (typically at top of document) */
.document-content > .document-image:first-child {
    margin-top: 0;
    margin-bottom: 40px;
}

/* Links in content */
.document-content a {
    color: #3B7FB8;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.document-content a:hover {
    color: #2E6A9E;
}

.document-content a:visited {
    color: #5A4A9E;
}
