/* ===== EXETERIC — Main Stylesheet ===== */
/* Fonts: Libre Franklin (body), Special Elite (headings) */

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a25;
  --text: #d0d0d8;
  --text2: #8888a0;
  --accent: #c9a84c;
  --accent2: #8b6f3c;
  --border: #222233;
  --font-body: 'Titillium Web', sans-serif;
  --font-heading: 'Special Elite', cursive;
  --max-width: 1200px;
  --header-h: 70px;
}

html.light {
  --bg: #f5f0eb;
  --bg2: #ede8e2;
  --bg3: #e5dfd8;
  --text: #2a2a35;
  --text2: #6a6a7a;
  --border: #d5d0ca;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: .3s; }
a:hover { color: #e0c060; }

/* ===== HEADER ===== */
#masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  height: var(--header-h);
}
html.light #masthead {
  background: rgba(245,240,235,.92);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: clamp(2px, 0.4vw, 4px);
}
.logo-img { height: 36px; width: auto; }

#main-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}
#main-nav a {
  color: var(--text2);
  font-size: clamp(11px, 1.2vw, 14px);
  text-transform: uppercase;
  letter-spacing: clamp(1px, 0.18vw, 2px);
  font-weight: 600;
}
#main-nav a:hover { color: var(--accent); }

.header-extra {
  display: flex;
  align-items: center;
  gap: 15px;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 600;
  letter-spacing: 1px;
}
.lang-link {
  color: var(--text2);
  text-decoration: none;
}
.lang-link:hover { color: var(--accent); }
.lang-active {
  color: var(--accent);
  font-weight: 700;
}
.lang-sep {
  color: var(--text2);
  opacity: 0.5;
}
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../img/articles/sigil-magic.webp') center/cover no-repeat;
  margin-top: var(--header-h);
  padding: 80px 20px;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,15,.4) 0%, rgba(10,10,15,.2) 50%, rgba(10,10,15,.6) 100%);
}
html.light .hero-overlay {
  background: linear-gradient(180deg, rgba(10,10,15,.4) 0%, rgba(10,10,15,.2) 50%, rgba(10,10,15,.6) 100%);
}
/* 21.08.2026: светлая тема hero = тёмная (тёмное затемнение вместо светлого тумана) */
.hero-content {
  position: relative;
  text-align: center;
  max-width: 700px;
  padding: 20px;
}
.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 48px;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0,0,0,.8);
}
.hero-highlight { color: #ffd700; }
.hero-content p {
  font-size: 18px;
  color: #f0f0f0;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
  margin-bottom: 30px;
}
.btn-hero {
  display: inline-block;
  padding: 14px 40px;
  background: var(--accent);
  color: #0a0a0f;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 14px;
}
.btn-hero:hover { background: #e0c060; color: #0a0a0f; }

/* ===== MAIN LAYOUT ===== */
.main-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 40px;
  padding: 40px 20px;
}
.content-area { flex: 1; min-width: 0; }
.sidebar { width: 320px; flex-shrink: 0; }

.section-title {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent);
}

/* ===== POSTS ===== */
.post {
  display: flex;
  gap: 25px;
  margin-bottom: 35px;
  padding-bottom: 35px;
  border-bottom: 1px solid var(--border);
}
.post-thumb { width: 260px; flex-shrink: 0; }
.post-thumb img, .post-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg3);
}
.post-body { flex: 1; }
.post-title {
  font-family: var(--font-heading);
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1.3;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }

.post-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 12px;
}
.post-cat {
  background: var(--accent);
  color: #0a0a0f;
  padding: 2px 10px;
  border-radius: 3px;
  font-weight: 700;
}
a.post-cat { text-decoration: none; display: inline-block; transition: .3s; }
a.post-cat:hover { background: #e84057; color: #fff; }
.post-excerpt {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 10px;
}
.read-more {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  gap: 8px;
  margin-top: 30px;
  justify-content: center;
}
.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text2);
}
.page-numbers.current {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
}
.page-numbers:hover:not(.current) { border-color: var(--accent); }

