:root {
    --blue: #1f5e8f;
    --blue-dark: #16466d;
    --green: #3f7b57;
    --border: #d7dee6;
    --muted: #657386;
    --bg: #f4f7fa;
    --paper: #ffffff;
    --text: #1d2733;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Arial, "Helvetica Neue", sans-serif;
    line-height: 1.55;
}

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

a:hover,
a:focus {
    text-decoration: underline;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    background: #fff;
    padding: 8px 12px;
}

.skip-link:focus {
    left: 16px;
    z-index: 10;
}

.top-line {
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    padding: 18px 0;
}

.brand {
    display: inline-flex;
    gap: 14px;
    align-items: center;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    color: #fff;
    background: var(--blue);
    font-weight: 700;
}

.brand strong {
    display: block;
    font-size: 21px;
}

.brand small {
    display: block;
    color: var(--muted);
}

.hero-banner {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(13, 35, 51, 0.78), rgba(33, 85, 62, 0.56)),
        url("../img/site-header-playground.jfif") center 54% / cover no-repeat;
    color: #fff;
}

.hero-banner .container {
    min-height: 240px;
    display: flex;
    align-items: end;
    padding: 28px 0;
}

.hero-banner p {
    max-width: 760px;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 26px auto 42px;
    display: grid;
    grid-template-columns: 285px 1fr;
    gap: 26px;
    align-items: start;
}

.sidebar,
.content {
    background: var(--paper);
    border: 1px solid var(--border);
}

.sidebar {
    position: sticky;
    top: 16px;
}

.side-nav {
    display: grid;
    padding: 12px;
}

.side-nav > a {
    padding: 11px 12px;
    border-radius: 4px;
    color: var(--text);
    font-weight: 700;
}

.side-nav > a:hover,
.camp-links a:hover {
    background: #edf4f9;
    text-decoration: none;
}

.camp-links {
    display: grid;
    margin: 2px 0 10px 12px;
    padding-left: 12px;
    border-left: 3px solid var(--border);
}

.camp-links a {
    padding: 7px 8px;
    border-radius: 4px;
    color: var(--blue-dark);
    font-size: 14px;
}

.content {
    min-width: 0;
    padding: 28px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
}

.page-heading {
    margin-bottom: 26px;
}

h1,
h2,
h3 {
    line-height: 1.25;
}

h1 {
    margin: 0 0 12px;
    font-size: 32px;
}

h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.lead-text {
    max-width: 820px;
    margin: 0;
    color: #394759;
    font-size: 18px;
}

.section-block {
    margin-top: 30px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.content-banner,
.article-image,
.info-card img,
.news-card img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.content-banner {
    max-height: 280px;
    margin-bottom: 26px;
    border: 1px solid var(--border);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 16px;
}

.info-card,
.document-card,
.news-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.info-card {
    padding: 18px;
}

.info-card img {
    height: 150px;
    margin: -18px -18px 16px;
    width: calc(100% + 36px);
    border-radius: 6px 6px 0 0;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 28px;
}

.tabs a {
    max-width: 320px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #f8fafc;
    color: var(--text);
    font-size: 14px;
}

.tabs a.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.tabs a:hover {
    text-decoration: none;
}

.document-list,
.news-list {
    display: grid;
    gap: 14px;
}

.document-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 16px;
}

.document-card.is-unpublished,
.info-card.is-unpublished,
.news-card.is-unpublished {
    border-style: dashed;
    background: #fbfcfd;
}

.card-actions,
.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.card-actions {
    margin-top: 14px;
}

