/* Import Google Fonts (EB Garamond for site name and Libre Baskerville for everything else) */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&family=Libre+Baskerville:wght@400;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/aptos.min.css');

:root {
    --main-font: 'Libre Baskerville', Georgia, serif;
    --heading-font: 'EB Garamond', serif;
    --bg-color: #e8eae2; /* Light background */
    --text-color: #1a1a1a;
    --accent-color: #9fa392;
    --accent-dark: #868979;
    --accent-light: #e0e3d9;
    --link-color: #0066cc;  /* Consistent blue for both modes */
    --hover-color: #0052a3; /* Slightly darker blue for hover */
    --border-color: #e0e3d9;
    --code-bg: #f3f4f6;
    --date-color: #666666;
    --toggle-bg: #c5c9bc;
}

.dark-mode {
    --bg-color: #292B38;
    --text-color: #f5f5f0;
    --accent-color: #9fa392;
    --accent-dark: #f5f5f0;
    --accent-light: #9fa392;
    --link-color: #0066cc;  /* Same blue as light mode */
    --hover-color: #3385d6; /* Slightly lighter blue for hover in dark mode */
    --border-color: #2a2a2a;
    --code-bg: #333333;
    --date-color: #999999;
    --toggle-bg: #444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--main-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open {
    overflow: hidden;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background-color: var(--bg-color);
    z-index: 1000;
    transition: background-color 0.3s;
}

header > div {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.site-name {
    margin: 0;
    padding: 0;
}

.site-name a {
    font-family: var(--heading-font);
    font-size: 3.2rem;
    font-weight: 400;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 1rem 2rem;
}

.content-container {
    max-width: 680px;
    margin: 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

h2 {
    font-size: 1.8rem;
    font-weight: 500;
}

h4 {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--accent-dark);
}

p {
    margin: 1rem 0;
}

.author-date {
    color: var(--date-color);
    font-size: 0.9rem;
    margin: 1rem 0 2rem;
}

ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

/* Hamburger Menu */
.hamburger-menu {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    transition: color 0.3s;
    padding: 10px;
    margin-left: 5px;
}

.hamburger-menu:hover {
    color: var(--hover-color);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar.open {
    left: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-sidebar {
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 10px;
    margin: -10px;
}

.close-sidebar:hover {
    color: var(--hover-color);
}

.sidebar-links {
    list-style: none;
    padding: 0;
}

.sidebar-links li {
    margin: 1rem 0;
}

.sidebar-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-links a:hover {
    color: var(--hover-color);
}

#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

#sidebar-overlay.active {
    display: block;
}

/* Dark Mode Toggle */
.header-controls {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-right: 10px;
}

.toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider {
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-color);
    transition: .4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
    background-color: var(--accent-color);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(20px);
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .site-name a {
        font-size: 2.8rem;
    }
    
    .content-wrapper {
        padding: 6rem 1rem 2rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .site-name a {
        font-size: 2.4rem;
    }
    
    .content-wrapper {
        padding: 5rem 1rem 2rem;
    }
}

@media (max-width: 375px) {
    .site-name a {
        font-size: 2rem;
    }
}

/* Add specific styling for links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--hover-color);
} 