/* ==========================================================================
   Articles: списки материалов (/finance/, /investments/, /news/, поиск)
   и единый шаблон статьи.
   ========================================================================== */

/* -------- Шапка списка -------- */
.articles__head {
  padding-block: clamp(1.75rem, 3.6vw, 3.25rem) clamp(1.75rem, 3.4vw, 2.875rem);
  background: var(--c-soft);
}

.articles__head .label {
  margin: 0 0 0.75rem;
}

.articles__title {
  margin: 0;
  font-size: clamp(1.875rem, 3.6vw, 2.875rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.02em;
}

.articles__lead {
  max-width: 42em;
  margin: 0.875rem 0 0;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.55;
  color: var(--c-muted);
}

.articles__lead:empty,
.articles__lead p:empty {
  display: none;
}

.articles__lead p {
  margin: 0;
}

.articles__body {
  padding-block: clamp(1.75rem, 3.4vw, 3rem) clamp(2.75rem, 5vw, 4.75rem);
}

/* -------- Сетка карточек -------- */
.articles__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 1.9vw, 1.625rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.articles__list > li {
  display: flex;
  margin: 0;
}

.post-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 0.0625rem solid var(--c-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.post-card:hover {
  border-color: #c6d4ea;
  box-shadow: 0 0.125rem 0.25rem rgba(15, 37, 87, .06), 0 0.875rem 1.875rem rgba(15, 37, 87, .12);
  transform: translateY(-0.1875rem);
}

.post-card__media {
  overflow: hidden;
}

.post-card__media img {
  width: 100%;
  aspect-ratio: 1.6;
  object-fit: cover;
  transition: transform .5s ease;
}

.post-card:hover .post-card__media img {
  transform: scale(1.04);
}

.post-card__media .post-media-fallback {
  aspect-ratio: 1.6;
  border: 0;
  border-radius: 0;
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.125rem 1.375rem 1.25rem;
}

.post-card__cat {
  margin: 0 0 0.5rem;
}

.post-card__cat a {
  position: relative;
  z-index: 2;
  transition: color .2s;
}

.post-card__cat a:hover {
  color: var(--c-blue);
}

.post-card__cat:empty {
  display: none;
}

.post-card__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -.01em;
}

.post-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card__text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--c-muted);
}

.post-card__text p {
  margin: 0;
}

.post-card__date {
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--c-muted);
}

.articles__pagination {
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.25rem;
  font-weight: 600;
}

.feed-empty {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--c-muted);
}

/* ==========================================================================
   Статья
   ========================================================================== */

.article__top,
.article__cover-wrap,
.article__body {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Хлебные крошки (views/article-crumbs.php) — по ширине колонки заголовка */
.article-crumbs {
  width: 100%;
  max-width: calc(53.75rem + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(1.25rem, 2.6vw, 2rem) var(--gutter) 0;
}

.article-crumbs__list {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--c-muted);
}

.article-crumbs__list li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: none;
  min-width: 0;
}

.article-crumbs__list a {
  padding: 0.25rem 0.625rem;
  font-weight: 500;
  color: var(--c-navy);
  background: var(--c-soft-2);
  border-radius: 2rem;
  transition: color .2s, background-color .2s;
}

.article-crumbs__list a:hover {
  color: var(--c-blue);
  background: var(--c-soft);
}

.article-crumbs__sep {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  color: #a9b6cc;
}

.article-crumbs__current {
  flex: 1 1 auto !important;
  display: block !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.article__top {
  max-width: calc(53.75rem + var(--gutter) * 2);
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.article__cat {
  margin: 0 0 0.875rem;
}

.article__cat a {
  transition: color .2s;
}

.article__cat a:hover {
  color: var(--c-blue);
}

.article__title {
  margin: 0;
  font-size: clamp(1.875rem, 3.8vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.02em;
}

.article__date {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--c-muted);
}

.article__cover-wrap {
  max-width: calc(67.5rem + var(--gutter) * 2);
  padding-top: clamp(1.25rem, 2.6vw, 2rem);
}

.article__cover:empty {
  display: none;
}

.article__cover img {
  width: 100%;
  aspect-ratio: 2;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Текст из редактора */
.article__body {
  padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4.5rem);
}

.article__content,
.prose,
.page-body > :not(.alignfull) {
  font-size: 1.125rem;
  line-height: 1.7;
}

.article__content > * + *,
.prose > * + *,
.page-body > :not(.alignfull) > * + * {
  margin-top: 1.1em;
}

.article__content > h2,
.prose > h2,
.page-body > :not(.alignfull) > h2,
.page-body > h2 {
  margin-top: 1.9em;
  margin-bottom: .5em;
  font-size: clamp(1.4375rem, 2.2vw, 1.875rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
}

.article__content > h3,
.prose > h3,
.page-body > :not(.alignfull) > h3,
.page-body > h3 {
  margin-top: 1.6em;
  font-size: clamp(1.1875rem, 1.7vw, 1.4375rem);
  line-height: 1.3;
  font-weight: 700;
}

.article__content > :first-child,
.prose > :first-child,
.page-body > :not(.alignfull) > :first-child {
  margin-top: 0;
}

.article__content a:not(.wp-block-button__link),
.prose a:not(.wp-block-button__link),
.page-body > :not(.alignfull) a:not(.wp-block-button__link) {
  color: var(--c-blue);
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.1875rem;
}

.article__content a:not(.wp-block-button__link):hover,
.prose a:not(.wp-block-button__link):hover,
.page-body > :not(.alignfull) a:not(.wp-block-button__link):hover {
  color: var(--c-blue-hover);
}

.article__content ul,
.prose ul,
.page-body > :not(.alignfull) ul,
.page-body > ul,
.article__content ol,
.prose ol,
.page-body > :not(.alignfull) ol,
.page-body > ol {
  padding: 0;
  list-style: none;
}

.article__content ul li,
.prose ul li,
.page-body > :not(.alignfull) ul li,
.page-body > ul li,
.article__content ol li,
.prose ol li,
.page-body > :not(.alignfull) ol li,
.page-body > ol li {
  position: relative;
  margin: 0 0 .6em;
  padding-left: 1.75rem;
}

.article__content ul li::before,
.prose ul li::before,
.page-body > :not(.alignfull) ul li::before,
.page-body > ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .65em;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--c-blue);
  border-radius: 0.1875rem;
}

.article__content ol,
.prose ol,
.page-body > :not(.alignfull) ol,
.page-body > ol {
  counter-reset: item;
}

.article__content ol li,
.prose ol li,
.page-body > :not(.alignfull) ol li,
.page-body > ol li {
  counter-increment: item;
}

.article__content ol li::before,
.prose ol li::before,
.page-body > :not(.alignfull) ol li::before,
.page-body > ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: .2em;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  color: var(--c-blue);
  background: var(--c-soft);
  border-radius: 50%;
}