.document-actions {
    justify-content: flex-end;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

.meta span {
    padding: 3px 8px;
    border-radius: 4px;
    background: #edf2f6;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 4px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.button-link:hover {
    background: #326547;
    text-decoration: none;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.editor-page-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 18px;
}

.page-actions {
    margin-top: 16px;
    justify-content: flex-start;
}

.editor-only {
    display: none;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.editor-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #b9c9d8;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(29, 39, 51, 0.08);
}

.button-link.editor-mode-toggle {
    background: #fff;
    color: var(--blue-dark);
}

.editor-mode-toggle:hover,
.editor-mode-toggle:focus {
    border-color: var(--blue);
    background: #edf4f9;
    text-decoration: none;
}

.editor-mode-toggle[aria-pressed="true"] {
    border-color: var(--green);
    background: #edf7f1;
    color: #28583b;
}

.editor-mode-indicator {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #aebdca;
}

.editor-mode-toggle[aria-pressed="true"] .editor-mode-indicator {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(63, 123, 87, 0.15);
}

.icon-action {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--blue-dark);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.icon-action i {
    font-size: 15px;
}

.icon-action:hover,
.icon-action:focus {
    border-color: #b8c7d5;
    background: #edf4f9;
    text-decoration: none;
}

.icon-action.danger {
    color: #9b342b;
}

.icon-action.danger:hover,
.icon-action.danger:focus {
    border-color: #d8b6b0;
    background: #fff1ef;
}

.editor-only,
.editor-only.editor-actions,
.editor-only.icon-action {
    display: none;
}

.editor-mode-active .editor-only {
    display: inline-flex;
}

.editor-mode-active .editor-only.editor-actions {
    display: flex;
}

.editor-mode-active .editor-only.icon-action {
    display: inline-grid;
}

.editor-button,
.editor-icon-button {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #f8fafc;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.editor-button {
    min-height: 34px;
    padding: 6px 10px;
    font-weight: 700;
}

.editor-button:hover,
.editor-button:focus {
    background: #edf4f9;
}

.editor-icon-button {
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
}

.muted-action {
    color: var(--muted);
    font-size: 14px;
}

.editor-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 30;
    width: min(460px, 100%);
    padding: 22px;
    overflow-y: auto;
    background: var(--paper);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 32px rgba(29, 39, 51, 0.18);
    transform: translateX(100%);
    transition: transform 0.18s ease;
}

.editor-panel.is-open {
    transform: translateX(0);
}

.editor-panel-head,
.editor-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.editor-panel-head {
    margin-bottom: 18px;
}

.editor-panel-head h2 {
    margin: 0;
}

.editor-form {
    display: grid;
    gap: 16px;
}

.editor-form-row {
    display: grid;
    gap: 6px;
}

.editor-form-row label {
    font-weight: 700;
}

.editor-field {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font: inherit;
}

textarea.editor-field {
    resize: vertical;
}

.editor-errors {
    color: #a33a2c;
    font-size: 14px;
}

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

.editor-loading {
    color: var(--muted);
}

.editor-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    max-width: min(360px, calc(100% - 40px));
    padding: 12px 14px;
    border-radius: 4px;
    background: var(--green);
    color: #fff;
    box-shadow: 0 12px 28px rgba(29, 39, 51, 0.22);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.editor-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.editor-toast.is-error {
    background: #a33a2c;
}

.news-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    padding: 16px;
}

.news-card img {
    height: 120px;
    border-radius: 4px;
}

.article-page h1 {
    margin-bottom: 18px;
}

.article-image {
    max-height: 390px;
    margin: 0 0 22px;
    border: 1px solid var(--border);
}

.article-content {
    max-width: 820px;
}

.empty-state {
    padding: 16px;
    border: 1px dashed var(--border);
    background: #f8fafc;
    color: var(--muted);
}

.site-footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    background: var(--paper);
    color: var(--muted);
}

.site-footer p {
    margin: 0;
}

.site-footer p + p {
    margin-top: 6px;
}

.footer-note {
    font-size: 14px;
}

@media (max-width: 860px) {
    .hero-banner {
        background-position: center center;
    }

    .hero-banner .container {
        min-height: 190px;
    }

    .hero-banner p {
        font-size: 20px;
    }

    .page-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .news-card,
    .document-card {
        grid-template-columns: 1fr;
        display: grid;
    }

    .document-card {
        align-items: start;
    }

    .document-actions,
    .editor-page-toolbar,
    .editor-toolbar,
    .editor-form-actions {
        justify-content: flex-start;
    }
}
