/**
 * KBHost Dark Theme
 *
 * Based on Twenty Sixteen with WP Dark Mode overrides.
 * Colors extracted from the live kbhost.nl site.
 */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: Merriweather, Georgia, serif;
    font-size: 1rem;
    line-height: 1.75;
    background-color: #1a1a2e;
    color: #d4d4d4;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: Montserrat, "Helvetica Neue", sans-serif;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1.25;
    margin: 0 0 1em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

a {
    color: #007acc;
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: #3ca0e0;
}

p {
    margin: 0 0 1.5em;
}

code, pre, textarea.auto-resize {
    font-family: Inconsolata, Consolas, monospace;
}

pre, textarea.auto-resize {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    overflow-x: auto;
    border: 1px solid #333;
    border-radius: 3px;
    font-size: 0.875rem;
    line-height: 1.6;
    width: 100%;
}

blockquote {
    margin: 1em 0 1em 10px;
    padding-left: 20px;
    border-left: 4px solid #007acc;
    font-style: italic;
    color: #aaa;
}

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

table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}
table th, table td {
    border: 1px solid #444;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #d4d4d4;
}
table th {
    background: #2a2a3e;
    font-weight: bold;
}
table tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

/* ===== Layout ===== */
.site-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 7.6923%;
}

/* ===== Header ===== */
#masthead {
    background: #16161d;
    border-bottom: 1px solid #2a2a3e;
    padding: 1em 7.6923%;
}

.site-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.site-branding .site-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 900;
}
.site-branding .site-title a {
    color: #1e73be;
    text-decoration: none;
}

.header-ip {
    color: #999;
    font-size: 0.875rem;
    font-family: Inconsolata, monospace;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
.main-navigation ul li a {
    color: #ccc;
    font-family: Montserrat, sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.04em;
}
.main-navigation ul li a:hover {
    color: #007acc;
}

/* ===== Footer ===== */
#colophon {
    margin-top: 3em;
    padding: 1.5em 7.6923%;
    border-top: 1px solid #2a2a3e;
    background: #16161d;
    text-align: center;
}
.site-title-footer a {
    color: #666;
    font-family: Montserrat, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ===== Voting Widget ===== */
.voting-widget {
    float: right;
    font-size: 1rem;
    margin-bottom: 0.5em;
}
.vote-btn {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    user-select: none;
    transition: background 0.15s ease;
}
.vote-btn:hover {
    background: rgba(255,255,255,0.1);
}
.vote-up {
    color: #4caf50;
}
.vote-down {
    color: #f44336;
    margin-left: 8px;
}
.vote-btn.active {
    font-weight: bold;
}

/* ===== NO SLEEP Widget ===== */
.nosleep-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    border-radius: 26px;
    transition: 0.3s;
}
.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #4caf50;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

#nosleep-timer {
    font-family: Inconsolata, monospace;
    color: #999;
    font-size: 0.875rem;
}

/* ===== Password Generator ===== */
#password-gen-list .password-item {
    font-family: Inconsolata, monospace;
    font-size: 0.9375rem;
    color: #d4d4d4;
    padding: 3px 0;
    letter-spacing: 0.02em;
}
.widget-refresh-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #007acc;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 3em 0;
}
.error-404 h1 {
    font-size: 2rem;
    color: #e0e0e0;
}
.error-404 p {
    color: #999;
}

/* ===== Dark Mode Overrides (search) ===== */
#search-result li {
    background-color: #2a2a3e;
    border-color: #007acc;
}
#search-result li:hover {
    background-color: #333;
}
#search-result li a {
    color: #d4d4d4;
}
#search-result li a:hover {
    color: #fff;
}
#search-result {
    border-bottom: 1px solid #007acc;
}

.kbe_search_field input[type="text"] {
    color: #d4d4d4;
    background-color: #1e1e2e;
    border-color: #444;
    background-image: url(../images/kbe_search_btn.png);
    background-repeat: no-repeat;
    background-position: 9px center;
    background-size: 25px;
}
.kbe_search_field input[type="text"]:focus {
    color: rgb(168, 160, 149);
    border-color: #007acc;
    background-color: rgb(24, 26, 27);
    outline: none;
}
.kbe_search_field input[type="text"]::placeholder {
    color: #888;
}

/* ===== Dark Mode color overrides ===== */
#kbe_container h1,
#kbe_content h2,
.kbe_aside h2,
#kbe_content .kbe_child_category h3,
#kbe_content .kbe_child_category h3 a,
#kbe_content .kbe_category h2 a {
    color: #e0e0e0;
}

#kbe_content h2,
.kbe_aside h2,
#kbe_content .kbe_child_category h3 {
    border-bottom-color: #444;
}

.kbe_breadcrum ul li a,
.kbe_breadcrum ul li span {
    color: #007acc;
}
.kbe_breadcrum .separator {
    color: #666;
}

#kbe_content .kbe_leftcol a {
    color: #007acc;
}

#kbe_content .kbe_leftcol .kbe_article_list li a,
#kbe_content .kbe_leftcol .kbe_child_article_list li a,
.kbe_widget li a,
#kbe_content .kbe_leftcol .kbe_articles ul li a,
#kbe_content .kbe_leftcol .kbe_articles_search ul li a,
.kbe_tags_div ul li a,
.kbe-object-list li a {
    color: #b8b8b8;
}
#kbe_content .kbe_leftcol .kbe_article_list li a:hover,
#kbe_content .kbe_leftcol .kbe_child_article_list li a:hover,
.kbe_widget li a:hover,
.kbe-object-list li a:hover {
    color: #007acc;
}

#kbe_content .kbe_leftcol p,
#kbe_content .kbe_leftcol ul li,
#kbe_content .kbe_leftcol ol li,
#kbe_content .kbe_leftcol span {
    color: #d4d4d4;
}

.kbe_no_result {
    background: #2a2a3e;
    border-color: #444;
    color: #999;
}

#kbe_container table,
#kbe_container table th,
#kbe_container table tr,
#kbe_container table td {
    border-color: #444;
    color: #d4d4d4;
}

.kbe_articles_search ul li {
    border-bottom-color: #333;
}
.kbe_articles_search ul li span.post-meta {
    color: #888;
}

/* ===== Sidebar in dark ===== */
.kbe_widget {
    color: #d4d4d4;
}
.widget-title {
    color: #e0e0e0 !important;
}

/* ===== KBE Live Search Result (dark) ===== */
#kbe-live-search-result {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    z-index: 9999;
    width: 100%;
    background: #2a2a3e;
    border: 1px solid #007acc;
    border-top: none;
}
#kbe-live-search-result li {
    border-bottom: 1px solid #333;
}
#kbe-live-search-result li a {
    display: block;
    padding: 10px 16px;
    color: #d4d4d4;
    text-decoration: none;
    font-size: 0.875rem;
}
#kbe-live-search-result li a:hover {
    background: #333;
    color: #fff;
}
.kbe-live-search-no-result {
    display: block;
    padding: 10px 16px;
    color: #888;
    font-size: 0.875rem;
}

/* ===== Responsive ===== */
@media screen and (max-width: 985px) {
    .site-inner {
        padding: 0 4%;
    }
    #masthead {
        padding: 0.75em 4%;
    }
}

@media screen and (max-width: 640px) {
    .site-header-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-ip {
        order: 3;
    }
}
