/* Preptide — landing-page meal plan banner, CTA strips and sticky bar.
   Server-rendered by server/seo-plans.js; behaviour added by plan-banner.js.
   Loaded only on pages that carry a plan, so it never taxes the rest of the
   site. Tokens come from styles.css — this file defines no colours of its own
   beyond alpha layers over --ink/--paper. */

.ptp {
  position: relative;
  display: grid;
  gap: 28px 40px;
  margin: 0 0 56px;
  padding: 32px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.ptp::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--rust);
}

/* Mobile follows source order — headline, food, then the pitch. Desktop puts
   the copy in a left column and the meals alongside it, spanning both rows. */
@media (min-width: 1024px) {
  .ptp { grid-template-columns: 5fr 7fr; grid-template-rows: auto 1fr; align-items: start; padding: 40px 44px; column-gap: 44px; row-gap: 18px; }
  .ptp-lede { grid-column: 1; grid-row: 1; }
  .ptp-copy { grid-column: 1; grid-row: 2; }
  .ptp-meals { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---- left column: the pitch ---------------------------------------------- */

.ptp-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--rust-glow);
  margin: 0 0 14px;
}

.ptp-title {
  font-size: clamp(27px, 3.6vw, 40px);
  line-height: 1.06;
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  margin: 0 0 14px;
  text-wrap: balance;
}

.ptp-lede { margin: 0; }

.ptp-blurb {
  font-size: 15px;
  line-height: 1.72;
  color: rgba(251, 247, 238, 0.82);
  margin: 0 0 22px;
  max-width: 56ch;
}

.ptp-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  background: rgba(251, 247, 238, 0.16);
  border: 1px solid rgba(251, 247, 238, 0.16);
  border-radius: 4px;
  overflow: hidden;
}

@media (min-width: 480px) { .ptp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ptp-stats > div { background: var(--ink); padding: 12px 10px; }

.ptp-stats dt {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(251, 247, 238, 0.58);
  margin: 0 0 4px;
}

.ptp-stats dd {
  margin: 0;
  font-size: 21px;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ptp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.ptp-add {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 15px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--rust);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 6px 22px rgba(255, 46, 139, 0.3);
  -webkit-tap-highlight-color: transparent;
}

.ptp-add:hover { background: var(--rust-2); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 46, 139, 0.38); }
.ptp-add:active { transform: translateY(0); }
.ptp-add:focus-visible { outline: 3px solid var(--butter-2); outline-offset: 3px; }
.ptp-add[data-added="true"] { background: var(--blue); box-shadow: 0 6px 22px rgba(26, 83, 255, 0.3); }

/* Full-width, thumb-sized buttons on small screens (mobile-usability signal
   as much as a conversion one — every CTA clears the 48px tap target). */
@media (max-width: 640px) {
  .ptp-actions, .ptp-cta-actions { width: 100%; }
  .ptp-actions .ptp-add, .ptp-cta .ptp-add { width: 100%; }
  .ptp-actions { justify-content: center; }
}

.ptp-add-price {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.86;
}

.ptp-add-sm { flex-direction: row; align-items: center; min-height: 48px; padding: 12px 24px; font-size: 14.5px; }

.ptp-secondary {
  font-size: 14px;
  font-weight: 500;
  color: rgba(251, 247, 238, 0.78);
  border-bottom: 1px solid rgba(251, 247, 238, 0.34);
  padding-bottom: 2px;
}

.ptp-secondary:hover { color: var(--paper); border-color: var(--paper); }
.ptp-secondary:focus-visible { outline: 2px solid var(--rust-glow); outline-offset: 4px; border-radius: 2px; }

.ptp-note {
  margin: 18px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(251, 247, 238, 0.56);
  max-width: 52ch;
}

/* ---- right column: the meals -------------------------------------------- */

.ptp-meals-label,
.ptp-meals-foot {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(251, 247, 238, 0.55);
  margin: 0 0 12px;
}

.ptp-meals-foot { margin: 12px 0 0; text-transform: none; letter-spacing: 0.04em; font-size: 10px; }

.ptp-meal-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

@media (min-width: 640px) { .ptp-meal-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ptp-meal-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ptp-meal {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(251, 247, 238, 0.06);
  border: 1px solid rgba(251, 247, 238, 0.1);
  border-radius: 5px;
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease;
}

.ptp-meal:hover { border-color: rgba(251, 247, 238, 0.28); background: rgba(251, 247, 238, 0.1); }

.ptp-meal-shot { display: block; aspect-ratio: 1 / 1; background: rgba(251, 247, 238, 0.08); }
.ptp-meal-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ptp-meal-body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 3px; flex: 1; }

.ptp-meal-no {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--rust-glow);
}

.ptp-meal-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.28;
  color: var(--paper);
}

.ptp-meal-name:hover { text-decoration: underline; text-underline-offset: 2px; }

.ptp-meal-macros {
  margin: auto 0 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(251, 247, 238, 0.62);
}

.ptp-meal-macros strong { color: var(--rust-glow); font-weight: 600; }

.ptp-meal-add {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 13, 18, 0.68);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background 140ms ease, transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible hit-area extension — the visual stays a tidy 32px circle while the
   touch target clears 48px. */
