/**
 * Будинок Затишку — Articles (com_content) redesign.
 * Covers the single-article view (design §5 "Стаття", frames 5b/5d, 7a/7b)
 * and the articles list view (design §5 "Статті · список", frames 5a/5c).
 * Uses only design tokens from tokens.css. See CLAUDE.md frontend map.
 */

/* ============================================================= *
 *  Shared: page shell + breadcrumb                              *
 * ============================================================= */
.bz-articles {
  /* Vertical only, as two properties: the shorthand also wrote the
     horizontal padding, and articles.css loads after chrome.css at equal
     specificity, so it silently zeroed .bz-container's own
     `padding: 0 var(--bz-gutter)`. Invisible while the page was a 1280px
     column centred in a wider viewport; the moment it went full-width the
     text ran into the viewport edge while the header above it kept its
     46px gutter. */
  padding-top: var(--space-5);
  padding-bottom: var(--space-6);
}
.bz-articles__crumbs {
  font-size: 12px;
  color: var(--c-muted);
  margin-bottom: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.bz-articles__crumbs a { color: var(--c-muted); text-decoration: none; }
.bz-articles__crumbs a:hover { color: var(--c-ginger); }
.bz-articles__crumbs span.sep { opacity: .5; }

.bz-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--c-ginger);
}

/* ============================================================= *
 *  Articles LIST (index)                                        *
 * ============================================================= */
.bz-artlist__head { margin-bottom: var(--space-5); }
.bz-artlist__head h1 { font-size: clamp(28px, 0.89vw + 16.6px, 38px); line-height: 1.2; margin: 0 0 6px; }
.bz-artlist__sub { color: var(--c-muted); font-size: 14px; }

.bz-artgrid {
  display: grid;
  /* The page rides the wide grid (.bz-container--wide), so a fixed 3-track
     row would leave the cards stretched to ~700px each. auto-fill + a
     minimum track sizes the row to the viewport instead: 1 card on a
     phone, 3 at 1280, 4 at 1600, 6 near 2400 -- no per-breakpoint column
     counts to keep in step. min(100%, 340px) is what keeps the track from
     overflowing a viewport narrower than the minimum itself. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--space-5);
}
.bz-artcard {
  display: flex;
  flex-direction: column;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.bz-artcard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--c-pillow);
}
.bz-artcard__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--c-pillow);
  overflow: hidden;
}
.bz-artcard__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.bz-artcard__tag {
  position: absolute;
  left: 12px; top: 12px;
  background: rgba(255, 253, 249, .92);
  color: var(--c-coffee);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(47, 58, 51, .12);
}
.bz-artcard__body { padding: var(--space-4) var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bz-artcard__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  line-height: 23px;
  color: var(--c-coffee);
  margin: 0;
}
.bz-artcard:hover .bz-artcard__title { color: var(--c-ginger); }
.bz-artcard__meta { margin-top: auto; color: var(--c-muted); font-size: 12px; }

.bz-artlist__pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-6);
}
.bz-artlist__pager a, .bz-artlist__pager span {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-card);
  color: var(--c-coffee);
  text-decoration: none;
  font-weight: 600;
  padding: 0 10px;
}
.bz-artlist__pager .is-active { background: var(--c-coffee); color: var(--c-card); border-color: var(--c-coffee); }
.bz-artlist__empty { color: var(--c-muted); padding: var(--space-6) 0; }

/* ============================================================= *
 *  Single ARTICLE                                              *
 * ============================================================= */
.bz-article__grid {
  display: grid;
  /* Fluid, not fixed: on the wide grid a flat 320px aside next to a 44px
     gap left the reading column doing all the growing. Both scale with the
     viewport, so the aside stays a real column and the text column widens
     at a slower rate. */
  grid-template-columns: minmax(0, 1fr) clamp(300px, 20vw, 420px);
  gap: clamp(32px, 3vw, 72px);
  align-items: start;
}
.bz-article__main { min-width: 0; }

.bz-article__eyebrow { margin-bottom: 10px; }
.bz-article h1.bz-article__title {
  /* 28px up to 1280, 38px from 2400 -- the headline has to keep scale with
     a reading column that is now three times wider than the old 824px one.
     Cassiopeia hardcodes h1 sizes, hence the .bz-article h1.<class> chain
     (see PROJECT-MAP gotcha on template.min.css). */
  font-size: clamp(28px, 0.89vw + 16.6px, 38px);
  line-height: 1.2;
  margin: 0 0 14px;
}
.bz-article__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--c-muted);
  font-size: 14px;
  margin-bottom: var(--space-5);
}
.bz-article__share { display: inline-flex; gap: 8px; margin-left: auto; }
.bz-article__share a {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  color: var(--c-coffee);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.bz-article__share a:hover { background: var(--c-coffee); color: var(--c-card); border-color: var(--c-coffee); }

.bz-article__hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
  background: var(--c-pillow);
  aspect-ratio: 16 / 8;
}
.bz-article__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Once the column is wide, 2:1 means a 600-900px-tall photo that pushes the
   article below the fold. Swap the ratio for an explicit fluid height rather
   than capping it with max-height: a max-height against an aspect-ratio makes
   the BOX shrink to keep the ratio (measured: 1040px wide inside a 1217px
   column), which left a gap down the right of the hero. */
