/*
 * One look for every page, after the home page (DentaCare reference): cards are raised white panels with a hairline,
 * icons sit in round chips, lists inside a card are quiet rows. Loaded after every section stylesheet, before motion.css,
 * so it only restates surfaces; layout stays in each section's own file. Colours and type come from tokens.css.
 */

/* Raised cards: reviews, FAQ items (home and inner pages), "when to come", directions, steps, route, offers, the article CTA,
   doctor facts, the old content blocks on inner pages. */
.st-review,
.brxe-section.st-faq .brxe-accordion .accordion-item,
#brx-content > .brxe-section:has(.brxe-accordion) .brxe-accordion .accordion-item,
.brxe-block.st-when,
.brxe-block.st-dir,
.brxe-block.st-step,
.st-route__item,
.brxe-block.st-offer,
.brxe-block.st-article__cta,
.brxe-block.st-docfacts__row,
#brx-content .about-two__box,
#brx-content .need-implants__item > li,
#brx-content .wrap-services__etape > li.card-can,
#brx-content .wilbya,
#brx-content .nrause,
.brxe-text.st-when-list .st-checks > li {
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-card);
  box-shadow: none;
}

/* Steps: a card per step, the numeral kept large in the accent, no rule over it. */
.brxe-block.st-step { padding: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }

/* FAQ items open on the same card; the active one is marked by its border. */
.brxe-section.st-faq .brxe-accordion .accordion-item.brx-open,
#brx-content > .brxe-section:has(.brxe-accordion) .brxe-accordion .accordion-item.brx-open { border-color: var(--color-accent); }

/* Round icon chips, filled in the accent like the facts strip. */
.st-chip { width: 48px; height: 48px; border-radius: 50%; background: var(--color-accent); color: var(--color-accent-ink); }

/* Gallery tiles lose the mint fill that read as an empty frame. */
.st-gallery__item { background: var(--color-paper-2); }

@media (max-width: 40rem) {
  .brxe-block.st-step { padding: var(--space-md); }
}

/* The support button's pulsing ring stops under reduced motion (its CSS lives in Bricks). */
@media (prefers-reduced-motion: reduce) { .float01__ring { animation: none; } }

/* ===== Service pages, premium pass (the same template on all eight service pages) ===== */

/* "Why it matters" / the approach: a mint band like the home facts strip — round filled icons, hairlines between. */
.brxe-block.st-ways {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: var(--space-lg) 0;
  margin-top: var(--space-2xl); padding: var(--space-xl) var(--space-lg);
  border: 0; border-radius: var(--radius-lg); background: var(--color-mint);
}
.brxe-block.st-way, .brxe-block.st-way:first-child, .brxe-block.st-way:last-child { gap: var(--space-md); padding: 0 var(--space-lg); }
.brxe-heading.st-way__title { font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-strong); letter-spacing: 0; line-height: 1.4; }

/* Diagnostics, directions: numbered cards, three to a row where they fit. */
.brxe-block.st-dirs { counter-reset: st-dir; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.brxe-block.st-dir { counter-increment: st-dir; gap: var(--space-sm); padding: var(--space-lg); }
.brxe-block.st-dir::before {
  content: counter(st-dir, decimal-leading-zero);
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--space-xs); border-radius: 50%;
  background: var(--color-mint); color: var(--color-accent);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums;
}
.brxe-heading.st-dir__title { font-size: var(--text-lg); font-weight: var(--weight-strong); line-height: 1.3; }

/* Goals, "when to come": rows of equal height, each led by a round filled check. */
.brxe-text.st-when-list .st-checks { align-items: stretch; }
.brxe-text.st-when-list .st-checks > li {
  display: flex; align-items: center; min-height: 64px;
  padding: var(--space-sm) var(--space-lg) var(--space-sm) calc(var(--space-lg) + 32px + var(--space-md));
  font-weight: var(--weight-strong);
}
.brxe-text.st-when-list .st-checks > li::before {
  left: var(--space-lg); top: 50%; width: 32px; height: 32px; transform: translateY(-50%);
  border-radius: 50%; background: var(--color-accent); -webkit-mask: none; mask: none;
}
.brxe-text.st-when-list .st-checks > li::after {
  content: ""; position: absolute; left: calc(var(--space-lg) + 8px); top: 50%; width: 16px; height: 16px; transform: translateY(-50%);
  background: var(--color-accent-ink); -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat;
}