.ptp-meal-add::before { content: ""; position: absolute; inset: -8px; border-radius: 999px; }

.ptp-meal-add:hover { background: var(--rust); transform: scale(1.08); }
.ptp-meal-add:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.ptp-meal-add[data-added="true"] { background: var(--blue); }

/* Fills the tail of the 4-across grid (a plan is 7 meals) with a route to the
   rest of the menu rather than a hole. */
.ptp-meal-more { background: transparent; border-style: dashed; }
.ptp-meal-more a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  height: 100%;
  min-height: 96px;
  padding: 14px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--paper);
}
.ptp-meal-more span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 247, 238, 0.55);
}
.ptp-meal-more:hover a { color: var(--rust-glow); }

/* ---- mid-article CTA ----------------------------------------------------- */

.ptp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px 36px;
  margin: 0 0 48px;
  padding: 30px 32px;
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--rust);
  border-radius: 6px;
  background: var(--bg-2);
}

.ptp-cta > div:first-child { flex: 1 1 340px; min-width: 0; }
.ptp-cta .ptp-add { box-shadow: 0 4px 16px rgba(255, 46, 139, 0.24); }

.ptp-cta-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 8px;
}

.ptp-cta-title { font-size: 22px; line-height: 1.16; font-weight: 500; margin: 0 0 6px; color: var(--ink); }
.ptp-cta-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); max-width: 58ch; }
.ptp-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
  flex: 0 0 auto;
  min-width: 250px;
}

.ptp-cta-link {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 4px 0;
}

.ptp-cta-link:hover { color: var(--rust); }
.ptp-cta-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

.ptp-cta-compact { justify-content: space-between; padding: 20px 26px; gap: 16px 28px; }
.ptp-cta-compact .ptp-add { flex: 0 0 auto; }
.ptp-cta-compact .ptp-cta-text { font-size: 14px; }
.ptp-cta-compact .ptp-cta-text strong { color: var(--ink); }

/* ---- mobile sticky bar --------------------------------------------------- */
/* Shares .sticky-cta with the rest of the site so chat-widget.js's dock
   coordinator (the single writer of --pt-dock) lifts the floating cart, chat
   bubble and capture teaser above it without extra wiring. */

.ptp-sticky {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 12px 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 34px rgba(12, 13, 18, 0.35);
}

.ptp-sticky[hidden] { display: none; }

.ptp-sticky-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ptp-sticky-copy strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ptp-sticky-copy span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 247, 238, 0.62);
}

.ptp-sticky .ptp-add { flex: 0 0 auto; min-height: 46px; padding: 11px 22px; font-size: 14px; box-shadow: none; }

/* ---- checkout link — hidden until the box has meals ----------------------- */
/* plan-banner.js reveals [data-plan-checkout] after any add (or on load when
   the box already has meals), so the step after "Added ✓" is on the page
   instead of behind the floating cart icon. Butter over the banner's ink:
   deliberately not another rust pill — this is the NEXT step, not more adding. */

.ptp-checkout {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 15px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--butter);
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 6px 22px rgba(255, 210, 63, 0.32);
  -webkit-tap-highlight-color: transparent;
}

.ptp-checkout:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 210, 63, 0.42); }
.ptp-checkout:active { transform: translateY(0); }
.ptp-checkout:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.ptp-checkout .ptp-add-price { color: var(--ink); opacity: 0.72; }
.ptp-checkout[hidden] { display: none; }

@media (max-width: 640px) { .ptp-actions .ptp-checkout { width: 100%; } }

/* Sticky-bar variant rides on .ptp-add.ptp-add-sm for its pill geometry;
   only the colours change. */
.ptp-sticky .ptp-checkout { background: var(--butter); color: var(--ink); box-shadow: none; }
.ptp-sticky .ptp-checkout:hover { background: var(--butter-2); }

/* ---- top-of-page hero strip (PT_PLAN_HERO) -------------------------------- */
/* Three plan photos + price + anchor, sitting above the article header: real
   food on the first phone screen of pages whose fold used to be all text. */

.ptp-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  padding: 12px 18px 12px 14px;
  border: 1.5px solid var(--hairline);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 10px 30px -18px rgba(12, 13, 18, 0.35);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ptp-hero:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -16px rgba(12, 13, 18, 0.4); }
.ptp-hero:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }

.ptp-hero-shots { display: flex; flex: 0 0 auto; }

.ptp-hero-shots img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--paper);
  background: var(--bg-2);
}

.ptp-hero-shots img + img { margin-left: -16px; }

.ptp-hero-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.ptp-hero-copy strong { font-size: 14.5px; font-weight: 650; line-height: 1.3; }

.ptp-hero-copy > span { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }

.ptp-hero-copy em { font-style: normal; font-weight: 650; color: var(--rust); white-space: nowrap; margin-left: 8px; }

@media print { .ptp, .ptp-cta, .ptp-sticky, .ptp-hero { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .ptp-add, .ptp-meal, .ptp-meal-add { transition: none; }
  .ptp-add:hover, .ptp-meal-add:hover { transform: none; }
}
