/*
 * Festival Pro's palette and its festival menu, shared by Festival Pro, the artist and venue pages it
 * opens, and the festivals directory — which draws the menu itself so a festival slides in at once
 * instead of after Festival Pro has loaded (giggly-festival-directory-app.js). Every rule is under
 * html.fp-look-new. Load after giggly-festival-pro-look.css where both are on a page.
 */

html.fp-look-new.fp-look-new {
  --fp-look-bg: #07090c;
  --fp-look-card: #13171c;
  --fp-look-line: rgba(255, 255, 255, 0.1);
  --fp-look-text: #f4f6f7;
  --fp-look-muted: #a3adb4;
  --fp-look-accent: var(--fp-accent, #77aca2);
  --fp-look-photo: #1c2229;
  --fp-look-chip: rgba(255, 255, 255, 0.08);
  --fp-look-chip-border: rgba(255, 255, 255, 0.35);
  --fp-look-scheme: dark;
}

/* Day mode: the same layout on paper. The accent is darkened where it is read as text. */
html.fp-look-new.fp-look-day.fp-look-day {
  --fp-look-bg: #f5f5f2;
  --fp-look-card: #ffffff;
  --fp-look-line: rgba(3, 25, 38, 0.12);
  --fp-look-text: #0b0f14;
  --fp-look-muted: #56616a;
  --fp-look-photo: #e2e5e7;
  --fp-look-chip: rgba(3, 25, 38, 0.06);
  --fp-look-chip-border: rgba(3, 25, 38, 0.3);
  --fp-look-scheme: light;
}

html.fp-look-new.fp-look-day.fp-look-day {
  --fp-look-bg: #e7e8e3;
  --fp-look-card-shadow: 0 1px 2px rgba(3, 25, 38, 0.08), 0 6px 18px rgba(3, 25, 38, 0.1);
}

/* ---------- The festival menu ----------
 * The festival's home: big rows, one per tab. The footer is only the way out of the festival. */

html.fp-look-new #festivalProFooter > .festival-pro-footer__btn {
  display: none !important;
}

html.fp-look-new #festivalProFooter {
  justify-content: center;
  align-items: center;
  background: var(--fp-look-bg) !important;
  border-top: 1px solid var(--fp-look-line);
}

/* Exit pill is taller than the old tab row; keep controls parked above it. */
html.fp-look-new body.festival-pro-page {
  --fp-footer-h: 72px;
}

html.fp-look-new .fp-look-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 28px);
  min-height: 48px;
  margin: 6px 14px;
  padding: 0 18px;
  border: 1px solid var(--fp-look-line);
  border-radius: 999px;
  background: var(--fp-look-card);
  color: var(--fp-look-text);
  font: inherit;
  font-family: 'League Spartan', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

html.fp-look-new .fp-look-exit svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--fp-look-accent);
}

html.fp-look-new .fp-look-menu {
  position: fixed;
  inset: 0;
  z-index: 100025;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--fp-look-bg);
  color: var(--fp-look-text);
  color-scheme: var(--fp-look-scheme);
  /*
   * Real inset only. A 47px floor sat the menu under a blank band whenever env() was 0
   * (Safari tab, and the first frames of a cold launch before the persisted inset arrives).
   * The installed app still clears the clock via env() or --giggly-sat-fallback.
   */
  padding-top: max(env(safe-area-inset-top, 0px), var(--giggly-sat-fallback, 0px));
  padding-bottom: 0;
  box-sizing: border-box;
}

/* Same inset signed out. Kept so a guest override cannot bring the 47px band back. */
html.fp-look-new.giggly-guest-mode .fp-look-menu {
  padding-top: max(env(safe-area-inset-top, 0px), var(--giggly-sat-fallback, 0px));
}

html.fp-look-new .fp-look-menu[hidden] {
  display: none !important;
}

html.fp-look-new.fp-look-menu-open,
html.fp-look-new.fp-look-menu-open body {
  overflow: hidden;
}

/*
 * While the menu owns the screen, kill the tab chrome underneath. A translucent cover or a late
 * paint of Artists still showed through the hand-off from the directory slide on Neighbourhood and
 * Pitchfork (Mutations' photo hid most of it).
 */
html.fp-look-new.fp-look-menu-open #festivalProApp {
  visibility: hidden !important;
}

html.fp-look-new .fp-look-menu__head {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 18px 18px;
  box-sizing: border-box;
  border-bottom: 3px solid var(--fp-look-accent);
}

html.fp-look-new .fp-look-menu__icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 14px;
  overflow: hidden;
}

html.fp-look-new .fp-look-menu__icon:empty {
  display: none;
}

