/* Блог 1С-ника — стиль «методичка», единый с vharin.ru */

/* ---------- Шрифты (self-hosted, cyrillic+latin) ---------- */
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-sans-400-cyrillic.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-sans-400-latin.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:600; font-display:swap;
  src:url(fonts/plex-sans-600-cyrillic.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:600; font-display:swap;
  src:url(fonts/plex-sans-600-latin.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:700; font-display:swap;
  src:url(fonts/plex-sans-700-cyrillic.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:'IBM Plex Sans'; font-style:normal; font-weight:700; font-display:swap;
  src:url(fonts/plex-sans-700-latin.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Serif'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-serif-400-cyrillic.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:'IBM Plex Serif'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-serif-400-latin.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-mono-400-cyrillic.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/plex-mono-400-latin.woff2) format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:500; font-display:swap;
  src:url(fonts/plex-mono-500-cyrillic.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family:'IBM Plex Mono'; font-style:normal; font-weight:500; font-display:swap;
  src:url(fonts/plex-mono-500-latin.woff2) format('woff2'); }

:root {
  --paper:#FFFFFF; --ink:#191919; --muted:#5C6066; --hairline:#E4E2DD;
  --accent:#FFD500; --wash:#FAF9F6; --link:#1552B5;
  --sans:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --serif:'IBM Plex Serif',Georgia,serif;
  --mono:'IBM Plex Mono','Consolas',monospace;
}
* { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; }
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto;} *{transition:none!important;} }
body { font-family:var(--sans); font-size:17px; line-height:1.6; color:var(--ink); background:var(--paper); }
.page { max-width:780px; margin:0 auto; padding:0 24px 72px; }
a { color:var(--link); }
a:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }

/* ---------- Верхняя строка сайта ---------- */
.topbar {
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding:16px 0 14px; border-bottom:1px solid var(--hairline);
  font-family:var(--mono); font-size:12.5px; letter-spacing:.05em; text-transform:uppercase;
}
.topbar a { color:var(--muted); text-decoration:none; }
.topbar .brand { color:var(--ink); font-weight:500; }
.topbar .brand b { border-bottom:3px solid var(--accent); padding-bottom:2px; }
.topbar nav { display:flex; gap:18px; }
.topbar nav a:hover { color:var(--ink); }

/* ---------- Заголовок раздела ---------- */
.blog-head { padding:44px 0 8px; }
.blog-head h1 { font-size:clamp(34px,6vw,52px); font-weight:700; letter-spacing:-.015em; line-height:1.05; }
.blog-head h1 .hl { background:linear-gradient(transparent 58%, var(--accent) 58%);
  padding:0 .06em; box-decoration-break:clone; -webkit-box-decoration-break:clone; }
.blog-head .lead { font-family:var(--serif); font-size:clamp(18px,2.5vw,22px); color:var(--muted);
  max-width:620px; margin-top:16px; line-height:1.5; }
.rule-accent { height:8px; background:var(--accent); border:0; margin:22px 0 0; }

/* ---------- Управление: поиск + теги ---------- */
.controls { margin:26px 0 4px; }
.search { position:relative; margin-bottom:18px; }
.search input {
  width:100%; font-family:var(--sans); font-size:16px; color:var(--ink);
  padding:12px 14px 12px 40px; border:1px solid var(--hairline); border-radius:4px;
  background:var(--wash) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235C6066' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") no-repeat 12px center;
}
.search input:focus { outline:none; border-color:var(--ink); background-color:#fff; }
.tagbar { display:flex; flex-wrap:wrap; gap:8px; }
.tagbar a, .tagbar button {
  font-family:var(--mono); font-size:13px; color:var(--muted); cursor:pointer;
  background:var(--wash); border:1px solid var(--hairline); border-radius:100px;
  padding:5px 13px; text-decoration:none; transition:all .15s ease;
}
.tagbar a:hover, .tagbar button:hover { border-color:var(--ink); color:var(--ink); }
.tagbar .active { background:var(--accent); border-color:var(--accent); color:var(--ink); font-weight:500; }

/* ---------- Лента постов ---------- */
.feed { margin-top:12px; }
.post-card { padding:26px 0; border-top:1px solid var(--hairline); }
.post-card .meta { font-family:var(--mono); font-size:12.5px; color:var(--muted);
  letter-spacing:.03em; display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.post-card .meta .vid { color:var(--ink); background:var(--accent); border-radius:3px;
  padding:1px 7px; font-size:11.5px; font-weight:500; text-transform:uppercase; letter-spacing:.04em; }
.post-card h2 { font-size:clamp(22px,3.2vw,27px); font-weight:600; line-height:1.25; margin:9px 0 0; letter-spacing:-.01em; }
.post-card h2 a { color:var(--ink); text-decoration:none; }
.post-card h2 a:hover { text-decoration:underline; text-decoration-color:var(--accent);
  text-decoration-thickness:3px; text-underline-offset:3px; }
.post-card .excerpt { font-family:var(--serif); color:#39383A; margin-top:10px; line-height:1.55; max-width:660px; }
.post-card .card-tags { margin-top:12px; display:flex; gap:8px; flex-wrap:wrap; }
.post-card .card-tags a { font-family:var(--mono); font-size:12px; color:var(--muted); text-decoration:none; }
.post-card .card-tags a::before { content:'#'; opacity:.5; }
.post-card .card-tags a:hover { color:var(--ink); }
.no-results { padding:40px 0; color:var(--muted); font-family:var(--serif); font-size:19px; }

/* ---------- Пагинация ---------- */
.pager { display:flex; justify-content:space-between; gap:16px; margin-top:40px;
  padding-top:20px; border-top:1px solid var(--hairline); font-family:var(--mono); font-size:14px; }
.pager a { text-decoration:none; color:var(--ink); border-bottom:2px solid var(--accent); padding-bottom:1px; }
.pager span { color:var(--muted); }

/* ---------- Страница поста ---------- */
.post-meta { display:flex; justify-content:space-between; gap:16px; padding:18px 0 0;
  font-family:var(--mono); font-size:12.5px; letter-spacing:.04em; color:var(--muted); text-transform:uppercase; }
.post-meta a { color:var(--muted); text-decoration:none; }
.post-meta a:hover { color:var(--ink); }
article h1.post-title { font-size:clamp(29px,5vw,44px); font-weight:700; line-height:1.1;
  letter-spacing:-.015em; margin:20px 0 0; }
.article-body { margin-top:8px; }
.article-body p { margin:18px 0; }
.article-body a { color:var(--link); text-decoration:underline; text-decoration-color:#B9C7E6; text-underline-offset:2px; }
.article-body a:hover { text-decoration-color:var(--link); }
.article-body strong, .article-body b { font-weight:600; }
.article-body h2 { font-size:25px; font-weight:600; margin:34px 0 10px; letter-spacing:-.01em; }
.article-body h3 { font-size:20px; font-weight:600; margin:26px 0 8px; }
.article-body ul, .article-body ol { margin:16px 0; padding-left:26px; }
.article-body li { margin:7px 0; }
.article-body blockquote { border-left:4px solid var(--accent); background:var(--wash);
  margin:22px 0; padding:14px 20px; font-family:var(--serif); color:#39383A; border-radius:0 4px 4px 0; }
.article-body blockquote p { margin:6px 0; }
.article-body hr { border:0; border-top:1px solid var(--hairline); margin:32px 0; }
.article-body table { border-collapse:collapse; width:100%; margin:22px 0; font-size:15px; display:block; overflow-x:auto; }
.article-body th, .article-body td { border:1px solid var(--hairline); padding:8px 11px; text-align:left; }
.article-body th { background:var(--wash); font-weight:600; }
.article-body img { max-width:100%; height:auto; border-radius:6px; margin:16px 0; }
.article-body video { width:100%; max-width:960px; border-radius:12px; margin:22px 0; display:block; background:#000; }

/* Опрос (бывшая голосовалка Telegram) */
.poll { border:1px solid var(--hairline); border-left:4px solid var(--accent);
  background:var(--wash); border-radius:0 4px 4px 0; padding:16px 20px; margin:24px 0; }
.poll .poll-q { font-weight:600; margin:0 0 10px; }
.poll ul { list-style:none; padding:0; margin:0; }
.poll li { margin:6px 0; }

/* Кнопка «Обсудить в Telegram» */
.tg-cta { display:block; text-align:center; margin:34px 0 8px; padding:16px 22px;
  background:var(--accent); color:var(--ink); font-weight:600; font-size:16px;
  text-decoration:none; border-radius:6px; transition:filter .15s ease; }
.tg-cta:hover { filter:brightness(.94); }
.tg-cta::before { content:'✈  '; }

.post-tags { margin-top:26px; padding-top:18px; border-top:1px solid var(--hairline);
  display:flex; gap:10px; flex-wrap:wrap; }
.post-tags a { font-family:var(--mono); font-size:13px; color:var(--muted); text-decoration:none;
  border:1px solid var(--hairline); border-radius:100px; padding:4px 12px; }
.post-tags a::before { content:'#'; opacity:.5; }
.post-tags a:hover { border-color:var(--ink); color:var(--ink); }

.post-nav { display:flex; justify-content:space-between; gap:16px; margin-top:30px;
  padding-top:20px; border-top:1px solid var(--hairline); }
.post-nav a { text-decoration:none; max-width:46%; }
.post-nav .dir { font-family:var(--mono); font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.post-nav .t { display:block; color:var(--ink); font-weight:600; font-size:15px; line-height:1.3; margin-top:4px; }
.post-nav a:hover .t { text-decoration:underline; text-decoration-color:var(--accent); text-decoration-thickness:3px; text-underline-offset:2px; }
.post-nav .next { text-align:right; margin-left:auto; }

/* ---------- Код-блоки и инлайн-код ---------- */
.post-body pre { margin:22px 0; padding:16px 18px; background:var(--wash);
  border:1px solid var(--hairline); border-left:4px solid var(--accent); border-radius:6px;
  overflow-x:auto; }
.post-body pre code { font-family:var(--mono); font-size:13.5px; line-height:1.5;
  color:var(--ink); white-space:pre; background:none; padding:0; border:0; }
.post-body code { font-family:var(--mono); font-size:.9em; background:var(--wash);
  border:1px solid var(--hairline); border-radius:4px; padding:.08em .35em; }

/* ---------- Встроенный плеер площадки (RuTube/YouTube) ---------- */
.video-embed { position:relative; margin:24px 0; aspect-ratio:16/9; }
.video-embed iframe { position:absolute; inset:0; width:100%; height:100%;
  border:0; border-radius:6px; }

/* ---------- Картинки в постах ---------- */
figure.post-img { margin:26px 0; }
figure.post-img img { display:block; width:100%; height:auto; border-radius:6px;
  border:1px solid var(--hairline); }
figure.post-img figcaption { margin-top:8px; font-family:var(--mono); font-size:12.5px;
  color:var(--muted); text-align:center; }
.post-body img { max-width:100%; height:auto; }

/* ---------- Спойлеры (телеграмные ||…||) ---------- */
.spoiler { background:var(--ink); color:transparent; border-radius:3px; padding:0 .12em;
  filter:blur(.32em); cursor:pointer; transition:filter .12s, color .12s, background .12s;
  -webkit-tap-highlight-color:transparent; }
.spoiler:hover, .spoiler:focus { filter:none; color:inherit; background:var(--wash);
  outline:none; }

/* ---------- Контакты (подвал) ---------- */
.contacts { margin-top:52px; padding-top:22px; border-top:1px solid var(--hairline);
  display:flex; flex-wrap:wrap; gap:14px 40px; }
.contacts .c { display:flex; flex-direction:column; gap:3px; }
.contacts .k { font-family:var(--mono); font-size:11.5px; text-transform:uppercase;
  letter-spacing:.06em; color:var(--muted); }
.contacts .c a { font-weight:600; text-decoration:none; color:var(--ink);
  border-bottom:2px solid var(--accent); padding-bottom:1px; transition:background-color .15s; }
.contacts .c a:hover { background:var(--accent); }

/* ---------- Подвал ---------- */
footer { margin-top:24px; padding-top:18px; border-top:1px solid var(--hairline);
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px;
  font-family:var(--mono); font-size:12.5px; color:var(--muted); }
footer a { color:var(--muted); }
footer a:hover { color:var(--ink); }

@media (max-width:560px) {
  body { font-size:16px; }
  .page { padding:0 18px 56px; }
  .topbar nav { gap:12px; }
  .post-nav a { max-width:100%; }
  .contacts { gap:14px 28px; }
}