.article__content blockquote,
.prose blockquote,
.page-body > :not(.alignfull) blockquote,
.page-body > blockquote,
.article__content .wp-block-quote,
.prose .wp-block-quote,
.page-body > :not(.alignfull) .wp-block-quote,
.page-body > .wp-block-quote {
  margin-inline: 0;
  padding: 1.125rem 1.5rem;
  font-size: 1.1875rem;
  line-height: 1.55;
  font-weight: 500;
  background: var(--c-soft-2);
  border: 0;
  border-left: 0.25rem solid var(--c-blue);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.article__content blockquote p,
.prose blockquote p,
.page-body > :not(.alignfull) blockquote p,
.page-body > blockquote p {
  margin: 0;
}

.article__content blockquote cite,
.prose blockquote cite,
.page-body > :not(.alignfull) blockquote cite,
.page-body > blockquote cite {
  display: block;
  margin-top: 0.625rem;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--c-muted);
}

.article__content img,
.prose img,
.page-body > :not(.alignfull) img,
.page-body > img {
  height: auto;
  max-width: 100%;
  border-radius: var(--radius);
}

.article__content figcaption,
.prose figcaption,
.page-body > :not(.alignfull) figcaption,
.page-body > figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--c-muted);
}

.article__content .wp-block-table,
.prose .wp-block-table,
.page-body > :not(.alignfull) .wp-block-table,
.page-body > .wp-block-table {
  overflow-x: auto;
  border: 0.0625rem solid var(--c-line);
  border-radius: var(--radius-lg);
}

.article__content .wp-block-table table,
.prose .wp-block-table table,
.page-body > :not(.alignfull) .wp-block-table table,
.page-body > .wp-block-table table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  font-size: 1rem;
}

.article__content .wp-block-table td,
.prose .wp-block-table td,
.page-body > :not(.alignfull) .wp-block-table td,
.page-body > .wp-block-table td,
.article__content .wp-block-table th,
.prose .wp-block-table th,
.page-body > :not(.alignfull) .wp-block-table th,
.page-body > .wp-block-table th {
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 0.0625rem solid var(--c-line);
}

.article__content .wp-block-table th,
.prose .wp-block-table th,
.page-body > :not(.alignfull) .wp-block-table th,
.page-body > .wp-block-table th {
  text-align: left;
  background: var(--c-soft-2);
}

.article__content .wp-block-table tr:last-child td,
.prose .wp-block-table tr:last-child td,
.page-body > :not(.alignfull) .wp-block-table tr:last-child td,
.page-body > .wp-block-table tr:last-child td {
  border-bottom: 0;
}

.article__content .bank-note,
.prose .bank-note,
.page-body > :not(.alignfull) .bank-note,
.page-body > .bank-note,
.article__content .is-style-note,
.prose .is-style-note,
.page-body > :not(.alignfull) .is-style-note,
.page-body > .is-style-note {
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--c-muted);
  background: var(--c-soft-2);
  border-left: 0.1875rem solid var(--c-orange);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* -------- Читайте также -------- */
.article__related {
  padding-block: clamp(1.75rem, 3.4vw, 3rem) clamp(2.25rem, 4.4vw, 4rem);
  background: var(--c-soft);
}

.article__related .section-head {
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (max-width: 1000px) {
  .articles__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .articles__list {
    grid-template-columns: 1fr;
  }

  .article__content,
  .prose,
  .page-body > :not(.alignfull) {
    font-size: 1.0625rem;
  }

  .article__cover img {
    aspect-ratio: 1.6;
  }

  .article__content blockquote,
  .prose blockquote,
  .page-body > blockquote,
  .article__content .wp-block-quote,
  .prose .wp-block-quote,
  .page-body > .wp-block-quote {
    padding: 0.875rem 1.125rem;
    font-size: 1.0625rem;
  }
}

.article__byline {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--c-muted);
}

.article__byline a {
  font-weight: 600;
  color: var(--c-navy);
  transition: color .2s;
}

.article__byline a:hover {
  color: var(--c-blue);
}