@media (min-width: 1100px) {
  .bz-article__hero { aspect-ratio: auto; height: clamp(360px, 24vw, 520px); }
}

/* The running text takes the whole reading column, up to the contents box
   (owner 2026-11-17: the former 88ch cap left an empty strip beside the text
   on wide screens). Photos in the text keep a cap, see .bz-art-figure. */
.bz-article__body { max-width: none; }

/* article body typography */
 /* Body type scales with the column: 15px on the narrow end, 18px once the
    page is 2400px wide. Without this the line length grows but the letters
    do not, and a full-width article turns into a wall of tiny text. */
.bz-article__body { font-size: clamp(15px, 0.27vw + 11.6px, 18px); line-height: 1.73; color: var(--c-text); }
.bz-article__body > p { margin: 0 0 var(--space-4); }
.bz-article__body .bz-art__lead {
  font-size: clamp(17px, 0.27vw + 13.6px, 20px);
  line-height: 1.65;
  color: #4a4038;
  margin-bottom: var(--space-5);
}
.bz-article__body h2 {
  font-size: 22px;
  line-height: 28px;
  margin: var(--space-6) 0 var(--space-3);
  scroll-margin-top: 90px;
}
.bz-article__body h3 { font-size: 17px; margin: var(--space-5) 0 var(--space-2); }
.bz-article__body a { color: var(--c-ginger); text-decoration: underline; text-underline-offset: 2px; }
.bz-article__body ul { margin: 0 0 var(--space-4); padding-left: 20px; }
.bz-article__body ul li { margin-bottom: 6px; }

/* numbered tip list with big numerals */
.bz-tip-list { list-style: none; counter-reset: tip; margin: var(--space-4) 0 var(--space-5); padding: 0; }
/* A plain block with the numeral hung in the left padding: a grid made every
   piece of an item that mixes text and links its own cell and broke the line. */
.bz-tip-list > li {
  counter-increment: tip;
  position: relative;
  padding: 16px 0 16px 70px;
  border-bottom: 1px solid var(--c-line);
}
.bz-tip-list > li:last-child { border-bottom: 0; }
.bz-tip-list > li::before {
  content: counter(tip, decimal-leading-zero);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  color: var(--c-ginger);
  position: absolute;
  left: 0;
  top: 18px;
}

/* callout / important note */
.bz-art-callout {
  display: flex;
  gap: 12px;
  background: var(--c-pillow);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: var(--space-5) 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--c-coffee);
}
.bz-art-callout::before { content: "★"; color: var(--c-ginger); font-size: 18px; line-height: 22px; }

/* option / method cards (payment, delivery, terms) */
.bz-optcards { display: grid; gap: 12px; margin: var(--space-4) 0 var(--space-5); }
.bz-optcards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.bz-optcard {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
/* Title is <b> in source, but TinyMCE saves it as <strong> — style both so
   the heading always stacks above the text instead of running inline with it. */
.bz-optcard b,
.bz-optcard strong { display: block; color: var(--c-coffee); font-family: var(--font-heading); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.bz-optcard span { display: block; color: var(--c-muted); font-size: 14px; line-height: 22px; }
.bz-optcard img { display: block; max-width: 100%; height: auto; margin: 8px 0; }
.bz-optcard a[href^="tel:"] { color: var(--c-ginger); font-weight: 600; white-space: nowrap; }
.bz-optcard a[href^="tel:"]:hover { text-decoration: underline; }

/* terms table-ish rows */
.bz-terms { border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; margin: var(--space-4) 0 var(--space-5); }
.bz-terms > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--c-line); background: var(--c-card); }
.bz-terms > div:last-child { border-bottom: 0; }
.bz-terms b { color: var(--c-coffee); font-weight: 700; font-family: var(--font-body); }

