/**
 * Styles for the jixaw membership-tiers block.
 *
 * Layout-only glue + a small theme-matched square primitive (.jixaw-card look).
 * The Signature Theatre v2.0.2 theme supplies the brand look for headings
 * (has-heading-N-font-size), the eyebrow (has-eyebrow-medium-font-size), the
 * field label (.label), the bare <button> (data-submit-membership) and the bare
 * <input> (data-variable-price-input) via its global element selectors. We only
 * add layout, the flat square card, and presentational tweaks here — square,
 * 1px hairline, flat, no shadow, no rounded corners, no hover lift.
 *
 * Tokens: primary/near-black #1b1612, secondary/cream #fffef4,
 * light/alabaster #f7f5ea, muted grey #8d8a83.
 */
/* Outer wrapper: the CSS container + the block's width. The inner .membership-tiers
   is the grid; its column count responds to THIS element's width (container query
   below), not the viewport — so a wide screen can't cram 3 columns into a narrow
   content column. */
.membership-tiers-outer {
  container-type: inline-size;
}
/* A comparison grid needs room, but the block is dropped into a narrow constrained
   column (~644px on these pages). `max-width` alone can't widen a block past its
   containing block, so an alignwide block breaks OUT of the column with negative
   viewport margins, then re-constrains its INNER grid to the theme wide width and
   centers it — the cards span the wide width, centered, while the rest of the page
   stays in its column. The high-specificity selectors + !important are required to
   beat WordPress's `.is-layout-constrained > :where(...) { margin-inline: auto
   !important }` (0,2,0 + !important), which otherwise pins the block back into the
   column. (Verified on the real page: outer full-bleed, grid 1180px centered.) */
.is-layout-constrained > .membership-tiers-outer.alignwide,
.jixaw-flow > .membership-tiers-outer.alignwide {
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  max-width: none !important;
  width: auto !important;
}
.membership-tiers-outer.alignwide > .membership-tiers {
  max-width: var(--wp--style--global--wide-size, 1320px);
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

.membership-tiers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Square hairline card — the .jixaw-card primitive: flat, no radius, no shadow. */
.membership-tiers__card {
  display: flex;
  flex-direction: column;
  background: #f7f5ea;
  border: 1px solid #1b1612;
  border-radius: 0;
  padding: clamp(20px, 4vw, 40px);
}
.membership-tiers__card.is-highlighted {
  border-width: 2px;
}

/* Square flat tag (no rounded pill, no dark bar): 1px hairline, transparent fill. */
.membership-tiers__badge {
  align-self: flex-start;
  display: inline-block;
  border: 1px solid #1b1612;
  border-radius: 0;
  background: transparent;
  color: #1b1612;
  padding: 0.125rem 0.5rem;
  margin: 0 0 0.75rem;
}

.membership-tiers__name {
  margin: 0 0 0.5rem;
  /* Break only between words if a card is ever narrow — never mid-word (which
     produced "PROGR / AM"). Container queries keep cards wide enough anyway. */
  overflow-wrap: break-word;
}
.membership-tiers__price {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 0.25rem;
}
.membership-tiers__upto {
  font-size: 13px;
  font-weight: 400;
  color: #8d8a83;
  margin-left: 0.25rem;
}
.membership-tiers__term {
  font-size: 14px;
  color: #8d8a83;
  margin: 0 0 1rem;
}
.membership-tiers__benefits {
  font-size: 16px;
  margin-bottom: 1rem;
}
.membership-tiers__action {
  display: block;
  margin-top: auto;
}

/* Variable-amount field — layout only; the .label class supplies the theme
   uppercase field-label look (display:block), the bare <input> is theme-styled.
   The money frame is a block with its own top margin so the stack reads
   correctly regardless of theme/plugin stylesheet load order. */
.membership-tiers__amount {
  margin-bottom: 1rem;
}
.membership-tiers__money {
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
  border: 1px solid #1b1612;
  border-radius: 0;
  background: #fffef4;
}
.membership-tiers__money-prefix {
  padding: 0 0.25rem 0 0.75rem;
  color: #1b1612;
}
/* The number input sits inside the $-prefixed frame, so it drops its own border
   and lets the frame read as one field. Focus is left to the theme — no
   outline:none without a replacement. */
.membership-tiers__money input {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 0.5rem 0.75rem 0.5rem 0;
}

/* The numeric carrier the Spektrix component reads ([data-variable-price-input])
   is kept off-screen but NOT display:none, so its value stays readable; the
   comma-formatted [data-price-display] text input is what the buyer sees. */
.membership-tiers__raw-price {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.membership-tiers__autorenew {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 16px;
  margin-bottom: 1rem;
}

/* Submit button: full-width within the card; all brand styling (2px primary
   border, square, Space Grotesk uppercase, hover fills primary) comes from the
   theme's global <button> element selector — no custom appearance here. */
.membership-tiers__submit {
  width: 100%;
  white-space: nowrap;
}

.membership-tiers__held {
  font-size: 16px;
}
.membership-tiers__success {
  margin-top: 1rem;
  font-size: 16px;
}
.membership-tiers__fail {
  margin-top: 1rem;
  font-size: 16px;
  color: #b91c1c;
}

/* Column count keys off the BLOCK's own width (@container on .membership-tiers-outer),
   not the viewport — otherwise a wide screen forces 3 columns into whatever column
   the block sits in (a 720px content column → ~224px cards → mid-word heading breaks
   + a stacked button). 2- and 4-tier grids collapse evenly to 2 columns. A 3-tier
   grid does NOT go to 2 (3 across a 2-col grid leaves an orphan): it stays a single
   column until there's room for all 3 (per client feedback — "go directly down to 1
   column"). */
@container (min-width: 640px) {
  .membership-tiers--cols-2,
  .membership-tiers--cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (min-width: 980px) {
  .membership-tiers--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .membership-tiers--cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
