/* =========================================================
СТРАНИЦА: БЛОГ
ПОЛНАЯ CSS-ВЕРСИЯ
========================================================= */


/* =========================================================
БАЗОВЫЙ СБРОС
========================================================= */
/* Убираем белую полосу сверху */
html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

#page,
.site,
.site-content,
.ast-container,
.entry-content,
.entry-content > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}


/* =========================================================
БАЗА
========================================================= */

.ir-blog-page,
.ir-blog-section {
  --ir-red: #c93b33;
  --ir-red-dark: #a42824;
  --ir-dark: #1f2937;
  --ir-gray: #6b7280;
  --ir-light: #f5f7fb;
  --ir-border: #e5e7eb;
  --ir-header-offset: 118px;

  font-family: Arial, Helvetica, sans-serif;
  color: var(--ir-dark);
  line-height: 1.6;
}

.ir-blog-page *,
.ir-blog-section * {
  box-sizing: border-box;
}

.ir-blog-container {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 20px;
}

.ir-blog-page h1,
.ir-blog-page h2,
.ir-blog-page h3,
.ir-blog-section h2,
.ir-blog-section h3 {
  line-height: 1.15;
  margin: 0 0 16px;
  color: #1f2d4a;
}

.ir-blog-page h1 {
  font-size: clamp(38px, 5vw, 62px);
  letter-spacing: -0.03em;
}

.ir-blog-page h2,
.ir-blog-section h2 {
  font-size: clamp(28px, 3.5vw, 36px);
}

.ir-blog-page h3,
.ir-blog-section h3 {
  font-size: 22px;
}

.ir-blog-page p,
.ir-blog-section p {
  margin: 0 0 16px;
}

.ir-blog-page a,
.ir-blog-section a {
  color: inherit;
}


/* =========================================================
HERO
========================================================= */

.ir-blog-hero-shell {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-bottom: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #27303d 0px, #303847 120px, #4a3f47 220px, #ece8e6 220px, #f7f5f4 100%);
}

.ir-blog-hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 8%, rgba(201, 59, 51, 0.34), transparent 22%),
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
  pointer-events: none;
}

.ir-blog-hero-shell .ir-blog-container {
  position: relative;
  z-index: 1;
  padding-top: var(--ir-header-offset);
  padding-bottom: 34px;
}

.ir-blog-hero {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.ir-blog-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 34px;
  align-items: start;
  padding: 42px 40px 36px;
}

.ir-blog-badge {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(201, 59, 51, 0.18);
  color: var(--ir-red-dark);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.ir-blog-lead {
  max-width: 860px;
  font-size: 20px;
  line-height: 1.68;
  color: #445068;
  margin-bottom: 16px;
}

.ir-blog-lead--small {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 22px;
}


/* =========================================================
ПОИСК
========================================================= */

.ir-blog-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
}

.ir-blog-search input[type="search"] {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(31, 45, 74, 0.12);
  border-radius: 16px;
  background: #fff;
  font-size: 16px;
  color: #1f2d4a;
}

.ir-blog-search input[type="search"]::placeholder {
  color: #748097;
}

.ir-blog-search button {
  min-height: 54px;
  padding: 0 22px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, #cf433b 0%, #bb2f28 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(185, 47, 40, 0.22);
}


/* =========================================================
ГЛАВНЫЕ ТЕМЫ
========================================================= */

.ir-blog-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ir-blog-topic {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(31, 45, 74, 0.10);
  color: #2b3852;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 8px 18px rgba(20, 27, 45, 0.04);
  transition: all 0.2s ease;
}

.ir-blog-topic:hover {
  color: #9f1f25;
  border-color: rgba(159, 31, 37, 0.22);
  transform: translateY(-1px);
}


/* =========================================================
ПРАВАЯ КОЛОНКА HERO
========================================================= */

.ir-blog-hero-card {
  width: 100%;
  background: linear-gradient(180deg, #263451 0%, #1c2740 100%);
  border-radius: 24px;
  padding: 24px;
  color: #ffffff;
  box-shadow: 0 20px 48px rgba(19, 28, 46, 0.18);
}

.ir-blog-hero-card h2 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.2;
}

.ir-blog-hero-card__list {
  display: grid;
  gap: 16px;
}

