:root {
  --cie-header-open: 116px;
  --cie-header-small: 72px;
  scroll-padding-block-start: var(--cie-header-open);
}

:root:has([data-compact-header][data-compact]) {
  scroll-padding-block-start: var(--cie-header-small);
}

.compagnie-header-sticky {
  --cie-header-height: var(--cie-header-open);
  --cie-header-logo: clamp(76px, 12.8vw, 116px);
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  /* Réserver la hauteur initiale pour que la page ne saute pas au défilement. */
  min-block-size: var(--cie-header-open);
  pointer-events: none;
}

.compagnie-header-sticky[data-compact] {
  --cie-header-height: var(--cie-header-small);
  --cie-header-logo: 68px;
}

.compagnie-header-sticky > .theatre-header {
  position: relative;
  min-height: var(--cie-header-height);
  background-color: var(--cie-color-ink, #f7f4ee);
  pointer-events: auto;
  transition: min-height .24s ease, box-shadow .24s ease;
}

.compagnie-header-sticky[data-compact] > .theatre-header {
  box-shadow: 0 4px 12px rgb(0 0 0 / 14%);
}

.compagnie-header-sticky .theatre-brand {
  width: var(--cie-header-logo);
  transition: width .24s ease;
}

.skip {
  position: fixed;
  z-index: 11;
}

@media (max-width: 60rem) {
  :root { --cie-header-small: 56px; }
  .compagnie-header-sticky[data-compact] { --cie-header-logo: 50px; }

  .compagnie-header-sticky .theatre-header .site-menu-links {
    position: absolute;
    inset: 100% 0 auto;
    margin: 0;
    padding-inline: clamp(1rem, 5vw, 4.25rem);
    max-block-size: calc(100vh - var(--cie-header-height));
    max-block-size: calc(100dvh - var(--cie-header-height));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background-color: inherit;
    box-shadow: 0 4px 12px rgb(0 0 0 / 14%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .compagnie-header-sticky > .theatre-header,
  .compagnie-header-sticky .theatre-brand { transition: none; }
}
