:root {
    --bg:        #ffffff;
    --text:      #252530;
    --muted:     #65657a;
    --accent:    #3a52c4;
    --accent-dk: #2840a8;
    --border:    #d4d4df;
    --surface:   #ededea;
    --h2-mark:   #c8941a;
    --highlight: #e8eeff;
}

[data-theme="dark"] {
    --bg:        #18181f;
    --text:      #e2e2ec;
    --muted:     #9090aa;
    --accent:    #7a9fff;
    --accent-dk: #9ab5ff;
    --border:    #4a4a66;
    --surface:   #22222e;
    --h2-mark:   #d4a030;
    --highlight: #1e2545;
}

html::before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--h2-mark));
    z-index: 9999;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    color: var(--text);
}

a {
    text-decoration: none;
    color: var(--accent);
}
a:hover {
    color: var(--accent-dk);
    text-decoration: underline;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

html {
    font-size: 1.1em;
}

body {
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 4px;
    padding-bottom: 3em;
    background-color: var(--bg);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.65;
}

#main-content-centered {
    max-width: 1000px;
    margin: auto;
    width: 70%;
    margin-top: 15px;
    padding: 10px;
    padding-left: 30px;
    padding-right: 30px;
}

h1, h2, h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: normal;
}

h1 {
    color: var(--text);
    font-size: 175%;
    margin-bottom: 0.2em;
}
h2 {
    color: var(--text);
}

p {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.justify {
    text-align: justify;
}

a.selectable-shadow:hover img {
    filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));
}

.page-head-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 8px;
}


.dr-navigation {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 120%;
    color: var(--text);
    margin-left: 8px;
    letter-spacing: 0.01em;
}

nav a {
    display: inline-block;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95em;
    letter-spacing: 0.03em;
    font-variant: small-caps;
    padding: 6px 10px;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    margin: 5px 2px;
    transition: border-color 0.2s, color 0.2s;
}

nav a:hover {
    border-bottom-color: var(--h2-mark);
    color: var(--accent);
    background: none;
    text-decoration: none;
}

nav a.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    color: var(--muted);
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
    align-self: center;
    margin-left: 8px;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── FOCUS STATES ── */

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

nav a:focus-visible {
    border-bottom-color: var(--accent);
    color: var(--accent);
    outline: none;
}

@media (max-width:1150px)
{
    .page-head-container {
        flex-direction: column-reverse;
        align-items: flex-start;
    }
    .header-logo {
        display: flex;
        margin-left: auto;
    }
}

@media (max-width:600px)
{
    .header-logo img {
        flex-shrink: 1;
        max-width: 100%;
    }
    .page-head-container {
        align-items: center;
    }
    #main-content-centered {
        width: 100%;
        box-sizing: border-box;
        padding-left: 16px;
        padding-right: 16px;
        margin: auto;
        margin-top: 15px;
    }
    .navigation {
        text-align: center;
        width: 100%;
    }
    .dr-navigation {
        display: inline-block;
    }
    nav a {
        width: 90%;
        margin: 0;
        padding: 10px;
        margin-bottom: 0.5em;
    }
    body {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    html {
        margin: 0;
        padding: 0;
    }
}


/* ── PRINT ── */

@media print {
    .page-footer,
    .theme-toggle,
    .language_flag,
    .section-nav {
        display: none !important;
    }
    body {
        padding-bottom: 0;
        background: white;
        color: black;
    }
    a {
        color: inherit;
        text-decoration: underline;
    }
    .page-head-container {
        border-bottom: none;
    }
}
