/*
Theme Name: Lunar100 Classic
Theme URI: https://lunar100.com/
Author: Oleg Zaharciuc
Description: Custom dark astronomy theme for Lunar100.com
Version: 0.1.0
Text Domain: lunar100
*/

:root {
    --page-bg: #111;
    --panel-bg: #191919;
    --panel-alt: #202020;
    --border: #343434;
    --text: #ededed;
    --muted: #a9a9a9;
    --link: #d8e7ff;
    --accent: #f2df72;
    --content-width: 1100px;
    --sidebar-width: 230px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, #202733 0, #111 520px),
        var(--page-bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

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

.site-shell {
    width: min(calc(100% - 28px), var(--content-width));
    margin: 0 auto;
}

.site-header {
    margin: 20px auto 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #090909;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
}

.site-header img {
    display: block;
    width: 100%;
}

.site-title-fallback {
    padding: 44px 30px;
    text-align: center;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: .04em;
}

.site-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sidebar {
    display: grid;
    gap: 14px;
}

.widget {
    border: 1px solid var(--border);
    background: var(--panel-bg);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .22);
}

.widget-title {
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: #252525;
    color: #fff;
    font-size: 14px;
}

.widget-content,
.widget > ul,
.widget > form,
.widget > div:not(.widget-title) {
    padding: 10px;
}

.widget ul {
    margin: 0;
    padding-left: 18px;
}

.widget li {
    margin: 5px 0;
}

.main-content {
    min-width: 0;
}

.post-card {
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: var(--panel-bg);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
}

.post-header {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: #242424;
}

.post-title {
    margin: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.25;
}

.post-title a {
    color: inherit;
}

.post-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.post-content {
    padding: 16px;
}

.post-content p {
    margin: 0 0 1em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: #fff;
    line-height: 1.3;
}

.post-content figure {
    margin: 1.4em 0;
}

.post-content img {
    display: block;
    margin: 0 auto;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
}

.post-content th,
.post-content td {
    padding: 8px;
    border: 1px solid var(--border);
}

.navigation,
.pagination {
    margin: 20px 0;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--panel-bg);
}

.site-footer {
    margin: 22px auto;
    padding: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

@media (max-width: 820px) {
    .site-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .main-content {
        order: 1;
    }

    .site-title-fallback {
        font-size: 30px;
    }
}

@media (max-width: 520px) {
    .site-shell {
        width: min(calc(100% - 14px), var(--content-width));
    }

    .post-content {
        padding: 12px;
    }

    .post-title {
        font-size: 19px;
    }
}

/* Sidebar fixes */

:root {
    --sidebar-width: 260px;
}

.sidebar,
.widget,
.widget-content {
    min-width: 0;
}

.widget {
    overflow: hidden;
}

.widget-content,
.widget > ul,
.widget > form,
.widget > div:not(.widget-title) {
    overflow-wrap: anywhere;
    word-break: normal;
}

.widget img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Search form */

.search-form {
    display: flex;
    gap: 6px;
    width: 100%;
}

.search-form label {
    flex: 1 1 auto;
    min-width: 0;
}

.search-form .search-field {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #555;
    background: #fff;
    color: #111;
}

.search-form .search-submit {
    flex: 0 0 auto;
    max-width: 100%;
    padding: 7px 10px;
    white-space: nowrap;
}

/* Long links and archive items */

.widget a,
.widget li {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 820px) {
    .search-form {
        max-width: 420px;
    }
}

/* === Search widget === */

.search-form {
    display: block;
    width: 100%;
}

.search-form label {
    display: block;
    width: 100%;
}

.search-form .search-field {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #555;
    background: #fff;
    color: #111;
    font-size: 14px;
}

.search-form .search-submit {
    width: 100%;
    padding: 8px;
    border: 1px solid #555;
    background: #3a3f47;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.search-form .search-submit:hover {
    background: #505865;
}

/* === WordPress block search widget === */

.sidebar .wp-block-search,
.sidebar .wp-block-search__inside-wrapper {
    display: block !important;
    width: 100% !important;
}

.sidebar .wp-block-search__label {
    display: block;
    margin-bottom: 6px;
}

.sidebar .wp-block-search__input {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    height: 36px;
    margin: 0 0 8px 0 !important;
    padding: 6px 8px;
    border: 1px solid #555;
    background: #fff;
    color: #111;
    font-size: 14px;
}

.sidebar .wp-block-search__button {
    display: block;
    width: 100% !important;
    height: 36px;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 1px solid #555;
    background: #353b43;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.post-meta {
    margin-top: 7px;
    color: #9b9b9b;
    font-size: 12px;
    font-style: normal;
    line-height: 1.3;
}