:root {
    --paebiru-pink: #dc67e6;
    --accent: var(--paebiru-pink);
    --accent-light: #f3e7f9;
    --accent-dark: #9d2fb8;
}

/* Accent Colors */
.color-pink {
    --accent: #dc67e6;
    --accent-light: #f3e7f9;
    --accent-dark: #9d2fb8;
}
.color-red {
    --accent: #ef4444;
    --accent-light: #fef2f2;
    --accent-dark: #b91c1c;
}

.color-orange {
    --accent: #f97316;
    --accent-light: #fff7ed;
    --accent-dark: #c2410c;
}
.color-yellow {
    --accent: #eab308;
    --accent-light: #fefce8;
    --accent-dark: #a16207;
}
.color-green {
    --accent: #22c55e;
    --accent-light: #f0fdf4;
    --accent-dark: #15803d;
}
.color-blue {
    --accent: #3b82f6;
    --accent-light: #eff6ff;
    --accent-dark: #1d4ed8;
}
.color-indigo {
    --accent: #6366f1;
    --accent-light: #eef2ff;
    --accent-dark: #4338ca;
}
.color-violet {
    --accent: #a855f7;
    --accent-light: #faf5ff;
    --accent-dark: #7e22ce;
}

/* Font Families */
.font-spectral {
    --paebiru-font: "Spectral", serif;
}
.font-lora {
    --paebiru-font: "Lora", serif;
}
.font-garamond {
    --paebiru-font: "EB Garamond", serif;
}
.font-merriweather {
    --paebiru-font: "Merriweather", serif;
}
.font-bitter {
    --paebiru-font: "Bitter", serif;
}
.font-inter {
    --paebiru-font: "Inter", sans-serif;
}
.font-plex {
    --paebiru-font: "IBM Plex Mono", monospace;
}
.font-almendra {
    --paebiru-font: "Almendra", serif;
}
.font-vt323 {
    --paebiru-font: "VT323", monospace;
}
.font-macondo {
    --paebiru-font: "Macondo Swash Caps", cursive;
}

body {
    font-family: var(--paebiru-font, "Spectral", serif) !important;
    --theme-color: var(--accent);
    --links: var(--accent);
    --inline-code-color: var(--accent-dark);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--accent) !important;
}

/* Sidebar */
.sidebar .active {
    color: var(--accent) !important;
    font-weight: bold;
    border-left: 3px solid var(--accent);
    padding-left: 7px; /* adjust for border */
}

.sidebar a:hover {
    color: var(--accent) !important;
    background: var(--accent-light);
}

/* Tables */
table th {
    background-color: var(--accent);
    color: white !important;
}

table tr:nth-child(2n) {
    background-color: var(--accent-light);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--accent);
    background-color: var(--accent-light);
}

/* Inline Code */
:not(pre) > code {
    color: var(--accent-dark);
    background-color: var(--accent-light);
}

/* Search */
#searchresults mark {
    background-color: var(--accent);
    color: white;
}

/* On this page (Right ToC) */
.on-this-page {
    border-left: 1px solid var(--border);
}

.on-this-page a {
    color: var(--fg) !important;
    text-decoration: none !important;
}

.on-this-page a:hover {
    color: var(--accent) !important;
    background-color: var(--accent-light);
}

.on-this-page .current-header {
    color: var(--accent) !important;
    font-weight: bold;
    border-left: 2px solid var(--accent);
    padding-left: 8px;
}

/* Icons and Buttons */
.icon-button,
.paebiru-picker-btn,
.right-buttons a {
    color: var(--accent) !important;
    transition:
        color 0.1s,
        background-color 0.1s,
        transform 0.2s ease-in-out;
    height: 40px !important;
    width: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none !important;
}

.scroll-to-top-active i {
    transform: translateY(-2px);
}

/* Fix for SVG icons (like Print button) */
.right-buttons a svg,
.icon-button svg {
    fill: var(--accent) !important;
    width: 1.2em;
    height: 1.2em;
}

.icon-button:hover,
.paebiru-picker-btn:hover,
.right-buttons a:hover {
    color: var(--accent) !important;
    background-color: var(--accent-light) !important;
    border-radius: 4px;
}

.paebiru-picker-container {
    position: relative;
    display: inline-flex;
    height: 40px;
    align-items: center;
    vertical-align: middle;
}

/* Sticky Top Bar */
.menu-bar {
    position: sticky;
    top: 0;
    z-index: 1001;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
}

#content main a,
#content main a:link,
#content main a:visited {
    color: var(--accent) !important;
    text-decoration: underline !important;
}

#content main a:hover,
#content main a:active {
    color: var(--accent-dark) !important;
    text-decoration: underline !important;
}

/* Top bar customization */
.right-buttons {
    display: flex;
    align-items: center;
}

.paebiru-picker-menu {
    display: none;
    position: absolute;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    z-index: 1002;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    top: 100%;
    right: 0;
}

@media (max-width: 600px) {
    .paebiru-picker-menu {
        right: -50px; /* shift menu left on small screens to avoid overflow */
        min-width: 150px;
    }
}

.paebiru-picker-menu.visible {
    display: block;
}

.paebiru-picker-section {
    margin-bottom: 10px;
}

.paebiru-picker-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg);
    margin-bottom: 5px;
    display: block;
}

.paebiru-color-buttons,
.paebiru-font-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.paebiru-color-btn {
    width: 3em;
    height: 3em;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
}

.paebiru-font-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    border-radius: 3px;
    transition: transform 0.1s;
}

.paebiru-font-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.paebiru-color-btn.active {
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--accent);
}

.paebiru-font-btn.active {
    border: 2px solid var(--accent);
    background-color: var(--accent-light);
    font-weight: bold;
}

.paebiru-picker-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-title {
    font-size: 1em;
}
