@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&family=Work+Sans:wght@300;400;500;600&display=swap');

/* Pretorin brand theme for mdbook
 *
 * Colors:
 *   Gray Brown (text):    #231C1C  / hsl(14, 11%, 11%)
 *   Warm Orange (primary): #FF9010 / hsl(24, 100%, 53%)
 *   Turquoise (secondary): #5CC8C3 / hsl(177, 55%, 60%)
 *   Gold (accent):         #F5B820 / hsl(43, 97%, 63%)
 *   Warm Gray (muted):     #E8E6E3 / hsl(30, 10%, 90%)
 *   Border:                #DBD8D5 / hsl(30, 10%, 85%)
 *
 * Fonts:
 *   Headings: Lora (serif)
 *   Body:     Work Sans (sans-serif)
 */

/* ── Light theme ─────────────────────────────────────────────── */
.light {
    --bg:                       #ffffff;
    --fg:                       #231C1C;
    --sidebar-bg:               #231C1C;
    --sidebar-fg:               #E8E6E3;
    --sidebar-non-existant:     #8C8178;
    --sidebar-active:           #FF9010;
    --sidebar-spacer:           #3a3232;
    --scrollbar:                #8C8178;
    --icons:                    #E8E6E3;
    --icons-hover:              #FF9010;
    --links:                    #d07500;
    --inline-code-color:        #231C1C;
    --theme-popup-bg:           #ffffff;
    --theme-popup-border:       #DBD8D5;
    --theme-hover:              #E8E6E3;
    --quote-bg:                 #f5f3f1;
    --quote-border:             #FF9010;
    --table-border-color:       #DBD8D5;
    --table-header-bg:          #f0edea;
    --table-alternate-bg:       #faf9f8;
    --searchbar-border-color:   #DBD8D5;
    --searchbar-bg:             #ffffff;
    --searchbar-fg:             #231C1C;
    --searchbar-shadow-color:   rgba(35, 28, 28, 0.1);
    --searchresults-header-fg:  #8C8178;
    --searchresults-border-color: #DBD8D5;
    --searchresults-li-bg:      #fff5e6;
    --search-mark-bg:           #ffe0b2;
}

/* ── Navy (dark) theme ───────────────────────────────────────── */
.navy {
    --bg:                       #1a1515;
    --fg:                       #E8E6E3;
    --sidebar-bg:               #141010;
    --sidebar-fg:               #E8E6E3;
    --sidebar-non-existant:     #6a6260;
    --sidebar-active:           #FF9010;
    --sidebar-spacer:           #3a3232;
    --scrollbar:                #6a6260;
    --icons:                    #8C8178;
    --icons-hover:              #FF9010;
    --links:                    #FF9010;
    --inline-code-color:        #F5B820;
    --theme-popup-bg:           #231C1C;
    --theme-popup-border:       #3a3232;
    --theme-hover:              #3a3232;
    --quote-bg:                 #231C1C;
    --quote-border:             #FF9010;
    --table-border-color:       #3a3232;
    --table-header-bg:          #231C1C;
    --table-alternate-bg:       #1f1919;
    --searchbar-border-color:   #3a3232;
    --searchbar-bg:             #231C1C;
    --searchbar-fg:             #E8E6E3;
    --searchbar-shadow-color:   rgba(0, 0, 0, 0.3);
    --searchresults-header-fg:  #8C8178;
    --searchresults-border-color: #3a3232;
    --searchresults-li-bg:      #2a2222;
    --search-mark-bg:           #664000;
}

/* ── Rust theme ──────────────────────────────────────────────── */
.rust {
    --bg:                       #f5f3f1;
    --fg:                       #231C1C;
    --sidebar-bg:               #231C1C;
    --sidebar-fg:               #E8E6E3;
    --sidebar-non-existant:     #8C8178;
    --sidebar-active:           #FF9010;
    --sidebar-spacer:           #3a3232;
    --scrollbar:                #8C8178;
    --icons:                    #E8E6E3;
    --icons-hover:              #FF9010;
    --links:                    #d07500;
    --inline-code-color:        #231C1C;
    --theme-popup-bg:           #f5f3f1;
    --theme-popup-border:       #DBD8D5;
    --theme-hover:              #E8E6E3;
    --quote-bg:                 #ebe8e5;
    --quote-border:             #FF9010;
    --table-border-color:       #DBD8D5;
    --table-header-bg:          #e4e0dc;
    --table-alternate-bg:       #f0edea;
    --searchbar-border-color:   #DBD8D5;
    --searchbar-bg:             #ffffff;
    --searchbar-fg:             #231C1C;
    --searchbar-shadow-color:   rgba(35, 28, 28, 0.1);
    --searchresults-header-fg:  #8C8178;
    --searchresults-border-color: #DBD8D5;
    --searchresults-li-bg:      #fff5e6;
    --search-mark-bg:           #ffe0b2;
}