/*
 * The festival topbar icon is circular (`.festival-pro-topbar__fest-icon-img`). headHtml copies
 * that markup into the menu, so without this the land cover's plain square img snaps to a circle
 * the moment the festival finishes loading.
 */
html.fp-look-new .fp-look-menu__icon img,
html.fp-look-new .fp-look-menu__icon .festival-pro-topbar__fest-icon-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  object-fit: cover;
  display: block;
}

html.fp-look-new .fp-look-menu__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding-top: 0.12em;
  font-family: 'League Spartan', system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

html.fp-look-new .fp-look-menu__theme {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--fp-look-line);
  border-radius: 50%;
  background: var(--fp-look-card);
  color: var(--fp-look-text);
  cursor: pointer;
}

html.fp-look-new .fp-look-menu__theme svg {
  width: 22px;
  height: 22px;
}

/* Only the list scrolls. With the whole menu scrolling, iOS rubber-banding dragged the bottom bar
 * up with the content and dropped it back. */
html.fp-look-new .fp-look-menu__list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

html.fp-look-new .fp-look-menu__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 18px 15px;
  border: 0;
  border-bottom: 1px solid var(--fp-look-line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

html.fp-look-new .fp-look-menu__item:active {
  background: var(--fp-look-card);
}

html.fp-look-new .fp-look-menu__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

html.fp-look-new .fp-look-menu__label {
  font-family: 'League Spartan', system-ui, sans-serif;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 0.95;
  padding-top: 0.08em;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

html.fp-look-new .fp-look-menu__item.is-current .fp-look-menu__label {
  color: var(--fp-look-accent);
}

html.fp-look-new .fp-look-menu__sub {
  font-size: 1rem;
  color: var(--fp-look-muted);
}

html.fp-look-new .fp-look-menu__chev {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--fp-look-accent);
}

html.fp-look-new .fp-look-menu__chev svg {
  width: 100%;
  height: 100%;
}

/* Outside the scrolling list, so it holds still at the bottom and the way out is always there. */
html.fp-look-new .fp-look-menu__foot {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 0 max(34px, env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  background: color-mix(in srgb, var(--fp-look-bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--fp-look-line);
  /* Foot size must not depend on late credit/list paints or the Back button jumps. */
  min-height: calc(48px + 16px + max(34px, env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
  align-items: center;
}

/* A crowd photo behind the menu. The list scrolls inside it, so the photo holds still under the
 * list. Washed dark at night, pale by day. */
html.fp-look-new .fp-look-menu--photo.fp-look-menu--photo {
  --fp-look-line: rgba(255, 255, 255, 0.16);
  background: #031926;
  color: #fff;
  color-scheme: dark;
}

/*
 * The photo is an <img decoding="sync">, not a CSS background. A background image is decoded off
 * the first frame, so the new document painted the menu bare for a frame and then the crowd —
 * a flicker on Mutations alone, the one festival with a photo.
 */
html.fp-look-new .fp-look-menu__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
  pointer-events: none;
}

html.fp-look-new .fp-look-menu--photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 12, 20, 0.5) 0%, rgba(3, 12, 20, 0.6) 45%, rgba(3, 12, 20, 0.88) 100%);
}

html.fp-look-new .fp-look-menu--photo > :not(.fp-look-menu__photo) {
  position: relative;
  z-index: 2;
}

html.fp-look-new .fp-look-menu--photo .fp-look-menu__title,
html.fp-look-new .fp-look-menu--photo .fp-look-menu__label {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

html.fp-look-new .fp-look-menu--photo .fp-look-menu__sub {
  color: rgba(255, 255, 255, 0.78);
}

html.fp-look-new .fp-look-menu--photo .fp-look-menu__item:active {
  background: rgba(255, 255, 255, 0.08);
}

html.fp-look-new .fp-look-menu--photo .fp-look-menu__theme {
  background: rgba(3, 12, 20, 0.55);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

html.fp-look-new .fp-look-menu--photo .fp-look-menu__foot {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(3, 12, 20, 0.72);
  min-height: calc(48px + 20px + 1.2em + max(34px, env(safe-area-inset-bottom, 0px)));
}

html.fp-look-new.fp-look-day .fp-look-menu--photo .fp-look-menu__foot {
  background: rgba(255, 255, 255, 0.82);
}

/*
 * The credit inherited the page's own font and link styles, which differ between the festivals
 * directory (where the cover is drawn) and Festival Pro, so it was the one thing that redrew on
 * landing. Pin everything it would otherwise inherit.
 */
html.fp-look-new .fp-look-menu__credit {
  margin: 0;
  font-family: 'League Spartan', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
  color: rgba(255, 255, 255, 0.7);
  transition: none;
}

html.fp-look-new .fp-look-menu__credit a {
  font: inherit;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: none;
  opacity: 1;
}

/* Day: the same photo under a pale wash, so the menu matches the light pages it opens. */
html.fp-look-new.fp-look-day .fp-look-menu--photo.fp-look-menu--photo {
  --fp-look-line: rgba(3, 25, 38, 0.14);
  background: #ffffff;
  color: #031926;
  color-scheme: light;
}

html.fp-look-new.fp-look-day .fp-look-menu--photo::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.8) 45%, rgba(255, 255, 255, 0.94) 100%);
}