/* ===== SIDEBAR ===== */
.widget {
  margin-bottom: 35px;
}
.widget-title {
  font-family: var(--font-heading);
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.widget p {
  color: var(--text2);
  font-size: 14px;
}
.widget ul { list-style: none; }
.widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.widget ul li a {
  color: var(--text2);
  font-size: 14px;
}
.widget ul li a:hover { color: var(--accent); padding-left: 5px; }

.btn-sidebar {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--accent);
  color: #0a0a0f;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-sidebar:hover { background: #e0c060; color: #0a0a0f; }

/* CTA Widget */
.cta-widget { background: var(--bg3); padding: 20px; border-radius: 8px; border: 1px solid var(--border); }
.cta-list { list-style: none; margin: 10px 0 15px; }
.cta-list li { padding: 6px 0; font-size: 13px; color: var(--text2); border-bottom: none; }

/* ===== BOT CARDS (главная, сайдбар: AI-гиды) ===== */
.bot-card {
  background: var(--bg3);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color .3s, transform .2s;
}
.bot-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.bot-card .widget-title {
  margin-bottom: 8px;
  padding-bottom: 8px;
  font-size: 18px;
}
.bot-card p {
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 4px;
}
/* Блок между карточками (новости сайта / место для банера) */
.bot-news {
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 6px;
}
.bot-news-title {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: var(--text);
}
.bot-news-intro {
  color: var(--text2);
  font-size: 14px;
  font-style: italic;
  line-height: 1.6;
  margin: 0;
}
/* Вводный блок секции AI-гиды: мощный заголовок + якорь-подсказка */
.bot-news-hero .bot-news-title {
  font-size: 19px;
  line-height: 1.3;
  margin-bottom: 12px;
}
.bot-news-anchor {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}
.bot-news-list { list-style: none; }
.bot-news-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.bot-news-list li:last-child { border-bottom: none; }
.bot-news-list a {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  display: block;
}
.bot-news-list a:hover { color: var(--accent); padding-left: 5px; }
.bot-news-date {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}

/* ===== CTA-карточка бота в статье (горизонтальная, между Topics: и Related) ===== */
.article-cta-bot {
  margin-top: 48px;
}
.article-bot-h {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px 34px;
  background: var(--bg3);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: border-color .3s, transform .2s;
}
.article-bot-h:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.article-bot-icon {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: var(--bg2);
  border-radius: 50%;
  border: 1px solid var(--border);
}
.article-bot-body {
  flex: 1;
  min-width: 0;
}
.article-bot-title {
  font-family: var(--font-heading);
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
  text-align: left;
}
.article-bot-pitch {
  color: var(--text2);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 0;
  text-align: left;
}
.article-bot-btn {
  flex-shrink: 0;
  width: 150px;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  transition: background .3s, color .3s;
}
.article-bot-btn span { display: block; }
.article-bot-btn:hover {
  background: #e0c060;
  color: #0a0a0f;
}
@media (max-width: 700px) {
  .article-bot-h {
    flex-direction: column;
    text-align: left;
    padding: 26px 20px;
    gap: 14px;
  }
  .article-bot-icon {
    width: 72px;
    height: 72px;
    font-size: 36px;
  }
  .article-bot-btn {
    flex-direction: row;
    white-space: nowrap;
    width: auto;
    min-width: 160px;
    height: 48px;
    aspect-ratio: auto;
    padding: 0 20px;
    gap: 4px;
    margin: 0 auto;
  }
}

/* Article placeholder for missing images */
.article-placeholder {
  width: 100%;
  height: 170px;
  background: var(--bg3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--text2);
}

/* Article images */
.article-image {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Blog link */
.blog-footer-link {
  text-align: center;
  margin: 30px 0;
}

/* ===== MOBILE MENU ===== */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 22px;
  color: var(--text);
}

.off-canvas {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 200;
  padding: 80px 20px 20px;
  transition: right .3s ease;
  overflow-y: auto;
}
.off-canvas.open { right: 0; }
.off-canvas ul { list-style: none; }
.off-canvas li { border-bottom: 1px solid var(--border); }
.off-canvas a {
  display: block;
  padding: 14px 10px;
  color: var(--text);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.off-canvas a:hover { color: var(--accent); }
.off-canvas-cta a { color: var(--accent) !important; font-weight: 700; }

.off-canvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.off-canvas-overlay.show { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  #main-nav { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
}

/* ===== FOOTER ===== */
#footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 60px;
}
.footer-col { flex: 1; }
.footer-col h4 {
  font-family: var(--font-heading);
  margin-bottom: 12px;
  font-size: 18px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: var(--text2); font-size: 14px; }
.footer-col a:hover { color: var(--accent); }
.footer-col p { color: var(--text2); font-size: 13px; }

/* Контакты в футере (иконки + текст) */
.footer-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-contacts a:hover { color: var(--accent); }

/* Юрдокументы в футере — под первой колонкой (08.08.2026) */
.footer-docs {
  margin-top: 14px;
}
.footer-docs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.footer-docs a:hover { color: var(--accent); text-decoration: underline; }

/* ===== FOOTER MOBILE (19.08.2026) ===== */
@media (max-width: 700px) {
  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }
  .footer-col { width: 100%; }
  .footer-contacts a { word-break: break-word; }
}

