* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: "CMU Serif";
    src: url("/fonts/CMUSerif-Roman.woff2") format("woff2"),
         url("/fonts/CMUSerif-Roman.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "CMU Serif Upright Italic";
    src: url("/fonts/CMUSerif-UprightItalic.woff2") format("woff2"),
         url("/fonts/CMUSerif-UprightItalic.woff") format("woff");
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: "Depixel";
    src: url("/fonts/depixelschmal.woff2") format("woff2"),
         url("/fonts/depixelschmal.woff") format("woff");
    font-weight: normal;
    font-style: normal;
}


/* Theme Variables */
:root {
    /* Light Theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f0f0f0;
    --bg-table-header: #323232;
    --bg-table-odd: #dedede;
    --bg-table-even: #bdbdbd;
    
    --text-primary: #161616;
    --text-secondary: #666666;
    --text-tertiary: #3f3f3f;
    --text-link: #003249;
    --text-table-header: #bcbcbc;
    --accent-color: #5740cc;
    
    --border-color: #cccccc;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-table-header: #1a1a1a;
    --bg-table-odd: #2d2d2d;
    --bg-table-even: #383838;
    
    --text-primary: #989aa4;
    --text-secondary: #a0a0a0;
    --text-tertiary: #709f65;
    --text-link: #518f41;
    --text-table-header: #a0a0a0;
    --text-link-hover: #518f41;
    --accent-color: #76ff57;
    --border-color: #444444;
}

body {
    font-family: 'CMU Serif';
    font-size: 1rem;
    line-height: 1.5;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}
iframe {
    margin: 25px 0;
    border-bottom: 7px darkorange;
    border-bottom-style: none;
    padding-bottom: 10px;
    border-style: double;
}
@media (max-width: 640px) {
    iframe {
        max-width: 600px;
    }
}
header {
    font-size: 2rem;
}
@media (min-width: 640px) {
    header {
        font-size: 3rem;
    }
}

header a {
    text-decoration: none;
    color: var(--text-primary);
}
header a:hover {
    text-decoration: none;
}

h1 {
    font-family: 'Depixel';
    font-size: 2rem;
    font-weight: bold;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-tertiary);
}
h2 {
    font-family: 'Depixel';
    font-size: 1rem;
    font-weight: bold;
    margin: 1rem 0;
    color: var(--text-tertiary);
}
@media (min-width: 640px) {
    h2 {
        font-size: 1.5rem;
    }
}
h3 {
    font-family: 'Depixel';
    font-size: 0.7rem;
    font-weight: bold;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-tertiary);
}
@media (min-width: 640px) {
    h3 {
        font-size: 1.5rem;
    }
}
nav {
    margin-bottom: 20px;
}
aside {
    margin-bottom: 20px;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

a {
    text-decoration: none;
    color: var(--text-link);
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: none;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-primary);
    border: none;
}
nav ul li a:hover {
    text-decoration: none;
}
p a, li a {
    border-bottom: 1px dotted var(--text-link);
}
p a:hover, li a:hover {
    border-bottom: 1px dotted var(--accent-color);
}

main {
    margin-bottom: 20px;
}
main section {
    margin-bottom: 20px;
}
main section article {
    margin-bottom: 20px;
}

main section article p {
    margin-bottom: 10px;
}
main section article footer {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
}
main section article footer p {
    margin-bottom: 0;
}

footer {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 20px;
}
footer p {
    margin-bottom: 0;
}
.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

@media (min-width: 640px) {
    .container {
        align-items: center;
        justify-content: center;
        max-width: 800px;
    }
}

.journal-entry {
    margin-bottom: 20px;
    padding: 1rem;
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}
@media (min-width: 640px) {
    .journal-entry {
        padding: 1rem 2rem;
    }
}
.journal-entry img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}
.journal-entry-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}
@media (min-width: 640px) {
    .journal-entry-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
}
.journal-entry-title {
    font-family: 'Depixel';
    font-size: 1rem;
    font-weight: bold;
    flex: 4;
}
@media (min-width: 640px) {
    .journal-entry-title {
        font-size: 2rem;
    }
}
.journal-entry-date {
    font-family: 'CMU Serif Upright Italic';
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    flex: 1;
    align-self: flex-end;
}

@media (min-width: 640px) {
    .journal-entry-date {
        font-size: 1rem;
        text-align: right;
        align-self: center;
    }
}

.journal-entry-content {
    font-family: 'CMU Serif';
    font-size: 1rem;
    margin-bottom: 10px;
}
@media (min-width: 640px) {
    .journal-entry-content {
        max-width: 80%;
    }
}
.journal-entry-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 1rem;
}
.journal-entry-content ol {
    list-style: decimal;
    margin-left: 20px;
}
.journal-entry-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--accent-color);
    background-color: var(--bg-primary);
    font-family: 'CMU Serif Upright Italic';
    font-style: italic;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.journal-entry-content blockquote p {
    margin-bottom: 0.5rem;
}
.journal-entry-content blockquote p:last-child {
    margin-bottom: 0;
}
@media (min-width: 640px) {
    .journal-entry-footer {
        font-family: 'CMU Serif Upright Italic';
        padding: 0 2rem;
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: flex-end;
        max-width: 85%;
    }
}
.tag {
    font-family: 'Depixel';
    padding: 0.1rem .5rem;
    border-radius: 0.1rem;
    color: #fff;
    font-size: 0.6rem;
    border-radius: 0.1rem;
}
.journal-entries {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* sections */

section#all {
    display: flex;
    flex-direction: column;
    min-width: 300px;
}
@media (min-width: 640px) {
    section#all {
        min-width: 800px;
    }
}
table {
    width: 100%;
    border-collapse: collapse;
}
td.title {
    font-family: 'Depixel';
    font-size: 0.7rem;
}
table th, table td {
    padding: 0.1rem 0.5rem;
}
@media (min-width: 640px) {
    table th, table td {
        padding: 0.3rem 1rem;
        font-size: 1rem;
    }
}
table th {
    background-color: var(--bg-table-header);
    color: var(--text-table-header);
    transition: background-color 0.3s ease, color 0.3s ease;
}
table tr:nth-child(even) {
    background-color: var(--bg-table-even);
    transition: background-color 0.3s ease;
}
table tr:nth-child(odd) {
    background-color: var(--bg-table-odd);
    transition: background-color 0.3s ease;
}

section#all h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Table Controls (Search and Filter) */
.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box, .filter-box {
    flex: 1;
    min-width: 200px;
}

.search-box input,
.filter-box select {
    width: 100%;
    padding: 8px 12px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-box input:focus,
.filter-box select:focus {
    outline: none;
    border-color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* Sortable Table Headers */
table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

table th.sortable:hover {
    opacity: 0.8;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    filter:grayscale(100%);
}

.theme-toggle:hover {
    filter:grayscale(0%);
}

.theme-toggle:active {
    opacity: 0.7;
}