/* ===================================
   POST PAGE - Single Publication
   =================================== */

/* ===================================
   POST HEAD SECTION (Figma Design)
   =================================== */

.header {
    background-color: var(--color-white);
}

.post-head {
  position: relative;
  padding: 60px 0;
  background-color: var(--color-gray-95);
}

.post-head__content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  max-width: 1148px;
  margin: 0 auto;
}

/* Breadcrumbs - Figma Style */
.post-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}

.post-breadcrumbs__item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--body-small-size);
    font-weight: var(--font-regular);
    line-height: 1.6;
    color: var(--color-gray-20);
    text-decoration: none;
    transition: color var(--transition-fast);
}


.breadcrumbs__link:hover {
    color: var(--color-white);
}
.post-breadcrumbs__icon {
    flex-shrink: 0;
    width: 21px;
    height: 14px;
    top: 2px;
    position: relative;
    left: 4px;
}

.post-breadcrumbs__icon {
    transition: transform 0.3s ease;
}

.post-breadcrumbs__icon path,
.post-breadcrumbs__icon rect {
    transition: stroke 0.3s ease, fill 0.3s ease;
}


.post-breadcrumbs__item:hover .post-breadcrumbs__icon {
    transform: translateX(5px);
}

.post-breadcrumbs__item:hover .post-breadcrumbs__icon path {
    stroke: var(--color-green-50);
}

.post-breadcrumbs__item:hover .post-breadcrumbs__icon rect {
    stroke: var(--color-green-50);
    fill: var(--color-green-50);
}

/* Title & Author Container */
.post-head__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Title */
.post-head__title {
  font-size: var(--h1-size); /* 40px */
  font-weight: var(--font-bold);
  line-height: 1.3;
  letter-spacing: 0.03em; /* 3% */
  color: var(--color-gray-20);
  margin: 0;
  text-transform: uppercase;
}

/* Author Section */
.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-author__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #FAFAFA;
  display: block;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.post-author__avatar:hover {
  opacity: 0.8;
}

.post-author__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.post-author__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-author__name {
  font-size: var(--body-small-size); /* 14px */
  font-weight: var(--font-semibold);
  line-height: 1.6;
  color: var(--color-gray-20);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-author__name:hover {
  color: var(--color-green-40);
}

.post-author__name {
  font-size: var(--body-size); /* 16px */
  font-weight: var(--font-regular);
  line-height: 1.4;
  color: var(--color-gray-20);
}

.post-author__date {
  font-size: var(--body-xs-size); /* 12px */
  font-weight: var(--font-medium);
  line-height: 1.4;
  color: var(--color-gray-20);
  text-transform: uppercase;
}

/* ===================================
   POST HERO (Featured Image if needed)
   =================================== */

.post-hero {
  position: relative;
  padding: 0 0 60px;
  background-color: var(--color-white);
}

/* Featured Image */
.post-hero__image {
  position: relative;
  width: 100%;
  height: 560px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.post-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay 30% як на картках */
.post-hero__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(58, 58, 58, 0.3);
  pointer-events: none;
}
.wp-block-image img {
    border-radius: 16px;
}
/* ===================================
   POST CONTENT BOX SECTION
   =================================== */

.post-content-box {
  padding: 60px 0 0;
  background-color: var(--color-white);
}

.post-content-box .container {
  max-width: 952px;
}

/* ===================================
   ARTICLE CONTENT
   =================================== */

.post-article {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

/* Post Content */
.post-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

/* Cover Image */
.post-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 855 / 420;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #dde1e6;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Table of Contents */
.post-toc {
  padding: 24px;
  background-color: var(--color-gray-95);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-toc__title {
  font-size: var(--h4-size); /* 20px */
  font-weight: var(--font-semibold);
  line-height: 1.5;
  color: var(--color-gray-20);
  margin: 0;
}

.post-toc__nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-toc__link {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--body-size);
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-gray-20);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-toc__link:hover {
  color: var(--color-green-40);
}

.post-toc__icon {
  flex-shrink: 0;
  width: 21px;
  height: 14px;
}

/* Lead Paragraph */
.post-article__lead {
  font-size: var(--body-size); /* 16px */
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-gray-20);
  margin: 0;
}

.post-article__link {
  color: var(--color-green-50);
  font-weight: var(--font-semibold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-article__link:hover {
  color: var(--color-green-40);
}

/* Post Section */
.post-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-section__title {
  font-size: var(--h2-size); /* 32px */
  font-weight: var(--font-bold);
  line-height: 1.3;
  color: var(--color-gray-20);
  margin: 0;
}

.post-section__subtitle {
  font-size: var(--h3-alt-size); /* 26px */
  font-weight: var(--font-bold);
  line-height: 1.4;
  color: var(--color-gray-20);
  margin: 0;
}

.post-section__heading4 {
  font-size: var(--h4-size); /* 20px */
  font-weight: var(--font-semibold);
  line-height: 1.5;
  color: #5e5e5e;
  margin: 0;
}

.post-section__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-section p {
  font-size: var(--body-size);
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-gray-20);
  margin: 0;
}

.post-section p strong {
  font-weight: var(--font-semibold);
}

/* Post List */
.post-list {
  list-style: disc;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-list li {
  font-size: var(--body-size);
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-gray-20);
}

/* Gutenberg List Block (wp-block-list) */
.post-content .wp-block-list, .post-section .wp-block-list, .post-article .wp-block-list {
    list-style: none;
    padding-left: 10px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-content .wp-block-list li,
.post-section .wp-block-list li,
.post-article .wp-block-list li {
  position: relative;
  padding-left: 16px;
  font-size: var(--body-size);
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-gray-20);
}

.post-content .wp-block-list li::before, .post-section .wp-block-list li::before, .post-article .wp-block-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--color-gray-20);
}

