/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/*********** FA ***********/

@font-face {
    font-family: 'Font Awesome 5 Free';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("dist/fa-regular-400.eot");
    src: url("dist/fa-regular-400.eot?#iefix") format("embedded-opentype"),
        url("dist/fa-regular-400.woff2") format("woff2"),
        url("dist/fa-regular-400.woff") format("woff"),
        url("dist/fa-regular-400.ttf") format("truetype"),
        url("dist/fa-regular-400.svg#fontawesome") format("svg");
}

.far {
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
}

@font-face {
    font-family: 'Font Awesome 5 Free';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("dist/fa-solid-900.eot");
    src: url("dist/fa-solid-900.eot?#iefix") format("embedded-opentype"),
        url("dist/fa-solid-900.woff2") format("woff2"),
        url("dist/fa-solid-900.woff") format("woff"),
        url("dist/fa-solid-900.ttf") format("truetype"),
        url("dist/fa-solid-900.svg#fontawesome") format("svg");
}

.fa,
.fas {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

/************ FW *************/

body {
    background: white;
}
body,
input, textarea, select {
    font-family: 'Verdana', 'Geneva', sans-serif;
    font-size: 9pt;
    color: #333;
}
header {
    background: #34495e;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 2px 2px;
    padding: 3px;

    a { color: white; }
}
p {
    line-height: 1.5em;
}
.wrapper {
    max-width: 900px;
    margin: 0 auto;
}
h3 {
    font-size: 12pt;
    padding: 16px 16px 0;
}

/* breadcrumbs */
.navigation {
    font-size: 10pt;
    font-weight: bold;
    padding: 6px 10px;
    line-height: 24px;
}

/* subheader */
.subheader {
    display: flex;

    .title {
        font-size: 14pt;
        font-weight: bold;
        letter-spacing: -0.5px;
        word-break: break-word;
        margin: 16px;
        line-height: 30px;
        order: 1;
        width: 100%;

        a {
            text-decoration: none;
            color: inherit;
        }
    }
    .right {
        margin: 15px 15px 15px 0;
        order: 2;
        display: flex;

        > * {
            align-self: flex-start;
            margin-left: 5px;
        }
        > *:first-child { margin-left: 0; }
    }
    .title .thread-views {
        display: block;
        font-size: 9pt;
        font-weight: normal;
        letter-spacing: 0;
        color: #666;
        line-height: 20px;
        margin-top: 2px;
    }
}

/* main */
main {
    margin-bottom: 10px;
}

/* footer */
footer {
    padding-right: 10px;
    font-size: 8pt;
    text-align: right;
    margin-bottom: 10px;
    line-height: 20px;

    a { color: #333; }
    .login { font-weight: bold; }
    .rev { font-family: monospace; }
    .form { display: none; }
}

/* common styles */
.boards, .posts, .threads {
    margin-bottom: 0;
}
.board, .post, .thread, .thread-warning,
.flashed-message, .recent-post {
    background: #f9f9ff;
    display: block;
    border-top: 1px solid #e9e9ee;
    border-bottom: 1px solid #e9e9ee;
    margin-bottom: 6px;
    text-decoration: none;
    color: #333;
    padding: 8px 12px;
}

/* home */
.home-container {
    display: flex;
    flex-wrap: wrap;
}
.recent-posts {
    margin-left: 3px;
    width: calc(50% - 3px);
}
.boards h2,
.recent-attachments h2 {
    font-size: 12pt;
    line-height: 24px;
    font-weight: bold;
    margin: 10px 20px;
}
.recent-posts-header {
    display: flex;

    h2 {
        flex: 1;
        font-size: 12pt;
        line-height: 24px;
        font-weight: bold;
        margin: 10px 20px;

        a { color: #333; }
    }
    .rss-icon {
        float: right;
        font-size: unset;
        margin: 10px;
        width: 20px;
        color: #333;
    }
}
.recent-attachments {
    width: 100%;

    h2 {
        margin-top: 16px;

        a { color: #333; }
    }
}
.recent-post {
    display: flex;
    flex-wrap: wrap;

    .name,
    .reply-count,
    .author,
    .time,
    .excerpt {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #333;
        line-height: 20px;
    }
    .name {
        font-weight: bold;
        flex: 1;
        padding-right: 10px;
    }
    .reply-count {
        width: 100px;
        padding-right: 10px;
    }
    .author {
        width: 100px;
        font-weight: bold;
        padding-right: 10px;
    }
    .time { width: 100px; }
    .excerpt {
        width: 100%;
        color: #444;
    }
    &.is-thread .name {
        width: 100%;
        flex: unset;
    }
    &:last-child { margin-bottom: 0; }
}
.recent-attachments-gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    .recent-attachment {
        margin: 6px;
        width: 120px;
        height: 120px;
        align-items: center;
        justify-content: center;
        display: flex;
        background: #f9f9ff;
        border: 1px solid #eee;

        .thumb {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            overflow: hidden;

            img {
                max-width: 100%;
                max-height: 100%;
                width: auto;
                height: auto;
                object-fit: contain;
            }
        }
    }
}
.recent-attachments-see-more {
    margin: 10px 10px;
    text-align: right;
}

/* board list */
.boards {
    &:not(.full-width) {
        margin-right: 3px;
        width: calc(50% - 3px);
    }
    &.full-width { width: 100%; }
}
.board {
    display: flex;
    flex-wrap: wrap;
    flex: auto;
    padding-top: 10px;
    font-weight: bold;
    word-break: break-all;
    line-height: 22px;
    font-size: 10pt;

    &.hidden .name .icon { color: #f8b700; }
    .name { flex: 1; }
    .thread-count,
    .post-count {
        width: 90px;
        line-height: 22px;
    }
    .description {
        width: 100%;
        color: #333;
        font-size: 9pt;
        font-weight: normal;
        line-height: 22px;
    }
    &:last-child { margin-bottom: 0; }
}

/* search */
.search-container {
    display: flex;
    align-items: flex-start;

    .form {
        width: 30%;
        position: sticky;
        top: 0;

        form {
            grid-template-columns: 1fr;
            padding: 0 20px 0 10px;
        }
        .left {
            justify-content: flex-start;
            margin-left: 8px;
        }
        .right { margin-bottom: 6px; }
        input[type=submit] { margin-top: 10px; }
    }
    .posts {
        width: 70%;

        .result-count {
            margin: 8px 10px;
            line-height: 20px;
        }
    }
}
.posts .post-meta {
    border-top: 1px solid #eee;
    background: #eee;
    padding: 8px 20px;
    line-height: 20px;

    a { color: #333; }
}

/* board->thread */
.thread {
    display: flex;
    flex: auto;
    flex-wrap: wrap;
    text-decoration: none;
    color: #333;
    font-size: 9pt;
    line-height: 22px;

    &:visited .name { color: #666; }
    > * {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        padding-right: 5px;
    }
    .name {
        order: 1;
        flex: 1;
        font-weight: bold;
        word-break: break-all;
        line-height: 22px;
        font-size: 10pt;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    &.mod .name .icon { color: #f8b700; }
    .reply-count {
        order: 2;
        width: 64px;
    }
    .view-count {
        order: 3;
        width: 64px;
    }
    .author {
        order: 4;
        width: 108px;
        font-weight: bold;
    }
    .time {
        order: 5;
        width: 100px;

        a {
            color: #444;
            text-decoration: none;
        }
    }
    .reply-count,
    .view-count,
    .author,
    .time { color: #444; }
    .excerpt {
        order: 6;
        width: 100%;
        color: #666;
        font-size: 9pt;
        line-height: 20px;
        display: none;
    }
}
.thread-warning {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    line-height: 18px;
}

/* thread->post */
.post {
    position: relative;
    overflow: hidden;
    padding-bottom: 0;
    color: #333;
    font-size: 9pt;
    line-height: 22px;

    .author,
    .time,
    .ip_hash {
        margin-right: 8px;
        white-space: nowrap;
        line-height: 20px;
    }
    .time a {
        color: #333;
        text-decoration: none;
    }
    &.anonymous .meta .author { font-style: italic; }
    .ip_hash {
        font-size: 9pt;
        padding: 1px 3px;
        border-radius: 2px;
        font-family: 'Consolas', monospace;
    }
    &.mod .author .icon { color: #f8b700; }
    .text {
        margin: 10px 25px 16px;
        font-size: 9.5pt;
        line-height: 20px;
        word-wrap: break-word;

        img {
            max-width: 100%;
            max-height: 2000px;
        }
        .greentext { color: #789922; }
        .title { font-weight: bold; }
    }
    &.short .text {
        overflow-y: auto;
        max-height: 250px;
    }
    .attachment {
        .meta { font-size: 8pt; }
        .thumb {
            float: left;
            margin: 0 12px 12px 0;

            img {
                float: left;
                max-width: 120px;
                max-height: 120px;
            }
        }
    }
    &.deleted {
        opacity: .7;

        .text { font-style: italic; }
    }
    .author { font-weight: bold; }
    .post-buttons {
        float: right;

        .post-button {
            display: inline-block;
            border: 1px solid #ccc;
            background-color: white;
            width: 26px;
            height: 26px;
            box-sizing: border-box;
            cursor: pointer;
            text-align: center;
            line-height: 24px;
            color: #333;
        }
    }
}

/* buttons */
:is(.subheader .right .button, form input[type=submit]) {
    border: 0;
    border-radius: 3px;
    background: #34495e;
    color: white;
    padding: 0 14px;
    line-height: 30px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 9pt;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    -webkit-appearance: none;
    cursor: pointer;

    &:hover { background: #3d566f; }
}

/* forms */
form {
    display: grid;
    grid-template-columns: 30% 1fr;
    align-items: start;
    row-gap: 12px;

    h4 {
        grid-column: 1 / -1;
        margin: 10px 0 5px 0;
    }
    noscript { grid-column: 1 / -1; }
    > .errors {
        grid-column: 1 / -1;
        color: #d00;
        line-height: 20px;
        font-style: italic;
        padding-left: calc(30% + 10px);
        margin-bottom: 6px;
    }
    .left,
    .right {
        display: flex;
        align-items: flex-start;

        label { line-height: 20px; }
    }
    .left {
        justify-content: flex-end;
        text-align: right;
        line-height: 20px;
        padding-right: 10px;

        input[type=checkbox] { margin-right: 7px; }
        &.checkbox {
            justify-content: flex-end;
            align-items: center;
            padding-right: 10px;
        }
        label { padding-right: 10px; }
    }
    .right {
        &.checkbox {
            align-items: center;
            line-height: 20px;
        }
        input:not([type=submit]):not([type=file]):not([type=checkbox]),
        textarea,
        select {
            box-sizing: border-box;
            padding: 5px;
            width: 100%;
            max-width: 500px;
            border: 1px solid #ddd;
        }
        textarea { height: 160px; }
        input[type=text],
        input[type=number],
        input[type=password] { height: 28px; }
        select { height: 28px; }
        input[type=submit] {
            width: auto;
            padding-left: 18px;
            padding-right: 18px;
        }
        &.errors {
            color: #d00;
            line-height: 20px;
            font-style: italic;
        }
        .field-error {
            color: #d00;
            font-size: 8pt;
            margin-bottom: 4px;
        }
    }
}
.form form { padding: 10px; }

.flashed-message {
    padding: 10px;
    margin: 20px 0 0 20px;
    text-align: center;
    display: inline-block;
    line-height: 18px;
}

/* pager */
.pager {
    padding: 10px 15px;
    line-height: 24px;
    font-size: 9pt;

    span,
    a {
        display: inline-block;
        text-decoration: none;
        border-radius: 3px;
        padding: 0 8px;
        color: #333;
        margin-bottom: 6px;
        font-weight: bold;
    }
    span {
        border: 1px solid #f9f9f9;
        background: #f9f9f9;

        &.current {
            border: 1px solid #666;
            background: #666;
            color: white;
        }
    }
    a {
        border: 1px solid #ccd;

        &:hover {
            border: 1px solid #666;
            background: #666;
            color: white;
        }
    }
}

/* post info/admin ui */
.post-info,
.cfg-params {
    padding: 12px 24px;

    p { margin-bottom: 5px; }
}
.post-info {
    border-bottom: 1px solid #e9e9ee;

    p.indented { padding-left: 12px; }
}
.cfg-params {
    table {
        width: 100%;
        margin-top: 10px;
    }
    th, td {
        border: 1px dotted #999;
        padding: 8px 10px;
        text-align: left;
    }
}
.admin-panel {
    padding: 10px 16px 14px;
    border-top: 1px solid #e9e9ee;
    margin-top: 8px;

    h3 {
        font-size: 12pt;
        font-weight: bold;
        padding: 6px 0 8px 0;
    }
    p {
        line-height: 20px;
        margin-bottom: 4px;
    }
    .flashed-message { margin: 10px 0 10px 10px; }
}
.post-text-raw {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* aux */
.icon.fa-file-alt { padding: 0 2px; }

mark {
    background: #ffe066;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

@media all and (max-width: 600px) {
    select, textarea, input {
        font-size: 16px;
    }

    header { border-radius: 0; }

    .excerpt { -webkit-text-size-adjust: none; }

    form {
        grid-template-columns: 1fr;

        .left { justify-content: flex-start; }
        > .errors { padding-left: 0; }
        .right {
            input[type=submit] { margin-top: 6px; }
            input[type=file] { width: 100%; }
        }
    }

    .pager {
        line-height: 32px;
        font-size: 10pt;

        a, span { padding: 0 14px; }
    }

    .subheader {
        flex-wrap: wrap;

        .right {
            margin-top: 0;
            margin-left: 15px;
        }
        .title { margin: 10px 16px; }
    }

    .boards, .recent-posts {
        width: unset;
        margin: 0;
    }
    .board .name { flex: 100% 0 0; }

    .search-container {
        flex-wrap: wrap;

        .form {
            position: unset;
            width: 100%;
        }
        .posts { width: 100%; }
        .result-count.empty-query { display: none; }
    }

    .thread {
        line-height: 28px;

        .name {
            flex: 100% 0 0;
            overflow: unset;
            white-space: unset;
            word-break: break-word;
            line-height: 20px;
        }
    }

    .post .text { margin: 10px 5px; }

    .home-container { flex-direction: column; }

    .recent-post {
        .name {
            flex: 100% 0 0;
            white-space: normal;
            overflow: visible;
            word-break: break-word;
        }
        .reply-count { width: 75px; }
        .author { width: 90px; }
        .excerpt {
            white-space: normal;
            overflow: visible;
            word-break: break-word;
        }
    }

    .boards:not(.full-width) {
        width: unset;
        margin: 0;
    }
}

.no-threads {
    padding: 60px 30px;
    line-height: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

button.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
}
