/* ================================================================
   EOF Topbar — gemeinsame Header-Styles für alle Seiten
   ================================================================ */

@font-face {
  font-family: "UnifrakturCook";
  src: url("Schriften/UnifrakturCook-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --eof-upperbox-heading-font: "UnifrakturCook", "Old English Text MT", "Lucida Blackletter", serif;
}

.countdown-welcome > h1,
.hero-left > h1,
.hero-panel h1 {
  font-family: var(--eof-upperbox-heading-font);
  font-weight: 700;
  letter-spacing: 0;
}

/* ——— Layout ——— */

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 14px 5vw;
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.95), rgba(10, 14, 28, 0.8));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  position: relative;
}

.topbar-home {
  justify-self: center;
}

.topbar-wordmark {
  justify-self: end;
  margin-right: 10px;
  position: relative;
  width: min(340px, 36vw);
  max-width: 340px;
  padding: 4px 0 8px;
  overflow: visible;
  pointer-events: auto;
  animation: none !important;
}

.topbar-wordmark::after {
  display: none;
}

.topbar-wordmark img {
  display: block;
  width: 100%;
  height: auto;
  margin-left: auto;
  object-fit: contain;
  transform: none;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: repeating-linear-gradient(
    45deg,
    rgba(31, 78, 216, 0.9) 0 12px,
    rgba(233, 241, 255, 0.9) 12px 24px
  );
  opacity: 0.85;
}

.topbar-logo {
  height: 88px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

/* ——— Navigation ——— */

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 100%;
}

.topbar-item-mega {
  position: relative;
  display: inline-flex;
}

.topbar-root-trigger {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.topbar-mega {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

.topbar-link {
  color: #dfe9ff;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0.92;
  transition: color 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar-link:hover {
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: rgba(255, 204, 112, 0.75);
}

.topbar-link:focus-visible {
  outline: 2px solid rgba(255, 223, 154, 0.58);
  outline-offset: 4px;
  border-radius: 6px;
}

.topbar-link.active {
  color: #ffdf9a;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: rgba(255, 223, 154, 0.95);
}

/* ——— Tickets-Button (golden) — Vorlage für alle Pill-Buttons ——— */

.topbar-ticket {
  margin-left: auto;
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 9px 16px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 223, 154, 0.95);
  background: linear-gradient(145deg, #f9d58b, #d5a84a);
  color: #1a1309 !important;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(213, 168, 74, 0.35);
  text-decoration: none !important;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, filter 0.24s ease;
}

.topbar-ticket::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -70%;
  width: 44%;
  height: 340%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  transform: rotate(18deg);
  opacity: 0;
  pointer-events: none;
  animation: ticketFlashSweep 7.5s ease-in-out infinite;
}

.topbar-ticket:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(213, 168, 74, 0.42);
  filter: brightness(1.04);
  color: #1a1309;
  text-decoration: none;
}

.topbar-ticket:focus-visible {
  outline: 2px solid rgba(255, 223, 154, 0.85);
  outline-offset: 4px;
}

.topbar-ticket.active {
  color: #1a1309 !important;
  opacity: 1;
  text-decoration: none !important;
  background: linear-gradient(145deg, #f9d58b, #d5a84a) !important;
  border-color: rgba(255, 223, 154, 1) !important;
}

/* ——— EOF-Shuttle-Button (dunkel) ——— */

.topbar-shuttle-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 9px 16px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(214, 228, 254, 0.34);
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.96), rgba(10, 14, 28, 0.88));
  color: #f4f8ff !important;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(7, 10, 20, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-decoration: none !important;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, filter 0.24s ease;
}

.topbar-shuttle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(7, 10, 20, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  filter: brightness(1.05);
  color: #f4f8ff;
  text-decoration: none;
}

.topbar-shuttle-btn:focus-visible {
  outline: 2px solid rgba(214, 228, 254, 0.62);
  outline-offset: 4px;
}

.topbar-shuttle-btn.active {
  color: #f4f8ff !important;
  opacity: 1;
  text-decoration: none !important;
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.96), rgba(10, 14, 28, 0.88)) !important;
  border-color: rgba(214, 228, 254, 0.46) !important;
}

/* ——— Menü-Button (desktop, blau-dunkel) ——— */

.topbar-menu-desktop-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(233, 241, 255, 0.3);
  background: rgba(14, 29, 70, 0.78);
  color: #e8efff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(9, 18, 44, 0.34);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), border-color 320ms ease, background-color 320ms ease, box-shadow 320ms ease, color 320ms ease;
}

.topbar-menu-desktop-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 223, 154, 0.58);
  background: rgba(21, 40, 92, 0.9);
  box-shadow: 0 12px 28px rgba(9, 18, 44, 0.42);
  color: #ffffff;
}

.topbar-menu-desktop-btn:focus-visible {
  outline: 2px solid rgba(255, 223, 154, 0.7);
  outline-offset: 4px;
}

/* ——— Desktop-Nav-Leiste ——— */

.topbar-links-rail {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ——— Hamburger-Button (mobil) ——— */

.topbar-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(233, 241, 255, 0.24);
  background: rgba(18, 32, 76, 0.6);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  justify-self: end;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.24s ease, background-color 0.24s ease;
}

.topbar-menu-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 223, 154, 0.58);
  background: rgba(21, 38, 88, 0.74);
}

.topbar-menu-btn:focus-visible {
  outline: 2px solid rgba(255, 223, 154, 0.58);
  outline-offset: 4px;
}

