/*
 * The festivals directory in Festival Pro's new look. Rules for the look are under html.fp-look-new
 * (set by giggly-fp-look.js before the first paint); the design switch is styled in both looks,
 * because it is how the old look gets back to the new one.
 */

/* A festival opened from here slides in from the right; coming back slides it away again. */
@view-transition {
  navigation: auto;
}

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

html.fp-look-xdoc-out::view-transition-new(root) {
  animation: none;
}

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

/* ---------- Use new Festival Pro design ---------- */

.festivals-look-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 28px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border, rgba(3, 25, 38, 0.14));
  background: var(--bg, #fff);
  color: var(--text, #031926);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.festivals-look-toggle__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.festivals-look-toggle__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.festivals-look-toggle__track {
  position: relative;
  flex: 0 0 auto;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.32);
  transition: background-color 0.2s ease;
}

.festivals-look-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.festivals-look-toggle__input:checked + .festivals-look-toggle__track {
  background: #34c759;
}

.festivals-look-toggle__input:checked + .festivals-look-toggle__track .festivals-look-toggle__thumb {
  transform: translateX(20px);
}

.festivals-look-toggle__input:focus-visible + .festivals-look-toggle__track {
  outline: 2px solid #34c759;
  outline-offset: 2px;
}

.festivals-look-toggle[hidden] {
  display: none;
}

.festivals-look-toggle:has(+ .festivals-look-toggle:not([hidden])) {
  margin-bottom: 10px;
}

.festivals-directory-past {
  margin-top: 4px;
}

.festivals-directory-past[hidden] {
  display: none;
}

/* ---------- New look ---------- */

html.fp-look-new.fp-look-new {
  --fdl-bg: #07090c;
  --fdl-card: #13171c;
  --fdl-line: rgba(255, 255, 255, 0.1);
  --fdl-text: #f4f6f7;
  --fdl-muted: #a3adb4;
}

html.fp-look-new.fp-look-day.fp-look-day {
  --fdl-bg: #f5f5f2;
  --fdl-card: #ffffff;
  --fdl-line: rgba(3, 25, 38, 0.12);
  --fdl-text: #0b0f14;
  --fdl-muted: #56616a;
}

html.fp-look-new,
html.fp-look-new body.festivals-channels-directory-page {
  background: var(--fdl-bg) !important;
}

