/* Public navigation — mobile navigation, announcement bar, and shared public focus treatment. Keep this file linked in source order. */

/* Mobile festival nav */

.mobile-nav-toggle,
.mobile-nav-panel {
  display: none;
}

body.mobile-nav-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .nav-container,
  body:has(.event-page) .nav-container {
    top: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 0;
    z-index: 500;
  }

  .nav-bar,
  body:has(.event-page) .nav-bar {
    width: 100%;
    max-width: none;
    min-height: 64px;
    padding: 8px 10px;
    justify-content: space-between;
    border-radius: 31px;
    background:
      linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(255, 255, 255, 0.08)),
      rgba(18, 18, 22, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
      0 24px 70px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }

  .nav-links,
  .nav-ticket-btn {
    display: none;
  }

  .mobile-nav-toggle {
    width: 52px;
    height: 46px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #050505;
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.20),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
    cursor: pointer;
  }

  .mobile-nav-toggle span {
    width: 24px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
  }

  .nav-logo {
    width: auto;
    height: 46px;
    padding: 0 4px 0 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .nav-logo:hover {
    transform: none;
    background: transparent;
    border-color: transparent;
  }

  .logo-img,
  body:has(.event-page) .logo-img {
    height: 36px;
    max-width: 100px;
    filter: brightness(1.16) drop-shadow(0 0 18px rgba(255, 255, 255, 0.08));
  }

  .nav-container.is-open .nav-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
  }

  .mobile-nav-panel {
    position: fixed;
    inset: calc(env(safe-area-inset-top, 0px) + 12px) 14px auto;
    min-height: calc(100svh - env(safe-area-inset-top, 0px) - 24px);
    max-height: calc(100svh - env(safe-area-inset-top, 0px) - 24px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 18px 16px 24px;
    border-radius: 30px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
    overflow: hidden;
    background:
      radial-gradient(circle at 5% 0%, rgba(86, 32, 151, 0.78), transparent 44%),
      radial-gradient(circle at 94% 24%, rgba(var(--accent-rgb), 0.20), transparent 40%),
      linear-gradient(150deg, rgba(60, 20, 98, 0.96), rgba(164, 74, 62, 0.92) 54%, rgba(40, 14, 72, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      0 28px 90px rgba(0, 0, 0, 0.60),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    transition:
      opacity 0.22s ease,
      transform 0.22s ease;
  }

  .nav-container.is-open .mobile-nav-panel {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .mobile-nav-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 0 0 auto;
  }

  .mobile-nav-close {
    width: 52px;
    height: 48px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #050505;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    cursor: pointer;
  }

  .mobile-nav-close span {
    position: absolute;
    width: 28px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-nav-close span:first-child {
    transform: rotate(45deg);
  }

  .mobile-nav-close span:last-child {
    transform: rotate(-45deg);
  }

  .mobile-nav-brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 116px;
  }

  .mobile-nav-brand img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.18) drop-shadow(0 0 12px rgba(255, 255, 255, 0.10));
  }

  .mobile-nav-links {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(22px, 4.7svh, 44px);
    padding: 8px 0;
  }

  .mobile-nav-link {
    max-width: 100%;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(2.05rem, 9.6vw, 3.8rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
    overflow-wrap: anywhere;
  }

  .mobile-nav-link:active {
    transform: scale(0.98);
  }

  .mobile-nav-link.is-active,
  .mobile-nav-link[aria-current="page"] {
    color: #fff;
    text-shadow:
      0 0 20px rgba(255, 255, 255, 0.32),
      0 18px 36px rgba(0, 0, 0, 0.18);
  }

  .mobile-nav-link.is-active::after,
  .mobile-nav-link[aria-current="page"]::after {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: 11px auto 0;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.36);
  }

  .mobile-nav-cta {
    flex: 0 0 auto;
    min-height: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-on);
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 6vw, 2.35rem);
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow:
      0 18px 45px rgba(var(--accent-rgb), 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .mobile-nav-cta-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent-on);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 900;
  }

  body:has(.event-page) .event-page {
    padding-top: 92px;
  }

  .events-list-head {
    padding-top: 16px;
  }
}

@media (max-width: 390px) {
  .mobile-nav-panel {
    gap: 18px;
    padding: 18px 14px 20px;
  }

  .mobile-nav-links {
    gap: clamp(18px, 4svh, 32px);
  }

  .mobile-nav-cta {
    min-height: 68px;
  }
}

/* editable announcement bar */

body:has(.announcement-bar) {
  --announcement-offset: 36px;
}

.announcement-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 480;
  height: var(--announcement-offset, 32px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), transparent 26%, rgba(var(--accent-rgb), 0.08)),
    #050505;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.announcement-bar-track {
  height: 100%;
  width: max-content;
  min-width: 200%;
  display: flex;
  align-items: center;
  animation: announcementScroll 30s linear infinite;
}

.announcement-bar-item {
  height: 100%;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 0 20px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.18;
  text-transform: uppercase;
  white-space: nowrap;
}

.announcement-bar-item::after {
  content: "+";
  color: var(--accent);
  font-size: 1.05em;
}

.announcement-bar-item strong {
  color: var(--accent);
  font-weight: 900;
}

a.announcement-bar-item:hover {
  color: var(--accent);
}

body.light-mode .announcement-bar {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 26%, rgba(0, 0, 0, 0.06)),
    #f7f7f7;
  border-bottom-color: rgba(0, 0, 0, 0.10);
}

body:has(.announcement-bar) .nav-container,
body:has(.announcement-bar):has(.event-page) .nav-container,
body:has(.announcement-bar):has(main.teaser) .nav-container,
body:has(.announcement-bar):has(.not-found-page) .nav-container {
  top: var(--announcement-offset, 32px);
}

body:has(.announcement-bar) .info-page {
  padding-top: 144px;
}

body:has(.announcement-bar):has(.event-page) .event-page {
  padding-top: 120px;
}

body:has(.announcement-bar) .teaser {
  padding-top: 104px;
}

@keyframes announcementScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-bar-track {
    animation: none;
  }
}

@media (max-width: 640px) {
  body:has(.announcement-bar) {
    --announcement-offset: 34px;
  }

  .announcement-bar-item {
    gap: 8px;
    padding: 0 14px;
    font-size: 0.66rem;
  }

  body:has(.announcement-bar) .nav-container,
  body:has(.announcement-bar):has(.event-page) .nav-container,
  body:has(.announcement-bar):has(main.teaser) .nav-container,
  body:has(.announcement-bar):has(.not-found-page) .nav-container {
    top: var(--announcement-offset, 30px);
  }

  body:has(.announcement-bar) .mobile-nav-panel {
    inset: calc(var(--announcement-offset, 30px) + env(safe-area-inset-top, 0px) + 12px) 14px auto;
    min-height: calc(100svh - var(--announcement-offset, 30px) - env(safe-area-inset-top, 0px) - 24px);
    max-height: calc(100svh - var(--announcement-offset, 30px) - env(safe-area-inset-top, 0px) - 24px);
  }

  body:has(.announcement-bar) .info-page {
    padding-top: 132px;
  }

  body:has(.announcement-bar):has(.event-page) .event-page {
    padding-top: 122px;
  }
}

/* Keep a single, high-contrast keyboard focus treatment across public pages.
   This is intentionally late in the cascade so component focus resets cannot
   suppress it. */
:is(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
