/**
 * /join designs (LOL-462): the looks a visitor can be given, on top of
 * join-v2.css. A design (src/JoinDesign.php) picks a layout, a plan picker, a
 * photo and an accent colour; the classes and custom properties it sets on
 * #outer-container switch on the rules here.
 *
 *   .join-v2--picker-list     every plan listed with its price (any layout)
 *   .join-v2--card-price      plan cards lead with the price, not "$0.00 today"
 *   .join-v2--headline-color  the headline's promise in the accent colour,
 *                             not highlighted (-color-all: the whole headline)
 *   .join-v2--layout-photo    photo beside the plans and form; stacked on phones
 *   --join-accent             the one highlight colour, --join-accent-ink on it
 *   --join-marker             the headline highlighter and --join-marker-ink on
 *                             it, when a design wants it off the accent
 *   --join-photo-focus        what to keep in view when the photo is cropped
 *
 * The classic layout with the switch picker needs nothing from this file.
 */

/* The headline highlighter follows the highlight colour unless a design sets
   its own. Before the layouts, so a layout can change the ink. */
.join-v2 {
  --join-marker: var(--join-highlight);
  --join-marker-ink: var(--color-black);
}

/* ---- List picker ---- */
.join-v2 #subscriptions.join-v2__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.join-v2__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--join-line);
  border-radius: 10px;
  background: var(--color-white);
}

.join-v2__option:has(input:checked) {
  border-color: var(--join-frame);
  box-shadow: 0 0 0 1px var(--join-frame);
}

/* The radio covers the whole row, so anywhere on it picks the plan. Square
   corners: a round radio stretched over the row leaves its corners dead. */
.join-v2 .join-v2__option input {
  display: block !important;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  opacity: 0;
  cursor: pointer;
}

.join-v2__option:has(input:focus-visible) {
  outline: 2px solid var(--join-frame);
  outline-offset: 2px;
}

.join-v2__option-dot {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid #9a9a96;
  border-radius: 50%;
  background: var(--color-white);
}

.join-v2__option:has(input:checked) .join-v2__option-dot {
  border-color: var(--join-frame);
  background: radial-gradient(circle, var(--join-frame) 0 42%, var(--color-white) 46%);
}

.join-v2__option-body {
  flex: 1;
  min-width: 0;
}

/* The row is the card here. */
.join-v2__option .join-v2__card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.join-v2__option .join-v2__badge {
  position: static;
  display: inline-block;
  margin: 0 0 8px;
  transform: none;
}

.join-v2__option .join-v2__card-title {
  font-size: 20px;
  white-space: normal;
}

.join-v2__option .join-v2__card-today strong {
  font-size: 26px;
}

/* One plan: nothing to pick, so no radio. */
.join-v2__options--single .join-v2__option-dot {
  display: none;
}

.join-v2__options--single .join-v2__option input {
  cursor: default;
}

/* ---- Price-led plan card ---- */
.join-v2__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.join-v2__card-tags .join-v2__badge {
  position: static;
  margin: 0;
  transform: none;
}

.join-v2__tag {
  padding: 4px 8px;
  background: #ececea;
  color: var(--color-black);
  font-family: var(--font-body-extended);
  font-weight: var(--fw-semibold);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.join-v2__card--price .join-v2__card-title {
  white-space: normal;
}

.join-v2__card--price .join-v2__card-title s {
  color: var(--join-muted);
}

/* ---- Photo layout ---- */
.join-v2--layout-photo {
  --join-surface: var(--color-white);
  --join-soft: #f5f5f5;
  --join-frame: var(--join-accent, var(--color-black));
  --join-highlight: var(--join-accent, var(--color-electric-lime));
  --join-on-highlight: var(--join-accent-ink, var(--color-black));
  --join-marker-ink: var(--join-on-highlight);
}

/* No streak banner. */
.join-v2--layout-photo.outer-container::before {
  display: none;
}

.page-wrap.chromeless:has(.join-v2--layout-photo) .content-main,
.page-wrap.chromeless:has(.join-v2--layout-photo) #content-inside-wrapper {
  background: var(--color-white);
}

