:root {
    --page-bg: #e9eeea;
    --surface: #ffffff;
    --surface-alt: #f4f5f3;
    --text: #111111;
    --muted: #59635d;
    --line: #bfc8c2;
    --brand: #145b43;
    --brand-dark: #0b412f;
    --brand-soft: #e0ebe5;
    --accent: #d2a13a;
    --shadow: 0 5px 16px rgba(24, 45, 34, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background: var(--page-bg);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.45;
}

a {
    color: #005f43;
}

a:hover {
    color: #003e2c;
}

.skip-link {
    position: fixed;
    top: 6px;
    left: 6px;
    z-index: 1000;
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid var(--line);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    background: #ffffff;
    border-top: 5px solid var(--brand-dark);
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.site-header__inner {
    width: min(1400px, calc(100% - 24px));
    min-height: 96px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    color: var(--brand-dark);
    text-decoration: none;
}

.site-brand:hover {
    color: var(--brand-dark);
}

.site-brand__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 84px;
    padding: 3px;
    overflow: hidden;
    background: #ffffff;
}

.site-brand img {
    display: block;
    width: 100px;
    height: 82px;
    object-fit: contain;
}

.site-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.site-brand__name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: normal;
    letter-spacing: 0.01em;
}

.site-brand__tagline {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid var(--brand-dark);
    border-radius: 3px;
    font: inherit;
    cursor: pointer;
}

.menu-toggle__icon,
.menu-toggle__icon::before,
.menu-toggle__icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    content: "";
}

.menu-toggle__icon {
    position: relative;
}

.menu-toggle__icon::before {
    position: absolute;
    top: -5px;
}

.menu-toggle__icon::after {
    position: absolute;
    top: 5px;
}

.page-shell {
    width: min(1400px, calc(100% - 24px));
    margin: 14px auto 24px;
}

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

.site-sidebar {
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    background: #d9d9d9;
    border: 1px solid #929b95;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.language-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px;
    background: #f5f5f5;
    border-bottom: 1px solid #aeb5b0;
}

.language-links a {
    display: block;
    padding: 5px 6px;
    line-height: 0;
}

.language-links img {
    display: block;
    width: 32px;
    height: 20px;
    border: 1px solid #777777;
    object-fit: cover;
}

