/* ═══════════════════════════════════════════════════════════════════════════
   Join / sign-up landing page
   Designed for mobile-first QR-code scanning. Displays the SevenRooms
   subscription widget with a branded hero above it.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page shell ─────────────────────────────────────────────────────────── */

.join-page {
  background: var(--color-dark);
  color: var(--color-light);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /*
   * Mobile-first: the header is NOT fixed on small screens (main.css only
   * fixes it at min-width: 901px AND min-height: 801px), so no 124px
   * clearance is needed. Content flows from the top with breathing room only.
   */
  justify-content: flex-start;
  padding-top: clamp(1.5rem, 4svh, 2.5rem);
  padding-bottom: clamp(3rem, 6svh, 5rem);
  gap: 0;
  text-align: center;
  width: 100%;
  overflow-x: clip;
}

/* Hero copy and the signup form both live in the page content so they
   can be edited in the page editor. The group block wraps that content,
   so stretch the real wrapper rather than assuming post-content is a
   direct child of the page shell. */
.join-page > .wp-block-group__inner-container,
.join-page .wp-block-post-content,
.join-page__hero,
.join-page__hero > .wp-block-group__inner-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: 0;
  align-self: stretch;
}

/* When the header IS fixed — matches the main.css media query exactly */
@media (prefers-reduced-motion: no-preference) and (min-height: 801px) and (min-width: 901px) {
  .join-page {
    justify-content: center;
    padding-top: calc(124px + clamp(1.5rem, 4svh, 2.5rem));
  }
}

/* ── Hero — headline + subtext ──────────────────────────────────────────── */

.join-page__hero {
  width: 100%;
  max-width: min(620px, 100%); /* matches the signup form card */
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  /* Ensure WordPress block alignment classes don't pull it off-centre */
  margin-inline: auto;
}

/* The group block wraps the heading and paragraphs, so the text only
   fills the form width if that inner wrapper does too. */
.join-page__hero > .wp-block-group__inner-container {
  width: 100%;
  align-self: stretch;
}

.join-page__headline.wp-block-heading {
  font-family: var(--font-headline) !important;
  /* One line, just inside the form width. */
  font-size: 7.5rem !important;
  color: var(--color-light) !important;
  text-transform: uppercase;
  line-height: 0.95;
  margin: 0 auto;
  white-space: nowrap;
  text-wrap: nowrap;
}

/* A soft return in the heading must not split the title. */
.join-page__headline br {
  display: inline-block;
  width: 0.25em;
  height: 0;
  overflow: hidden;
}

.join-page__sub {
  font-size: calc(var(--size-body-text-medium) * 0.75);
  color: var(--color-light);
  line-height: 1.5;
  max-width: none;
  width: 100%;
  margin: 0;
  opacity: 0.75;
}

.join-page__sub + .join-page__sub {
  margin-top: 1lh;
}

.join-page__sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* "Welcome to our Pizza Club" is longer than the join headline, so it
   scales down to stay on one line at the same width. */
.join-page__headline--long.wp-block-heading {
  font-size: 5.7rem !important;
}

@media (max-width: 767px) {
  /* One line, about 80% of the screen width. */
  .join-page__headline.wp-block-heading {
    font-size: 11.4vw !important;
  }

  .join-page__headline--long.wp-block-heading {
    font-size: 8.7vw !important;
  }

  .join-page__sub {
    font-size: calc(var(--size-body-text-medium) * 0.65);
  }
}

@media (min-width: 768px) {
  .join-page__hero {
    padding-inline: 0;
  }
}

/* ── Welcome page — video hero ──────────────────────────────────────────── */

.welcome-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 60svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0;
}

.welcome-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.welcome-hero__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.welcome-hero__overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding: clamp(2rem, 6svh, 4rem) clamp(1.25rem, 5vw, 2.5rem);
  width: 640px;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
  /* Semi-transparent dark backdrop so text reads over the video */
  background: rgba(18, 14, 10, 0.6);
  backdrop-filter: blur(3px);
  border-radius: 4px;
}

.welcome-hero__overlay .join-page__sub,
.welcome-hero__overlay p {
  /* Ensure paragraphs wrap inside the overlay box */
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  /* Welcome page paragraph sizing */
  font-size: calc(var(--size-body-text-medium) * 0.975); /* base × 0.75 × 1.3 ≈ 30% bigger */
  line-height: 1.8rem;
  color: var(--color-light);
  opacity: 0.75;
  margin: 0;
  text-align: center;
}

