/* Типографіка і сітка блогу dsantoshka.com.ua.
   Тільки нові класи — жодного перевизначення webflow-класів.
   Токени (--spanish-violet тощо) приходять з antoshka.webflow.css :root. */

.body-blog {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-family: "Museosanscyrl 500", sans-serif;
  font-size: 16px;
  font-weight: 500;
  display: flex;
}

.blog-main {
  width: 95%;
  max-width: 1184px;
  margin-top: 128px;
}

.blog-hero {
  display: flex;
  flex-direction: column;
  row-gap: 16px;
  margin-bottom: 64px;
}

/* Grid із фіксованими клітинками: картки завжди однакового розміру,
   незалежно від їх кількості (вимога користувача, 14.08.2026). */
.blog-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.blog-card {
  background-color: #f6f2fa;
  border-radius: 32px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  row-gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(82, 41, 128, 0.12);
}

.blog-card__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 8px;
}

.blog-card__date {
  font-size: 14px;
  color: #6b6470;
}

.blog-card__title {
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.3;
  color: var(--spanish-violet);
  margin: 0;
}

.blog-card__excerpt {
  font-size: 16px;
  line-height: 1.5;
  color: var(--spanish-violet);
}

.blog-empty {
  text-align: center;
  padding: 64px 0;
}

/* ── Пошук і категорії (прогресивне покращення, blog-search.js) ── */

/* Тулбар прихований, поки blog-search.js не поставить is-ready:
   без JS (або якщо модуль не завантажився) мертві контроли не показуються */
.blog-toolbar {
  display: none;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.blog-explorer.is-ready .blog-toolbar {
  display: flex;
}

.blog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-chip {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--spanish-violet);
  background-color: #fff;
  border: 1px solid rgba(82, 41, 128, 0.2);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.blog-chip:hover {
  border-color: var(--spanish-violet);
}

.blog-chip.is-active {
  background-color: var(--spanish-violet);
  border-color: var(--spanish-violet);
  color: #fff;
}

.blog-chip__count {
  margin-left: 6px;
  opacity: 0.55;
}

.blog-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 320px;
}

.blog-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(82, 41, 128, 0.45);
  pointer-events: none;
}

.blog-search__input {
  width: 100%;
  font-family: inherit;
  /* ≥16px обов'язково: iOS Safari зумить сторінку при фокусі на менших полях */
  font-size: 16px;
  color: var(--spanish-violet);
  background-color: #fff;
  border: 1px solid rgba(82, 41, 128, 0.2);
  border-radius: 999px;
  padding: 10px 16px 10px 42px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.blog-search__input:focus {
  border-color: var(--spanish-violet);
  box-shadow: 0 0 0 3px rgba(82, 41, 128, 0.12);
}

/* Хрестик очищення запиту (нативний прибраний webflow-normalize) */
.blog-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  color: rgba(82, 41, 128, 0.55);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.blog-search__clear:hover {
  color: var(--spanish-violet);
  background-color: rgba(82, 41, 128, 0.08);
}

.blog-count {
  min-height: 20px;
  font-size: 14px;
  color: #6b6470;
  margin-bottom: 24px;
}

.blog-card.is-hidden {
  display: none !important;
}

/* ── Featured «Остання публікація» (рендериться лише при ≥4 статтях) ── */

.blog-featured {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 32px;
  align-items: center;
  background-color: #f6f2fa;
  border-radius: 32px;
  padding: 24px;
  margin-bottom: 32px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(82, 41, 128, 0.12);
}

.blog-featured__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
}

/* Захист: featured без обкладинки (через Studio недосяжно — coverImage
   обов'язкова) не лишає порожню колонку сітки */
.blog-featured:not(:has(.blog-featured__img)) {
  grid-template-columns: 1fr;
}

.blog-featured__badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b6470;
}

.blog-featured__title {
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  font-size: 32px;
  line-height: 1.25;
  color: var(--spanish-violet);
  margin: 12px 0 0;
}