html.fp-look-new.fp-look-day .fp-look-menu--photo .fp-look-menu__title,
html.fp-look-new.fp-look-day .fp-look-menu--photo .fp-look-menu__label {
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.7);
}

html.fp-look-new.fp-look-day .fp-look-menu--photo .fp-look-menu__sub {
  color: rgba(3, 25, 38, 0.72);
}

html.fp-look-new.fp-look-day .fp-look-menu--photo .fp-look-menu__item:active {
  background: rgba(3, 25, 38, 0.06);
}

html.fp-look-new.fp-look-day .fp-look-menu--photo .fp-look-menu__theme {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(3, 25, 38, 0.2);
  color: #031926;
}

html.fp-look-new.fp-look-day .fp-look-menu__credit {
  color: rgba(3, 25, 38, 0.6);
}

html.fp-look-new.fp-look-day .fp-look-menu__credit a {
  color: #031926;
}

html.fp-look-new.fp-look-day.fp-look-day .fp-look-menu--photo .fp-look-menu__item.is-current .fp-look-menu__label,
html.fp-look-new.fp-look-day.fp-look-day .fp-look-menu--photo .fp-look-menu__chev {
  color: color-mix(in srgb, var(--fp-look-accent) 70%, #031926);
}

/* A dark accent would vanish on the night menu, and a pale one on the day menu. */
html.fp-look-new.fp-look-day.fp-look-day .fp-look-menu__item.is-current .fp-look-menu__label,
html.fp-look-new.fp-look-day.fp-look-day .fp-look-menu__chev {
  color: color-mix(in srgb, var(--fp-look-accent) 70%, #031926);
}

/* The directory's stand-in for the menu while Festival Pro loads: the real one replaces it. */
html.fp-look-new .fp-look-menu--cover {
  pointer-events: none;
}

/* Menu to page and back (and the directory sliding the menu in over itself): the page slides in over the menu from the right, and back slides it away
 * to the right to uncover the menu. The menu's picture holds still under it. */
@keyframes fp-look-page-in {
  from {
    transform: translateX(100%);
  }
}

@keyframes fp-look-page-out {
  to {
    transform: translateX(100%);
  }
}

html.fp-look-slide-in::view-transition-old(root),
html.fp-look-slide-out::view-transition-new(root) {
  animation: none;
}

html.fp-look-slide-in::view-transition-new(root) {
  animation: fp-look-page-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.35);
}

html.fp-look-slide-out::view-transition-old(root) {
  z-index: 1;
  animation: fp-look-page-out 280ms cubic-bezier(0.4, 0, 0.7, 1) both;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.35);
}

/*
 * "More below" arrow (giggly-scroll-more.js): a 44px round dark glass button, chevron and ring in
 * the accent colour (teal on Festivals, the festival's own colour on its menu), with a fade along
 * the bottom edge of the list. Sits above the bottom bar, or above Back to Giggly Events on the menu,
 * which itself is z-index 100025.
 */
.gg-more-arrow {
  --gg-more-accent: var(--fp-look-accent, var(--fdl-accent, #77aca2));
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-bar-height, 68px) + env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 100030;
  width: 44px;
  height: 44px;
  margin: 0 0 0 -22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--gg-more-accent);
  background: rgba(10, 14, 20, 0.62);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  color: var(--gg-more-accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: gg-more-bob 1.8s ease-in-out infinite;
  transition: opacity 0.2s ease;
}
.gg-more-arrow[hidden] {
  display: none !important;
}
.gg-more-arrow--inline {
  position: absolute;
  bottom: calc(100% + 10px);
}
.gg-more-fade {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-bar-height, 68px) + env(safe-area-inset-bottom, 0px));
  height: 72px;
  z-index: 100029;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--fp-look-bg, var(--fdl-bg, #07090c)));
}
.gg-more-fade--inline {
  position: absolute;
  bottom: 100%;
  height: 64px;
}
.gg-more-fade[hidden] {
  display: none !important;
}
@keyframes gg-more-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .gg-more-arrow { animation: none; }
}
@media (min-width: 900px) {
  html.giggly-desktop-nav-active .gg-more-arrow--fixed,
  html.giggly-desktop-nav-active .gg-more-fade--fixed { display: none !important; }
}
