/* Статьи и гайды: подключается после kit.css и берёт его цвета и шрифты.
   Правила вида в brand/identity.md: углы прямые, линии в один пиксель, один голубой акцент. */

.sitebar {
  position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: .7rem 16px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  background: var(--bg); border-bottom: 1px solid var(--fg);
}
.sitebar > a { color: var(--fg); text-decoration: none; font: 700 1.5rem/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.sitebar nav { display: flex; gap: 1rem; font-size: .9rem; overflow-x: auto; scrollbar-width: none; }
.sitebar nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.sitebar nav a:hover { color: var(--fg); }

main.post { max-width: 42rem; padding-top: 1.5rem; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--muted); }
main.post h1 { font-size: clamp(2.6rem, 11vw, 4.2rem); }
.meta { margin: 0 0 1.75rem; color: var(--muted); font-size: .9rem; }

article { overflow-wrap: break-word; }
article h2 { margin: 3rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--fg); font-size: clamp(1.9rem, 7vw, 2.4rem); text-wrap: balance; scroll-margin-top: 4rem; }
article h3 { margin: 1.75rem 0 .6rem; font: 600 1.12rem/1.3 var(--body); }
article p, article ul, article ol { margin: 0 0 1rem; }
article li { margin: .3rem 0; }
article blockquote { margin: 1.25rem 0; padding: .9rem 1.1rem; background: var(--paper); border-left: 1px solid var(--fg); }
article blockquote p:last-child { margin: 0; }
article code { font: .9em/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--paper); padding: .1em .35em; }
article pre { margin: 0 0 1.25rem; padding: 1rem; background: var(--paper); border-left: 1px solid var(--fg); overflow-x: auto; white-space: pre-wrap; }
article pre code { background: none; padding: 0; }

/* Картинка шире колонки текста на больших экранах, по клику открывается в полном размере */
article figure { margin: 1.75rem 0; }
article figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; }
article figcaption { margin-top: .5rem; color: var(--muted); font-size: .88rem; }
@media (min-width: 62rem) {
  article figure, article .table { width: 58rem; max-width: calc(100vw - 32px); margin-left: 50%; transform: translateX(-50%); }
  article figcaption { max-width: 42rem; margin-inline: auto; }
}

.table { margin: 0 0 1.25rem; overflow-x: auto; border-top: 1px solid var(--fg); }
.table table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .55rem .7rem .55rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table th { font-weight: 600; }

/* Частые вопросы: вопрос строкой, ответ раскрывается */
.faq { border-top: 1px solid var(--fg); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: baseline;
  padding: .95rem 0; cursor: pointer; list-style: none;
  font: 600 1.12rem/1.3 var(--body);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.7rem/.7 var(--body); color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; color: var(--fg); }
.faq summary:hover::after { color: var(--fg); }
.faq .answer { padding: 0 2.5rem 1rem 0; }
.faq .answer p:last-child { margin-bottom: 0; }

.toc { margin: 1.5rem 0 2rem; padding: 1rem 1.1rem; background: var(--paper); border-left: 1px solid var(--fg); }
.toc p { margin: 0 0 .4rem; font-weight: 600; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: .25rem 0; }

.cta { margin: 3rem 0 0; padding: 1.25rem 1.25rem .75rem; border: 1px solid var(--fg); }
.cta h2 { margin-top: 0; }
.cta .btn { margin: 0 .5rem .5rem 0; }

/* Список блога: сетка в две колонки, свежий материал во всю ширину */
main.post.blog { max-width: 62rem; }
main.post.blog .lead { max-width: 42rem; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem 2rem; border-top: 1px solid var(--fg); padding-top: 2rem; }
.posts a { display: grid; gap: 1rem; align-content: start; color: inherit; text-decoration: none; }
.posts a > div { display: grid; gap: .35rem; align-content: start; }
.posts .cover { display: block; width: 100%; aspect-ratio: 1200 / 630; height: auto; border: 1px solid var(--rule); }
.posts span.cover { display: flex; flex-direction: column; justify-content: space-between; padding: 6% 7%; background: #141414; color: #fff; border-color: #141414; overflow: hidden; }
.posts span.cover i { align-self: flex-start; font: 400 .8rem/1 var(--body); font-style: normal; border: 1px solid #fff; padding: .3rem .55rem; }
.posts span.cover b { font: 700 clamp(1.5rem, 4.2vw, 2.3rem)/.9 var(--display); text-transform: uppercase; letter-spacing: -.01em; }
.posts em { font-style: normal; color: var(--muted); font-size: .85rem; }
.posts strong { font: 600 1.2rem/1.3 var(--body); }
.posts a:hover strong { color: var(--accent-ink); }
.posts div > span { color: var(--muted); }
.posts small { color: var(--muted); font-size: .85rem; }
.posts .empty { color: var(--muted); }
@media (min-width: 48rem) {
  .posts { grid-template-columns: 1fr 1fr; }
  .posts li:first-child { grid-column: 1 / -1; }
  .posts li:first-child a { grid-template-columns: 1.25fr 1fr; gap: 2rem; align-items: center; }
  .posts li:first-child strong { font-size: 1.6rem; line-height: 1.2; }
  .posts li:first-child span.cover b { font-size: clamp(2rem, 4vw, 3.2rem); }
}