.legacy-menu__heading {
    padding: 7px 8px;
    color: #ffffff;
    background: var(--brand-dark);
    border-bottom: 1px solid #082d22;
    font-size: 11px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.legacy-menu ul {
    margin: 0;
    padding: 4px;
    list-style: none;
}

.legacy-menu li + li {
    margin-top: 2px;
}

.legacy-menu a {
    display: block;
    padding: 5px 6px;
    color: #263129;
    background: #eeeeee;
    border: 1px solid #b8bdb9;
    border-radius: 2px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
}

.legacy-menu ul a {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.1;
}

.legacy-menu a:hover,
.legacy-menu a:focus-visible {
    color: #ffffff;
    background: #64766b;
    border-color: #4e5e55;
    outline: none;
}

.legacy-menu a.is-current {
    color: #ffffff;
    background: var(--brand);
    border-color: var(--brand-dark);
}

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

.legacy-content,
.home-partners,
.home-links {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.legacy-content {
    padding: 14px 18px;
    overflow: hidden;
}

.legacy-content,
.legacy-content td,
.legacy-content th,
.legacy-content p,
.legacy-content div,
.legacy-content font,
.legacy-content span {
    font-family: Consolas, "Courier New", monospace !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
}

.legacy-content > div:first-child table,
.legacy-content > table:first-of-type {
    width: 100% !important;
}

.legacy-content table {
    max-width: 100% !important;
    border-collapse: collapse;
}

.legacy-content td,
.legacy-content th {
    max-width: 100%;
    padding: 4px;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.legacy-content p,
.legacy-content .main_page_justify {
    margin-top: 0;
    margin-bottom: 9px;
    color: #111111;
    text-align: justify;
}

.legacy-content h1,
.legacy-content h2,
.legacy-content h3 {
    color: var(--brand-dark);
    font-family: Consolas, "Courier New", monospace !important;
    line-height: 1.25 !important;
}

.legacy-content h1 {
    font-size: 15px !important;
}

.legacy-content h2 {
    font-size: 13px !important;
}

.legacy-content h3 {
    font-size: 11px !important;
}

.legacy-content a {
    overflow-wrap: anywhere;
}

.legacy-content img {
    max-width: 100% !important;
    height: auto !important;
}

.legacy-content img.postimage {
    width: auto !important;
    max-width: min(100%, 560px) !important;
    border-width: 2px !important;
}

.legacy-content hr {
    height: 1px;
    border: 0;
    background: var(--line);
}

.legacy-content marquee {
    display: block;
    white-space: normal;
}

.preview-error {
    margin: 0;
    padding: 10px;
    color: #7a2525;
    background: #fff1f1;
    border: 1px solid #efc9c9;
}

.home-partners {
    margin-top: 12px;
    padding: 12px 14px 14px;
}

.home-partners h2 {
    margin: 0 0 10px;
    color: var(--brand-dark);
    font-size: 13px;
    text-align: center;
}

.sponsor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.sponsor-card {
    min-height: 94px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #d3d7d4;
    border-radius: 3px;
    text-decoration: none;
}

.sponsor-card:hover {
    border-color: #8f9d94;
    box-shadow: 0 2px 8px rgba(20, 50, 35, 0.10);
}

.sponsor-card img {
    display: block;
    max-width: 220px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.home-links {
    margin-top: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.home-links a {
    min-height: 42px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #1e2a23;
    background: #f5f6f5;
    border: 1px solid #cbd1cd;
    border-radius: 3px;
    font-size: 11px;
    text-decoration: none;
}

.home-links a:hover {
    background: var(--brand-soft);
    border-color: #9eaaa3;
}

.home-links img {
    display: block;
    width: 30px;
    height: 30px;
}

.home-links .home-links__news {
    padding-inline: 12px;
    color: #ffffff;
    background: var(--brand);
    border-color: var(--brand-dark);
}

.site-footer {
    color: #dce7e1;
    background: var(--brand-dark);
}

.site-footer__inner {
    width: min(1400px, calc(100% - 24px));
    min-height: 46px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 10px;
}

.site-footer a {
    color: #ffffff;
}

@media (max-width: 899px) {
    .site-header__inner {
        min-height: 78px;
    }

    .site-brand__logo {
        width: 76px;
        height: 68px;
    }

    .site-brand img {
        width: 72px;
        height: 64px;
    }

    .site-brand__name {
        font-size: 27px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .site-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .site-sidebar {
        position: static;
        display: none;
        max-height: none;
    }

    .site-sidebar.is-open {
        display: block;
    }

    .legacy-menu ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px;
    }

    .legacy-menu li + li {
        margin-top: 0;
    }
}

@media (max-width: 580px) {
    .site-header__inner,
    .page-shell,
    .site-footer__inner {
        width: calc(100% - 14px);
    }

    .site-brand {
        gap: 8px;
    }

    .site-brand__logo {
        width: 58px;
        height: 56px;
    }

    .site-brand img {
        width: 55px;
        height: 52px;
    }

    .site-brand__name {
        font-size: 23px;
    }

    .site-brand__tagline {
        display: none;
    }

    .page-shell {
        margin-top: 8px;
    }

    .legacy-menu ul {
        grid-template-columns: 1fr;
    }

    .legacy-content {
        padding: 9px;
    }

    .legacy-content td,
    .legacy-content th {
        padding: 2px;
    }

    .sponsor-card {
        min-height: 80px;
    }

    .home-links {
        justify-content: stretch;
    }

    .home-links a {
        flex: 1 1 120px;
        justify-content: center;
    }

    .site-footer__inner {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
    }
}