/* FAQ accordion */
.bz-faq { margin: var(--space-3) 0 var(--space-5); }
.bz-faq details {
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  background: var(--c-card);
  margin-bottom: 10px;
  overflow: hidden;
}
.bz-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 44px 14px 16px;
  position: relative;
  font-weight: 600;
  color: var(--c-coffee);
  font-family: var(--font-heading);
  font-size: 15px;
}
.bz-faq summary::-webkit-details-marker { display: none; }
.bz-faq summary::after {
  content: "+";
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--c-ginger); font-weight: 400;
}
.bz-faq details[open] summary::after { content: "\2013"; }
.bz-faq details > div { padding: 0 16px 16px; color: var(--c-text); font-size: 14px; line-height: 22px; }

/* related-article inline links */
.bz-art-related {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: var(--space-5) 0;
}
.bz-art-related a {
  display: block;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--c-coffee);
  font-weight: 600;
  background: var(--c-card);
  font-size: 14px;
  line-height: 20px;
}
.bz-art-related a:hover { border-color: var(--c-pillow); color: var(--c-ginger); }
.bz-art-related a::before { content: "Читати далі →"; display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 6px; }

/* prev / next */
.bz-article__nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--c-line);
}
.bz-article__nav a { color: var(--c-coffee); text-decoration: none; font-weight: 600; font-size: 14px; }
.bz-article__nav a:hover { color: var(--c-ginger); }
.bz-article__nav a.next { margin-left: auto; text-align: right; }

/* ---- sidebar ---- */
.bz-article__aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: var(--space-4); }
.bz-aside-box {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.bz-aside-box h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-muted); margin: 0 0 12px; font-family: var(--font-body); font-weight: 700;
}
.bz-toc { list-style: none; counter-reset: toc; margin: 0; padding: 0; }
.bz-toc li { counter-increment: toc; margin-bottom: 4px; }
.bz-toc a {
  display: grid; grid-template-columns: 22px 1fr; gap: 6px;
  padding: 6px 0; text-decoration: none; color: var(--c-text); font-size: 14px; line-height: 22px;
}
.bz-toc a::before { content: counter(toc) "."; color: var(--c-ginger); font-weight: 700; }
.bz-toc a:hover { color: var(--c-ginger); }
.bz-toc a.is-active { color: var(--c-ginger); font-weight: 700; }

/* related products (Товари по темі) */
.bz-aside-prod { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--c-line); text-decoration: none; color: inherit; }
.bz-aside-prod:last-child { border-bottom: 0; }
.bz-aside-prod .thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--c-pillow); flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.bz-aside-prod .info b { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 14px; color: var(--c-coffee); line-height: 22px; }
.bz-aside-prod .info span { color: var(--c-ginger); font-weight: 800; font-size: 14px; }

/* consultation CTA */
.bz-aside-cta { background: var(--c-coffee); color: var(--c-card); border: 0; }
.bz-aside-cta h4 { color: var(--c-pillow); }
.bz-aside-cta p { margin: 0 0 12px; font-size: 14px; line-height: 22px; color: #efe4d6; }
.bz-aside-cta .phone { font-family: var(--font-heading); font-weight: 600; font-size: 20px; color: #fff; display: block; text-decoration: none; margin-bottom: 4px; }
.bz-aside-cta small { color: #cbb9a6; font-size: 11px; }

/* ============================================================= *
 *  Responsive                                                  *
 * ============================================================= */
@media (max-width: 980px) {
  .bz-article__grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .bz-article__aside { position: static; order: 2; }
  .bz-artgrid { gap: var(--space-4); }
}
@media (max-width: 640px) {
  .bz-article h1.bz-article__title { font-size: 26px; line-height: 32px; }
  .bz-artlist__head h1 { font-size: 24px; line-height: 30px; }
  .bz-optcards.cols-2 { grid-template-columns: 1fr; }
  .bz-art-related { grid-template-columns: 1fr; }
  .bz-tip-list > li { padding-left: 52px; }
  .bz-article__hero { aspect-ratio: 16 / 10; }
}

/* article body figures — inline photos and floated mechanism schemes
   (introduced with the legacy-article migration, 2026-08) */
.bz-article__body img { max-width: 100%; height: auto; }
.bz-art-figure { margin: var(--space-4) 0 var(--space-5); max-width: 960px; }
.bz-art-figure img { display: block; width: 100%; border-radius: var(--radius-lg); background: var(--c-pillow); }
.bz-art-figure figcaption { font-size: 13px; color: var(--c-muted); margin-top: 6px; }
.bz-art-scheme { float: right; width: 250px; margin: 4px 0 12px 16px; }
.bz-art-scheme img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--c-line); background: #fff; }
.bz-article__body h2 { clear: both; }
@media (max-width: 640px) {
  .bz-art-scheme { float: none; width: auto; max-width: 280px; margin: 0 0 var(--space-3); }
}
