/* Custom theme for Android Interview Guide */
/* Using Roboto Slab - clean, modern slab serif */

/* Import Roboto Slab from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Roboto Slab - modern, readable slab serif */
    --content-font: 'Roboto Slab', 'Rockwell', 'Georgia', serif;
    
    /* Monospace for code */
    --code-font: 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    
    /* Wider content width */
    --content-max-width: 47rem;
    
    /* Comfortable line height for reading */
    --line-height: 1.7;
}

/* Set base font size */
html {
    font-size: 16px !important;
}

/* Sidebar font size */
.sidebar {
    font-size: 12px !important;
}

/* On-this-page TOC at bottom of h1 */
.on-this-page-bottom {
    background: var(--quote-bg, #f8f9fa);
    border: 1px solid var(--quote-border, #e9ecef);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.on-this-page-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fg, #333);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.on-this-page-list {
    margin: 0;
    padding: 0;
    list-style: none;
    column-count: 2;
    column-gap: 2rem;
}

@media (max-width: 600px) {
    .on-this-page-list {
        column-count: 1;
    }
}

.on-this-page-item {
    margin: 0.25rem 0;
    break-inside: avoid;
}

.on-this-page-item-h3 {
    padding-left: 1rem;
}

.on-this-page-item a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.5;
}

.on-this-page-item a:hover {
    color: var(--links, #4183c4);
    text-decoration: underline;
}

/* Hide mdbook's built-in on-this-page sidebar */
.on-this-page {
    display: none !important;
}

/* Main content typography */
.content main {
    font-family: var(--content-font);
    font-size: 16px !important;
    line-height: var(--line-height);
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Force font on all content elements including numbers */
.content,
.content *:not(code):not(pre):not(pre *) {
    font-family: var(--content-font) !important;
    font-feature-settings: "lnum" 0, "onum" 0, "tnum" 0 !important;
    -webkit-font-feature-settings: "lnum" 0, "onum" 0, "tnum" 0 !important;
    -moz-font-feature-settings: "lnum" 0, "onum" 0, "tnum" 0 !important;
}

/* Override mdbook's default number styling */
html, body, .content main, .content p, .content li, .content span {
    font-variant: normal !important;
    font-variant-numeric: normal !important;
    font-variant-ligatures: normal !important;
}

/* Headings */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    font-family: var(--content-font);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--quote-border);
    padding-bottom: 0.5rem;
}

.content h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--quote-border);
    padding-bottom: 0.3rem;
}

.content h3 {
    font-size: 1.25rem;
    color: var(--fg);
    margin-top: 2.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed var(--quote-border);
}

.content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 2rem;
}

/* Paragraphs */
.content p {
    margin-bottom: 1.25rem;
    text-align: left;
    hyphens: none;
    -webkit-hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
}

/* Lists */
.content ul,
.content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
    line-height: var(--line-height);
}

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

/* Code blocks */
.content code {
    font-family: var(--code-font);
    font-size: 0.9rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.content pre {
    font-family: var(--code-font);
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.content pre > code {
    padding: 0;
    background: transparent;
}

/* Blockquotes */
.content blockquote {
    font-style: italic;
    border-left: 4px solid var(--quote-border);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--quote-color, inherit);
}

/* Tables */
.content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.content th,
.content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--table-border-color);
    text-align: left;
}

.content th {
    font-weight: 700;
    background: var(--table-header-bg);
}

/* Strong and emphasis */
.content strong {
    font-weight: 700;
}

.content em {
    font-style: italic;
}

/* Links */
.content a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.content a:hover {
    text-decoration-thickness: 2px;
}

/* Horizontal rules */
.content hr {
    border: none;
    border-top: 1px solid var(--quote-border);
    margin: 2.5rem 0;
}

/* Sidebar styling */
.sidebar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
}

.sidebar .chapter {
    font-size: 0.85rem;
}

.sidebar .chapter li a {
    font-size: 0.85rem;
}

/* Search box */
#searchbar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .content main {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .content h1 {
        font-size: 1.8rem;
    }
    
    .content h2 {
        font-size: 1.4rem;
    }
    
    .content h3 {
        font-size: 1.2rem;
    }
    
    .content pre {
        font-size: 0.82rem;
        padding: 0.75rem 1rem;
    }
}

/* Print styles */
@media print {
    .content main {
        font-size: 11pt;
        line-height: 1.6;
        max-width: 100%;
    }
    
    .content pre {
        font-size: 9pt;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

/* ASCII art / diagrams - use monospace */
.content pre code {
    font-family: var(--code-font);
}

/* Improve emoji rendering */
.content {
    font-variant-emoji: emoji;
}

/* Page navigation - prev/next buttons */
.nav-chapters {
    font-size: 0.9rem;
    opacity: 0.6;
    max-width: 150px;
}

.nav-chapters:hover {
    opacity: 1;
}

.nav-wrapper {
    margin-top: 2rem;
}

.previous, .next {
    font-size: 0.85rem;
}