/* Phones: photo across the top, then plans, form, and the terms last. */
.join-v2--layout-photo .choose-plan-block {
  gap: 28px;
  max-width: none;
  padding: 0 20px 56px;
}

.join-v2--layout-photo .join-v2__photo {
  order: -1;
  display: block;
  width: calc(100% + 40px);
  height: 220px;
  margin: 0 -20px;
  overflow: hidden;
  background: var(--join-soft);
}

.join-v2--layout-photo .join-v2__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--join-photo-focus, 50% 30%);
}

/* A promo's own banner: a modest card above the headline, all of it showing. */
.join-v2--layout-photo .join-v2__hero {
  margin-bottom: 20px;
}

.join-v2--layout-photo .join-v2__hero img {
  width: auto;
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  box-shadow: none;
}

.join-v2--layout-photo .join-v2__checkout {
  order: 1;
}

/* Empty until sign-in; keep it from adding a second gap above the form. */
.join-v2--layout-photo #addendum-spacer {
  order: 9;
}

.join-v2--layout-photo .join-v2__details {
  order: 2;
  gap: 32px;
}

/* What's included, then the review, then how the trial works. */
.join-v2--layout-photo .join-v2__message { order: 0; margin: 0; }
.join-v2--layout-photo .join-v2__answers { order: 1; }
.join-v2--layout-photo .join-v2__what { order: 2; }
.join-v2--layout-photo .join-v2__review { order: 3; margin-top: 0; }
.join-v2--layout-photo .join-v2__how { order: 4; }

.join-v2--layout-photo .join-v2__details .join-v2__heading,
.join-v2--layout-photo .join-v2__details > :first-child .join-v2__heading,
.join-v2--layout-photo .join-v2__details > :first-child > :not([hidden]) .join-v2__heading {
  margin-top: 0;
}

@media (max-width: 899px) {
  /* Wizard finishers: their answers stay above the form; the rest follows it
     in the same order as everyone else's. */
  .join-v2--layout-photo.join-v2--wizard .join-v2__checkout { order: 2; }
  .join-v2--layout-photo.join-v2--wizard .join-v2__what { order: 3; margin-top: 0; }
  .join-v2--layout-photo.join-v2--wizard .join-v2__review { order: 4; }
  .join-v2--layout-photo.join-v2--wizard .join-v2__how { order: 5; }
}

/* The flex gap already separates the plans from the form. */
.join-v2--layout-photo #subscription {
  margin-bottom: 0;
}

/* Words on white, not on the streak. */
.join-v2--layout-photo .join-v2__title {
  margin-bottom: 20px;
  font-size: 34px;
  color: var(--color-black);
}

.join-v2--layout-photo .join-v2__title em,
.join-v2--layout-photo .join-v2__badge,
.join-v2--layout-photo .join-v2__applied b {
  color: var(--join-on-highlight);
}

.join-v2--layout-photo .join-v2__applied--error b {
  color: var(--color-black);
}

.join-v2--layout-photo .join-v2__applied,
.join-v2--layout-photo .join-v2__applied a {
  color: var(--color-black);
}

/* One accent: the "for 7 days" tag steps back to grey. */
.join-v2--layout-photo .join-v2__card-today span {
  background: #ececea;
  color: var(--color-black);
}

.join-v2--layout-photo .form-button:not(.disabled):not(:disabled) {
  border-color: var(--join-frame);
  background: var(--join-frame);
  color: var(--join-on-highlight);
}

.join-v2--layout-photo .form-button:not(.disabled):not(:disabled):hover {
  filter: brightness(.92);
}

/* The switch picker, if a photo design uses it. */
.join-v2--layout-photo #subscriptions.join-v2__terms {
  border-color: var(--join-line);
  background: var(--join-soft);
}

.join-v2--layout-photo #subscriptions.join-v2__terms::before {
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.join-v2--layout-photo .join-v2__term > span:not(.join-v2__badge) {
  color: var(--color-black);
}

/* The form sits on the page, not in a card. */
.join-v2--layout-photo .login-block,
.join-v2--layout-photo .pay-form,
.join-v2--layout-photo .join-v2__start,
.join-v2--layout-photo .idme-block {
  padding: 0;
  border: 0;
  background: none;
}

