html {
    color-scheme: light;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    color: #333;
    -webkit-text-size-adjust: 100%;
}

.container {
    width: min(1200px, 95%);
    margin: auto;
}

/* HEADER */

.site-header {
    background: #004080;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.site-header h1 a {
    color: white;
    text-decoration: none;
}

.site-header nav {
    margin-top: 0;
}

.site-header nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 600;
}

.site-header nav a:hover {
    text-decoration: underline;
}

.welcome {
    margin: 0 15px;
    font-weight: 600;
    color: white;
}

/* MAIN CONTENT */

main.container {
    padding: 20px 0;
}

/* THREAD LIST */

.thread-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.thread-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.thread-card h3 {
    margin: 0 0 10px 0;
}

.thread-card h3 a {
    color: #004080;
    text-decoration: none;
}

.thread-card h3 a:hover {
    text-decoration: underline;
}

.thread-card.pinned {
    border-left: 5px solid #ff9900;
    background: #fffbe8;
}

.thread-card.pinned h3::before {
    content: "📌 ";
}

.meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* THREAD VIEW */

.thread-view {
    background: #ffffff;
    color: #333333;
    border-radius: 10px;
    padding: 25px;
}

.thread-view h2 {
    margin-top: 0;
}

.thread-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

..thread-post {
    line-height: 1.7;
    overflow-wrap: break-word;
    color: #333333;
    background: #ffffff;
}

.thread-post img {
    max-width: 100%;
    height: auto;
}

/* REPLIES */

.reply-card {
    background: white;
    border-left: 4px solid #004080;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.reply-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.reply-body {
    line-height: 1.6;
    overflow-wrap: break-word;
}

.reply-body img {
    max-width: 100%;
    height: auto;
}

/* FORMS */

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

textarea,
textarea:focus {
    background: #ffffff;
    color: #333333 !important;
    -webkit-text-fill-color: #333333;
}

input[type="text"],
input[type="text"]:focus {
    background: #ffffff;
    color: #333333 !important;
    -webkit-text-fill-color: #333333;
}

button {
    background: #004080;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background: #0059b3;
}

/* FOOTER */

.site-footer {
    background: #222;
    color: white;
    padding: 20px;
    margin-top: 40px;
}

.thread-card,
.thread-view,
.reply-card {
    color: #333;
}

.thread-card a {
    color: #004080;
}

.thread-card h3 a {
    color: #004080;
}

.thread-post a,
.reply-body a {
    color: #004080;
}

/*
h2 {
    color: #004080 !important;
}
*/

h2, h3 {
    color: #004080;
}

/* MOBILE */

@media (max-width: 768px) {

    .header-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-header h1 {
        font-size: 1.4rem;
    }

    .site-header nav {
        margin-top: 12px;
    }

    .site-header nav a {
        display: inline-block;
        margin-bottom: 8px;
    }

    .welcome {
        display: block;
        margin: 8px 0;
    }

    .thread-view {
        padding: 15px;
    }

    .thread-card {
        padding: 14px;
    }
}

.welcome {
    color: #ffffff !important;
}

.site-header .welcome {
    color: #ffffff !important;
}


.site-header,
.site-header * {
    color: white;
}

.site-header h1 a {
    color: white;
}

.site-header nav a {
    color: white;
}

.site-header .welcome {
    color: white;
}

/*
main h2 {
    color: #004080;
}
*/

/* Main page content */

main {
    color: #333;
}

main p,
main div,
main span {
    color: inherit;
}

/* Thread cards */

.thread-card {
    background: #ffffff;
    color: #333333;
}

/*
.thread-card * {
    color: inherit;
}
*/

.thread-card h3 a {
    color: #004080;
}

/* Thread view */

.thread-view {
    background: #ffffff;
    color: #333333;
}

.thread-post {
    color: #333333;
}

/* Replies */

.reply-card {
    background: #ffffff;
    color: #333333;
}

.reply-body {
    color: #333333;
}

.thread-card p {
    color: #333333 !important;
}

.thread-view p {
    color: #333333 !important;
}

.reply-card p {
    color: #333333 !important;
}


main {
    color: #333333 !important;
}

main h2 {
    color: #004080 !important;
}

/* Thread list page */

.thread-card {
    color: #333333;
}

.thread-card h3 {
    color: #004080;
}

.thread-card .meta {
    color: #666666;
}

.thread-card p {
    color: #333333;
}

.thread-card strong {
    color: #333333;
}

.thread-card span {
    color: #666666;
}

/* Force thread page colours */

.thread-view h2 {
    color: #004080 !important;
}

.thread-view h3 {
    color: #004080 !important;
}

.thread-meta {
    color: #666666 !important;
}

.thread-meta strong {
    color: #333333 !important;
}

.thread-post {
    color: #333333 !important;
}

.thread-post * {
    color: inherit;
}

.admin-controls {
    margin-bottom: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
}

.admin-controls a {
    color: #004080;
    font-weight: bold;
    text-decoration: none;
}

/* Reply colours */

.reply-card {
    background: #ffffff;
    color: #333333;
}

.reply-card strong {
    color: #333333;
}

.reply-meta {
    color: #666666;
}

.reply-meta strong {
    color: #333333;
}

.reply-meta a {
    color: #cc0000;
    text-decoration: none;
    margin-left: 10px;
}

.reply-meta a:hover {
    text-decoration: underline;
}

.thread-likes {
    color: #333333;
    margin-top: 15px;
}

.thread-likes a {
    color: #004080;
    text-decoration: none;
    font-weight: 600;
}

.thread-likes a:hover {
    text-decoration: underline;
}

.pagination {
    text-align: center;
    margin: 30px 0;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #004080;
    background: white;
}

.pagination strong {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    background: #004080;
    color: white;
}

.back-link {
    margin-bottom: 15px;
}

.back-link a {
    color: #004080;
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    text-decoration: underline;
}

.thread-post b,
.thread-post strong,
.reply-body b,
.reply-body strong {
    color: #000000 !important;
}

/* Form fields */

input[type="text"],
input[type="password"],
textarea {
    background: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    background: #ffffff;
    color: #333333;
}