html.fp-look-new body.festivals-channels-directory-page {
  --bg: var(--fdl-card);
  --text: var(--fdl-text);
  --border: var(--fdl-line);
  color: var(--fdl-text);
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__scroll-body,
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__list-canvas,
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__intro {
  padding: 26px 18px 14px;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__title {
  font-family: 'League Spartan', system-ui, sans-serif;
  font-size: calc(3rem * var(--giggly-dir-card-type-scale, 1)) !important;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

/* The crowd photo sits behind the top of the list: sharp at the top, blurring as it goes down,
   then gone into the page colour. Both layers scroll with the cards. */
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__scroll-body {
  position: relative;
  isolation: isolate;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__scroll-body::before,
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__scroll-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1100px;
  z-index: -1;
  background-image:
    linear-gradient(180deg, rgba(7, 9, 12, 0.35) 0%, rgba(7, 9, 12, 0.5) 45%, var(--fdl-bg) 100%),
    url('/img/festivals/festivals-crowd.jpg?v=20261014-fest-crowd-v1');
  background-size: 100% 100%, cover;
  background-position: center top, center top;
  background-repeat: no-repeat;
  pointer-events: none;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__scroll-body::before {
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 22%, transparent 52%);
  mask-image: linear-gradient(180deg, #000 0%, #000 22%, transparent 52%);
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-page__scroll-body::after {
  filter: blur(22px) saturate(1.2);
  -webkit-mask-image: linear-gradient(180deg, transparent 14%, #000 42%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 14%, #000 42%, #000 70%, transparent 100%);
}

html.fp-look-new.fp-look-day body.festivals-channels-directory-page .promoter-channels-page__scroll-body::before,
html.fp-look-new.fp-look-day body.festivals-channels-directory-page .promoter-channels-page__scroll-body::after {
  background-image:
    linear-gradient(180deg, rgba(7, 9, 12, 0.3) 0%, rgba(245, 245, 242, 0.35) 50%, var(--fdl-bg) 100%),
    url('/img/festivals/festivals-crowd.jpg?v=20261014-fest-crowd-v1');
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list {
  padding: 6px 8px 0 !important;
  margin: 0;
  background: transparent !important;
}

@keyframes fdl-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item {
  list-style: none;
  margin: 0 0 14px !important;
  animation: fdl-rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item:nth-child(2) { animation-delay: 55ms; }
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item:nth-child(3) { animation-delay: 110ms; }
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item:nth-child(4) { animation-delay: 165ms; }
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item:nth-child(5) { animation-delay: 220ms; }
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item:nth-child(n + 6) { animation-delay: 275ms; }

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__divider {
  display: none !important;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__rowwrap {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  border-radius: 20px;
  background: color-mix(in srgb, var(--fdl-card) 72%, transparent) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.18s ease;
}

html.fp-look-new.fp-look-day body.festivals-channels-directory-page .promoter-channels-list__rowwrap {
  background: color-mix(in srgb, var(--fdl-card) 84%, transparent) !important;
  border-color: var(--fdl-line) !important;
  box-shadow: 0 8px 24px rgba(3, 25, 38, 0.14) !important;
}

/* The festival's own artwork, blurred behind its card, and its colour along the edge. */
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__rowwrap::before {
  content: '';
  position: absolute;
  inset: -30%;
  z-index: -1;
  background-image: var(--fdl-art, none);
  background-size: cover;
  background-position: center;
  filter: blur(30px) saturate(1.5);
  opacity: 0.42;
  pointer-events: none;
}

html.fp-look-new.fp-look-day body.festivals-channels-directory-page .promoter-channels-list__rowwrap::before {
  opacity: 0.22;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__rowwrap::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--fdl-accent, #77aca2);
  pointer-events: none;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__rowwrap:active {
  transform: scale(0.98);
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__row {
  position: relative;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  min-height: 124px;
  height: auto !important;
  max-height: none !important;
  padding: 16px !important;
  background: transparent !important;
  box-sizing: border-box;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__row::after {
  display: none;
}

html.fp-look-new body.festivals-channels-directory-page .giggly-fd-selecting .promoter-channels-list__row::after,
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__row.gfd-has-badge::after {
  display: none;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__avatar-wrap {
  flex: 0 0 auto;
  width: 88px !important;
  height: 88px !important;
  min-width: 88px !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__avatar-img,
html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__avatar-fallback {
  width: 100% !important;
  height: 100% !important;
  border-radius: 14px !important;
  object-fit: cover;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__content {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__name {
  font-family: 'League Spartan', system-ui, sans-serif !important;
  font-size: calc(1.45rem * var(--giggly-dir-card-type-scale, 1)) !important;
  font-weight: 600 !important;
  line-height: 1.02 !important;
  padding-top: 0.12em;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--fdl-text) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  display: block !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__genres {
  font-family: 'League Spartan', system-ui, sans-serif !important;
  font-size: calc(1rem * var(--giggly-dir-card-type-scale, 1)) !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--fdl-accent, #77aca2) !important;
  white-space: normal !important;
}

html.fp-look-new.fp-look-day body.festivals-channels-directory-page .promoter-channels-list__genres {
  color: color-mix(in srgb, var(--fdl-accent, #468189) 70%, #031926) !important;
}

html.gfd2-phone-list.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__row {
  min-height: 0 !important;
  padding: 8px 8px 8px 10px !important;
  gap: 10px !important;
}
html.gfd2-phone-list.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__avatar-wrap {
  flex: 0 0 80px !important;
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  height: 100px !important;
  min-height: 100px !important;
  max-height: 100px !important;
  border-radius: 8px !important;
}
html.gfd2-phone-list.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__name {
  font-size: 1.25rem !important;
}
html.gfd2-phone-list.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__genres,
html.gfd2-phone-list.fp-look-new body.festivals-channels-directory-page .festivals-directory-list__location {
  font-size: 1rem !important;
}

html.fp-look-new body.festivals-channels-directory-page .festivals-directory-list__location {
  font-family: 'League Spartan', system-ui, sans-serif !important;
  font-size: calc(0.9rem * var(--giggly-dir-card-type-scale, 1)) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fdl-muted) !important;
}

html.fp-look-new body.festivals-channels-directory-page .festivals-directory-list__past-head {
  margin: 12px 18px 14px;
  font-family: 'League Spartan', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  color: var(--fdl-text);
}

html.fp-look-new body.festivals-channels-directory-page .festivals-directory-past .promoter-channels-list__rowwrap {
  opacity: 0.72;
}

html.fp-look-new body.festivals-channels-directory-page #gigglyFestivalDownloadCard,
html.fp-look-new body.festivals-channels-directory-page .festivals-look-toggle {
  margin-left: 14px;
  margin-right: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html.fp-look-new body.festivals-channels-directory-page .promoter-channels-list__item {
    animation: none;
  }
}
