/* ==========================================================
   InStyle with Stacey — collab bridge page template
   Layout is fixed; each page sets its own "brand skin" by
   overriding the tokens in :root (see <style id="brand-skin">).
   ========================================================== */

:root {
  /* ---- Brand skin tokens (defaults = Stacey neutral) ---- */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Helvetica Neue", Arial, sans-serif;
  --display-weight: 500;
  --display-case: none;          /* none | uppercase */
  --display-tracking: 0;

  --c-bg: #fbf9f6;               /* page background */
  --c-surface: #ffffff;          /* cards */
  --c-ink: #1d1b19;              /* main text */
  --c-muted: #6b655e;            /* secondary text */
  --c-line: #e6e0d8;             /* hairlines */
  --c-accent: #8a6a4f;           /* small accents, eyebrow, code box */
  --c-tint: #f3eee7;             /* soft panels */

  --btn-bg: #1d1b19;
  --btn-ink: #ffffff;
  --btn-radius: 0px;             /* 0 = square, 999px = pill */
  --btn-case: uppercase;
  --btn-tracking: 0.12em;
  --btn-weight: 500;

  --img-ratio: 4 / 5;            /* match the brand's PDP photos */
  --img-bg: #efe9e1;
  --price-weight: 400;

  /* ---- Fixed layout tokens ---- */
  --page-max: 640px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Co-brand bar + disclosure ---------- */
.cobrand {
  text-align: center;
  padding: 18px var(--gutter) 14px;
  border-bottom: 1px solid var(--c-line);
  font-family: var(--font-display);
  font-size: clamp(12px, 3.6vw, 15px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  text-wrap: balance;   /* long brand names wrap evenly, never cut off */
}
.cobrand .x { white-space: nowrap; }
.cobrand .x { color: var(--c-accent); margin: 0 0.5em; letter-spacing: 0; }
.disclosure {
  text-align: center;
  font-size: 12px;
  color: var(--c-muted);
  padding: 8px var(--gutter);
  background: var(--c-tint);
  margin: 0;
}

/* ---------- Hero ---------- */
.hero { padding: 28px 0 8px; }
.hero-photo {
  aspect-ratio: 4 / 5;
  background: var(--img-bg);
  overflow: hidden;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow {
  margin: 28px 0 8px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-accent);
}
h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-case);
  letter-spacing: var(--display-tracking);
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.08;
  margin: 0 0 16px;
  text-wrap: balance;
}
.note p { margin: 0 0 14px; }
.signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  margin: 4px 0 0;
}

/* ---------- Discount code ---------- */
.code {
  margin: 28px 0 8px;
  border: 1px solid var(--c-accent);
  background: var(--c-surface);
  padding: 18px;
  text-align: center;
}
.code-label { margin: 0 0 10px; font-size: 14px; color: var(--c-muted); }
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-value {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--c-line);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.14em;
  min-height: 48px;
}
.code-fine { margin: 10px 0 0; font-size: 12px; color: var(--c-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 50px;
  padding: 12px 18px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 1px solid var(--btn-bg);
  border-radius: var(--btn-radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--btn-weight);
  text-transform: var(--btn-case);
  letter-spacing: var(--btn-tracking);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s ease;
}
.btn:active { opacity: .8; }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.btn-outline { background: transparent; color: var(--btn-bg); }

/* ---------- Products (bento: 1 hero + 2-up grid) ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-case);
  font-size: 28px;
  line-height: 1.15;
  margin: 40px 0 18px;
  text-align: center;
}
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 14px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.card--feature { grid-column: 1 / -1; }
.card-img {
  aspect-ratio: var(--img-ratio);
  background: var(--img-bg);
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; flex: 1; padding-top: 12px; }
.card-name { font-size: 15px; font-weight: 500; margin: 0; line-height: 1.35; }
.card-meta { font-size: 13px; color: var(--c-muted); margin: 2px 0 0; }
.card-price { font-size: 15px; font-weight: var(--price-weight); margin: 6px 0 0; }
.card-price s { color: var(--c-muted); margin-right: 6px; }
.card-why {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.35;
  margin: 10px 0 14px;
}
.card .btn { margin-top: auto; font-size: 12px; letter-spacing: calc(var(--btn-tracking) * .8); padding: 10px 8px; min-height: 46px; }
.card--feature .card-name { font-size: 18px; }
.card--feature .card-why { font-size: 20px; }
.card--feature .btn { font-size: 14px; min-height: 52px; }

/* Placeholder art for the template (remove once real photos are in) */
.ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-muted); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  background:
    linear-gradient(135deg, transparent 49.6%, var(--c-line) 50%, transparent 50.4%),
    var(--img-bg);
}

/* ---------- Footer ---------- */
.more {
  margin: 48px 0 0;
  padding: 28px 0;
  border-top: 1px solid var(--c-line);
  text-align: center;
}
.more h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 24px; margin: 0 0 6px; }
.more p { margin: 0 0 16px; color: var(--c-muted); font-size: 15px; }
.more .btn { max-width: 320px; margin: 0 auto; }

/* Substack's official subscribe embed (its inner styling is Substack's) */
.substack-embed {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--c-line);
}
.substack-embed iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  background: #fff;
}
.more .sub-alt { margin: 12px 0 0; font-size: 13px; }
.more .sub-alt a { color: var(--c-muted); }
.fine {
  text-align: center;
  font-size: 12px;
  color: var(--c-muted);
  padding: 20px var(--gutter) 40px;
  line-height: 1.5;
}
.fine a { color: var(--c-muted); }

