/* 1990s Retro Web Styling */

html {
    background-color: #C0C0C0;
}

body {
    background-color: #C0C0C0;
    font-family: "Times New Roman", Times, serif;
    font-size: 14px;
    color: #000000;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    border: 3px solid;
    border-color: #FFFFFF #808080 #808080 #FFFFFF;
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        padding: 0;
        border: none;
        margin: 0;
        max-width: 100%;
    }

    main {
        border: none;
        padding: 0;
        margin: 0;
    }

    article {
        padding: 8px;
    }
}

header h1 {
    font-size: 24px;
    text-align: center;
    margin: 0;
    padding: 10px 0;
}

header h1 a {
    text-decoration: none;
    color: #000080;
}

header h1 a:hover {
    text-decoration: underline;
}

nav {
    text-align: center;
    margin: 10px 0;
}

nav a {
    color: #0000FF;
    text-decoration: underline;
    font-size: 14px;
}

nav a:hover {
    text-decoration: underline;
}

hr {
    border: 1px inset #808080;
    height: 2px;
    margin: 10px 0;
}

main {
    background-color: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 15px;
    margin: 10px 0;
}

/* Post article */
article > h2 {
    font-size: 20px;
    color: #000080;
    border-bottom: 2px solid #000080;
    margin-bottom: 10px;
}

/* Latest post preview on home page */
article.latest-post {
    background-color: #F0F0F0;
    border: 2px inset #C0C0C0;
    padding: 15px;
    margin-bottom: 15px;
}

/* Post list */
.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-list li {
    padding: 6px 0;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list li a {
    flex: 1;
}

.meta {
    font-style: italic;
    color: #595959;
    font-size: 12px;
    margin: 5px 0;
}

/* Link colors */
a {
    color: #0000FF;
    text-decoration: underline;
}

a:visited {
    color: #800080;
}

a:hover {
    text-decoration: underline;
}

a:active {
    color: #FF0000;
}

a:focus {
    outline: 2px solid #000080;
    outline-offset: 2px;
}

/* Code blocks */
pre {
    background-color: #E0E0E0;
    border: 1px inset #808080;
    padding: 10px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-x: auto;
}

code {
    font-family: "Courier New", monospace;
    font-size: 12px;
}

/* Lists */
ul, ol {
    margin-left: 20px;
}

li {
    margin: 5px 0;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #000080;
    font-weight: bold;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }

/* Shift org-mode headings: org * -> h3 size, org ** -> h4 size */
article .outline-2 h2 { font-size: 16px; margin-bottom: 5px; } /* org * */
article .outline-3 h3 { font-size: 14px; margin-bottom: 5px; } /* org ** */

h3 { font-size: 16px; margin-bottom: 5px; }
h4 { font-size: 14px; }

p {
    line-height: 1.6;
}

footer {
    text-align: center;
    font-size: 14px;
    color: #404040;
    margin-top: 20px;
}

footer p {
    margin: 5px 0;
}

footer a {
    text-decoration: none;
}

.made-with {
    font-size: 22px;
    line-height: 22px;
    color: #404040;
}

.tech-logo {
    height: 1em;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tech-logo:hover {
    opacity: 1;
}

.browser-logo {
    height: 31px;
    width: 88px;
    vertical-align: middle;
    border: 2px inset #808080;
    transition: opacity 0.2s;
    opacity: 0.8;
}

.browser-logo:hover {
    opacity: 1;
}

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #000080;
    color: #FFFFFF;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    font-size: 14px;
}

.skip-link:focus {
    top: 0;
}

/* Tags — ul.tags with li > a.tag-link */
.tags {
    list-style: none;
    margin: 5px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tags li {
    margin: 0;
}

.tag-link {
    display: inline-block;
    background-color: #E0E0E0;
    border: 1px solid #808080;
    padding: 3px 8px;
    margin: 2px 5px 2px 0;
    color: #000080;
    text-decoration: underline;
    font-size: 12px;
}

.tag-link:hover {
    background-color: #D0D0D0;
    text-decoration: underline;
}

/* Images in posts */
article img {
    max-width: 100%;
    border: 1px solid #000000;
    height: auto;
}

article figure {
    max-width: 100%;
    margin: 10px 0;
}

article figcaption {
    font-size: 0.8em;
    font-style: italic;
    color: #666666;
    text-align: center;
    margin-top: 0;
}

/* Footnotes */
.footnote-definition {
    display: flex;
    align-items: flex-start;
    margin: 10px 0;
    font-size: 12px;
}

.footnote-definition sup {
    margin-right: 5px;
    flex-shrink: 0;
}

.footnote-body {
    margin: 0;
}

.footnote-body p {
    margin: 0;
}

/* Keyboard shortcuts */
kbd {
    background-color: #E0E0E0;
    border: 2px outset #C0C0C0;
    padding: 2px 6px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    margin: 0 2px;
    display: inline-block;
}

/* Dark mode styles - placed at end for higher specificity */
@media (prefers-color-scheme: dark) {
    html {
        background-color: #2D2D2D;
    }

    body {
        background-color: #2D2D2D;
        color: #E0E0E0;
        border-color: #606060 #1A1A1A #1A1A1A #606060;
    }

    main {
        background-color: #1A1A1A;
        border: 2px inset #404040;
    }

    header h1 a {
        color: #6B9BD1;
    }

    nav a {
        color: #7BA7E7;
    }

    article > h2 {
        color: #6B9BD1;
        border-bottom: 2px solid #6B9BD1;
    }

    a {
        color: #7BA7E7;
    }

    a:visited {
        color: #B19CD9;
    }

    a:focus {
        outline-color: #7BA7E7;
    }

    .skip-link {
        background: #1A4A7A;
        color: #E0E0E0;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #6B9BD1;
    }

    article.latest-post {
        background-color: #1F1F1F;
        border: 2px inset #404040;
    }

    .post-list li {
        border-bottom-color: #333;
    }

    pre {
        background-color: #1F1F1F;
        border: 1px inset #404040;
    }

    .tag-link {
        background-color: #1F1F1F;
        border: 1px solid #404040;
        color: #6B9BD1;
    }

    .tag-link:hover {
        background-color: #2A2A2A;
    }

    hr {
        border: 1px inset #404040;
    }

    .meta {
        color: #A0A0A0;
    }

    footer {
        color: #A0A0A0;
    }

    .tags {
        color: #A0A0A0;
    }

    .made-with {
        color: #A0A0A0;
    }

    .browser-logo {
        border: 2px inset #404040;
    }

    article img {
        border: 1px solid #E0E0E0;
    }

    article figcaption {
        color: #A0A0A0;
    }

    .footnote-definition {
        color: #B0B0B0;
    }

    kbd {
        background-color: #1F1F1F;
        border: 2px outset #404040;
        color: #E0E0E0;
    }
}
