/* Financial Guide Styling */

* {
    box-sizing: border-box;
}

body {
    font-family: Charter, Georgia, 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background: #f5f5f5;
}

/* Site Header */
.site-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-branding {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.site-branding h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5em;
}

.site-branding h1 a {
    color: #fff;
    text-decoration: none;
    display: inline-block;
}

.site-branding h1 a:hover {
    color: #ffd700;
}

.tagline {
    color: #ffd700;
    font-size: 1.2em;
    margin: 0;
    font-style: italic;
}

/* Navigation */
.site-nav {
    max-width: 900px;
    margin: 1.5rem auto 0;
    padding: 0 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
    display: inline-block;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.site-nav a.active {
    background: #ffd700;
    color: #1a1a2e;
    font-weight: bold;
}

/* Main Content */
.content {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Site Footer */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.site-footer p {
    margin: 0.5rem 0;
}

.site-footer em {
    color: #ffd700;
}

/* Chapter Navigation */
.chapter-nav {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-top: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
    background: #f9f9f9;
}

.chapter-nav a {
    margin: 0 10px;
    font-weight: bold;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }

p {
    margin: 0 0 1em 0;
    text-indent: 0;
}

/* Table of Contents */
#TOC {
    border: 1px solid #ddd;
    padding: 20px;
    margin: 2em 0;
    background: #f9f9f9;
}

#TOC a {
    text-decoration: none;
    color: #0066cc;
}

#TOC a:hover {
    text-decoration: underline;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin: 1em 0;
    padding-left: 2em;
}

/* Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95em;
}

.content th,
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.92em;
}
.content th,
.content td {
    border: 1px solid #e6e6e6;
    padding: 6px 8px;
    vertical-align: top;
    text-align: left;
}
}

.content tbody tr:nth-child(odd) {
    background: #fafafa;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.table-responsive table {
    min-width: 700px; /* reduce min-width to avoid horizontal scroll where possible */
}

/* Compact tables for small reference lists (centered, not full-width) */
.table-compact {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.table-compact table {
    /* Use fixed layout so colgroup widths are respected */
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

/* Tighter, wrapped layout for compact reference tables */
.table-compact th,
.table-compact td {
    padding: 4px 6px;
    white-space: normal;
    word-break: break-word;
    vertical-align: middle;
    font-size: 0.95em;
}
/* Keep compact table alignment natural (left) for readability */

/* Make first column shrink to content and avoid wrapping so it doesn't become too wide */
/* (reverted) Previous first-column nowrap caused layout regressions; default behavior restored */

/* Portfolio-specific tweaks */
.table-portfolio table {
    font-size: 0.9em;
}
.table-portfolio th,
.table-portfolio td {
    padding: 6px 8px;
}
/* Right-align numeric columns (third column onward) for portfolio tables */
.table-portfolio th:nth-child(n+3),
.table-portfolio td:nth-child(n+3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Code and pre */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
}

pre {
    background: #f4f4f4;
    padding: 10px;
    overflow-x: auto;
    border-radius: 5px;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #ddd;
    margin: 1em 0;
    padding-left: 1em;
    color: #666;
}

/* Horizontal rules */
hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 2em 0;
}

/* Call to Action Section */
.cta-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid #ffd700;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    text-align: center;
}

.cta-section h3 {
    color: #1a1a2e;
    margin-top: 0;
}

.cta-section a {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    padding: 1rem 2rem;
    margin: 0.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.cta-section a:hover {
    background: #ffd700;
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-branding h1 {
        font-size: 1.8em;
    }
    
    .tagline {
        font-size: 1em;
    }
    
    .content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .site-nav a {
        display: block;
        margin: 0.5rem 0;
    }
    
    .cta-section a {
        display: block;
        margin: 0.5rem 0;
    }
}

/* Sidebar / Callout */
.sidebar {
    background: #fffaf0;
    border-left: 5px solid #ffd700;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Principle Box */
.principle-box {
    background: #fff8e1; /* soft amber */
    border-left: 4px solid #ffd700;
    padding: 12px 16px;
    margin: 1rem 0 1.5rem;
}
.principle-box p {
    margin: 0;
    font-weight: bold;
}

/* You Are Here mini-map */
.mini-map {
    background: #f9f9fb;
    border: 1px dashed #ddd;
    padding: 10px 14px;
    margin: 1rem 0 1.5rem;
    font-size: 0.95em;
}
.mini-map strong { font-weight: 700; }

.sidebar h3 {
    margin-top: 0;
    color: #1a1a2e;
}

.sidebar p:last-child {
    margin-bottom: 0;
}

/* Principle Callout */
.principle {
    background: #f0f7ff;
    border-left: 5px solid #0066cc;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.principle h2 {
    margin-top: 0;
    color: #1a1a2e;
}

.principle p:last-child {
    margin-bottom: 0;
}
    border: 0;
    border-top: 1px solid #ddd;
    margin: 2em 0;
}

/* Print styles */
@media print {
    body {
        max-width: 100%;
        font-size: 11pt;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    #TOC {
        page-break-after: always;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}
