/* Site header and navigation. */

.site-header {
  box-sizing: border-box;
  position: sticky;
  top: calc(-1 * var(--header-collapse-distance, 0px));
  z-index: 100;
  background: var(--brand-cream);
  border-bottom: 1px solid var(--color-taupe);
  transition: background-color .24s ease, border-color .24s ease, box-shadow .24s ease;
}

.site-header.is-scrolled {
  background: rgb(250 247 241 / 96%);
  border-bottom-color: rgb(194 182 157 / 65%);
  box-shadow: 0 .45rem 1.4rem rgb(31 41 43 / 8%);
}

.site-header.is-compact {
  background: rgb(250 247 241 / 72%);
}

/* Keep automatic scroll compensation off until the expanded layout is restored. */
html:has(.site-header:is(.is-compact, .is-transitioning)) {
  overflow-anchor: none;
}

@supports (backdrop-filter: blur(1px)) {
  .site-header.is-scrolled {
    backdrop-filter: blur(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: clamp(1.5rem, 2vw, 2rem);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  width: fit-content;
}

.brand__logo {
  display: block;
  flex: 0 0 auto;
  width: 140px;
  height: 105px;
  object-fit: cover;
  object-position: center 45%;
}

.brand__copy {
  display: block;
}

.brand__name {
  display: block;
  color: var(--color-aqua);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 2.88px;
  text-transform: uppercase;
}

.brand__name > span {
  display: inline-block;
  white-space: nowrap;
}

.brand__place {
  display: block;
  margin-top: 10px;
  color: var(--color-aqua);
  font: 500 11px/13px var(--font-display);
  letter-spacing: 2.88px;
}

.primary-navigation .menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 2.5vw, 3.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-navigation {
  min-width: 0;
}

.primary-navigation a,
.header-appointment {
  font-size: var(--text-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-navigation a {
  padding-block: 2rem;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
  color: var(--color-aqua);
}

/* Temporarily disabled: gold ring on navigation hover and keyboard focus.
@media (min-width: 1280px) {
  .primary-navigation a {
    position: relative;
  }

  .primary-navigation a::before {
    position: absolute;
    top: 50%;
    left: -1.05rem;
    width: .7rem;
    height: .7rem;
    border: 2.5px solid var(--color-gold-figma);
    border-radius: 50%;
    content: '';
    opacity: 0;
    pointer-events: none;
    transform: translate(.2rem, -50%);
    transition: opacity .18s ease, transform .18s ease;
  }

  .primary-navigation a:hover::before,
  .primary-navigation a:focus-visible::before {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .header-appointment {
    position: relative;
  }

  .header-appointment::before {
    position: absolute;
    top: 50%;
    left: -1.05rem;
    width: .7rem;
    height: .7rem;
    border: 2.5px solid var(--color-gold-figma);
    border-radius: 50%;
    content: '';
    opacity: 0;
    pointer-events: none;
    transform: translate(.2rem, -50%);
    transition: opacity .18s ease, transform .18s ease;
  }

  .header-appointment:hover::before,
  .header-appointment:focus-visible::before {
    opacity: 1;
    transform: translate(0, -50%);
  }

}
*/

.header-appointment {
  justify-self: end;
  color: var(--color-aqua);
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: .65rem;
  padding: .5rem;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--color-aqua);
  font: 500 .6875rem / 1 var(--font-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-toggle__icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 2rem;
  height: 1.25rem;
}

.menu-toggle__icon span {
  display: block;
  width: 100%;
  height: 3px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(1) {
  transform: translateY(.53125rem) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(3) {
  transform: translateY(-.53125rem) rotate(-45deg);
}

@media (min-width: 1280px) {
  .site-header__inner.container {
    width: calc(100% - clamp(3rem, 8.8889vw, 8rem));
    max-width: none;
  }

  .brand__name {
    white-space: nowrap;
  }

  .primary-navigation a {
    display: block;
    padding: 1.5rem 0;
    font-size: .6875rem;
    line-height: 1.25;
  }

  .header-appointment {
    display: block;
    padding: 1.5rem 0;
    font-size: .625rem;
    line-height: 1.25;
  }

  .header-appointment::after {
    content: none;
  }
}

@media (max-width: 1279px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: minmax(4.5rem, auto);
    gap: .5rem;
    min-height: 4.5rem;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
  }

  .brand__logo {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    object-fit: contain;
  }

  .brand__copy {
    min-width: 0;
  }

  .brand__name {
    font-size: .72rem;
    line-height: 1.35;
    letter-spacing: .15em;
  }

  .brand__place {
    margin-top: .35rem;
    font-size: .58rem;
    line-height: 1;
    letter-spacing: .15em;
  }

  .header-appointment {
    display: none;
  }

  .menu-toggle {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    justify-self: end;
  }

  .primary-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    max-height: calc(100svh - 9rem);
    overflow-y: auto;
    padding: .5rem 0 1.25rem;
    border-top: 1px solid var(--color-border-soft);
    pointer-events: auto;
  }

  .primary-navigation.is-open {
    display: block;
  }

  .primary-navigation .menu {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  .primary-navigation a {
    display: block;
    padding: .85rem 0;
    border-bottom: 1px solid rgb(215 206 191 / 55%);
  }
}

.language-switcher {
  position: relative;
  justify-self: end;
  color: var(--brand-text);
}

.language-switcher > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 48px;
  min-height: 44px;
  padding: .25rem;
  cursor: pointer;
  list-style: none;
}

.language-switcher > summary::-webkit-details-marker { display: none; }
.language-switcher__flag { display: block; width: 28px; height: 20px; object-fit: contain; flex: 0 0 28px; }
.language-switcher__chevron { width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.language-switcher[open] .language-switcher__chevron { transform: rotate(225deg); margin-top: 3px; }
.language-switcher__dropdown { position: absolute; top: calc(100% + .35rem); right: 0; z-index: 2; min-width: 185px; padding: .3rem; background: var(--brand-cream); border: 1px solid var(--color-taupe); box-shadow: 0 .4rem 1rem rgb(31 41 43 / 12%); }
.language-switcher__option { display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: .5rem .65rem; font-size: .8rem; white-space: nowrap; }
.language-switcher__option:hover { background: rgb(194 182 157 / 20%); }
.language-switcher > summary:focus-visible,
.language-switcher__option:focus-visible { outline: 2px solid var(--color-aqua); outline-offset: 2px; }

@media (min-width: 1280px) and (max-width: 1439px) {
  .site-header__inner { column-gap: 1rem; }
  .primary-navigation .menu { gap: 1.1rem; }
}

/* Use the same readable navigation scale on every template, not only home. */
@media (min-width: 1280px) {
  .primary-navigation a,
  .header-appointment {
    font-size: .875rem;
    line-height: 1.25;
  }
}

@media (max-width: 1279px) {
  .language-switcher { grid-column: 2; grid-row: 1; }
}

@media (max-width: 600px) {
  .language-switcher { align-self: start; margin-top: .25rem; }
  .language-switcher__dropdown { left: 0; right: auto; }
}

@media (max-width: 600px) {
  .site-header__inner {
    padding-block: .625rem;
  }

  .brand {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    gap: .375rem;
    width: 100%;
    text-align: left;
  }

  .brand__copy {
    max-width: 100%;
  }

  .menu-toggle {
    position: relative;
    align-self: start;
    margin-top: .25rem;
  }
}

/* Center the desktop identity above the bottom navigation row. */
@media (min-width: 1280px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    padding-top: 1rem;
  }

  .brand {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    flex-direction: column;
    gap: .5rem;
    text-align: center;
  }

  .brand__copy {
    text-align: center;
  }

  .primary-navigation {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
  }

  .header-appointment {
    grid-column: 3;
    grid-row: 2;
    justify-self: center;
  }

  .language-switcher {
    grid-column: 4;
    grid-row: 2;
    justify-self: center;
  }
}

/* Keep the expanded catalogue navigation in its centered desktop row. */
@media (min-width: 1280px) {
  .site-header__inner {
    column-gap: clamp(.75rem, 1vw, 1.25rem);
  }

  .primary-navigation .menu {
    gap: clamp(.75rem, 1.1vw, 1.25rem);
  }
}

/* Leave room for Impressions before the full desktop spacing becomes available. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .site-header .primary-navigation .menu {
    gap: .625rem;
  }

  .site-header .primary-navigation .menu > li > a,
  .site-header .site-header__inner > .header-appointment {
    font-size: .8125rem;
    letter-spacing: .12em;
  }
}

/* Keep the same navigation in one compact row after leaving the page top. */
.site-header.is-compact .site-header__inner {
  top: var(--header-collapse-distance, 0px);
}

.site-header.is-compact .brand__copy {
  display: none;
}

.site-header.is-compact .brand__logo {
  animation: compact-logo-appear 180ms ease-out both;
}

@keyframes compact-logo-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.is-compact .brand__logo {
    animation: none;
  }
}

@media (max-width: 1279px) {
  .site-header .primary-navigation {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--brand-cream);
  }
}

@media (min-width: 1280px) {
  .site-header.is-compact .site-header__inner {
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
    grid-template-rows: auto;
    min-height: 4.5rem;
    padding-block: 0;
  }

  .site-header.is-compact .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    gap: 0;
  }

  .site-header.is-compact .brand__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
  }

  .site-header.is-compact .primary-navigation {
    grid-column: 2;
    grid-row: 1;
  }

  .site-header.is-compact .header-appointment {
    grid-column: 3;
    grid-row: 1;
  }

  .site-header.is-compact .language-switcher {
    grid-column: 4;
    grid-row: 1;
  }
}

@media (max-width: 600px) {
  .site-header.is-compact .site-header__inner {
    padding-block: 0;
  }

  .site-header.is-compact .brand {
    grid-column: 1;
    flex-direction: row;
    gap: 0;
  }

  .site-header.is-compact .menu-toggle,
  .site-header.is-compact .language-switcher {
    align-self: center;
    margin-top: 0;
  }
}

/* The open burger panel spans the viewport; links keep their existing inset. */
@media (max-width: 1279px) {
  .site-header__inner.container {
    width: 100%;
    max-width: none;
    padding-inline: max(1.5rem, calc((100% - 76rem) / 2));
  }

  .site-header .primary-navigation {
    grid-area: auto;
    padding-inline: max(1.5rem, calc((100% - 76rem) / 2));
  }
}
