/* -----------------------------
   Theme Variables
----------------------------- */
:root {
    --bg-color: #222;
    --header-color: #333;
    --nav-color: #222;
    --text-color: #fff;
    --muted-color: #aaa;
    --border-color: #444;
}

:root.light {
    --bg-color: #fdfdfd;
    --header-color: #fff;
    --nav-color: #fff;
    --text-color: #121212;
    --muted-color: #777;
    --border-color: #ccc;
}

/* -----------------------------
   Dark Mode Toggle Button
----------------------------- */
#dark-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    font-size: 1.8rem;
    cursor: pointer;
}

/* -----------------------------
   Theme Transition Handling
----------------------------- */
body, header, main, .bottom-nav, #dark-toggle,
.bottom-nav *, #dark-toggle i {
    transition: none;
}

html.theme-transition body,
html.theme-transition header,
html.theme-transition main,
html.theme-transition .bottom-nav,
html.theme-transition #dark-toggle,
html.theme-transition .bottom-nav *,
html.theme-transition #dark-toggle i {
    transition: color 1s ease, background-color 1s ease;
}

/* -----------------------------
   Body & Global
----------------------------- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    padding: 0;
    margin: 0;
}

/* -----------------------------
   Header
----------------------------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

header .logo {
    max-width: 100%;
    max-height: 60px;
    height: auto;
}

header nav a {
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
}

/* -----------------------------
   Main Sections
   Only the active section is visible
----------------------------- */
.page {
    display: none;
    opacity: 0;
}

.page.active {
    display: block;
    opacity: 1;
}

main {
    padding: 1rem;
    padding-top: 0;
    padding-bottom: 120px;
}

/* -----------------------------
   Bottom Navigation
----------------------------- */
.bottom-nav {
    background-color: var(--header-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
}

.bottom-nav a i {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.bottom-nav a.selected {
    color: var(--muted-color);
}

/* -----------------------------
   Media Queries
----------------------------- */
@media(min-width: 768px) {
    header nav a {
        margin-right: 1.5rem;
    }

    .bottom-nav {
        height: 80px;
    }

    .bottom-nav a {
        font-size: 0.9rem;
    }
}