.ir-blog-hero-card__item {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.ir-blog-hero-card__item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.ir-blog-hero-card__item strong {
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.35;
}

.ir-blog-hero-card__item span {
  display: block;
  color: rgba(255,255,255,0.82);
  line-height: 1.6;
}


/* =========================================================
ОБЩИЕ СЕКЦИИ
========================================================= */

.ir-blog-section {
  margin: 0 0 28px;
}

.ir-blog-section .ir-blog-container {
  padding-top: 0;
  padding-bottom: 0;
}

.ir-blog-section__head {
  margin-bottom: 20px;
}

.ir-blog-section__lead {
  max-width: 860px;
  color: #445068;
  font-size: 17px;
  line-height: 1.72;
}


/* =========================================================
БЛОК "ВСЕ ТЕМЫ"
========================================================= */

.ir-blog-section--topics .ir-blog-container {
  padding: 34px 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.ir-blog-categories.wp-block-categories-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ir-blog-categories.wp-block-categories-list li {
  margin: 0;
}

.ir-blog-categories.wp-block-categories-list a {
  color: #445068;
  text-decoration: none;
  border-bottom: 1px solid rgba(68, 80, 104, 0.18);
  transition: all 0.2s ease;
}

.ir-blog-categories.wp-block-categories-list a:hover {
  color: #9f1f25;
  border-bottom-color: rgba(159, 31, 37, 0.34);
}


/* =========================================================
БЛОК "ПОСЛЕДНИЕ СТАТЬИ"
========================================================= */

.ir-blog-section--posts .ir-blog-container {
  padding: 34px 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.ir-blog-query .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Сетка растягивает карточки на всю высоту ряда */
.ir-blog-query .wp-block-post-template > li {
  display: flex;
  margin: 0;
}

.ir-post-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ir-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  border-color: rgba(201, 59, 51, 0.18);
}


/* ---------- 1. КАРТИНКА: всегда один и тот же формат 4:3 ---------- */

.ir-post-card__image {
  margin: 0 0 14px;
  border-radius: 18px;
  overflow: hidden;
  background: #eef1f6;
  flex: 0 0 auto;
}

.ir-post-card__image,
.ir-post-card__image a {
  display: block;
  width: 100%;
}

.ir-post-card__image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
}

/* Запись без миниатюры: рисуем такую же «заглушку»,
   чтобы карточка не разъехалась относительно соседних */
.ir-post-card > .ir-post-card__terms:first-child::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #eef1f6 0%, #e3e8f0 100%);
}


/* ---------- 2. РУБРИКА: строго одна строка ---------- */

.ir-post-card__terms {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #9f1f25;
  line-height: 1.4;
  min-height: 1.4em;

  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ir-post-card__terms a {
  color: #9f1f25;
  text-decoration: none;
}

.ir-post-card__terms a:hover {
  text-decoration: underline;
}


/* ---------- 3. ЗАГОЛОВОК: максимум 3 строки ---------- */

.ir-post-card__title {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.28;
  min-height: calc(1.28em * 3);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ir-post-card__title a {
  color: #1f2d4a;
  text-decoration: none;
}

.ir-post-card__title a:hover {
  color: #9f1f25;
}


/* ---------- 4. ТЕКСТ + КНОПКА ---------- */

/* .ir-post-card__excerpt — это обёртка блока Gutenberg.
   Делаем её флекс-колонкой и растягиваем на остаток карточки,
   тогда кнопка «Читать статью» прижмётся к низу у ВСЕХ карточек. */
.ir-post-card__excerpt {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  margin: 0;
  color: #445068;
  font-size: 16px;
  line-height: 1.62;
}

.ir-post-card__excerpt .wp-block-post-excerpt__excerpt {
  margin: 0;
  min-height: calc(1.62em * 3);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ir-post-card__excerpt .wp-block-post-excerpt__more-text {
  margin: 0;
  margin-top: auto;
  padding-top: 14px;
}

.ir-post-card__excerpt .wp-block-post-excerpt__more-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff4f4;
  border: 1px solid rgba(201, 59, 51, 0.14);
  color: #9f1f25;
  text-decoration: none;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease;
}

.ir-post-card__excerpt .wp-block-post-excerpt__more-link:hover {
  background: #fdeaea;
  border-color: rgba(201, 59, 51, 0.28);
}


/* =========================================================
ПАГИНАЦИЯ
========================================================= */

.ir-blog-pagination {
  margin-top: 28px;
  gap: 10px;
}

.ir-blog-pagination a,
.ir-blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 45, 74, 0.10);
  background: #fff;
  color: #2b3852;
  text-decoration: none;
  font-weight: 700;
}