.join-v2--layout-photo #user-create > .create-your-account,
.join-v2--layout-photo #user-login > .create-your-account,
.join-v2--layout-photo .join-v2__pay-head h2,
.join-v2--layout-photo .join-v2__start h2 {
  font-size: 26px;
  text-align: left;
}

.join-v2--layout-photo .join-v2__pay-head,
.join-v2--layout-photo .join-v2__start,
.join-v2--layout-photo #user-create > .sign-in,
.join-v2--layout-photo #user-login > .sign-in {
  justify-content: flex-start;
  text-align: left;
}

.join-v2--layout-photo details.join-v2__promo {
  text-align: left;
}

/* The review, when a design keeps it, without the streak. */
.join-v2--layout-photo .join-v2__review {
  background: var(--join-soft);
}

.join-v2--layout-photo .join-v2__review blockquote,
.join-v2--layout-photo .join-v2__review figcaption {
  color: var(--color-black);
}

.join-v2--layout-photo .join-v2__stars {
  color: var(--join-frame);
}

/* Desktop: photo on the left for the height of the plans and form; the terms
   run across the page underneath. The photo fills its cell rather than the
   window: inside the storefront frame there's no window height to stick to. */
@media (min-width: 900px) {
  .join-v2--layout-photo .choose-plan-block {
    display: grid;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    grid-template-rows: auto 1fr auto;
    gap: 0;
    padding: 0;
  }

  .join-v2--layout-photo .join-v2__photo {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: relative;
    align-self: stretch;
    width: auto;
    height: auto;
    min-height: 640px;
    margin: 0;
  }

  .join-v2--layout-photo .join-v2__photo img {
    position: absolute;
    inset: 0;
  }

  .join-v2--layout-photo .plan-options {
    grid-column: 2;
    grid-row: 1;
    max-width: 680px;
    padding: 56px 56px 0;
  }

  .join-v2--layout-photo .join-v2__checkout {
    grid-column: 2;
    grid-row: 2;
    max-width: 680px;
    padding: 32px 56px 56px;
  }

  .join-v2--layout-photo .join-v2__details {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px 64px;
    justify-self: center;
    width: 100%;
    max-width: 1200px;
    margin: 0;
    padding: 56px 56px 80px;
  }

  .join-v2--layout-photo .join-v2__message {
    grid-column: 1 / -1;
  }

  /* Left: what's included with the review under it. Right: how it works. */
  .join-v2--layout-photo .join-v2__what {
    grid-column: 1;
  }

  .join-v2--layout-photo .join-v2__how {
    order: 3;
    grid-column: 2;
  }

  .join-v2--layout-photo .join-v2__details:has(.join-v2__review) .join-v2__how {
    grid-row: span 2;
  }

  .join-v2--layout-photo .join-v2__review {
    order: 4;
    grid-column: 1;
    align-self: start;
  }

  /* Wizard finishers: their answers beside how it works, then what's included
     beside the review. */
  .join-v2--layout-photo.join-v2--wizard .join-v2__answers {
    grid-column: 1;
  }

  .join-v2--layout-photo.join-v2--wizard .join-v2__how {
    order: 2;
  }

  .join-v2--layout-photo.join-v2--wizard .join-v2__details:has(.join-v2__review) .join-v2__how {
    grid-row: auto;
  }

  .join-v2--layout-photo.join-v2--wizard .join-v2__what {
    order: 3;
  }

  .join-v2--layout-photo.join-v2--wizard .join-v2__review {
    grid-column: 2;
  }

  .join-v2--layout-photo .join-v2__title {
    font-size: 40px;
  }
}

/* ---- Headline styles ----
   After the layouts, so they win over each layout's own headline colours. */
.join-v2--headline-marker .join-v2__title em {
  background: var(--join-marker);
  color: var(--join-marker-ink);
}

.join-v2--headline-color .join-v2__title em,
.join-v2--headline-color-all .join-v2__title em {
  padding: 0;
  background: none;
  color: var(--join-highlight);
}

.join-v2--headline-color-all .join-v2__title {
  color: var(--join-highlight);
}