/* Treatment steps: cards of equal height, the numeral in a large filled circle. */
.brxe-block.st-steps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--space-md); align-items: stretch; }
.brxe-block.st-step { height: 100%; gap: var(--space-sm); padding: var(--space-xl) var(--space-lg) var(--space-lg); }
.brxe-text-basic.st-step__num {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 0 var(--space-sm); border-radius: 50%;
  background: var(--color-accent); color: var(--color-accent-ink);
  font-family: var(--font-display); font-size: var(--text-xl); line-height: 1;
}
.brxe-heading.st-step__title { font-family: var(--font-body); font-size: var(--text-lg); font-weight: var(--weight-strong); letter-spacing: 0; }

@media (max-width: 40rem) {
  .brxe-block.st-ways { grid-template-columns: minmax(0, 1fr); padding: var(--space-md) var(--space-lg); gap: 0; }
  .brxe-block.st-way, .brxe-block.st-way:first-child, .brxe-block.st-way:last-child { padding: var(--space-md) 0; }
  .brxe-block.st-way + .brxe-block.st-way { border-left: 0; border-top: var(--rule-hair) solid var(--color-rule); }
  .brxe-text.st-when-list .st-checks { grid-template-columns: minmax(0, 1fr); }
}

/* "Why it matters" band, premium: the deep-teal of the hero in a soft gradient with a light glow, light text, icons in
   translucent rings, generous air. The selectors match service.css's ".st-head + .st-ways" so the padding is not zeroed. */
.brxe-section .brxe-block.st-ways,
.brxe-section .brxe-block.st-head + .brxe-block.st-ways {
  position: relative; isolation: isolate; overflow: hidden;
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-xl) 0; align-items: start;
  margin-top: var(--space-2xl); padding: var(--space-2xl) var(--space-lg);
  border: 0; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--color-field) 55%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, var(--color-deep) 0%, var(--color-deep-2) 100%);
  color: var(--color-on-deep);
}
.brxe-section .brxe-block.st-way { gap: var(--space-md); padding: 0 var(--space-xl); }
.brxe-section .brxe-block.st-way + .brxe-block.st-way { border-left: var(--rule-hair) solid color-mix(in oklab, var(--color-on-deep) 18%, transparent); }
.brxe-section .brxe-block.st-ways .st-chip {
  width: 56px; height: 56px;
  background: color-mix(in oklab, var(--color-on-deep) 12%, transparent);
  box-shadow: inset 0 0 0 var(--rule-hair) color-mix(in oklab, var(--color-on-deep) 32%, transparent);
  color: var(--color-on-deep);
}
.brxe-section .brxe-block.st-ways .brxe-heading.st-way__title { color: var(--color-on-deep); font-size: var(--text-md); line-height: 1.45; }
.brxe-section .brxe-block.st-ways .brxe-text-basic.st-way__text { color: color-mix(in oklab, var(--color-on-deep) 80%, transparent); }

@media (max-width: 64rem) {
  .brxe-section .brxe-block.st-ways,
  .brxe-section .brxe-block.st-head + .brxe-block.st-ways { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); gap: 0; padding: var(--space-lg); }
  .brxe-section .brxe-block.st-way { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--space-md); row-gap: var(--space-2xs); padding: var(--space-md) 0; }
  .brxe-section .brxe-block.st-way > .brxe-shortcode { grid-row: 1 / span 2; grid-column: 1; width: auto; }
  .brxe-section .brxe-block.st-way > .st-way__title,
  .brxe-section .brxe-block.st-way > .st-way__text { grid-column: 2; min-width: 0; margin: 0; }
  .brxe-section .brxe-block.st-way:has(> .st-way__text) > .st-way__title { align-self: end; }
  .brxe-section .brxe-block.st-way > .st-way__text { align-self: start; }
  .brxe-section .brxe-block.st-way:not(:has(> .st-way__text)) > .brxe-shortcode { grid-row: 1; }
  .brxe-section .brxe-block.st-way:first-child { padding-top: 0; }
  .brxe-section .brxe-block.st-way:last-child { padding-bottom: 0; }
  .brxe-section .brxe-block.st-ways .st-chip { flex: 0 0 auto; width: 48px; height: 48px; }
  .brxe-section .brxe-block.st-way + .brxe-block.st-way { border-left: 0; border-top: var(--rule-hair) solid color-mix(in oklab, var(--color-on-deep) 18%, transparent); }
}

