/* ==========================================================================
   Акции и спецпредложения — listing cards + article page
   (the burger's base + mobile rules live in header.css / responsive.css)
   ========================================================================== */

.page-hero__sub {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}

/* --- promo cards (scoped with --promo so search result cards keep their
       square product-friendly thumbs) --- */
.post-grid--promo .post-card {
  border-radius: 22px;
  border-color: #f0eae4;
  transition: box-shadow .18s ease, transform .18s ease;
}
.post-grid--promo .post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
}
.post-card__media {
  display: block;
  position: relative;   /* anchors the status chip, mirroring .loop-tile */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #faf6f2;
}
/* Status chip — the promo analogue of the catalog's «Для кого» .loop-badge
   (same pill metrics, same top-left overlay). Green while the promo runs,
   red once it's over; undated posts (анонсы, бессрочные) get no chip. */
.promo-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 6px;
  color: #fff;
}
.promo-status--active  { background: var(--green); }
.promo-status--expired { background: #c1543b; }  /* the form-error red */
.post-card__cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.post-grid--promo .post-card:hover .post-card__cover { transform: scale(1.04); }
.post-card__cover--fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fdf4ee, #fbe3d8);
}
.post-card__cover--fallback svg {
  width: 64px;
  height: 64px;
  fill: rgba(242, 122, 88, .45);
}
.post-grid--promo .post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 22px 22px;
}
.post-card__date {
  font-size: 13px;
  font-weight: 500;
  color: var(--placeholder);
  margin: 0 0 6px;
}
.post-grid--promo .post-card__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.post-grid--promo .post-card__excerpt {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.post-card__more .arrow { display: inline-block; transition: transform .16s ease; }
.post-grid--promo .post-card:hover .post-card__more .arrow { transform: translateX(4px); }

/* --- «Акции и спецпредложения» carousel on the home page. The track CARRIES
       post-grid--promo, so it inherits the /akcii/ card styles wholesale and
       only swaps the grid for a snap-scrolling flex row — the same scroll
       mechanics as the «ТОП продаж» track (home.css). --- */
.promos-home__viewport { overflow: hidden; }
.promos-home__track {
  display: flex;                       /* overrides .post-grid's grid */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;               /* Firefox */
  -ms-overflow-style: none;            /* old Edge */
  padding-bottom: 4px;                 /* room for hover lift */
}
.promos-home__track::-webkit-scrollbar { display: none; }
.promos-home__track .post-card {
  flex: 0 0 calc((100% - 2 * 26px) / 3);   /* 3 per view, mirrors the grid */
  min-width: 0;                            /* the grid's minmax(0,…) guard */
  scroll-snap-align: start;
}
.promos-home__all {
  margin-top: 28px;
  text-align: center;
}
/* Star twinkle on reveal is shared with any other .sec-head that carries a
   star icon (currently also «ТОП продаж») — see home.css .gk-star-twinkle,
   so every instance of the same icon flourishes in sync, not just this one. */
@media (max-width: 1000px) {
  .promos-home__track .post-card { flex-basis: calc((100% - 26px) / 2); }
}
@media (max-width: 640px) {
  .promos-home__track .post-card { flex-basis: 100%; }
}

/* --- empty state --- */
.promo-empty {
  max-width: 460px;
  margin: 0 auto;
  padding: 60px 0 40px;
  text-align: center;
}
.promo-empty__icon svg {
  width: 72px;
  height: 72px;
  fill: #f4c9ba;
}
.promo-empty__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 10px 0 8px;
}
.promo-empty__text {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 24px;
}

/* --- article (single акция) --- */
.article-narrow {
  max-width: 880px;          /* readable measure inside the wide .container */
  margin-left: auto;
  margin-right: auto;
}
.page-title--article {
  font-size: clamp(26px, 4.5vw, 34px); /* self-responsive; no media override needed */
}
/* Date + status chip on one row under the H1. */
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 0;
}
.article-meta .promo-status { position: static; }  /* in-flow next to the date */
.article-date {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--placeholder);
}
.entry--article .article-cover {
  width: 100%;
  border-radius: 22px;
  margin: 4px 0 26px;
}
.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid #f0f0f0;
}
/* Quiet tertiary back link. Deliberately NOT a button: the price CTA is the
   footer's single button, so nothing competes with it or invites comparing
   two button designs. Hover follows the site's link pattern (orange → ink,
   arrow slides in the direction of travel). */
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--orange);
  font-weight: 600;
  font-size: 16px;
  transition: color .15s ease;
}
.link-back:hover { color: var(--ink); }
.link-back .arrow { display: inline-block; transition: transform .16s ease; }
.link-back:hover .arrow { transform: translateX(-4px); }

/* --- «Товары акции» — linked products under the article text. Cards are the
       standard catalog loop, so tiles/badges/variant viewers style themselves;
       only the column count needs care: the base grid is 4-up (full-width
       shop), 3 fits the 880px article measure. The override sits in a
       min-width query because promos.css loads after woocommerce.css — a bare
       rule here would also beat its ≤1000px two-column rule by cascade order. */
.promo-products { margin-top: 44px; }
.promo-products__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 22px;
}
@media (min-width: 1001px) {
  .promo-products ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .nav, .nav-toggle__bar,
  .post-grid--promo .post-card, .post-card__cover,
  .post-card__more .arrow, .link-back, .link-back .arrow { transition: none; }
  .post-grid--promo .post-card:hover { transform: none; }
  .post-grid--promo .post-card:hover .post-card__cover { transform: none; }
}

/* --- price / newsletter CTA in посты --- */
/* .btn-cta was written for <a>; the price CTA is a <button> — reset UA bits. */
.gk-post-cta {
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.entry .gk-post-cta {
  margin: 10px 0 4px;
  color: #fff;
  text-decoration: none;
}

/* Narrow screens: primary CTA first at full width, the quiet back link
   centered under it (column-reverse keeps desktop DOM order: link, CTA). */
@media (max-width: 640px) {
  .article-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .article-footer .btn-cta {
    width: 100%;
    justify-content: center;
    /* one step down: at 18px the label wraps into a two-line button on 375px */
    font-size: 16px;
    padding: 13px 20px;
  }
  .article-footer .link-back { align-self: center; }
}
