/* A single membership offer component, shared across direct and paired visits.
   Scoped layer keeps legacy page/utility selectors out of its layout. */
@layer membership-plan {
  .membership-offer {
    padding: clamp(3rem, 5vw, 5rem) 0 !important;
    scroll-margin-top: 68px;
  }

  .membership-offer-shell {
    --membership-columns: minmax(290px, .9fr) minmax(0, 1.65fr);
    --membership-inset: clamp(1.5rem, 2.2vw, 2.5rem);
    display: grid;
    grid-template-columns: minmax(250px, .9fr) minmax(0, 2.55fr);
    gap: clamp(2rem, 3vw, 3.5rem);
    align-items: start;
    width: min(1520px, calc(100% - 80px));
    margin-inline: auto;
  }

  .membership-offer-heading {
    min-width: 0;
    margin: 0;
    padding-top: var(--membership-inset);
    text-align: left;
  }

  .membership-offer-heading h2 {
    max-width: none !important;
    margin: 0 !important;
    color: var(--dt-color-ink) !important;
    font-family: 'Cormorant Stable', Georgia, serif !important;
    font-size: clamp(2.5rem, 3.5vw, 3.8rem) !important;
    font-weight: 400 !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
    text-wrap: wrap !important;
  }

  .membership-offer-heading p {
    max-width: 58ch;
    margin: 1.25rem 0 0 !important;
    color: var(--dt-color-body) !important;
    font-size: 1.0625rem !important;
    line-height: 1.65 !important;
  }

  .membership-offer-card {
    display: grid;
    grid-template-columns: var(--membership-columns);
    min-width: 0;
    background: transparent !important;
    border: 0 !important;
  }

  .membership-offer-summary {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: var(--membership-inset) !important;
    background: var(--dt-color-ink) !important;
    color: var(--dt-color-cream) !important;
    border-radius: 14px;
  }

  /* A quiet folded-paper detail follows the supplied membership reference. */
  .membership-offer-summary::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 110px;
    border-radius: 0 0 14px 14px;
    background: var(--dt-color-primary);
    opacity: .24;
    clip-path: polygon(0 0, 100% 80%, 100% 100%, 0 100%);
    pointer-events: none;
    z-index: -1;
  }

  .membership-offer-label {
    margin: 0 0 1.25rem !important;
    color: var(--dt-color-sand) !important;
    font-family: 'Playfair Stable', Georgia, serif !important;
    font-size: 1.5rem !important;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.5 !important;
  }

  .membership-offer-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .075em;
    margin: 0 !important;
    color: var(--dt-color-cream) !important;
    font-family: 'Cormorant Stable', Georgia, serif !important;
    font-size: clamp(5.5rem, 7vw, 7rem) !important;
    line-height: .95 !important;
    font-weight: 400 !important;
    letter-spacing: -.035em !important;
    font-variant-numeric: lining-nums;
  }

  .membership-offer-currency {
    align-self: flex-start;
    margin-top: .17em;
    font-size: .42em;
  }

  .membership-offer-period {
    margin-left: .35rem;
    color: var(--dt-color-sand) !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem !important;
    letter-spacing: 0 !important;
    line-height: 1.5 !important;
  }

  .membership-offer-summary-note {
    margin: 1.5rem 0 1.5rem !important;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dt-color-primary) !important;
    max-width: 31ch;
    color: var(--dt-color-sand) !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }

  .membership-offer-contact {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: 52px !important;
    padding: .9rem 1rem !important;
    border: 1px solid var(--dt-color-cream) !important;
    border-radius: 999px !important;
    background: var(--dt-color-cream) !important;
    color: var(--dt-color-ink) !important;
    font: 500 1rem/1.4 Arial, Helvetica, sans-serif !important;
    text-align: center;
    text-decoration: none !important;
    white-space: normal !important;
    transition: background-color 140ms ease, border-color 140ms ease;
  }

  .membership-offer-contact svg { flex-shrink: 0; }

  .membership-offer-contact:hover {
    background: var(--dt-color-sand) !important;
    border-color: var(--dt-color-sand) !important;
  }

  .membership-offer-contact:focus-visible {
    outline: 2px solid var(--dt-color-tan) !important;
    outline-offset: 5px !important;
  }

  .membership-offer-details {
    padding: var(--membership-inset) !important;
    min-width: 0;
    background: var(--dt-page-surface) !important;
    border-radius: 14px;
  }

  .membership-offer-details > h3 {
    margin: 0 0 1rem !important;
    color: var(--dt-color-ink) !important;
    font: 500 1.6rem/1.2 'Cormorant Stable', Georgia, serif !important;
  }

  .membership-offer-benefits {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .membership-offer-benefit {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    margin: 0 !important;
    padding: 1rem 0 !important;
    border-top: 1px solid var(--dt-color-sand) !important;
  }

  .membership-offer-benefit:first-child {
    padding-top: 0 !important;
    border-top: 0 !important;
  }

  .membership-offer-benefit:last-child {
    padding-bottom: 0 !important;
  }

  .membership-offer-benefit:last-child .membership-offer-icon {
    align-self: start;
    margin-top: .15rem;
  }

  .membership-offer-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--dt-color-cream);
    color: var(--dt-color-primary) !important;
  }
  .membership-offer-icon svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .membership-offer-benefit h4 {
    margin: 0 0 .4rem !important;
    color: var(--dt-color-ink) !important;
    font-family: 'Cormorant Stable', Georgia, serif !important;
    font-size: clamp(1.55rem, 1.85vw, 1.75rem) !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
  }

  .membership-offer-benefit p {
    margin: 0 !important;
    color: var(--dt-color-ink) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  .membership-offer-benefit .membership-offer-fine-print {
    margin: .75rem 0 0 !important;
    --dt-accent-copy: var(--dt-text-accent);
    color: var(--dt-accent-copy) !important;
    -webkit-text-fill-color: currentColor !important;
    font-family: 'Playfair Stable', Georgia, serif !important;
    font-style: italic !important;
    font-size: .875rem !important;
    line-height: 1.6 !important;
  }

  @media (max-width: 1199px) {
    .membership-offer-shell { display: block; width: min(1040px, calc(100% - 48px)); }
    .membership-offer-heading { max-width: 700px; margin-bottom: 2rem; padding-top: 0; }
    .membership-offer-heading h2 { font-size: clamp(2.5rem, 5vw, 3.8rem) !important; }
    .membership-offer-heading > p { margin-top: 1rem !important; }
  }

  @media (max-width: 900px) {
    .membership-offer-heading p { max-width: 55ch; }
    .membership-offer-card { grid-template-columns: 1fr; }
    .membership-offer-summary { padding: 2rem !important; }
    .membership-offer-label { margin-bottom: 1rem !important; }
    .membership-offer-price { margin-bottom: 0 !important; }
    .membership-offer-summary-note { max-width: 45ch; margin-top: 1.5rem !important; padding-top: 1.5rem; }
    .membership-offer-contact { width: auto; }
    .membership-offer-benefit .membership-offer-fine-print { font-size: 1rem !important; }
  }

  @media (max-width: 540px) {
    .membership-offer-shell { width: calc(100% - 32px); }
    .membership-offer-heading { text-align: left; }
    .membership-offer-heading h2 { max-width: 14ch !important; }
    .membership-offer-summary, .membership-offer-details { padding: 1.75rem 1.5rem !important; }
    .membership-offer-contact { width: 100%; }
    .membership-offer-benefit { grid-template-columns: 52px minmax(0, 1fr); column-gap: 1rem; row-gap: .875rem; align-items: center; }
    .membership-offer-benefit > div { display: contents; }
    .membership-offer-benefit h4 { margin-bottom: 0 !important; }
    .membership-offer-benefit p { grid-column: 1 / -1; }
    .membership-offer-benefit .membership-offer-fine-print { margin-top: 0 !important; }
    .membership-offer-benefit:last-child .membership-offer-icon { align-self: center; margin-top: 0; }
    .membership-offer-icon { width: 52px; height: 52px; }
    .membership-offer-icon svg { width: 28px; height: 28px; }
  }

  @media (min-width: 640px) and (max-width: 900px) {
    .membership-offer-summary {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      column-gap: 2rem;
      row-gap: 1.25rem;
      align-items: center;
    }
    .membership-offer-label { grid-column: 1; grid-row: 1; margin: 0 !important; }
    .membership-offer-price { grid-column: 1; grid-row: 2; }
    .membership-offer-summary-note {
      grid-column: 2;
      grid-row: 1;
      margin: 0 !important;
      padding: 0;
      border-top: 0 !important;
    }
    .membership-offer-contact { grid-column: 2; grid-row: 2; width: 100%; }
  }

  @media (prefers-reduced-motion: reduce) {
    .membership-offer-contact { transition: none; }
  }
}