/* ===== LEGAL POPUP (08.08.2026) ===== */
.legal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.legal-overlay.show { display: flex; }
.legal-modal {
  background: var(--bg2);
  border: 1px solid var(--bg3);
  border-radius: 12px;
  max-width: 860px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bg3);
}
.legal-modal-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text);
}
.legal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.legal-close:hover { color: var(--text); background: var(--bg3); }
.legal-modal-body {
  padding: 22px 26px 34px;
  overflow-y: auto;
  color: var(--text2);
  line-height: 1.7;
}
.legal-modal-body h2 { color: var(--text); font-size: 18px; margin: 24px 0 10px; }
.legal-modal-body h3 { color: var(--text); font-size: 16px; margin: 18px 0 8px; }
.legal-modal-body a { color: var(--accent); }
.legal-modal-body ul,
.legal-modal-body ol { padding-left: 22px; margin: 8px 0 14px; }
.legal-modal-body .legal-subtitle { font-size: 16px; color: var(--text2); margin: 0 0 22px; }
html.light .legal-modal { background: #f7f4ef; border-color: #ddd6cc; }
html.light .legal-close:hover { background: #e8e2d8; }
@media (max-width: 700px) {
  .legal-modal { max-height: 92vh; }
  .legal-modal-body { padding: 16px 18px 26px; }
}

/* Темы (ключевые слова) в конце статьи */
.article-tags {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text2);
}

.article-tags-label {
  font-weight: 600;
  color: var(--text);
}

/* ===== TABLES (статьи, контент из воркфлоу) ===== */
.section-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
  line-height: 1.5;
}
.section-article table th {
  background: var(--bg2);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.section-article table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.section-article table tr:nth-child(even) td {
  background: rgba(128,128,128,0.07);
}
@media (max-width: 700px) {
  .section-article table { font-size: 13px; }
  .section-article table th,
  .section-article table td { padding: 7px 8px; }
}

/* ===== MOBILE-CYRILLIC-FONTS (06.08.2026): кириллица на мобильных ===== */
@media (max-width: 700px) {
  :root {
    --font-body: 'Titillium Web', 'Rubik', sans-serif;
    --font-heading: 'Special Elite', 'PT Mono', monospace;
  }
}


/* ===== ARTICLE HEADINGS UNIFIED (19.08.2026) =====
   Единый шрифт (Special Elite) + отступы для всех заголовков в статьях.
   Раньше правило было в section.css (не грузился) → h2/h3 наследовали font-body
   и шли сплошным листом без отступов. !important перебивает инлайн-стили контента.
*/
.section-article h1,
.section-article h2,
.section-article h3 {
  font-family: var(--font-heading) !important;
  margin-top: 28px !important;
  margin-bottom: 14px !important;
  line-height: 1.3;
}
.section-article h1 {
  font-size: 36px !important;
}
.section-article h2 {
  font-size: 28px !important;
}
.section-article h3 {
  font-size: 22px !important;
}
.section-article h2 + p,
.section-article h3 + p {
  margin-top: 0;
}


/* ===== ARTICLE LISTS (19.08.2026) =====
   Списки в статьях: отступы и маркеры в пределах колонки.
   Раньше не было стилей → числа выходили за край.
*/
.section-article ol,
.section-article ul {
  padding-left: 24px;
  margin: 14px 0 18px;
  list-style-position: inside;
}
.section-article li {
  margin-bottom: 10px;
  line-height: 1.6;
}
.section-article li > ul,
.section-article li > ol {
  margin-top: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .main-wrapper { flex-direction: column; }
  .sidebar { width: 100%; }
  .post { flex-direction: column; }
  .post-thumb { width: 100%; }
  #main-nav { display: none; }
  .hero { height: auto; min-height: 420px; }
  .hero-content h1 { font-size: 32px; }
}