.topbar-menu-btn span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #eaf2ff;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.topbar.menu-open .topbar-menu-btn span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.topbar.menu-open .topbar-menu-btn span:nth-child(2) {
  opacity: 0;
}

.topbar.menu-open .topbar-menu-btn span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ——— Keyframes ——— */

@keyframes ticketFlashSweep {
  0%, 72%, 100% {
    opacity: 0;
    transform: translateX(-180%) rotate(18deg);
  }
  78%, 85% {
    opacity: 1;
    transform: translateX(260%) rotate(18deg);
  }
}

@keyframes wordmarkWrite {
  0%   { clip-path: inset(-12% 100% -22% 0); }
  100% { clip-path: inset(-12% 0   -22% 0); }
}

/* ================================================================
   Desktop (≥ 1241 px)
   ================================================================ */

@media (min-width: 1241px) {

  /* Alle drei Pill-Buttons: gleiche Größe wie Tickets-Button */
  .topbar .topbar-menu-desktop-btn,
  .topbar .topbar-shuttle-btn,
  .topbar .topbar-ticket {
    height: 32px !important;
    min-width: 100px !important;
    padding: 0 16px !important;
    font-size: 0.86rem !important;
    box-sizing: border-box;
    justify-content: center;
    line-height: 1 !important;
  }

  .topbar .topbar-home,
  .topbar .topbar-wordmark {
    transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1), transform 620ms cubic-bezier(0.22, 1, 0.36, 1), max-width 620ms cubic-bezier(0.22, 1, 0.36, 1), margin 620ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .topbar.desktop-menu-open .topbar-home,
  .topbar.desktop-menu-open .topbar-wordmark {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
  }

  .topbar .topbar-wordmark {
    transform-origin: right center;
  }

  .topbar .topbar-nav {
    width: auto;
    gap: 4px;
  }

  .topbar .topbar-ticket {
    margin-left: 0;
  }

  .topbar .topbar-links-rail {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(18px);
    transition: max-width 700ms cubic-bezier(0.22, 1, 0.36, 1), opacity 520ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .topbar:not(.desktop-menu-open) .topbar-links-rail {
    margin-right: -12px;
  }

  .topbar .topbar-links-rail {
    pointer-events: none;
  }

  .topbar .topbar-links-rail .topbar-link {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 420ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .topbar.desktop-menu-open .topbar-links-rail {
    max-width: 1200px;
    opacity: 1;
    transform: translateX(0);
  }

  .topbar.desktop-menu-open .topbar-links-rail {
    pointer-events: auto;
  }

  .topbar.desktop-menu-open .topbar-links-rail .topbar-link {
    opacity: 1;
    transform: none;
  }

  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(1) { transition-delay: 40ms; }
  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(2) { transition-delay: 80ms; }
  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(3) { transition-delay: 120ms; }
  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(4) { transition-delay: 160ms; }
  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(5) { transition-delay: 200ms; }
  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(6) { transition-delay: 240ms; }
  .topbar.desktop-menu-open .topbar-links-rail .topbar-link:nth-child(7) { transition-delay: 280ms; }
}

/* ================================================================
   Unter 1241 px: Desktop-Elemente ausblenden
   ================================================================ */

@media (max-width: 1240px) {
  .topbar-menu-desktop-btn {
    display: none;
  }

  .topbar-links-rail {
    display: contents;
  }
}

/* ================================================================
   Mobiles Dropdown-Menü (≤ 1240 px)
   ================================================================ */

@media (max-width: 1240px) {
  .topbar-wordmark {
    display: none;
  }

  .topbar-shell {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .topbar-home {
    justify-self: center;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .topbar-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(330px, 92vw);
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(11, 18, 36, 0.96), rgba(10, 14, 28, 0.92));
    box-shadow: 0 16px 34px rgba(7, 10, 20, 0.55);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 20;
  }

  .topbar.menu-open .topbar-nav {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .topbar-nav .topbar-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
  }

  .topbar-nav .topbar-link:hover {
    text-decoration: none;
    transform: none;
    background: rgba(255, 255, 255, 0.08);
  }

  .topbar-nav .topbar-link.active {
    text-decoration: none;
    background: rgba(255, 223, 154, 0.14);
  }

  .topbar-nav .topbar-link.topbar-shuttle-btn {
    display: none !important;
  }

  .topbar-nav .topbar-link.topbar-ticket {
    margin-left: 0 !important;
    display: inline-flex !important;
    width: auto !important;
    max-width: max-content !important;
    flex: 0 0 auto !important;
    white-space: nowrap;
    justify-content: center;
  }
}

/* ================================================================
   Tablet (≤ 900 px): Wordmark ausblenden
   ================================================================ */

@media (max-width: 900px) {
  .topbar-wordmark {
    display: none;
  }
}

/* ================================================================
   Mobil (≤ 700 px)
   ================================================================ */

@media (max-width: 700px) {
  .topbar {
    padding: 10px 4vw;
  }

  .topbar-shell {
    gap: 10px;
  }

  .topbar-logo {
    height: 68px;
  }

  .topbar-nav {
    gap: 14px;
  }

  .topbar-link {
    font-size: 0.9rem;
  }
}

/* ================================================================
   Reduzierte Bewegung
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  .topbar-wordmark {
    animation: none;
  }

  .topbar-wordmark::after {
    display: none;
  }

  .topbar-ticket::after {
    animation: none;
  }
}
