/**
 * Main CSS - persists across all themes
 * Base reset and common utilities
 */

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base document */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    line-height: 1.5;
}

/* Links */
a {
    color: inherit;
    text-decoration-skip-ink: auto;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lists */
ul,
ol {
    list-style: none;
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container utility */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: system-ui, sans-serif;
    color: #666;
}

/* Transitions for theme changes */
#theme-content {
    transition: opacity 0.3s ease;
}

/* ===================================
   Sidebar - Consistent minimal theme
   =================================== */

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
    z-index: 1100;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: #fafafa;
    color: #333;
    font-family: "Georgia", "Times New Roman", serif;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1200;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    font-size: 1.75rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: #333;
}

.sidebar-content {
    padding: 3rem 2rem 2rem;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.sidebar-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.sidebar-body p {
    margin-bottom: 1rem;
}

.sidebar-body a {
    color: #333;
    text-decoration: underline;
    text-decoration-color: #ccc;
    transition: text-decoration-color 0.2s;
}

.sidebar-body a:hover {
    text-decoration-color: #333;
}

.sidebar-body h1,
.sidebar-body h2,
.sidebar-body h3 {
    font-weight: normal;
    color: #333;
    margin: 1.5rem 0 0.75rem;
}

.sidebar-body h1 {
    font-size: 1.25rem;
}
.sidebar-body h2 {
    font-size: 1.125rem;
}
.sidebar-body h3 {
    font-size: 1rem;
    font-style: italic;
}
