﻿/* === Статьи — Anthropic design system === */
/* Палитра: warm parchment, ivory surfaces, clay accent, hairline borders, no shadows */

.articles-layout {
  --ant-canvas: #f0eee6;
  --ant-card: #faf9f5;
  --ant-oat: #e3dacc;
  --ant-manilla: #f5e3c7;
  --ant-clay: #d97757;
  --ant-clay-deep: #c6613f;
  --ant-slate: #141413;
  --ant-cloud-med: #b0aea5;
  --ant-cloud-dark: #87867f;
  --ant-stone: #cccbc8;
  --ant-slate-med: #3d3d3a;
}

:root {
  --ant-canvas: #f0eee6;
  --ant-card: #faf9f5;
  --ant-oat: #e3dacc;
  --ant-manilla: #f5e3c7;
  --ant-clay: #d97757;
  --ant-clay-deep: #c6613f;
  --ant-slate: #141413;
  --ant-cloud-med: #b0aea5;
  --ant-cloud-dark: #87867f;
  --ant-stone: #cccbc8;
  --ant-slate-med: #3d3d3a;
}

/* Page background — full width */
body.articles-page {
  background: var(--ant-canvas) !important;
  color: #141413 !important;
}

/* Layout */
.articles-layout {
  background: transparent;
  padding-top: calc(var(--header-h, 108px) + 40px);
}

/* === Sidebar === */
.articles-sidebar::-webkit-scrollbar { width: 2px; }
.articles-sidebar::-webkit-scrollbar-track { background: transparent; }
.articles-sidebar::-webkit-scrollbar-thumb { background: var(--ant-stone); border-radius: 0; }
.articles-sidebar { scrollbar-width: thin; scrollbar-color: var(--ant-stone) transparent; }

.sidebar-group h4 {
  color: var(--ant-cloud-med);
  letter-spacing: 1.5px;
}
.sidebar-nav a {
  color: var(--ant-slate);
  border-radius: 0;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--ant-stone);
  transition: color 0.2s, padding-left 0.2s;
}
.sidebar-nav a:hover {
  background: transparent;
  color: var(--ant-clay);
  padding-left: 6px;
}
.sidebar-nav a.active {
  background: transparent;
  color: var(--ant-clay);
  font-weight: 700;
}
.cat-count {
  background: transparent;
  color: var(--ant-cloud-med);
  border-radius: 0;
  padding: 0 0 0 6px;
  font-weight: 400;
}
.cat-posts {
  border-bottom: 1px solid var(--ant-stone);
}
.cat-post-link {
  color: var(--ant-cloud-dark);
  border-radius: 0;
  padding: 6px 12px 6px 12px;
  border-left: none;
  transition: color 0.2s;
}
.cat-post-link:hover {
  background: transparent;
  color: var(--ant-slate);
}
.cat-post-link:last-child {
  border-bottom: none;
}

/* TG block — manilla paper */
.tg-block {
  background: var(--ant-manilla);
  border: none;
  border-radius: 24px;
  color: var(--ant-slate);
}
.tg-block:hover {
  transform: translateY(-2px);
}

/* === Article cards (list page) === */
.article-card {
  background: #e3dacc;
  border: none;
  border-radius: 24px;
  box-shadow: none;
  padding: 28px 32px;
  transition: border-color 0.3s, transform 0.3s;
}
.article-card:hover {
  box-shadow: none;
  border-color: var(--ant-cloud-dark);
  transform: translateY(-2px);
}
.article-card h3 {
  color: var(--ant-slate);
  font-weight: 700;
}
.article-card h3 a {
  color: var(--ant-slate);
}
.article-card h3 a:hover {
  color: var(--ant-clay);
}
.article-card-sub {
  color: var(--ant-clay);
  font-weight: 600;
}
.article-card-preview {
  color: var(--ant-cloud-dark);
}
.article-card-thumb {
  border-radius: 16px;
}

