:root {
    /* Фоновые цвета в гамме выдержанной хны и молочной бумаги */
    --bg: #fdfbf7;
    --bg-soft: #f5f0e6;
    --card: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f4ed;
    --text: #1c1917;
    --muted: #78716c;
    --line: #e7e5e4;

    /* ЕДИНООБРАЗНЫЙ АКЦЕНТ: НАТУРАЛЬНАЯ ХНА */
    --accent: #b45309;
    --accent-hover: #78350f;
    --accent-soft: rgba(180, 83, 9, 0.08);
    --accent-soft-strong: rgba(180, 83, 9, 0.15);

    --radius: 16px;
    --shadow: 0 10px 25px -5px rgba(120, 53, 15, 0.06), 0 8px 10px -6px rgba(120, 53, 15, 0.04);
    --shadow-hover: 0 18px 30px -5px rgba(120, 53, 15, 0.15);
    --container: 1200px;
    --article: 860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    position: relative;
}

/* Фон с драконом (opacity 0.45) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background-image: url('/images/bg-silver-dragon.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    opacity: 0.45;
}

/* Мягкая молочная подложка поверх дракона */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: linear-gradient(
        180deg, 
        rgba(253, 251, 247, 0.55) 0%, 
        rgba(253, 251, 247, 0.85) 50%, 
        rgba(253, 251, 247, 0.98) 100%
    );
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

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

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

/* Шапка сайта */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(253, 251, 247, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transition: transform .25s ease, box-shadow .25s ease;
}

.site-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    min-height: 68px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 40px;
}

.logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo__title {
    font-size: 19px;
    font-weight: bold;
    color: var(--text);
    white-space: nowrap;
}

.main-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    transition: .2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--accent);
    background: var(--accent-soft);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Кнопки в стиле Хны */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: bold;
    transition: .2s ease;
}

.btn--ghost {
    border-color: var(--line);
    color: var(--text);
    background: #ffffff;
}

.btn--ghost:hover {
    background: var(--bg-soft);
    border-color: #d6d3d1;
}

.btn--accent {
    background: linear-gradient(180deg, #c2410c 0%, #9a3412 100%);
    color: #ffffff;
    border: 1px solid #9a3412;
    box-shadow: 0 4px 14px rgba(154, 52, 18, 0.2);
}

.btn--accent:hover {
    background: linear-gradient(180deg, #9a3412 0%, #7c2d12 100%);
    border-color: #7c2d12;
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.mobile-menu {
    border-top: 1px solid var(--line);
    background: var(--card);
}

.mobile-menu__nav {
    display: grid;
    gap: 8px;
    padding: 14px 0 16px;
}

.mobile-menu__nav a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--text);
}

/* Статья и карточки */
.article-top {
    padding: 24px 0 0;
}

.breadcrumbs {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.article-hero {
    padding: 18px 0 28px;
}

.article-hero__box,
.toc,
.article-body,
.faq-box,
.related-box,
.tags-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.article-hero__box {
    padding: 28px;
}

.article-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-soft-strong);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 14px;
}

h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 4vw, 58px);
    line-height: 1.05;
    color: var(--text);
}

.article-lead {
    margin: 0;
    max-width: 68ch;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.article-meta span,
.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.hero-cover {
    margin-top: 24px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.hero-cover img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 34px;
}

.toc,
.article-body,
.faq-box,
.related-box,
.tags-box {
    padding: 28px;
}

.toc h2,
.faq-box h2,
.related-box h2 {
    margin: 0 0 14px;
    font-size: 28px;
    color: var(--text);
}

.toc ol {
    margin: 0;
    padding-left: 18px;
    line-height: 1.85;
}

.toc a {
    color: var(--text);
}

.toc a:hover {
    color: var(--accent);
}

.article-body h2 {
    margin: 34px 0 14px;
    font-size: 34px;
    line-height: 1.15;
    position: relative;
    color: var(--text);
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h2::before {
    content: "";
    display: block;
    width: 68px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin-bottom: 12px;
}

.article-body h3 {
    margin: 24px 0 12px;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text);
}

.article-body p,
.article-body ul,
.article-body ol {
    font-size: 17px;
    line-height: 1.85;
    color: #292524;
}

.article-body p {
    margin: 0 0 16px;
}

.article-body ul,
.article-body ol {
    margin: 0 0 18px;
    padding-left: 22px;
}

.article-body li + li {
    margin-top: 8px;
}

.article-image {
    margin: 26px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-2);
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.article-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article-image figcaption {
    padding: 12px 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    background: var(--surface-2);
}

/* Акцентные плашки в тексте */
.accent-box {
    margin: 26px 0;
    padding: 20px 20px 18px 24px;
    border-radius: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-strong);
    position: relative;
}

