/* Pro promotion price button + lightbox (Brian, 2026-09-26; design B4 2026-09-28). Loaded on the
   home page and /pricing when a promotion is live.
   Markup: views/partials/promo-price.php + promo-dialog.php; behaviour: /assets/js/promo.js.
   Palette: site charcoal (--primary) and the Premier gold (#f5b301, directory.css). */

.promo-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── PROMO PRICE BUTTON (design B4, 2026-09-28) ──
   The featured promotion's price, store style: the regular price struck and muted, the sale price
   as the main number, and the whole thing is one <button> that opens the lightbox. The small info
   mark after the sale price is the tap affordance; hover and keyboard focus add a dotted gold
   underline under the sale price. Markup: views/partials/promo-price.php. */
.promo-price {
  position: relative; display: inline-flex; align-items: baseline; gap: 0.1em;
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; line-height: inherit; letter-spacing: inherit;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.promo-price::before { content: ''; position: absolute; inset: -0.35rem -0.4rem; border-radius: 0.6rem; }
.promo-now {
  font-weight: inherit; color: inherit;
  text-decoration: underline dotted transparent; text-decoration-thickness: 2px; text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease;
}
.promo-was { font-weight: 500; text-decoration-line: line-through; text-decoration-thickness: 1.5px; }
.promo-i {
  flex: none; width: 0.5em; height: 0.5em; min-width: 12px; min-height: 12px;
  align-self: flex-start; margin: 0.18em 0 0 0.12em;
  color: #b88600; transition: color 0.15s ease, transform 0.15s ease;
}
.promo-price:hover .promo-now, .promo-price:focus-visible .promo-now { text-decoration-color: #f5b301; }
.promo-price:hover .promo-i, .promo-price:focus-visible .promo-i { color: #f5b301; transform: scale(1.12); }
.promo-price:focus-visible { outline: 2px solid #2a2a2a; outline-offset: 3px; border-radius: 0.4rem; }

/* Home stat: the struck price sits ABOVE the value, absolutely, so it takes no space and the stat
   row lines up exactly as it does without a promotion. */
.promo-price--stat .promo-was {
  position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 0.1rem;
  font-family: 'Outfit', sans-serif; font-size: 0.85rem; line-height: 1.1; color: #8a8a8a;
  text-align: center; white-space: nowrap;
}
/* The info mark hangs off the right edge, so the sale price itself stays centred over "Pro Plan". */
.promo-price--stat .promo-i { position: absolute; left: 100%; top: 0.14em; margin: 0 0 0 0.12em; }
/* Pricing card (dark): the struck price sits small above the sale price, the same as the home stat
   (the desktop Pro column is about 244px wide, too narrow for both prices and "/ month" on one
   line). The price row gets that line's room as top margin. */
.promo-pricing-price { margin-top: 1.55rem; }
.promo-price--card .promo-was {
  position: absolute; left: 0; bottom: 100%; margin-bottom: 0.15rem;
  font-size: 0.42em; line-height: 1.1; white-space: nowrap;
  color: rgba(255, 255, 255, 0.5); text-decoration-color: rgba(255, 255, 255, 0.6);
}
.pricing-card.featured .promo-i { color: #f5b301; }
.pricing-card.featured .promo-price:hover .promo-i,
.pricing-card.featured .promo-price:focus-visible .promo-i { color: #ffd257; }
.pricing-card.featured .promo-price:focus-visible { outline-color: #fff; }

@media (max-width: 768px) {
  .promo-price--stat .promo-was { font-size: 0.72rem; }
  /* Three stats share one phone row and "$24.50/mo" is longer than "$49/mo": only the sale text
     shrinks, so the value's line box (and the label under it) stays level with the other stats. */
  .promo-price--stat .promo-now { font-size: 0.84em; }
  .promo-i { min-width: 11px; min-height: 11px; }
}

/* ── LIGHTBOX ── */
.promo-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.promo-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(26, 26, 26, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.22s ease;
}
.promo-modal-panel {
  position: relative; width: min(30rem, 100%); max-height: calc(100vh - 2.5rem); overflow: auto;
  background: #fff; color: var(--primary, #2a2a2a);
  border-radius: 1.5rem; padding: 2.25rem 2rem 1.75rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  outline: none;
}
.promo-modal.is-open .promo-modal-backdrop { opacity: 1; }
.promo-modal.is-open .promo-modal-panel { opacity: 1; transform: none; }

.promo-modal-x {
  position: absolute; top: 0.85rem; right: 0.85rem;
  width: 2.5rem; height: 2.5rem; border-radius: 9999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: #6b6b6b; cursor: pointer;
}
.promo-modal-x:hover { background: #f1f0ea; color: #2a2a2a; }
.promo-modal-x:focus-visible { outline: 2px solid #2a2a2a; outline-offset: 2px; }

.promo-modal-title {
  font-family: 'Outfit', sans-serif; font-weight: 700;
  font-size: 1.65rem; line-height: 1.2; letter-spacing: -0.01em;
  margin: 0 2rem 0.9rem 0;
}
.promo-modal-label {
  display: inline-block; vertical-align: 0.3em; margin: 0 0.35rem 0.5rem 0;
  padding: 0.2rem 0.6rem; border-radius: 9999px;
  background: #f5b301; color: #2a2a2a;
  font-family: 'Inter', sans-serif; font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.promo-modal-text { display: block; }
.promo-modal-details { font-size: 0.95rem; line-height: 1.7; color: #5f5f5f; margin: 0 0 1.5rem; }
.promo-modal-extra { margin: -1rem 0 1.4rem; font-size: 0.88rem; line-height: 1.6; color: #6b6b6b; }

.promo-modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.promo-modal-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.6rem; border-radius: 1rem;
  background: var(--primary, #2a2a2a); color: #fff;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  box-shadow: 0 8px 24px rgba(42, 42, 42, 0.2);
  transition: background 0.18s ease;
}
.promo-modal-cta:hover { background: rgba(42, 42, 42, 0.9); }
.promo-modal-cta:focus-visible { outline: 2px solid #f5b301; outline-offset: 3px; }
.promo-modal-later {
  border: 0; background: none; cursor: pointer; padding: 0.6rem 0.4rem;
  font: inherit; font-size: 0.9rem; font-weight: 600; color: #6b6b6b;
}
.promo-modal-later:hover { color: #2a2a2a; text-decoration: underline; }
.promo-modal-later:focus-visible { outline: 2px solid #2a2a2a; outline-offset: 2px; border-radius: 0.4rem; }

.promo-modal-price {
  margin: -0.2rem 0 0.9rem; font-family: 'Outfit', sans-serif; font-size: 1.05rem; color: #5f5f5f;
}
.promo-modal-price strong { font-size: 1.6rem; font-weight: 700; color: var(--primary, #2a2a2a); }
.promo-modal-price s { margin-left: 0.35rem; color: #9a9a9a; text-decoration-thickness: 1.5px; }

.promo-modal-code {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin: 0 0 1.4rem; padding: 0.6rem 0.6rem 0.6rem 0.9rem;
  border: 1.5px dashed #d8c48a; border-radius: 0.9rem; background: #fffaf0;
}
.promo-modal-code-k {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #8a6d00;
}
.promo-modal-code-v {
  flex: 1 1 auto; font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--primary, #2a2a2a);
}
.promo-modal-copy {
  min-height: 2.25rem; padding: 0 0.95rem; border: 0; border-radius: 9999px; cursor: pointer;
  background: var(--primary, #2a2a2a); color: #fff; font: inherit; font-size: 0.8rem; font-weight: 700;
}
.promo-modal-copy:hover { background: rgba(42, 42, 42, 0.88); }
.promo-modal-copy.is-copied { background: #15803d; }
.promo-modal-copy:focus-visible { outline: 2px solid #f5b301; outline-offset: 2px; }
.promo-modal-note { margin: 0.9rem 0 0; font-size: 0.78rem; color: #8a8a8a; }

/* Phones: a full-width bottom sheet. */
@media (max-width: 560px) {
  .promo-modal { align-items: flex-end; padding: 0; }
  .promo-modal-panel {
    width: 100%; max-height: 88vh;
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 2rem 1.35rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .promo-modal-title { font-size: 1.45rem; }
  .promo-modal-actions { flex-direction: column; align-items: stretch; }
  .promo-modal-cta { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .promo-price .promo-i, .promo-now, .promo-modal-backdrop, .promo-modal-panel { transition: none; }
  .promo-modal-panel { transform: none; }
}