/* Service template card grids (diagnostics / kinds, treatment steps), after the reference: light cards on a hairline, the
   marker top left in a soft mint square, a bold title, a quiet description, a mint tint on hover. Twelve tracks, three cards
   to a row; the last row is always full: one card left spans the row, two split it. Four steps sit in one row. */
.st-svc-dirs__inner > .brxe-block.st-dirs,
.st-svc-steps__inner > .brxe-block.st-steps {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-md); align-items: stretch; counter-reset: st-dir;
}
.st-svc-dirs__inner .brxe-block.st-dir,
.st-svc-steps__inner .brxe-block.st-step {
  grid-column: span 4; display: flex; flex-direction: column; justify-content: flex-start; gap: var(--space-sm);
  height: auto; min-width: 0; padding: var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-card);
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
@media (min-width: 64.0625rem) {
:is(.st-svc-dirs__inner .brxe-block.st-dir, .st-svc-steps__inner .brxe-block.st-step):last-child:nth-child(3n+1) { grid-column: span 12; }
:is(.st-svc-dirs__inner .brxe-block.st-dir, .st-svc-steps__inner .brxe-block.st-step):nth-last-child(2):nth-child(3n+1),
:is(.st-svc-dirs__inner .brxe-block.st-dir, .st-svc-steps__inner .brxe-block.st-step):last-child:nth-child(3n+2) { grid-column: span 6; }
.st-svc-steps__inner .brxe-block.st-step:first-child:nth-last-child(4),
.st-svc-steps__inner .brxe-block.st-step:first-child:nth-last-child(4) ~ .brxe-block.st-step { grid-column: span 3; }
}

/* The marker: the item's number, set like the reference's icon. */
.st-svc-dirs__inner .brxe-block.st-dir::before,
.st-svc-steps__inner .brxe-text-basic.st-step__num {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 0 var(--space-xs); border-radius: var(--radius-md);
  background: var(--color-mint); color: var(--color-accent);
  font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-strong); line-height: 1; font-variant-numeric: tabular-nums;
}
.st-svc-dirs__inner .brxe-heading.st-dir__title,
.st-svc-steps__inner .brxe-heading.st-step__title {
  max-width: none; margin: 0; font-family: var(--font-body); font-size: var(--text-lg); font-weight: var(--weight-strong);
  letter-spacing: 0; line-height: 1.3; text-wrap: pretty; color: var(--color-ink);
}
.st-svc-dirs__inner .brxe-text-basic.st-dir__text,
.st-svc-steps__inner .brxe-text-basic.st-step__text { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--color-ink-2); }
.st-svc-dirs__inner .brxe-text.st-dir__list { align-self: stretch; width: 100%; font-size: var(--text-sm); }
/* A card that spans the row spreads its list over columns instead of leaving the right side empty. */
@media (min-width: 64.0625rem) {
.st-svc-dirs__inner .brxe-block.st-dir:last-child:nth-child(3n+1) .st-dir__list ul { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xl); }
.st-svc-dirs__inner .brxe-block.st-dir:last-child:nth-child(3n+2) .st-dir__list ul,
.st-svc-dirs__inner .brxe-block.st-dir:nth-last-child(2):nth-child(3n+1) .st-dir__list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-lg); }
}

