/* ======================= blog post ======================= */

/* --- title actions (top-right icons) --- */
.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
/* the icon SVGs already include the circle + glyph — button is just a bare wrapper */
.post-actions__btn {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  border: none;
  background: none;
  border-radius: 50%;

  transition: 0.3s;
}
.post-actions__btn img {
  width: 40px;
  height: 40px;
  display: block;
}
.post-actions__btn:hover {
  opacity: 0.7;
}
.post-actions__btn:focus,
.post-actions__btn:focus-visible {
  outline: none;
}
/* "link copied" confirmation tooltip */
.post-actions__btn::after {
  content: attr(data-copied);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);

  padding: 6px 12px;
  border-radius: 6px;
  background-color: var(--heading);
  color: var(--white);
  font-size: 12px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.post-actions__btn.is-copied::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- centered article column --- */
.post-article {
  max-width: none;
  padding: 80px 0 60px;
  background-image: url('/assets/images/blog-bg.svg');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center 150px;
  background-size: contain;
}
.post-article__inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.post-article__title {
  margin: 0 0 44px;
  color: var(--heading);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
}
.post-image {
  width: 100%;
}
.post-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- table of contents ("Содержание") --- */
.post-toc {
  margin-top: 44px;
  background-color: var(--background-color);
  border-radius: 12px;
  padding: 32px 40px;
}
.post-toc__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 20px;
}
.post-toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-toc__link {
  display: flex;
  align-items: baseline;
  gap: 8px;

  font-size: 18px;
  color: var(--heading);
  transition: 0.2s;
}
.post-toc__link:hover {
  color: var(--primary-color);
}
.post-toc__num {
  flex: 0 0 auto;
  color: var(--heading);
}

/* --- content typography --- */
.post-content {
  width: 100%;
  margin: 44px 0 0;

  color: var(--text-color);
  font-size: 18px;
  line-height: 1.6;

  display: flex;
  flex-direction: column;
  gap: 30px;
}
.post-content > * {
  margin: 0;
}
.post-content p,
.post-content .t-redactor__text {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
}
.post-content strong {
  color: var(--heading);
}
/* leading bold subheadings become anchored section targets for the TOC */
.post-content [id^="section-"] {
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading);
  margin-bottom: 4px;
  scroll-margin-top: 100px;
}
.post-content a {
  color: var(--primary-color);
}
.post-content ul,
.post-content ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-content li {
  padding-left: 4px;
}
.post-content figure,
.post-content img {
  width: 100%;
  /* TinyMCE stamps fixed width/height attributes on inline images; without
     height:auto the forced 100% width squishes portrait photos. */
  height: auto;
  margin: 0;
}
.post-content figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.post-content figcaption {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--primary-color);
  font-size: 14px;
  line-height: 1.5;
  color: var(--primary-color);
}
.post-content blockquote,
.post-content em {
  display: block;
  font-style: normal;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--primary-color);
  color: var(--primary-color);
}

/* --- content footer (share + categories) --- */
.post-content-footer {
  width: 100%;
  margin: 40px 0 0;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  padding-top: 10px;
}
.post-content-footer .icons {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-content-footer__categories {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* small category tags (footer of article) */
.post-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 16px;
  border-radius: 4px;
  background-color: var(--heading);
  color: var(--white);

  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  transition: 0.3s;
}
.post-tag:hover {
  background-color: var(--primary-color);
}

/* --- other articles carousel --- */
.other-articles {
  padding: 20px 0 80px;
}
.other-articles__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.other-articles__head h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--heading);
}
.other-articles__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.other-articles__arrow {
  --size: 32px;

  flex: 0 0 var(--size);
  height: var(--size);
  width: var(--size);

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 5px;
  background-color: var(--heading);

  transition: 0.3s;
}
.other-articles__arrow:hover {
  opacity: 0.85;
}
.other-articles__arrow img {
  width: 16px;
  height: 16px;
}
.other-articles__arrow.next img {
  transform: rotate(180deg);
}
.other-articles__arrow.swiper-button-disabled {
  cursor: default;
}
.other-articles__swiper {
  width: 100%;
  overflow: hidden;
}
.other-articles__swiper .swiper-slide {
  height: auto;
}
.other-articles__more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.other-articles__more .button {
  min-width: 200px;
}

@media (max-width: 992px) {
  .post-article {
    padding: 60px 0 50px;
  }
  .post-article__title {
    margin-bottom: 32px;
    font-size: 34px;
  }
  .post-content-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .post-content-footer__categories {
    justify-content: flex-start;
  }
  .other-articles {
    padding-bottom: 50px;
  }
}

@media (max-width: 576px) {
  .post-article {
    padding: 40px 0;
  }
  .post-article__title {
    margin-bottom: 24px;
    font-size: 28px;
  }
  .post-content {
    margin-top: 30px;
    gap: 24px;
    font-size: 16px;
  }
  .post-content p,
  .post-content .t-redactor__text {
    font-size: 16px;
  }
}
