:root, body.light-mode {
    /* Backgrounds */
    --bg-primary: #fdfaf6; /* Parchment white */
    --bg-secondary: #f4ede4; /* Light beige */
    --bg-tertiary: #e9e0d6; /* Light wood/tan */
    --bg-diff-old: #f98;
    --bg-diff-new: #aea;

    /* Text */
    --text-primary: #4a382a; /* Dark wood brown */
    --text-secondary: #7a685a; /* Muted brown */
    --text-headings: #1e3a3a; /* Dark teal */

    /* Accents & Links */
    --accent-glow: #008a7d; /* A deeper, more saturated teal for contrast */
    --accent-secondary: #c88c0e; /* A rich, earthy gold */

    /* Borders & UI Elements */
    --border-color: #c9bbaf; /* Muted tan */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --heading-shadow: 1px 1px 3px var(--shadow-color);
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    :root {
        /* Backgrounds */
        --bg-primary: #0a1a1a;
        --bg-secondary: #1e3a3a;
        --bg-tertiary: #4a382a;
        --bg-diff-old: #911;
        --bg-diff-new: #044904;

        /* Text */
        --text-primary: #e0e6e4;
        --text-secondary: #a0b0ac;
        --text-headings: #f0f5f3;

        /* Accents & Links */
        --accent-glow: #30e8d8;
        --accent-secondary: #f0c869;

        /* Borders & UI Elements */
        --border-color: #2a5c5c;
        --shadow-color: rgba(0, 0, 0, 0.4);
        --heading-shadow: 0 0 8px var(--accent-glow);
    }
}

/* Responsive Oddmuse CSS - Updated */

html {
    text-align: center;
    background-color: var(--bg-primary);
}

body {
    font-family: sans-serif;
    font-size: 1em;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    max-width: 90ch;
    margin: auto;
    padding: 1em;
    text-align: left;
}

/* titles */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-headings);
    text-shadow: 0 0 8px var(--shadow-color-glow);
}

h1 {
    color: var(--text-headings);
    font-weight: bold;
    font-size: 150%;
    padding: 1em 0 0;
    font-family: serif;
}

h1 a:link,
h1 a:visited {
    color: inherit;
    background-color: inherit;
    text-decoration: inherit;
}

h2 {
    font-weight: bold;
    font-size: 130%;
    padding: 1em 0 0 0;
    clear: both;
    font-family: serif;
}

h3 {
    font-weight: bold;
    font-size: 110%;
    padding: 1em 0 0 0;
    clear: both;
    font-family: serif;
}

img,
video {
    max-width: 100%;
    height: auto;
}

/* Layout columns stack on small screens */
.col1,
.col2,
.column2 {
    width: 48%;
    display: inline-block;
    vertical-align: top;
    margin-right: 2%;
}

@media only screen and (max-width: 1200px) {
    body {
        font-size: 1.24em;
        padding: 0.3em;
    }
    .col1,
    .col2,
    .column2 {
        width: 100%;
        display: block;
        margin: 0 0 1em;
    }
    .mobile {
        display: block;
    }
    .col2::before {
        content: "⁂";
        display: block;
        text-align: center;
        padding-bottom: 1em;
    }
}

@media only screen and (max-width: 800px) {
    body {
        font-size: inherit;
    }
}

.red {
    background: red;
    color: red;
}

.orange {
    background: orange;
    color: orange;
}

.yellow {
    background: yellow;
    color: yellow;
}

.green {
    background: green;
    color: green;
}

.blue {
    background: blue;
    color: blue;
}

.indigo {
    background: indigo;
    color: indigo;
}

.violet {
    background: violet;
    color: violet;
}

.white {
    background: white;
    color: white;
}

/* Forms */
form.search label {
    display: inline;
    min-width: 12ch;
}
textarea {
    font-family: monospace, monospace;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    border: var(--border-color) solid 1px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

textarea#summary {
    font-family: sans-serif;
    display: inline-block;
    width: 100%;
    height: 1.5em;
    border: var(--border-color) solid 1px;
}

input {
    font-size: 1em;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: black solid 1px;
}

input#mail,
input#homepage,
input#username,
input#search {
    width: 35.7%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: var(--border-color) solid 1px;
}

input[type="submit"] {
    background-color: var(--bg-tertiary);
    border: var(--border-color) solid 2px;
    border-radius: 4px;
    cursor: pointer;
    -moz-appearance: button;
}

input[type="radio"] {
    border: 0px;
    width: 148%;
    height: 0.8em;
}

/* Code and Preformatted Text */
pre,
code {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Courier New", Courier, monospace, monospace;
    border-radius: 1px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    overflow: auto;
}

/* links */
a {
    color: var(--accent-glow);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:visited {
    color: var(--accent-glow);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--accent-secondary);
    text-shadow: 0 0 10px var(--accent-secondary);
    text-decoration: none;
}

/* Responsive images */
.fit img,
.full img,
.half img {
    width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
}

img.logo {
    border: none;
    width: 15%;
    float: right;
}

a.logo {
    display: block;
    background: url(./imnawiki-logo.webp);
}

@media only screen and (max-width: 1200px) {
    img.logo {
	height: 100%;
    width: 23%
    }
}

/* Tables */
table.user tbody {
    display: table;
    width: 99.7%;
    max-width: 100%;
}
table tr.first td {
    border-bottom: 1px solid #bbb;
}
table td,
th {
    padding: 0 1ex;
    text-align: left;
}

table.user {
    overflow: auto;
    width: 100%;
    display: block;
    margin: 0 auto;
    border-collapse: collapse;
}

table.user td,
table.user th {
    border: var(--border-color) solid 3px;
    white-space: nowrap;
}

/* Blockquotes */
blockquote {
    margin-left: 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--accent-glow);
    color: var(--text-secondary);
    font-style: italic;
    background-color: rgba(48, 232, 216, 0.05);
    border-radius: 0 8px 8px 0;
}

/* Responsive utilities */
.narrow,
.aside {
    width: 100%;
    float: none;
    margin: 1em 0;
}

/* Misc fixes */
a img {
    border: 1px solid #333;
}
.button {
    display: inline-block;
    padding: 0.5em 1em;
    border: 1px solid #000000;
    border-radius: 1px;
    background-color: #cfa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-size: 1em;
    text-align: center;
    cursor: pointer;
}

/* Diff */
div.time {
    font-size: 0.8em;
}

div.diff {
    border: var(--border-color) solid;
}
div.old {
    background-color: var(--bg-diff-old);
    font-family: monospace, monospace;
    color: var(--text-primary);
}
div.new {
    background-color: var(--bg-diff-new);
    font-family: monospace, monospace;
    color: var(--text-primary);
}