/* === Article detail page === */
.article-feed-item .card {
  background: #e3dacc !important;
  border: none !important;
  border-radius: 24px !important;
  box-shadow: none !important;
  padding: 36px 40px !important;
  margin-bottom: 28px !important;
}
.article-feed-item .card h1 {
  color: var(--ant-slate) !important;
}
.article-body {
  color: var(--ant-slate) !important;
  line-height: 1.8;
}
.article-body p, .article-feed-item .card p { color: #141413 !important; }
.article-body h3 {
  color: var(--ant-slate) !important;
}
.article-body a {
  color: var(--ant-clay) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover {
  color: var(--ant-clay-deep);
}
.article-subtitle {
  color: var(--ant-cloud-dark);
}
.article-img {
  border-radius: 16px;
  box-shadow: none;
  border: none;
}
.article-body img[src*="/uploads/"]:not([alt="emoji"]) {
  border-radius: 16px;
  box-shadow: none;
  border: none;
}

/* TG post link — clay CTA, bottom-only radius */
.tg-post-link {
  background: var(--ant-clay);
  color: #ffffff;
  border-radius: 8px 8px 0 0;
  transition: background 0.2s, transform 0.2s;
}
.tg-post-link:hover {
  background: var(--ant-clay-deep);
  transform: translateY(-2px);
}

/* Sidebar toggle */
.sidebar-toggle {
  background: var(--ant-oat);
  border: 1px solid var(--ant-stone);
  border-radius: 12px;
  color: var(--ant-slate);
}

/* Mobile toggle */
.mobile-cat-toggle {
  background: var(--ant-clay);
  color: #ffffff;
  box-shadow: none;
}

/* Mobile sidebar */
@media (max-width: 700px) {
  .articles-sidebar {
    background: var(--ant-card) !important;
    border-right: 1px solid var(--ant-stone);
    box-shadow: none !important;
  }
  .article-card {
    padding: 20px !important;
  }
  .article-feed-item .card {
    padding: 20px !important;
  }
}

/* Sidebar overlay */
.sidebar-overlay {
  background: rgba(20, 20, 19, 0.4);
}

/* === Комментарии === */
.art-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; position: relative; flex-wrap: nowrap; }
.tg-post-link, .cmt-btn { vertical-align: middle; margin: 0; box-sizing: border-box; }
.tg-post-link, .cmt-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--ant-clay, #d97757); color: #fff; border: none; border-radius: 14px; padding: 9px 16px; font-family: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: opacity .2s; flex-shrink: 0; line-height: 1.2; }
.tg-post-link:hover, .cmt-btn:hover { opacity: 0.88; }
.cmt-btn { margin-left: auto; }
.cmt-btn.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3); }
.tg-ic { width: 15px; height: 15px; flex-shrink: 0; }
.cmt-btn .ic-comments { width: 16px; height: 16px; background: #fff; }
.cmt-btn .cmt-count { background: rgba(255,255,255,0.25); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; min-width: 18px; text-align: center; }
.cmt-section { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; max-height: 0; overflow: hidden; transition: max-height .4s ease; background: var(--ant-canvas, #f0eee6); border: 1px solid var(--ant-stone, #cccbc8); border-radius: 14px; z-index: 20; box-shadow: 0 -4px 20px rgba(0,0,0,0.06); }
.cmt-section.open { max-height: 480px; }
.cmt-section-inner { padding: 16px; display: flex; flex-direction: column; height: 480px; box-sizing: border-box; overflow: hidden; }
.cmt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.cmt-list::-webkit-scrollbar { width: 4px; }
.cmt-list::-webkit-scrollbar-track { background: transparent; }
.cmt-list::-webkit-scrollbar-thumb { background: var(--ant-stone, #cccbc8); border-radius: 4px; }
.cmt-item { background: var(--ant-card, #e3dacc); border-radius: 10px; padding: 8px 12px; }
.cmt-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cmt-author { font-weight: 700; font-size: 13px; color: var(--ant-slate, #141413); }
.cmt-date { font-size: 11px; color: var(--ant-stone, #999); flex: 1; }
.cmt-del-ic { background: none; border: none; cursor: pointer; color: var(--ant-stone, #999); padding: 2px; display: flex; align-items: center; border-radius: 4px; transition: all .2s; flex-shrink: 0; }
.cmt-del-ic:hover { color: #c0392b; }
.cmt-del-confirm { color: #c0392b !important; background: rgba(192,57,43,0.1); }
.cmt-body { font-size: 13px; line-height: 1.45; color: var(--ant-slate, #141413); word-wrap: break-word; }
.cmt-body img { display: inline-block; vertical-align: middle; }
.cmt-empty { color: var(--ant-stone, #999); font-size: 14px; padding: 20px 0; text-align: center; }
.cmt-form { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.cmt-input { width: 100%; min-height: 44px; max-height: 80px; overflow-y: auto; border: 1px solid var(--ant-stone, #cccbc8); border-radius: 12px; padding: 10px 14px; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ant-slate, #141413); background: #fff; box-sizing: border-box; }
.cmt-input:empty::before { content: attr(data-placeholder); color: var(--ant-stone, #999); pointer-events: none; }
.cmt-input:focus { outline: none; border-color: var(--ant-clay, #d97757); }
.cmt-input::-webkit-scrollbar { width: 0; height: 0; }
.cmt-form-bottom { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cmt-emoji-btn { background: none; border: 1px solid var(--ant-clay, #d97757); border-radius: 8px; cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; transition: opacity .2s; }
.cmt-emoji-btn:hover { opacity: 0.7; }
.cmt-emoji-btn img { display: none; }
.cmt-emoji-btn::after { content: ""; display: block; width: 18px; height: 18px; background: var(--ant-clay, #d97757); -webkit-mask: url(/assets/icons/toolbar/emoji.svg) no-repeat center / contain; mask: url(/assets/icons/toolbar/emoji.svg) no-repeat center / contain; }
.cmt-submit { background: var(--ant-clay, #d97757); color: #fff; border: none; border-radius: 10px; padding: 8px 20px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .2s; }
.cmt-submit:hover { opacity: 0.88; }
.cmt-login-hint { font-size: 14px; color: var(--ant-stone, #999); padding: 8px 0; }
.cmt-login-hint a { color: var(--ant-clay, #d97757); font-weight: 600; }