.accent-box::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 999px;
    background: var(--accent);
}

.accent-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--accent-hover);
}

.accent-box p {
    margin: 0;
    color: var(--text);
}

/* Цитаты */
.quote-box {
    margin: 28px 0;
    padding: 26px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    position: relative;
}

.quote-box::before {
    content: "“";
    position: absolute;
    left: 18px;
    top: 8px;
    font-size: 72px;
    line-height: 1;
    color: var(--accent-soft-strong);
}

.quote-box blockquote {
    margin: 0;
    padding-left: 20px;
    font-size: 22px;
    line-height: 1.6;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.quote-box cite {
    display: block;
    margin-top: 12px;
    padding-left: 20px;
    font-style: normal;
    font-size: 14px;
    color: var(--muted);
}

/* FAQ (Спойлеры) */
.faq-spoilers {
    display: grid;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
    overflow: hidden;
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
    position: relative;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--accent);
    transition: .2s ease;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-answer {
    padding: 0 22px 18px;
    color: var(--muted);
    line-height: 1.75;
    font-size: 16px;
}

/* Теги и похожие статьи */
.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip {
    transition: .2s ease;
}

.tag-chip:hover {
    color: var(--accent);
    border-color: var(--accent-soft-strong);
    background: var(--accent-soft);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.related-card {
    display: block;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: .25s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    border-color: #d6d3d1;
    box-shadow: var(--shadow-hover);
}

.related-card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-soft);
}

.related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.related-card:hover .related-card__image img {
    transform: scale(1.06);
}

.related-card__body {
    padding: 18px;
}

.related-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.25;
    color: var(--text);
}

.related-card__text {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

/* Подвал */
.site-footer {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    background: #f3eee3;
}

.footer-main {
    padding: 34px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
}

.footer-brand .logo {
    margin-bottom: 14px;
}

.footer-brand p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
    font-size: 15px;
    max-width: 34ch;
}

.footer-col h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: var(--text);
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li + li {
    margin-top: 10px;
}

.footer-col a {
    color: var(--muted);
    line-height: 1.6;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 16px 0 24px;
    color: var(--muted);
    font-size: 14px;
}

.footer-bottom__inner {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

/* Мобильная адаптивность */
@media (max-width: 980px) {
    .main-nav { display: none; }
    .header-desktop-only { display: none; }
    .mobile-menu-toggle { display: inline-flex; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .site-header__inner {
        min-height: 56px;
        gap: 12px;
    }

    .logo img {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .logo__title {
        font-size: 16px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .article-top { padding: 12px 0 0; }
    .article-hero { padding: 12px 0 20px; }

    .article-hero__box,
    .toc,
    .article-body,
    .faq-box,
    .related-box,
    .tags-box {
        padding: 18px;
        border-radius: 16px;
    }

    h1 { font-size: 30px; }
    .article-lead { font-size: 16px; line-height: 1.65; }
    .article-body h2 { font-size: 26px; }
    .article-body h3 { font-size: 21px; }

    .article-body p,
    .article-body ul,
    .article-body ol {
        font-size: 16px;
    }

    .footer-grid { grid-template-columns: 1fr; }
}