/* Copied toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--c-ink); color: var(--c-bg);
  padding: 10px 18px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Very narrow phones: stack everything */
@media (max-width: 340px) {
  .products { grid-template-columns: 1fr; }
}
/* Larger screens: a little more air */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .hero { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================
   SPOTLIGHT — one hero product (+ up to 2 "pairs well with")
   ========================================================== */
.sp { padding-bottom: 8px; }

/* Swipeable gallery */
.gallery { margin: 0 calc(var(--gutter) * -1); position: relative; }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: var(--img-ratio); background: var(--img-bg); overflow: hidden;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-dots { display: flex; justify-content: center; gap: 8px; padding: 12px 0 0; }
.gallery-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--c-line); transition: background .2s; }
.gallery-dots span.on { background: var(--c-ink); }
@media (min-width: 700px) { .gallery { margin: 24px 0 0; } }

/* Product header */
.sp-head { padding-top: 20px; }
.sp-head .eyebrow { margin-top: 0; }
.sp-head h1 { font-size: clamp(30px, 8vw, 40px); margin-bottom: 6px; }
.sp-sub { margin: 0; color: var(--c-muted); font-size: 14px; }
.sp-price { margin: 10px 0 0; font-size: 20px; font-weight: var(--price-weight); }
.sp-price s { color: var(--c-muted); font-size: 16px; margin-right: 8px; }
.sp-price .save { font-size: 13px; color: var(--c-accent); margin-left: 8px; letter-spacing: .04em; }

/* Options: chips (sizes/scents/flavors/colors) and swatches (shades) */
.opts { margin: 20px 0 0; }
.opts-label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--c-line); background: var(--c-surface); border-radius: var(--btn-radius);
  font-size: 14px; text-decoration: none; color: var(--c-ink);
}
.chip:active { border-color: var(--c-ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 56px; text-decoration: none; font-size: 11px; color: var(--c-muted); text-align: center; line-height: 1.25; }
.swatch i { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); box-shadow: inset 0 0 0 3px var(--c-bg); outline: 1px solid var(--c-line); }

/* Retailer buttons */
.buy { margin: 22px 0 0; display: grid; gap: 10px; }
.buy .btn { min-height: 54px; font-size: 14px; }
.buy-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.buy-more .btn { min-height: 46px; font-size: 12px; }
.code.code--compact { margin: 20px 0 0; padding: 14px; }

/* Content blocks */
.block { margin: 40px 0 0; }
.block h2 {
  font-family: var(--font-display); font-weight: var(--display-weight);
  text-transform: var(--display-case); font-size: 26px; line-height: 1.15; margin: 0 0 14px;
}
.highlights { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-line); }
.highlights li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--c-line); }
.highlights b { display: block; font-weight: 500; }
.highlights span { color: var(--c-muted); font-size: 15px; }
.highlights .n { flex: 0 0 auto; font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--c-accent); width: 22px; }

.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 44px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--c-accent); color: var(--c-accent);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.steps b { display: block; font-weight: 500; }
.steps span { color: var(--c-muted); font-size: 15px; }

.looks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.looks figure { margin: 0; }
.looks .ph-box { aspect-ratio: 3 / 4; background: var(--img-bg); overflow: hidden; }
.looks figcaption { font-family: var(--font-display); font-style: italic; font-size: 16px; line-height: 1.3; margin-top: 8px; }
.looks figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }

.details { margin: 0; border-top: 1px solid var(--c-line); }
.details div { display: grid; grid-template-columns: 38% 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-line); font-size: 15px; }
.details dt { color: var(--c-muted); }
.details dd { margin: 0; }

.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ba figure { margin: 0; }
.ba .ph-box { aspect-ratio: 1 / 1; background: var(--img-bg); }
.ba figcaption { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); text-align: center; margin-top: 6px; }
.ba-note { font-size: 12px; color: var(--c-muted); margin: 8px 0 0; text-align: center; }

.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pairs .card .btn { font-size: 11px; }
.pairs .card:only-child {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 42% 1fr; gap: 16px; align-items: start;
}
.pairs .card:only-child .card-body { padding-top: 0; }

.claims { margin: 32px 0 0; padding: 14px; background: var(--c-tint); font-size: 12px; color: var(--c-muted); line-height: 1.5; }

/* Sticky shop bar (phones) */
.sticky-buy {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--c-surface); border-top: 1px solid var(--c-line);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-buy.show { transform: none; }
.sticky-buy .sb-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
.sticky-buy .sb-text b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-buy .sb-text span { color: var(--c-muted); }
.sticky-buy .btn { flex: 0 0 auto; min-height: 46px; padding: 10px 20px; font-size: 12px; }
body.has-sticky { padding-bottom: 76px; }
@media (min-width: 900px) { .sticky-buy { max-width: 640px; margin: 0 auto; border: 1px solid var(--c-line); border-bottom: 0; } }

/* ---------- Disclosure line (v4, Playbook v1.3) ----------
   One plain line directly above the first product, before any
   affiliate link. Readable, not a banner. */
.disc-line {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-muted);
}
.sp .disc-line { margin: 14px 0 0; }
