/* Header: the wordmark, a quiet row of links, the clinic's phone and an outlined booking action. No rule beneath: the paper ends where the hero begins. */
.brxe-section.st-header { display: block; width: 100%; padding: 0; background: var(--color-paper); font-family: var(--font-body); font-weight: 400; color: var(--color-ink); }
.brxe-container.st-header__inner {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-xl);
  width: 100%; max-width: var(--container); margin-inline: auto; padding: var(--space-md) var(--gutter);
}

.brxe-logo.st-header__logo {
  flex: 0 0 auto; max-width: 18ch;
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--display-weight); font-synthesis: none;
  letter-spacing: var(--tracking-display); line-height: 1.15; text-wrap: balance; text-decoration: none; color: var(--color-ink);
}

.brxe-block.st-header__nav { display: flex; flex-direction: row; align-items: center; gap: var(--space-lg); width: auto; margin-left: auto; }

.brxe-nav-menu.st-header__menu .bricks-nav-menu { display: flex; align-items: center; gap: var(--space-lg); margin: 0; padding: 0; }
.brxe-nav-menu.st-header__menu .bricks-nav-menu > li { margin: 0; }
.brxe-nav-menu.st-header__menu .bricks-nav-menu > li > a,
.brxe-nav-menu.st-header__menu .bricks-nav-menu > li > .brx-submenu-toggle > a {
  padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid transparent; white-space: nowrap;
  font-family: var(--font-body); font-size: var(--text-md); font-weight: 400; line-height: 1.2; text-decoration: none; color: var(--color-ink);
  transition: border-color var(--dur-micro) var(--ease-out);
}
.brxe-nav-menu.st-header__menu .bricks-nav-menu > li.current-menu-item > a,
.brxe-nav-menu.st-header__menu .bricks-nav-menu > li.current-menu-ancestor > .brx-submenu-toggle > a { border-bottom-color: var(--color-ink); }
@media (hover: hover) and (pointer: fine) {
  .brxe-nav-menu.st-header__menu .bricks-nav-menu > li:hover > a,
  .brxe-nav-menu.st-header__menu .bricks-nav-menu > li:hover > .brx-submenu-toggle > a { border-bottom-color: var(--color-ink); }
  .brxe-nav-menu.st-header__menu .sub-menu a:hover { background: var(--color-paper-2); }
  .brxe-text-link.st-header__phone:hover { text-decoration-thickness: 2px; }
}
.brxe-nav-menu.st-header__menu a:focus-visible,
.brxe-nav-menu.st-header__menu button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* The services list: one tinted-paper panel on a hairline, never a shadow. */
.brxe-nav-menu.st-header__menu .sub-menu {
  min-width: 280px; margin: var(--space-sm) 0 0; padding: var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); box-shadow: none;
}
.brxe-nav-menu.st-header__menu .sub-menu a {
  display: block; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-card);
  font-family: var(--font-body); font-size: var(--text-md); font-weight: 400; line-height: 1.3; text-decoration: none; color: var(--color-ink);
}
.brxe-nav-menu.st-header__menu .sub-menu a:focus-visible { background: var(--color-paper-2); }

.brxe-text-link.st-header__phone {
  font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-strong); line-height: 1.2; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: var(--rule-hair); text-underline-offset: 0.2em; text-decoration-color: var(--color-accent); color: var(--color-ink);
}
.brxe-text-link.st-header__phone:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

.st-header .brxe-button.st-btn { min-height: 44px; padding: 0 var(--space-md); white-space: nowrap; }

/* Below the desktop width Bricks swaps the links for its menu button and drawer; both take the same ground and ink. */
.brxe-nav-menu.st-header__menu .bricks-mobile-menu-toggle { color: var(--color-ink); }
.brxe-nav-menu.st-header__menu .bricks-mobile-menu-wrapper { background: var(--color-paper); color: var(--color-ink); }
.brxe-nav-menu.st-header__menu .bricks-mobile-menu-wrapper::before { background: var(--color-paper); }
.brxe-nav-menu.st-header__menu .bricks-mobile-menu li,
.brxe-nav-menu.st-header__menu .bricks-mobile-menu .brx-submenu-toggle,
.brxe-nav-menu.st-header__menu .bricks-mobile-menu .brx-submenu-toggle > * { color: var(--color-ink); }
.brxe-nav-menu.st-header__menu .bricks-mobile-menu .brx-submenu-toggle > a { padding: var(--space-md) var(--gutter); font-family: var(--font-body); font-size: var(--text-lg); font-weight: 400; line-height: 1.3; }
.brxe-nav-menu.st-header__menu .bricks-mobile-menu a:focus-visible,
.brxe-nav-menu.st-header__menu .bricks-mobile-menu button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.brxe-nav-menu.st-header__menu .bricks-mobile-menu > li > a,
.brxe-nav-menu.st-header__menu .bricks-mobile-menu .sub-menu a {
  padding: var(--space-md) var(--gutter); font-family: var(--font-body); font-size: var(--text-lg); font-weight: 400; line-height: 1.3; color: var(--color-ink);
}