@media (hover: hover) and (pointer: fine) {
  .st-svc-dirs__inner .brxe-block.st-dir:hover,
  .st-svc-steps__inner .brxe-block.st-step:hover {
    background: color-mix(in oklab, var(--color-mint) 55%, var(--color-card));
    border-color: color-mix(in oklab, var(--color-accent) 35%, var(--color-rule));
  }
}
@media (prefers-reduced-motion: reduce) {
  .st-svc-dirs__inner .brxe-block.st-dir, .st-svc-steps__inner .brxe-block.st-step { transition: none; }
}

/* Tablet: two to a row, an odd last card spans it. */
@media (max-width: 64rem) {
  .st-svc-dirs__inner .brxe-block.st-dir,
  .st-svc-steps__inner .brxe-block.st-step { grid-column: span 6; }
  :is(.st-svc-dirs__inner .brxe-block.st-dir, .st-svc-steps__inner .brxe-block.st-step):last-child:nth-child(odd) { grid-column: span 12; }
  .st-svc-dirs__inner .brxe-block.st-dir .st-dir__list ul { grid-template-columns: minmax(0, 1fr); }
  .st-svc-dirs__inner .brxe-block.st-dir:last-child:nth-child(odd) .st-dir__list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Phone: one column. */
@media (max-width: 40rem) {
  .st-svc-dirs__inner > .brxe-block.st-dirs,
  .st-svc-steps__inner > .brxe-block.st-steps { gap: var(--space-sm); }
  .st-svc-dirs__inner .brxe-block.st-dir,
  .st-svc-steps__inner .brxe-block.st-step,
  :is(.st-svc-dirs__inner .brxe-block.st-dir, .st-svc-steps__inner .brxe-block.st-step):last-child:nth-child(odd) { grid-column: span 12; padding: var(--space-md); }
  .st-svc-dirs__inner .brxe-block.st-dir:last-child:nth-child(odd) .st-dir__list ul { grid-template-columns: minmax(0, 1fr); }
}

/* Long Ukrainian words ("найдосвідченішого", "Високоестетична") wrap instead of running out of narrow boxes. */
.st-est__name, .st-way__title, .st-way__text, .st-dir__title, .st-dir__text, .st-step__title, .st-step__text,
.st-facts__label, .st-review__text, .st-svc__name, .st-checks li { overflow-wrap: break-word; hyphens: auto; }

/* Wide but low screens: an unfolded iPhone Duo (951 x ~610 pt in Safari), tablets and phones turned sideways. The stacked
   tablet layout put the clinic photo, the map or a post's picture a whole screen tall above its text; side by side, both fit. */
@media (min-width: 40.0625rem) and (max-width: 60rem) and (orientation: landscape) {
  .brxe-block.st-about__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-xl); align-items: center; }
  .st-posts--single .st-post__link { flex-direction: row; align-items: center; gap: var(--space-xl); }
  .st-posts--single .st-post__media { flex: 0 0 46%; }
}

/* Narrow phones (the Duo's folded screen leaves Safari about 370 pt): the eight service pills wrapped into five rows and pushed
   the booking button off the first screen. They now run in one row that scrolls sideways, edge to edge of the hero card. */
@media (max-width: 40rem) {
  .st-hero .brxe-shortcode:has(.st-pills) { align-self: stretch; }
  .st-hero .st-pills {
    flex-wrap: nowrap; max-width: none; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
  }
  .st-hero .st-pills::-webkit-scrollbar { display: none; }
  .st-hero .st-pills__item { flex: 0 0 auto; }
}

/* Tablets in the desktop layout (iPad portrait 1024, tablets turned sideways up to 1280): four facts in a row broke their
   captions into syllables, three doctor cards set each name on three lines, and the services rail, squeezed beside its side
   column, hyphenated the card names. Two facts and two doctors to a row; the rail's side column goes above the cards. */
@media (min-width: 60.0625rem) and (max-width: 80rem) {
  .st-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-md); }
  .st-facts__item + .st-facts__item { border-left: 0; }
  .st-facts__item:nth-child(2n) { border-left: var(--rule-hair) solid var(--color-rule); }
  .st-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-svc-rail { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
  .st-svc-rail__aside { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-bottom: 0; }
  .st-svc--rail { grid-auto-columns: calc((100% - 2 * var(--space-md)) / 3.2); }
}
