:root {
  --bg: #1B1B1B;
  --bg-container: #262626;
  --row: #2E2E2E;
  --row-hover: #363636;
  --divider: #3D3D3D;
  --orange: #F08A00;
  --orange-light: #F6A623;
  --orange-dark: #C75B00;
  --text: #E6E6E6;
  --text-muted: #9A9A9A;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Open Sans', Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--orange-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: 'Fira Sans', 'Trebuchet MS', sans-serif; font-weight: 700; color: var(--orange); margin: 0 0 .6em; }
h2 { font-size: 26px; margin-top: 1.4em; }
h3 { font-size: 20px; color: var(--orange-light); }
img { max-width: 100%; display: block; }

.content-col { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
.content-col.with-sidebar { display: grid; grid-template-columns: 1fr 280px; gap: 32px; align-items: start; }
.content-body { max-width: 760px; }
.content-col:not(.with-sidebar) .content-body { max-width: 760px; margin: 0 auto; }

/* --- Topbar --- */
.topbar {
  background: #141414;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--divider);
}

/* --- Header --- */
.site-header {
  background: linear-gradient(180deg, var(--orange-dark), var(--orange) 55%, var(--orange-light));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 18px 70px;
  position: relative;
  /* не overflow:hidden здесь — полоса меню сидит ниже через top:100% и обрезалась бы вместе
     с языками пламени; у .banner-flames свой overflow:hidden того же размера (inset:0). */
}

/* Мягкие языки пламени/дыма поверх градиента (лист "дизайн": сток или CSS-градиент). */
.banner-flames { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.flame-lick {
  position: absolute;
  bottom: -6%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,247,214,.85) 0%, rgba(255,210,120,.55) 45%, rgba(255,210,120,0) 75%);
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  filter: blur(3px);
  transform-origin: bottom center;
}
.fl-1 { left: 0%;  width: 70px;  height: 125px; opacity: .55; transform: rotate(-8deg); }
.fl-2 { left: 13%; width: 95px;  height: 150px; opacity: .4;  transform: rotate(6deg); }
.fl-3 { left: 27%; width: 75px;  height: 118px; opacity: .5;  transform: rotate(-4deg); }
.fl-4 { left: 41%; width: 110px; height: 160px; opacity: .35; transform: rotate(5deg); }
.fl-5 { left: 57%; width: 80px;  height: 130px; opacity: .5;  transform: rotate(-6deg); }
.fl-6 { left: 73%; width: 100px; height: 148px; opacity: .4;  transform: rotate(7deg); }
.fl-7 { left: 88%; width: 70px;  height: 120px; opacity: .55; transform: rotate(-5deg); }

.logo-block { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; color: #1B1B1B; }
.logo-horns { flex-shrink: 0; }
.logo-text-group { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text {
  font-family: 'Cinzel Decorative', 'Uncial Antiqua', serif;
  font-weight: 700;
  font-size: 28px;
  color: #1B1B1B;
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.logo-dot { font-size: 17px; opacity: .8; }
.logo-subtitle { font-family: 'Open Sans', sans-serif; font-size: 13px; font-weight: 600; color: #2a1a00; letter-spacing: .03em; margin-top: 3px; }

.menu-toggle { display: none; position: absolute; right: 16px; top: 16px; z-index: 2; background: none; border: 1px solid #1B1B1B; color: #1B1B1B; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.main-nav { display: flex; align-items: center; justify-content: center; background: #141414; position: absolute; left: 0; right: 0; top: 100%; padding: 2px 16px; min-height: 40px; }
.nav-items { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.nav-sep { color: #fff; opacity: .45; font-size: 12px; }
.nav-item { position: relative; }
.nav-item > a { display: block; padding: 10px 14px; color: #fff; font-size: 14px; letter-spacing: .03em; }
.nav-item > a[aria-current="true"] { color: var(--orange-light); }
.nav-item.has-dropdown:hover .dropdown, .nav-item.has-dropdown.open .dropdown { display: block; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--bg-container); border: 1px solid var(--divider); min-width: 220px; z-index: 20; }

/* Поиск по сайту (справа в полосе меню) */
.nav-search { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.nav-search input[type="search"] {
  background: #1f1f1f; border: 1px solid var(--divider); color: var(--text);
  font-size: 13px; padding: 6px 10px; border-radius: 3px 0 0 3px; width: 140px; outline: none;
}
.nav-search input[type="search"]:focus { border-color: var(--orange); }
.nav-search button {
  background: var(--orange); border: none; color: #141414; padding: 0 8px; align-self: stretch;
  border-radius: 0 3px 3px 0; cursor: pointer; display: flex; align-items: center;
}
.search-results {
  position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--bg-container);
  border: 1px solid var(--divider); width: 260px; max-height: 320px; overflow-y: auto; z-index: 30;
}
.search-results a { display: block; padding: 8px 12px; color: var(--text); font-size: 13px; border-bottom: 1px solid var(--divider); }
.search-results a:hover { background: var(--row-hover); text-decoration: none; }
.search-results p { padding: 10px 12px; margin: 0; color: var(--text-muted); font-size: 13px; }
.dropdown a { display: block; padding: 10px 16px; color: var(--text); font-size: 14px; }
.dropdown a:hover { background: var(--row-hover); text-decoration: none; }
body { padding-top: 0; }
.main-nav { margin-bottom: 0; }
.site-header + .topbar { display: none; }

/* чтобы фиксированная полоса меню не перекрывала контент, добавляем отступ сверху у следующего блока */
.category-stripe, .hero-banner, .home-intro { margin-top: 44px; }

/* --- Category stripe (H1) --- */
.category-stripe {
  background: linear-gradient(90deg, #4A4A4A, #2A2A2A);
  padding: 28px 24px;
  text-align: center;
  position: relative;
}
.category-stripe::before, .category-stripe::after {
  content: "";
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(240,138,0,.35);
  border: 1px solid rgba(240,138,0,.6);
}
.category-stripe::before { left: 24px; }
.category-stripe::after { right: 24px; }
.category-stripe h1 { color: var(--orange-light); font-size: 30px; margin: 0; }
.category-stripe-home h1 { font-size: 34px; }
.lb { text-transform: none; }

.page-crumb {
  background: #141414;
  color: var(--orange);
  font-size: 13px;
  padding: 8px 24px;
  margin: 0 0 24px;
}
.page-crumb a { color: var(--orange); }
.banner-date { float: right; color: var(--text-muted); }

/* --- Home intro --- */
.home-intro p { margin: 0 0 1.1em; }

.section-title-bar {
  background: linear-gradient(90deg, #4A4A4A, #2A2A2A);
  color: var(--orange-light);
  font-weight: 700;
  letter-spacing: .04em;
  padding: 10px 16px;
  margin: 30px 0 0;
}

/* --- Forum-style tables --- */
.tscroll { overflow-x: auto; }
table.forum-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-container);
  margin: 0 0 10px;
}
table.forum-table thead th {
  background: var(--orange);
  color: #fff;
  text-align: left;
  font-size: 13px;
  padding: 10px 14px;
}
table.forum-table tbody tr { background: var(--row); border-bottom: 1px solid var(--divider); }
table.forum-table tbody tr:hover { background: var(--row-hover); }
table.forum-table td { padding: 12px 14px; vertical-align: middle; }
.row-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange-dark); color: #fff; font-weight: 700; font-size: 13px;
  margin-right: 10px;
}
.row-title { color: var(--orange-light); font-weight: 700; }
.row-subtitle { display: block; color: var(--text-muted); font-weight: 400; font-size: 13px; margin-top: 2px; }
.row-type, .row-count, .row-updated { color: var(--text-muted); font-size: 13px; }
table.related-table thead { display: none; }

/* --- Table des matières (блок-оглавление, лист "дизайн" страница категории) --- */
.section-toc { margin: 18px 0 26px; max-width: 420px; }
.section-toc table.forum-table td { padding: 8px 14px; }

/* --- Inline figures --- */
.inline-figure { margin: 24px 0; }
.inline-figure img { border-radius: 6px; width: 100%; height: auto; aspect-ratio: 16/5; object-fit: cover; }
.inline-figure figcaption { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* --- Related / official sources --- */
.related-block { margin-top: 30px; }
.official-sources {
  background: var(--bg-container);
  border: 1px solid var(--divider);
  padding: 18px;
  border-radius: 6px;
}
.official-sources h3 { margin-top: 0; }
.official-sources ul { list-style: none; margin: 0; padding: 0; }
.official-sources li { margin-bottom: 8px; }

/* --- Slogan stripe --- */
.slogan-stripe {
  background: linear-gradient(135deg, var(--orange-dark), var(--orange));
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  margin-top: 30px;
}
.slogan-stripe p { font-weight: 700; letter-spacing: .04em; margin: 0 0 14px; }
.btn-outline-white, .btn-outline {
  display: inline-block;
  border: 2px solid #fff;
  color: #fff;
  padding: 10px 22px;
  font-weight: 700;
  letter-spacing: .03em;
}
.btn-outline-white:hover, .btn-outline:hover { background: #fff; color: var(--orange-dark); text-decoration: none; }
.btn-outline { border-color: var(--orange); color: var(--orange); margin: 6px; }
.btn-outline:hover { background: var(--orange); color: #141414; }

/* --- Footer --- */
.site-footer { background: #141414; border-top: 1px solid var(--divider); padding: 24px 20px; text-align: center; }
.footer-stats { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.footer-links { margin-bottom: 14px; }
.footer-links a { margin: 0 10px; color: var(--text); }
.footer-brand { color: var(--orange); font-weight: 700; letter-spacing: .04em; margin: 0 0 8px; }
.footer-disclaimer { color: var(--text-muted); font-size: 12px; max-width: 680px; margin: 0 auto; }

/* --- Error pages --- */
.error-content { text-align: center; padding-top: 60px; }
.error-code { font-family: 'Cinzel Decorative', serif; font-size: 90px; color: var(--orange); margin: 0; }
.error-links { margin-top: 20px; }

/* --- Mobile --- */
@media (max-width: 860px) {
  .site-header { justify-content: flex-start; padding: 18px 60px 18px 20px; min-height: 110px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; flex-direction: column; position: static; padding: 8px 0; }
  .main-nav.open { display: flex; }
  .nav-items { flex-direction: column; width: 100%; }
  .nav-sep { display: none; }
  .nav-item.has-dropdown .dropdown { position: static; display: none; }
  .nav-item.has-dropdown.open .dropdown { display: block; }
  .nav-search { position: static; transform: none; width: 100%; padding: 10px 16px; justify-content: center; }
  .nav-search input[type="search"] { width: 100%; }
  .search-results { position: static; width: 100%; margin-top: 8px; }
  .category-stripe, .hero-banner, .home-intro { margin-top: 0; }
  .content-col.with-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  table.forum-table .row-type, table.forum-table .row-count, table.forum-table .row-updated { display: none; }
  table.forum-table thead th:nth-child(n+2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
