/* Promo popup (includes/promo-popup.php, assets/js/promo-popup.js): a dark
   design system panel over a dimmed page. Logical properties keep it right for
   RTL without a mirror rule. Only the four Breakdance breakpoints are used. */

html.pi-promo-open {
  overflow: hidden;
}

.pi-promo {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.pi-promo[hidden] {
  display: none;
}

.pi-promo__backdrop {
  position: absolute;
  inset: 0;
  background-color: oklch(0.16 0.02 152 / 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pi-promo__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--pi-ink);
  border: 1px solid var(--pi-line-dark, oklch(0.32 0.02 150));
  border-radius: var(--pi-radius-lg);
  box-shadow: 0 40px 90px -30px oklch(0.10 0.02 152 / 0.8);
  color: var(--pi-on-dark);
}

.pi-promo__close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background-color: oklch(0.16 0.02 152 / 0.6);
  border: 1px solid oklch(1 0 0 / 0.25);
  border-radius: 50%;
  color: var(--pi-white);
  cursor: pointer;
  transition: background-color 0.2s var(--pi-ease), border-color 0.2s var(--pi-ease);
}

.pi-promo__close:hover {
  background-color: var(--pi-green);
  border-color: var(--pi-green);
}

.pi-promo__close:focus-visible {
  outline: 2px solid var(--pi-green-bright);
  outline-offset: 2px;
}

/* An X from two bars */
.pi-promo__close span {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.pi-promo__close span::before,
.pi-promo__close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 2px;
  margin-top: -1px;
  background-color: currentColor;
}

.pi-promo__close span::before {
  transform: rotate(45deg);
}

.pi-promo__close span::after {
  transform: rotate(-45deg);
}

.pi-promo__hero {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--pi-ink);
}

.pi-promo__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pi-promo__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, oklch(0.18 0.022 152 / 0.92) 0%, oklch(0.18 0.022 152 / 0.25) 70%);
}

.pi-promo__heading {
  position: absolute;
  inset-inline: 36px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.pi-promo__title {
  margin: 0;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--pi-on-dark-title);
}

.pi-promo__subtitle {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--pi-on-dark);
}

.pi-promo__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px 36px 36px;
}

.pi-promo__headline {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--pi-green-on-dark);
}

.pi-promo__text {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--pi-on-dark-2);
}

.pi-promo__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.pi-promo__thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--pi-radius);
  background: var(--pi-ink);
}

.pi-promo__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pi-btn.pi-promo__cta {
  margin-top: 28px;
}

html[dir="rtl"] .pi-promo__arrow {
  display: inline-block;
  transform: scaleX(-1);
}

@media (max-width: 767px) {
  .pi-promo__heading {
    inset-inline: 22px;
    bottom: 20px;
  }

  .pi-promo__title {
    font-size: 34px;
  }

  .pi-promo__subtitle {
    font-size: 16px;
  }

  .pi-promo__body {
    padding: 22px 22px 26px;
  }

  .pi-promo__headline {
    font-size: 24px;
  }

  .pi-promo__text {
    font-size: 15px;
  }

  .pi-promo__thumbs {
    gap: 8px;
    margin-top: 18px;
  }

  .pi-btn.pi-promo__cta {
    align-self: stretch;
    margin-top: 22px;
  }
}

@media (max-width: 479px) {
  .pi-promo {
    padding: 12px;
  }

  .pi-promo__panel {
    max-height: calc(100dvh - 24px);
  }

  .pi-promo__title {
    font-size: 28px;
  }

  .pi-promo__thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pi-promo__thumb:nth-child(n+3) {
    display: none;
  }
}