.blog-featured__excerpt {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--spanish-violet);
}

.blog-featured__meta {
  margin-top: 16px;
  font-size: 14px;
  color: #6b6470;
}

/* Featured-стаття є і в сітці першою карткою: поза фільтром картку ховаємо
   (щоб не дублювалась), під час пошуку/фільтра — навпаки, ховаємо featured
   і показуємо картку. Без JS клас is-filtering не з'явиться — все коректно. */
.blog-list.has-featured > .blog-card:first-child {
  display: none;
}

.blog-explorer.is-filtering .blog-featured {
  display: none;
}

.blog-explorer.is-filtering .blog-list.has-featured > .blog-card:first-child {
  display: flex;
}

/* ── «Нічого не знайдено» ── */

.blog-notfound {
  text-align: center;
  background-color: #f6f2fa;
  border-radius: 32px;
  padding: 48px 24px;
}

.blog-notfound__title {
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--spanish-violet);
  margin: 0 0 8px;
}

.blog-notfound__text {
  font-size: 15px;
  line-height: 1.5;
  color: #6b6470;
  max-width: 480px;
  margin: 0 auto 20px;
}

.blog-notfound__reset {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--spanish-violet);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.blog-cta {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

/* ── Стаття ── */

.article {
  max-width: 768px;
  width: 100%;
  margin: 0 auto;
}

.article-title {
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  font-size: 40px;
  line-height: 1.15;
  color: var(--spanish-violet);
  margin: 0;
}

.article-meta {
  font-size: 14px;
  color: #6b6470;
  margin: 16px 0 32px;
}

.article-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 32px;
}

.article-body {
  margin-top: 32px;
  color: var(--spanish-violet);
}

.article-body p {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.65;
}

.article-body h2 {
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  font-size: 32px;
  line-height: 1.2;
  margin: 40px 0 16px;
  color: var(--spanish-violet);
}

.article-body h3 {
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  font-size: 24px;
  line-height: 1.25;
  margin: 32px 0 12px;
  color: var(--spanish-violet);
}

.article-body ul,
.article-body ol {
  padding-left: 24px;
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.65;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body a {
  color: var(--spanish-violet);
  text-decoration: underline;
}

.article-body a:hover {
  opacity: 0.8;
}

.article-body blockquote {
  border-left: 4px solid var(--spanish-violet);
  padding: 4px 0 4px 24px;
  margin: 24px 0;
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
}

.article-figure {
  margin: 32px 0;
}

.article-figure img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 520px;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
}

.article-figure figcaption {
  font-size: 14px;
  color: #6b6470;
  text-align: center;
  margin-top: 8px;
}

.back-to-blog {
  display: inline-block;
  font-family: "Museosanscyrl 900", sans-serif;
  font-weight: 900;
  color: var(--spanish-violet);
  text-decoration: none;
  margin-top: 48px;
}

.back-to-blog:hover {
  opacity: 0.8;
}

/* ── Адаптив (брейкпоінти сайту) ── */

@media screen and (max-width: 991px) {
  .blog-main {
    margin-top: 96px;
  }
  .blog-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-title {
    font-size: 36px;
  }
}

@media screen and (max-width: 767px) {
  .blog-list {
    grid-template-columns: 1fr;
  }
  .blog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .blog-search {
    /* НЕ 1 1 240px: у колонці flex-basis стає висотою — блок роздувався
       до 240px, лупа (top:50%) з'їжджала вниз, контент відсувався */
    flex: 0 0 auto;
    max-width: none;
  }
  .blog-featured {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .blog-featured__title {
    font-size: 24px;
  }
  .article-title {
    font-size: 32px;
  }
  .article-body h2 {
    font-size: 26px;
  }
}

@media screen and (max-width: 479px) {
  .blog-main {
    margin-top: 64px;
  }
  .article-title {
    font-size: 28px;
  }
  .article-body p,
  .article-body ul,
  .article-body ol {
    font-size: 16px;
  }
  .article-cover img {
    border-radius: 16px;
  }
}
