/* ==========================================================================
   CSS Variables & Theme System
   ========================================================================== */

:root {
    --bg: #fff;
    --fg: #000;
    --border-color: #000;
    --link-color: #0066cc;
}

body.theme-light {
    --bg: #fff;
    --fg: #000;
    --border-color: #000;
    --link-color: #0066cc;
}

body.theme-dark {
    --bg: #1a1a1a;
    --fg: #e0e0e0;
    --border-color: #444;
    --link-color: #66b3ff;
}

@media (prefers-color-scheme: dark) {
    body.theme-system {
        --bg: #1a1a1a;
        --fg: #e0e0e0;
        --border-color: #444;
        --link-color: #66b3ff;
    }
}

/* ==========================================================================
   Base Elements
   ========================================================================== */

body {
    background-color: var(--bg);
    color: var(--fg);
}

a {
    color: var(--link-color);
}

a:hover {
    text-decoration-thickness: .1rem;
}

p {
    line-height: 1.4;
}

li {
    margin-bottom: 0.5rem;
}

button {
    margin-bottom: 0;
}

/* ==========================================================================
   Typography & Code
   ========================================================================== */

code {
    background-color: rgba(128, 128, 128, 0.15);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.8rem;
}

/* ==========================================================================
   Dark Mode - Mark Element
   ========================================================================== */

.theme-dark mark {
    background-color: transparent;
    outline: 2px solid #f7ff589e;
    outline-offset: 4px;
}

.theme-dark mark * {
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    body.theme-system mark {
        background-color: transparent;
        outline: 2px solid #f7ff589e;
        outline-offset: 4px;
    }

    body.theme-system mark * {
        text-decoration: none;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    background-color: black;
    color: white;
    opacity: 0;
}

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

/* ==========================================================================
   Layout
   ========================================================================== */

main.container {
    padding-top: 1em;
}

/* ==========================================================================
   Header / Navigation Bar
   ========================================================================== */

header.paperboat-bar {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px 4px;
    border-bottom: 2px solid var(--border-color);
}

header.paperboat-bar ul {
    margin: 0;
}

header.paperboat-bar li {
    padding: 0.2em 0;
    margin-bottom: 0;
}

header.paperboat-bar img {
    vertical-align: middle;
}

.paperboat-bar nav {
    margin: 0;
}

.paperboat-bar nav a {
    color: var(--fg);
    text-decoration: none;
}

.paperboat-bar nav a:hover {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-thickness: initial;
}

.paperboat-bar nav a.active {
    font-weight: bold;
    text-decoration-style: wavy;
}

.site-name a {
    font-size: 1.3em;
    text-decoration: none;
    color: var(--fg);
}

a.paperboat {
    text-decoration: none;
}

/* ==========================================================================
   Navigation (General)
   ========================================================================== */

nav a.active {
    font-weight: bold;
}

nav ul li:first-child {
    margin-left: 0;
}

/* ==========================================================================
   Components
   ========================================================================== */

article.distinct {
    border-left: 2px solid var(--border-color);
    padding-left: 1em;
    margin-bottom: 2em;
}

/* ==========================================================================
   Messages / Alerts
   ========================================================================== */

.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--border-color);
    background-color: rgba(128, 128, 128, 0.1);
}

.message.success {
    border-left-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.message.error {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.message.warning,
.warning {
    border-left: 4px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
    padding: 0.75rem 1rem;
}

.message.info {
    border-left-color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
}

span.links a:not(:last-child) {
    margin-right: 0.5em;
}

/* ==========================================================================
   Task Lists (Markdown Checkboxes)
   ========================================================================== */

ul.task-list {
    list-style: none;
    padding-left: 0;
}

li.task-list-item {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

li.task-list-item input[type="checkbox"] {
    margin-right: 0.5rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

li.input {
    margin-right: 0.4rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */

form label {
    margin-top: 2rem;
}

textarea {
    field-sizing: content;
    min-width: 100%;
    max-width: 100%;
    height: 400px;
    min-height: 50px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.default-font-size {
    font-size: 1rem;
}

.fullheight {
    min-height: 100vh;
}

.halfheight {
    min-height: 50vh;
}
