/* Shared single-row header. Navigation and social links are in the footer. */
:root {
  --site-header-height: 72px;
}

html {
  scroll-padding-top: calc(var(--site-header-height) + 16px);
}

.site-header {
  display: block;
  position: sticky;
  inset: 0 0 auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 80;
}

/* Only the background fades: blur builds toward the top while controls stay crisp. */
.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-header::before {
  background: linear-gradient(to bottom, #ffffffad, #ffffff3d 55%, #ffffff00);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
}

.site-header::after {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(to bottom, #000 5%, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, #000 5%, transparent 80%);
}

.header-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 7px 36px;
}

.festival-brand {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  flex-shrink: 0;
  color: var(--ink);
}

.festival-brand img {
  display: block;
  width: 80px;
  height: auto;
  mix-blend-mode: normal;
}

.festival-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.festival-university {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.06em;
}

.festival-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34em;
  font-size: 23px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.015em;
}

.site-header .festival-university,
.site-header .festival-title {
  color: var(--ink);
  font-weight: 700;
}

.site-header .festival-edition strong {
  font-weight: inherit;
}

.festival-edition strong {
  display: inline-block;
  font-size: 1.32em;
  letter-spacing: -0.035em;
  margin: 0 0.035em;
}

.site-header .header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

/* The open menu continues through the header; closed-page glass is unchanged. */
body.menu-open .site-header {
  background: #1c3daa;
}

body.menu-open .site-header::before,
body.menu-open .site-header::after {
  display: none;
}

body.menu-open .site-header .festival-university,
body.menu-open .site-header .festival-title {
  color: #fff;
}

body.menu-open .site-header .festival-brand img {
  background: transparent;
}

body.menu-open .site-header .menu-toggle {
  background: var(--ink);
  color: #fff;
  border: 0;
}

body.menu-open .site-header .menu-toggle:focus-visible {
  outline-color: #fff;
}

.js-ready .site-menu {
  inset: var(--site-header-height) 0 0;
}

/* Keep the menu out of the first paint while the deferred navigation script loads.
   The footer still provides navigation when JavaScript is unavailable. */
html:not(.js-ready) .site-menu {
  display: none;
}

/* Navigation and history restoration close immediately; manual toggles still animate. */
body.menu-resetting .site-menu,
body.menu-resetting .site-menu *,
body.menu-resetting .menu-bars > span {
  transition: none;
}

.calendar-controls {
  top: var(--site-header-height);
}

/* The calendar script also measures the header for its nested sticky headings.
   Map drawings and place lists use their own scroll areas and need no offset. */
.event-story {
  scroll-margin-top: 0;
}

@media (max-width: 760px) {
  :root {
    --site-header-height: 58px;
  }

  .header-top {
    min-height: 58px;
    gap: 10px;
    padding: 7px 14px;
  }

  .festival-brand {
    gap: 9px;
  }

  .festival-brand img {
    width: 58px;
  }

  .festival-title {
    font-size: 16px;
    gap: 0.24em;
  }

  .festival-university {
    font-size: 9px;
  }

  .site-header .header-tools {
    gap: 12px;
  }

  .js-ready .site-header .menu-toggle {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 360px) {
  .festival-brand img {
    width: 52px;
  }

  .festival-title {
    font-size: 15px;
  }
}

@media print {
  .site-header {
    position: static;
  }
  .site-header::before,
  .site-header::after,
  .site-header .header-tools {
    display: none;
  }
}