/* Quote */
.post-quote {
  padding: 20px;
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-quote__icon {
  width: 30px;
  height: 28px;
  flex-shrink: 0;
}

.post-quote__text {
  font-size: 18px;
  font-weight: var(--font-bold);
  line-height: 1.8;
  color: var(--color-gray-10);
  margin: 0;
}

.post-quote__author {
  font-size: 18px;
  font-weight: var(--font-regular);
  line-height: 1.4;
  color: var(--color-gray-10);
  font-style: normal;
}

/* Post Figure */
.post-figure {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.post-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
}

.post-figure__caption {
  font-size: var(--body-xs-size); /* 12px */
  font-weight: var(--font-regular);
  line-height: 1.8;
  color: #808080;
  text-align: center;
  margin: 0;
}

/* Figure Grid */
.post-figure--grid .post-figure__grid {
  display: flex;
  gap: 12px;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.post-figure--grid .post-figure__main {
  flex: 1;
  height: 470px;
}

.post-figure--grid .post-figure__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.post-figure--grid .post-figure__side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 470px;
}

.post-figure--grid .post-figure__side img {
  flex: 1;
  width: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Full Width Figure */
.post-figure--full {
  width: 100%;
}

.post-figure--full img {
  height: 470px;
  object-fit: cover;
}

/* Single Image (centered) */
.post-figure--single {
  align-items: center;
}

.post-figure--single img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Post CTA (Advertising Insert) */
.post-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: linear-gradient(63deg, #3DD078 0%, #23A859 59%);
  border-radius: var(--radius-xl);
}

.post-cta__image {
  width: 260px;
  height: 154px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-cta__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-cta__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.post-cta__title {
  font-size: var(--h4-size); /* 20px */
  font-weight: var(--font-semibold);
  line-height: 1.5;
  color: var(--color-white);
  margin: 0;
}

.post-cta__text {
  font-size: var(--body-size);
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-white);
  margin: 0;
}

.post-cta__btn {
  align-self: flex-start;
  display: flex;
  padding: 10px 20px;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* Button White variant */
.btn--white {
  background-color: var(--color-white);
  color: var(--color-gray-20);
  border: none;
}

.btn--white:hover {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-gray-20);
}

/* Post Inset */
.post-inset {
  padding: 28px;
  background-color: var(--color-gray-95);
  border-radius: var(--radius-lg);
}

.post-inset p {
  font-size: var(--body-size);
  font-weight: var(--font-regular);
  line-height: 1.5;
  color: var(--color-gray-20);
  margin: 0;
}

.post-inset p strong {
  font-weight: var(--font-semibold);
}

/* Author Block */
.post-author-block {
  display: flex;
  align-items: flex-end;
  gap: 30px;
  padding-top: 20px;
  border-top: 1px solid #B0B2B5;
}

.post-author-block__avatar {
  width: 165px;
  height: 165px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--color-gray-95);
  display: block;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.post-author-block__avatar:hover {
  opacity: 0.8;
}

.post-author-block__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-author-block__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.post-author-block__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-author-block__name {
  font-size: var(--h4-size); /* 20px */
  font-weight: var(--font-semibold);
  line-height: 1.5;
  color: var(--color-green-50);
  text-decoration: none;
  border-bottom: 1px solid var(--color-green-50);
  display: inline-block;
  width: fit-content;
}

.post-author-block__name:hover {
  color: var(--color-green-40);
  border-color: var(--color-green-40);
}

.post-author-block__role {
  font-size: var(--body-small-size); /* 14px */
  font-weight: var(--font-regular);
  line-height: 1.55;
  color: var(--color-gray-30);
  margin: 0;
}

.post-author-block__bio {
  font-size: var(--body-small-size);
  font-weight: var(--font-regular);
  line-height: 1.55;
  color: var(--color-gray-20);
  margin: 0;
}

/* Post Bottom Section */
.post-bottom {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 20px 0;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 4px 12px;
  background-color: var(--color-gray-95);
  border-radius: var(--radius-md);
  font-size: var(--body-small-size);
  font-weight: var(--font-regular);
  line-height: 1.55;
  color: var(--color-gray-20);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.post-tag:hover {
  background-color: var(--color-gray-20);
  color: var(--color-white);
}

/* Share */
.post-share {
  display: flex;
  align-items: center;
  gap: 30px;
}

.post-share__label {
  font-size: var(--h4-size); /* 20px */
  font-weight: var(--font-semibold);
  line-height: 1.5;
  color: var(--color-gray-10);
}

.post-share__icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.post-share__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: opacity var(--transition-fast);
}

.post-share__icon:hover {
  opacity: 0.7;
}

.post-share__icon svg {
  width: 24px;
  height: 24px;
}

/* ===================================
   SIMILAR MATERIALS SECTION
   =================================== */

.similar-posts {
  padding: 30px 0;
  background-color: var(--color-white);
}

.similar-posts .container {
  max-width: 1148px;
}

.similar-posts__title {
  font-size: var(--h3-alt-size); /* 26px */
  font-weight: var(--font-bold);
  line-height: 1.4;
  color: var(--color-gray-20);
  margin: 0 0 24px 0;
}

.similar-posts__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 30px;
}

/* Similar Card */
.similar-card {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  min-width: 264px;
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.similar-card:hover {
  transform: translateY(-4px);
}

.similar-card__inner {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-95);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.similar-card__image {
  position: relative;
  height: 162px;
  overflow: hidden;
  background-color: #dde1e6;
}

.similar-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.similar-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(58, 58, 58, 0.3);
  pointer-events: none;
}

.similar-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.similar-card__category {
  font-size: var(--caption-size); /* 10px */
  font-weight: var(--font-semibold);
  line-height: 1.55;
  letter-spacing: 0.5px;
  color: var(--color-green-40);
  text-transform: uppercase;
}

.similar-card__title {
  font-size: var(--body-size); /* 16px */
  font-weight: var(--font-semibold);
  line-height: 1.4;
  color: var(--color-gray-20);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-card__date {
  font-size: var(--body-xs-size); /* 12px */
  font-weight: var(--font-regular);
  line-height: 1.55;
  color: var(--color-gray-30);
  margin-top: auto;
}

/* ===================================
   RESPONSIVE
   =================================== */

/* Tablet */
@media (max-width: 1279px) {
  /* Head */
  .post-head {
    padding: 50px 0;
  }

  .post-head__content {
    gap: 24px;
  }

  .post-head__title {
    font-size: 36px;
  }

  /* Content Box */
  .post-content-box {
    padding: 50px 0 0;
  }

  .post-article {
    gap: 24px;
  }

  /* Figure Grid */
  .post-figure--grid .post-figure__main,
  .post-figure--grid .post-figure__side {
    height: 350px;
  }

  .post-figure--full img {
    height: 350px;
  }

  /* CTA */
  .post-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .post-cta__image {
    width: 100%;
    height: 200px;
  }

  /* Author Block */
  .post-author-block__avatar {
    width: 120px;
    height: 120px;
  }

  /* Similar Posts */
  .similar-posts__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Head on Mobile - Figma: py 60px, px 20px, gap 30px */
  .post-head {
    padding: 60px 0;
  }

  .post-head__content {
    gap: 30px;
  }

  .post-breadcrumbs {
    flex-wrap: wrap;
  }

  /* Breadcrumbs: 14px Regular as in Figma */
  .post-breadcrumbs__item {
    font-size: var(--body-small-size); /* 14px */
    gap: 8px;
  }

  .post-breadcrumbs__icon {
    width: 21px;
    height: 14px;
  }

  .post-head__text {
    gap: 16px;
  }

  /* Title: 30px Bold, line-height 1.5, letter-spacing 3% */
  .post-head__title {
    font-size: var(--h1-mobile-size); /* 30px */
    line-height: 1.5;
    letter-spacing: 0.03em;
  }

  /* Author: gap 10px, avatar 40px */
  .post-author {
    gap: 10px;
  }

  .post-author__avatar {
    width: 40px;
    height: 40px;
  }

  .post-author__name {
    font-size: var(--body-size); /* 16px */
  }

  .post-author__date {
    font-size: var(--body-xs-size); /* 12px */
  }

  /* Content Box on Mobile - Figma: py 40px, px 20px */
  .post-content-box {
    padding: 40px 0;
  }

  /* Article gap: 30px */
  .post-article {
    gap: 30px;
  }

  /* Cover - aspect ratio stays same as desktop */
  .post-cover {
    aspect-ratio: 855 / 420;
    border-radius: var(--radius-lg); /* 12px */
  }

  /* TOC - Figma: p 24px, gap 16px, title 20px Semibold */
  .post-toc {
    padding: 24px;
    gap: 16px;
  }

  .post-toc__title {
    font-size: var(--h4-size); /* 20px */
  }

  .post-toc__nav {
    gap: 16px;
  }

  .post-toc__link {
    font-size: var(--body-size); /* 16px */
    gap: 16px;
  }

  /* Section Titles - Figma: H2 32px, H3 26px */
  .post-section__title {
    font-size: var(--h2-size); /* 32px */
  }

  .post-section__subtitle {
    font-size: var(--h3-alt-size); /* 26px */
  }

  /* Quote - Figma: p 20px, gap 12px, text 18px Bold line-height 1.8 */
  .post-quote {
    padding: 20px;
    gap: 12px;
  }

  .post-quote__text {
    font-size: 18px;
    line-height: 1.8;
  }

  .post-quote__author {
    font-size: 18px;
  }

  /* Figure Grid - Figma: stays in row, gap 12px, height 470px */
  .post-figure--grid .post-figure__grid {
    flex-direction: row;
    gap: 12px;
  }

  .post-figure--grid .post-figure__main,
  .post-figure--grid .post-figure__side {
    height: 470px;
  }

  .post-figure--grid .post-figure__main img,
  .post-figure--grid .post-figure__side img {
    height: 100%;
    border-radius: 0;
  }

  .post-figure--full img {
    height: 470px;
  }

  /* CTA - Figma: p 20px, gap 24px, image height 232px */
  .post-cta {
    padding: 20px;
    gap: 24px;
  }

  .post-cta__image {
    width: 100%;
    height: 232px;
  }

  .post-cta__title {
    font-size: var(--h4-size); /* 20px */
  }

  .post-cta__text {
    font-size: var(--body-size); /* 16px */
  }

  .post-cta__btn {
    align-self: flex-start;
    width: auto;
  }

  /* Inset - Figma: p 28px */
  .post-inset {
    padding: 28px;
  }

  /* Author Block - Figma: flex-wrap, avatar 165px, gap 30px */
  .post-author-block {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 30px;
    text-align: left;
  }

  .post-author-block__avatar {
    width: 165px;
    height: 165px;
  }

  .post-author-block__info {
    gap: 24px;
    align-items: flex-start;
    min-width: 280px;
    flex: 1;
  }

  .post-author-block__header {
    align-items: flex-start;
  }

  /* Bottom - Figma: py 20px, gap 30px */
  .post-bottom {
    gap: 30px;
    padding: 20px 0;
  }

  /* Tags - Figma: gap 16px, height 40px */
  .post-tags {
    gap: 16px;
  }

  .post-tag {
    height: 40px;
    padding: 4px 12px;
  }

  /* Share - Figma: flex-wrap, gap 30px */
  .post-share {
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
  }

  .post-share__label {
    font-size: var(--h4-size); /* 20px */
  }

  /* Similar Posts - Figma: py 30px, gap 24px, title 26px */
  .similar-posts {
    padding: 30px 0;
  }

  .similar-posts__title {
    font-size: var(--h3-alt-size); /* 26px */
    margin-bottom: 24px;
  }

  /* Similar Grid - Figma: flex-wrap, gap 22px 30px */
  .similar-posts__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 22px 30px;
  }

  /* Similar Card - Figma: min-width 264px, flex-grow */
  .similar-card {
    padding-top: 8px;
    min-width: 264px;
    flex: 1 1 264px;
  }

  .similar-card:hover {
    transform: none;
  }

  .similar-card__image {
    height: 162px;
  }

  .similar-card__content {
    padding: 20px;
    gap: 16px;
  }
}