.ir-blog-pagination .current {
  background: linear-gradient(180deg, #cf433b 0%, #bb2f28 100%);
  color: #fff;
  border-color: transparent;
}


/* =========================================================
CTA
========================================================= */

.ir-blog-cta-shell {
  margin-bottom: 40px;
}

.ir-blog-cta {
  padding: 34px 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.ir-blog-cta__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.ir-blog-cta__content p {
  max-width: 760px;
  color: #445068;
  margin-bottom: 0;
}

.ir-blog-cta__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ir-blog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ir-blog-btn--primary {
  background: linear-gradient(180deg, #cf433b 0%, #bb2f28 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(185, 47, 40, 0.22);
}

.ir-blog-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(185, 47, 40, 0.26);
}

.ir-blog-btn--secondary {
  background: rgba(255, 255, 255, 0.82);
  color: #1f2937;
  border-color: rgba(31, 41, 55, 0.1);
}

.ir-blog-btn--secondary:hover {
  transform: translateY(-1px);
}


/* =========================================================
АДАПТИВ
========================================================= */

@media (max-width: 1100px) {
  .ir-blog-query .wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .ir-blog-hero__grid,
  .ir-blog-cta__wrap {
    grid-template-columns: 1fr;
  }

  .ir-blog-cta__actions {
    justify-content: flex-start;
  }

  .ir-blog-categories.wp-block-categories-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .ir-blog-page,
  .ir-blog-section {
    --ir-header-offset: 128px;
  }

  .ir-blog-container {
    width: min(100%, calc(100% - 16px));
    padding: 0 8px;
  }

  .ir-blog-hero-shell {
    background:
      linear-gradient(
        180deg,
        rgba(19, 26, 39, 0.18) 0px,
        rgba(19, 26, 39, 0.08) 95px,
        rgba(19, 26, 39, 0) 150px
      ),
      linear-gradient(
        180deg,
        #27303d 0px,
        #313948 110px,
        #4a3f47 185px,
        #ece8e6 185px,
        #f7f5f4 100%
      );
  }

  .ir-blog-hero-shell .ir-blog-container {
    padding-top: calc(var(--ir-header-offset) + 8px);
    padding-bottom: 20px;
  }

  .ir-blog-hero__grid {
    padding: 28px 18px 22px;
    gap: 18px;
  }

  .ir-blog-search {
    grid-template-columns: 1fr;
  }

  .ir-blog-categories.wp-block-categories-list,
  .ir-blog-query .wp-block-post-template {
    grid-template-columns: 1fr;
  }

  .ir-blog-section--topics .ir-blog-container,
  .ir-blog-section--posts .ir-blog-container,
  .ir-blog-cta {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .ir-blog-btn {
    width: 100%;
  }

  .ir-blog-cta__actions {
    width: 100%;
  }

  /* В одну колонку выравнивать не с чем —
     убираем резерв по высоте, чтобы не было пустот */
  .ir-post-card__terms,
  .ir-post-card__title,
  .ir-post-card__excerpt .wp-block-post-excerpt__excerpt {
    min-height: 0;
  }

  .ir-post-card__title {
    font-size: 21px;
  }
}


/* =========================================================
МОБИЛЬНОЕ МЕНЮ ASTRA ДЛЯ ПРОЗРАЧНОЙ ШАПКИ
========================================================= */

@media (max-width: 767px) {
  .ast-theme-transparent-header .main-header-menu-toggle,
  .ast-theme-transparent-header .ast-mobile-menu-trigger-minimal,
  .ast-theme-transparent-header .ast-button-wrap .menu-toggle {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(31, 45, 74, 0.08) !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    color: #1f2d4a !important;
  }

  .ast-theme-transparent-header .main-header-menu-toggle svg,
  .ast-theme-transparent-header .ast-mobile-menu-trigger-minimal svg,
  .ast-theme-transparent-header .ast-button-wrap .menu-toggle svg,
  .ast-theme-transparent-header .main-header-menu-toggle .ast-icon,
  .ast-theme-transparent-header .ast-mobile-menu-trigger-minimal .ast-icon {
    color: #1f2d4a !important;
    fill: #1f2d4a !important;
    stroke: #1f2d4a !important;
  }

  .ast-theme-transparent-header #masthead,
  .ast-theme-transparent-header .site-header,
  .ast-theme-transparent-header .main-header-bar,
  .ast-theme-transparent-header .ast-primary-header-bar,
  .ast-theme-transparent-header .ast-mobile-header-wrap {
    border-bottom: none !important;
    box-shadow: none !important;
  }
}