/*
 * home header styles.
 * Keep rule order intact: later rules refine earlier layouts and responsive states.
 */

/* Home-page reference header. */
.shared-header-page .minimal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid #e8e8e8;
}
.shared-header-page .minimal-header-inner {
  width: calc(100% - 64px);
  max-width: 1400px;
  height: 80px;
  min-height: 80px;
  padding-block: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 28px;
  transform: none;
}
.shared-header-page .minimal-header .menu-brand {
  width: 210px;
  height: 60px;
  padding-inline-end: 28px;
  border-inline-end: 1px solid #dedede;
  flex-shrink: 0;
}
.shared-header-page .menu-brand img {
  object-fit: contain;
  object-position: left center;
}
.home-header-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 30px;
  white-space: nowrap;
}
.home-header-nav a {
  padding-block: 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.home-header-nav a[aria-current="page"] {
  font-weight: 600;
}
.home-header-nav a:hover {
  color: var(--purple);
}
.shared-header-page .minimal-header-actions {
  gap: 17px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  padding-inline-start: 24px;
  border-inline-start: 1px solid #dedede;
}
.shared-header-page .minimal-header-actions .language-toggle {
  font-size: 13px;
  line-height: 1;
  min-height: 32px;
  padding: 4px;
}
.shared-header-page .minimal-header .menu-toggle {
  display: flex;
  color: inherit;
}
.shared-header-page .header-theme-toggle {
  width: 32px;
  height: 36px;
  padding: 7px;
}
.shared-header-page .header-theme-toggle svg {
  width: 19px;
  height: 19px;
}
.shared-header-page .menu-contact .menu-book-consultation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: fit-content;
  padding: 12px 18px;
  margin-block: 24px 18px;
  border: 1px solid currentColor;
  color: inherit;
}
.shared-header-page.dark .minimal-header {
  color: var(--ink);
  border-color: var(--line);
}
@media (max-width: 1150px) {
  .home-header-nav {
    gap: 18px;
  }
  .shared-header-page .minimal-header-inner {
    gap: 20px;
  }
  .shared-header-page .minimal-header .menu-brand {
    width: 180px;
    padding-inline-end: 20px;
  }
  .shared-header-page .minimal-header-actions {
    padding-inline-start: 16px;
    gap: 12px;
  }
}
@media (max-width: 980px) {
  .home-header-nav {
    display: none;
  }
  .shared-header-page .minimal-header-inner {
    width: calc(100% - 36px);
    height: 74px;
    min-height: 74px;
    justify-content: space-between;
  }
  .shared-header-page .minimal-header .menu-brand {
    width: 180px;
    height: 54px;
  }
  .shared-header-page .minimal-header-actions {
    margin-inline-start: auto;
    border: 0;
    padding: 0;
  }
  .shared-header-page .minimal-header .menu-toggle {
    display: flex;
  }
}

/* Keep anchor destinations clear of the sticky header. */
html:has(body.shared-header-page) {
  scroll-padding-top: 100px;
}
@media (max-width: 980px) {
  html:has(body.shared-header-page) {
    scroll-padding-top: 94px;
  }
}

/* A gentle transition between the resting and scrolled header. */
.shared-header-page .minimal-header {
  transition:
    box-shadow 320ms ease,
    border-color 320ms ease;
}
.shared-header-page .minimal-header-inner {
  transition:
    height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    min-height 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.shared-header-page .minimal-header .menu-brand img {
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.shared-header-page .minimal-header.is-scrolled {
  box-shadow: 0 5px 22px rgb(0 0 0 / 8%);
}
.shared-header-page .minimal-header.is-scrolled .minimal-header-inner {
  height: 68px;
  min-height: 68px;
}
.shared-header-page .minimal-header.is-scrolled .menu-brand img {
  transform: scale(0.94);
}
html[dir="rtl"] .shared-header-page .minimal-header .menu-brand img {
  transform-origin: right center;
}
@media (max-width: 980px) {
  .shared-header-page .minimal-header.is-scrolled .minimal-header-inner {
    height: 66px;
    min-height: 66px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shared-header-page .minimal-header,
  .shared-header-page .minimal-header-inner,
  .shared-header-page .minimal-header .menu-brand img {
    transition: none;
  }
}

@media (max-width: 380px) {
  .shared-header-page .minimal-header .menu-brand {
    width: 150px;
    padding-inline-end: 12px;
  }
  .shared-header-page .minimal-header-inner {
    gap: 10px;
  }
  .shared-header-page .minimal-header-actions {
    gap: 6px;
  }
}

/* Consultation tab stays attached to the sticky header. */
.shared-header-page .home-consultation-tag {
  position: absolute;
  top: 100%;
  right: max(32px, calc((100% - 1400px) / 2));
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #e8e8e8;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgb(0 0 0 / 4%);
  transition:
    padding 320ms ease,
    background-color 180ms ease,
    color 180ms ease;
}
.shared-header-page .home-consultation-tag:hover {
  background: var(--tint);
  color: var(--purple);
}
.shared-header-page .home-consultation-tag svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.shared-header-page.dark .home-consultation-tag {
  border-color: var(--line);
}
.shared-header-page .home-consultation-tag:focus-visible {
  outline-offset: 3px;
}
.shared-header-page .minimal-header.is-scrolled .home-consultation-tag {
  padding-block: 10px;
}
html[dir="rtl"] .shared-header-page .home-consultation-tag {
  right: auto;
  left: max(32px, calc((100% - 1400px) / 2));
}
html:has(body.shared-header-page) {
  scroll-padding-top: 140px;
}
@media (max-width: 980px) {
  .shared-header-page .home-consultation-tag {
    right: 18px;
    padding: 10px 15px;
    font-size: 12px;
    gap: 15px;
  }
  html[dir="rtl"] .shared-header-page .home-consultation-tag {
    right: auto;
    left: 18px;
  }
  html:has(body.shared-header-page) {
    scroll-padding-top: 130px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shared-header-page .home-consultation-tag {
    transition: none;
  }
}

/* Consultation tag keeps its diagonal left edge. */
.shared-header-page .home-consultation-tag {
  padding-inline-start: 32px;
  border-left: 0;
  border-radius: 0 0 3px 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 20px 100%);
}
.shared-header-page .home-consultation-tag::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20px;
  background: #e8e8e8;
  clip-path: polygon(0 0, 1px 0, 100% 100%, calc(100% - 1px) 100%);
  pointer-events: none;
}
.shared-header-page.dark .home-consultation-tag::before {
  background: var(--line);
}
.shared-header-page .home-consultation-tag:focus-visible {
  outline-offset: -4px;
}