/* ── Coal (dark) theme ───────────────────────────────────────── */
.coal {
    --bg:                       #141010;
    --fg:                       #E8E6E3;
    --sidebar-bg:               #0e0b0b;
    --sidebar-fg:               #E8E6E3;
    --sidebar-non-existant:     #5a5250;
    --sidebar-active:           #FF9010;
    --sidebar-spacer:           #2a2222;
    --scrollbar:                #5a5250;
    --icons:                    #8C8178;
    --icons-hover:              #FF9010;
    --links:                    #FF9010;
    --inline-code-color:        #F5B820;
    --theme-popup-bg:           #1a1515;
    --theme-popup-border:       #2a2222;
    --theme-hover:              #2a2222;
    --quote-bg:                 #1a1515;
    --quote-border:             #FF9010;
    --table-border-color:       #2a2222;
    --table-header-bg:          #1a1515;
    --table-alternate-bg:       #171212;
    --searchbar-border-color:   #2a2222;
    --searchbar-bg:             #1a1515;
    --searchbar-fg:             #E8E6E3;
    --searchbar-shadow-color:   rgba(0, 0, 0, 0.4);
    --searchresults-header-fg:  #8C8178;
    --searchresults-border-color: #2a2222;
    --searchresults-li-bg:      #231C1C;
    --search-mark-bg:           #664000;
}

/* ── Ayu (light alt) theme ───────────────────────────────────── */
.ayu {
    --bg:                       #faf9f8;
    --fg:                       #231C1C;
    --sidebar-bg:               #231C1C;
    --sidebar-fg:               #E8E6E3;
    --sidebar-non-existant:     #8C8178;
    --sidebar-active:           #FF9010;
    --sidebar-spacer:           #3a3232;
    --scrollbar:                #8C8178;
    --icons:                    #E8E6E3;
    --icons-hover:              #FF9010;
    --links:                    #d07500;
    --inline-code-color:        #231C1C;
    --theme-popup-bg:           #faf9f8;
    --theme-popup-border:       #DBD8D5;
    --theme-hover:              #E8E6E3;
    --quote-bg:                 #f0edea;
    --quote-border:             #FF9010;
    --table-border-color:       #DBD8D5;
    --table-header-bg:          #e8e5e2;
    --table-alternate-bg:       #f5f3f1;
    --searchbar-border-color:   #DBD8D5;
    --searchbar-bg:             #ffffff;
    --searchbar-fg:             #231C1C;
    --searchbar-shadow-color:   rgba(35, 28, 28, 0.1);
    --searchresults-header-fg:  #8C8178;
    --searchresults-border-color: #DBD8D5;
    --searchresults-li-bg:      #fff5e6;
    --search-mark-bg:           #ffe0b2;
}

/* ── Typography ──────────────────────────────────────────────── */

body,
.content {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 600;
}

.content h1 {
    font-weight: 700;
}

/* Sidebar fonts - targets both v0.5 (ol.chapter) and older (.sidebar-scrollbox .chapter) */
ol.chapter,
.sidebar .sidebar-scrollbox {
    font-family: 'Work Sans', sans-serif;
}

ol.chapter a,
.sidebar .sidebar-scrollbox .chapter a {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
}

ol.chapter .chapter-item a.active,
.sidebar .sidebar-scrollbox .chapter li.chapter-item a.active {
    font-weight: 500;
}

/* ── Sidebar part titles ─────────────────────────────────────── */

li.part-title,
.sidebar .sidebar-scrollbox .chapter li.part-title {
    font-family: 'Lora', Georgia, serif !important;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FF9010;
    margin-top: 1.25em;
    padding-top: 0.5em;
}

/* ── Top bar ─────────────────────────────────────────────────── */

.menu-title {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    color: var(--fg) !important;
}

.icon-button {
    color: var(--fg) !important;
}

.icon-button:hover {
    color: #FF9010 !important;
}

.right-buttons a {
    color: var(--fg) !important;
}

.right-buttons a:hover {
    color: #FF9010 !important;
}

.right-buttons .fa-svg svg {
    fill: var(--fg) !important;
}

.right-buttons a:hover .fa-svg svg {
    fill: #FF9010 !important;
}

/* ── Content refinements ─────────────────────────────────────── */

.content {
    font-size: clamp(1.125rem, 1.2vw + 0.85rem, 1.4rem);
    line-height: 1.75;
    max-width: none;
    padding-right: 2rem;
}

.content main {
    font-size: clamp(1.125rem, 1.2vw + 0.85rem, 1.4rem);
}

.content h1 {
    border-bottom: 2px solid #FF9010;
    padding-bottom: 0.3em;
}

.content h2 {
    border-bottom: 1px solid var(--table-border-color);
    padding-bottom: 0.25em;
    margin-top: 2em;
}

/* ── Inline code ─────────────────────────────────────────────── */

.content code {
    background-color: var(--table-alternate-bg);
    border: 1px solid var(--table-border-color);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.88em;
}

.content pre > code {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.88em;
}

/* ── Code blocks ─────────────────────────────────────────────── */

.content pre {
    border-radius: 6px;
    border: 1px solid var(--table-border-color);
}

/* ── Tables ──────────────────────────────────────────────────── */

.content table {
    border-collapse: collapse;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.content table th {
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
    text-align: left;
}

/* ── Blockquotes ─────────────────────────────────────────────── */

.content blockquote {
    border-left-width: 3px;
    border-radius: 0 4px 4px 0;
    padding: 0.75em 1em;
}

/* ── Links ───────────────────────────────────────────────────── */

.content a:hover {
    text-decoration: underline;
}

/* ── Nav buttons ─────────────────────────────────────────────── */

.nav-chapters:hover {
    color: #FF9010;
}
