/* Блог Colon Clinic. Базові стилі, кольори та шрифти беруться з /assets/styles.css, тут лише елементи блогу. */

/* ---------- Мета статті в шапці ---------- */
.blog-hero .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.4rem; margin-top: 1.6rem; color: var(--ink-2); font-size: var(--step--1); }
.post-author { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); }
.post-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--brand-soft); }
.post-author small { display: block; font-size: .75rem; color: var(--ink-3); line-height: 1.1; }
.post-author b { font-weight: 700; }
.lang-switch { display: inline-flex; align-items: center; font-weight: 700; font-size: .8rem; letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: .3rem .75rem; }
.lang-switch:hover { background: var(--brand); color: #fff; }

/* ---------- Розкладка статті ---------- */
.post-section { padding-top: clamp(1.6rem, 1rem + 2vw, 2.6rem); }
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(1.6rem, 1rem + 3vw, 3.4rem); align-items: start; }
.post { min-width: 0; }
.post-figure { margin: 0 0 2rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--brand-soft); }
.post-figure img { width: 100%; height: auto; display: block; }

/* ---------- Текст статті ---------- */
.post-body { max-width: 72ch; }
.post-body h2 { scroll-margin-top: 96px; }
.post-body h3, .post-body h4 { scroll-margin-top: 96px; }
.post-body h4 { font-size: var(--step-0); margin-top: 1.4rem; }
.post-body ul:not(.ticks) { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .45rem; }
.post-body ol { list-style: decimal; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .45rem; }
.post-body li::marker { color: var(--brand); }
.post-body a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body blockquote { margin: 1.6rem 0; padding: 1rem 1.3rem; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: var(--radius-sm); color: var(--ink); }
.post-body strong { color: var(--ink); }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.post-disclaimer { margin-top: 2.2rem; }
.post-disclaimer p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }

/* ---------- Зміст і бокова колонка ---------- */
.aside-sticky { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 1rem; }
.toc { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 1.1rem 1.2rem; }
.toc-title { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: .7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; counter-reset: toc; }
.toc li { counter-increment: toc; font-size: var(--step--1); line-height: 1.4; display: flex; gap: .45rem; }
.toc li::before { content: counter(toc) "."; color: var(--brand); font-weight: 700; flex: none; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--brand); }
.toc-inline { display: none; margin-bottom: 1.8rem; }
.aside-cta { background: linear-gradient(140deg, var(--brand-strong), var(--brand)); color: #fff; border-radius: var(--radius-sm); padding: 1.35rem; box-shadow: var(--shadow-sm); }
.aside-cta h3 { color: #fff; font-size: var(--step-1); }
.aside-cta p { color: rgba(255, 255, 255, .88); font-size: var(--step--1); margin: .45rem 0 1rem; }
.aside-cta .btn { width: 100%; margin-top: .55rem; justify-content: center; }
.aside-cta .btn-primary { background: #fff; color: var(--brand-strong); }
.aside-cta .btn-primary:hover { background: var(--brand-soft); }
.aside-cta .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .45); background: transparent; }
.aside-cta .btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Блок автора ---------- */
.author-box { display: flex; gap: 1.2rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.5rem; margin-top: 2.2rem; box-shadow: var(--shadow-sm); }
.author-box img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: top; flex: none; background: var(--brand-soft); }
.author-box .eyebrow { margin-bottom: .25rem; }
.author-box .author-name { font-size: var(--step-1); margin-bottom: .4rem; }
.author-box .author-name a { color: var(--ink); }
.author-box p { color: var(--ink-2); }
.author-box .more { margin-top: .6rem; color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Картки статей ---------- */
.card.post-card { padding: 0; overflow: hidden; gap: 0; }
.post-card .post-thumb { aspect-ratio: 3 / 2; overflow: hidden; background: var(--brand-soft); }
.post-card .post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-card-body { padding: 1.25rem 1.35rem 1.45rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.post-card-meta { font-size: var(--step--1); color: var(--ink-3); }
.post-card h3 { font-size: var(--step-1); line-height: 1.3; }
.post-feature { display: grid; grid-template-columns: 1.1fr .9fr; }
.post-feature .post-thumb { aspect-ratio: auto; min-height: 320px; height: 100%; }
.post-feature .post-card-body { justify-content: center; padding: clamp(1.4rem, 1rem + 2vw, 2.6rem); }
.post-feature h2 { font-size: var(--step-2); line-height: 1.25; }

@media (prefers-reduced-motion: reduce) { .post-card .post-thumb img { transition: none; } }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .blog-layout { grid-template-columns: 1fr; }
  .aside-sticky { position: static; }
  .blog-aside .toc { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 760px) {
  .post-feature { grid-template-columns: 1fr; }
  .post-feature .post-thumb { min-height: 0; aspect-ratio: 3 / 2; }
}
@media (max-width: 560px) {
  .author-box { flex-direction: column; }
  .blog-hero .post-meta { gap: .6rem 1rem; }
}