/* Spacing between consecutive paragraphs (gap on the outer flex doesn't reach
   into Gutenberg's inner-container wrapper, so we use margin-top instead) */
.welcome-hero__overlay p + p,
.welcome-hero__overlay .wp-block-group__inner-container p + p {
  margin-top: 2.5rem;
}

/* Inside the overlay the copy styles still apply */
.welcome-hero__overlay .join-page__headline.wp-block-heading {
  margin-bottom: 0.25rem;
}

/* On mobile, allow the headline to wrap inside the constrained overlay */
@media (max-width: 767px) {
  .welcome-hero__overlay .join-page__headline.wp-block-heading {
    white-space: normal;
    text-wrap: balance;
    font-size: 14.4vw !important; /* 8vw × 1.8 = 180% */
  }
}

/* On the welcome page, let the video hero go edge-to-edge.
   The header only becomes position:fixed (via main.css) when both min-width:901px
   AND min-height:801px are met, so we mirror those exact conditions here. */
.welcome-page {
  padding-top: 0 !important;
  gap: 0;
}
@media (prefers-reduced-motion: no-preference) and (min-width: 901px) and (min-height: 801px) {
  .welcome-page {
    padding-top: 124px !important;
  }
}

/* Link-cards block immediately below the video hero — orange accent panel */
.welcome-page .wp-block-wfs-link-cards {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--color-accent-main);
}

/* ── Embed page (bare template for popup iframes — no header/footer) ───── */

.join-popup-page {
  background: var(--color-dark);
  color: var(--color-light);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem clamp(1rem, 4vw, 1.5rem);
  width: 100%;
  box-sizing: border-box;
}

/* Fluent Form on the embed page — 80% width, centred */
.join-popup-page .fluentform_wrapper_3 {
  width: 80%;
  max-width: 100%;
  margin-inline: auto;
}

/* Mobile — form takes 80% of width on the main join page */
@media (max-width: 767px) {
  .join-page .fluentform_wrapper_3 {
    width: 80%;
  }
}

/* ── Form area (iframe embed) ───────────────────────────────────────────── */

.join-page__widget-area {
  width: 100%;
  /* No max-width — let the iframe use the full available page width so
     SevenRooms renders the form at a comfortable viewport, not mobile-squeezed */
  padding-inline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Venue tag — e.g. "AT WILMSLOW" shown above the form */
.join-page__venue-tag {
  font-family: var(--font-headline);
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  color: var(--color-accent-main);
  text-transform: uppercase;
  line-height: 0.85;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  text-align: center;
}

/* ── iframe wrapper ─────────────────────────────────────────────────────────
   The SevenRooms form page has a 72px header containing their branded logo.
   We crop it by:
     1. overflow: hidden on this wrapper (acts as a clipping mask)
     2. translateY(-72px) on the iframe shifts it up 72px so the header
        is above the visible area
     3. The wrapper height is sized for just the form content

   The form card itself is roughly 560px tall. We add extra height to
   accommodate the phone-number country-code dropdown expanding and the
   post-submit success message state.
   ─────────────────────────────────────────────────────────────────────────── */
.join-page__iframe-wrap {
  /* Full-bleed break-out: escapes all parent content-width constraints
     (wp:post-content, wp:group layout, theme.json contentSize).
     calc(50% - 50vw) pulls the left edge back to the viewport left margin
     regardless of how deeply nested the element is. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  /* Mobile: no side padding — form goes edge-to-edge */
  padding-inline: 0;
}

.join-page__iframe-clip {
  width: 100%;
  max-width: 620px; /* keeps the form readable on very wide screens */
  overflow: hidden;
  /* Mobile: no border-radius so the form card goes full width */
  border-radius: 0;
  /* Mobile-first: extra height to allow for checkbox label wrapping */
  height: 964px;
}

/* On larger screens: restore padding, radius, and shorter clip height */
@media (min-width: 768px) {
  .join-page__iframe-wrap {
    padding-inline: clamp(0.5rem, 2vw, 1.5rem);
  }
  .join-page__iframe-clip {
    border-radius: 6px;
    height: 866px;
  }
}

.join-page__form-iframe {
  width: 100%;
  /* Render the full SevenRooms page (header + form + footer).
     Must be taller than the clip so the translateY shift works correctly. */
  height: calc(100% + 72px);
  /* Shift up by exactly the SevenRooms nav height (hardcoded 72px in their DOM)
     so the header is hidden above the clip boundary. */
  transform: translateY(-72px);
  border: none;
  display: block;
}