/* Over a dark hero (any page that has one) the header floats on it inside the card: light text, the action as a light pill. */
body:has(:is(.st-hero, .st-pagehero)) .brxe-section.st-header { position: absolute; inset: 0 0 auto 0; z-index: var(--z-sticky-nav); background: transparent; }
body:has(:is(.st-hero, .st-pagehero)) .brxe-container.st-header__inner { padding: var(--space-lg) calc(var(--gutter) + var(--space-sm)); }
body:has(:is(.st-hero, .st-pagehero)) .brxe-logo.st-header__logo,
body:has(:is(.st-hero, .st-pagehero)) .brxe-text-link.st-header__phone,
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li > a,
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li > .brx-submenu-toggle > a,
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li > .brx-submenu-toggle > button,
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-mobile-menu-toggle { color: var(--color-on-deep); }
body:has(:is(.st-hero, .st-pagehero)) .brxe-text-link.st-header__phone { text-decoration-color: var(--color-on-deep); }
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li.current-menu-item > a,
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li.current-menu-ancestor > .brx-submenu-toggle > a { border-bottom-color: var(--color-on-deep); }
@media (hover: hover) and (pointer: fine) {
  body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li:hover > a,
  body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu .bricks-nav-menu > li:hover > .brx-submenu-toggle > a { border-bottom-color: var(--color-on-deep); }
  body:has(:is(.st-hero, .st-pagehero)) .st-header .brxe-button.st-btn:hover { background: var(--color-on-deep); border-color: var(--color-on-deep); color: var(--color-deep); }
}
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu a:focus-visible,
body:has(:is(.st-hero, .st-pagehero)) .brxe-nav-menu.st-header__menu button:focus-visible,
body:has(:is(.st-hero, .st-pagehero)) .brxe-text-link.st-header__phone:focus-visible { outline-color: var(--color-on-deep); }
body:has(:is(.st-hero, .st-pagehero)) .st-header .brxe-button.st-btn { background: transparent; border-color: color-mix(in oklab, var(--color-on-deep) 60%, transparent); color: var(--color-on-deep); }

/* Under 1440 the row has no room for the outlined action as well; the phone and the hero's primary button carry the booking. */
@media (max-width: 89.9375rem) {
  .st-header .brxe-button.st-btn { display: none; }
}

@media (max-width: 47.9375rem) {
  .brxe-text-link.st-header__phone { display: none; }
}

/* Wordmark (inc/brand.php): a tooth in an accent square, the name over a small line, set on one line each. The words come
   from "Налаштування клініки" (brand_name, brand_tagline). Header and footer share it; the colour follows the header's. */
.brxe-logo.st-brand { display: inline-flex; align-items: center; gap: var(--space-sm); max-width: none; min-width: 0; text-decoration: none; text-wrap: nowrap; }
.st-brand__mark {
  flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--color-accent); color: var(--color-accent-ink);
}
.st-brand__icon { display: block; width: 26px; height: 26px; stroke-width: 1.2; }
.st-brand__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-brand__name {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-strong); font-synthesis: none;
  letter-spacing: var(--tracking-display); line-height: 1; white-space: nowrap;
}
.st-brand__tag { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0; line-height: 1.1; white-space: nowrap; opacity: 0.75; }
.brxe-logo.st-brand:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: 14px; }
/* Over a dark hero the mark sits on a light glass square instead, so it reads against the photo. */
body:has(:is(.st-hero, .st-pagehero)) .st-header:not(.is-stuck) .st-brand__mark {
  background: color-mix(in oklab, var(--color-on-deep) 16%, transparent);
  box-shadow: inset 0 0 0 var(--rule-hair) color-mix(in oklab, var(--color-on-deep) 40%, transparent);
  color: var(--color-on-deep);
}
.st-header.is-stuck .brxe-logo.st-brand { max-width: none; font-size: inherit; }
.st-header.is-stuck .st-brand__mark { width: 38px; height: 38px; border-radius: 12px; }
.st-header.is-stuck .st-brand__icon { width: 22px; height: 22px; }

/* The phone carries an icon (inc/brand.php); on a phone the link becomes a round call button beside the menu. */
.st-header__phone-icon { display: none; width: 20px; height: 20px; stroke-width: 1.3; color: var(--color-accent-ink); }
/* Up to 1279 px the row has no room for the full number beside the menu, so it is the round button there too. */
@media (max-width: 79.9375rem) {
  body .st-header .brxe-text-link.st-header__phone.has-icon {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--color-accent); text-decoration: none;
  }
  .st-header__phone.has-icon .st-header__phone-icon { display: block; }
  .st-header__phone.has-icon .st-header__phone-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
@media (max-width: 47.9375rem) {
  .brxe-block.st-header__nav { gap: var(--space-sm); }
  .brxe-container.st-header__inner { gap: var(--space-sm); }
  .st-brand__name { font-size: 1.125rem; }
}
@media (max-width: 22.5rem) {
  .st-brand__tag { display: none; }
}
/* Wherever Bricks shows its menu button (tablet portrait and below, 991 px), the phone stands before it. */
@media (max-width: 61.9375rem) {
  .brxe-text-link.st-header__phone { order: -1; }
}
