/* ==========================================================================
   Sale landing template (Black Friday 2026 onward) — scoped under .sale-lp.

   Every measurement comes from Kim's handover (BF_SALE_PAGE_NOTES.pdf,
   reference views: desktop 1440 / mobile 390) and is asserted by
   design/targets/bf-landing/contract.spec.ts. Two stepped breakpoints only:
   <=767px takes the mobile spec values, >=768px the desktop ones —
   "tablet should look like desktop" is literal.
   Fonts come from ds-tokens.css (Quicksand + Devant @font-face).
   ========================================================================== */

.sale-lp {
  font-family: var(--font-core, "Quicksand", sans-serif);
  color: #000000;
}

/* :where() keeps the reset at (0,1,0) so component classes can set margins. */
.sale-lp :where(h1, h2, h3, p) {
  margin: 0;
}

.sale-lp img {
  display: block;
  width: 100%;
  height: auto;
}

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

/* --- Hero ----------------------------------------------------------------- */

.sale-lp__hero picture,
.sale-lp__hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Heading + intro ------------------------------------------------------ */

.sale-lp__heading {
  padding: 30px 20px 40px;
  text-align: center;
}

.sale-lp__intro-wrap {
  /* Kim (12 Nov review): tighten the white gap around the SEO copy block —
     it sits between mockup-locked sections, so it pulls up into the heading's
     comp whitespace rather than stacking on top of it. */
  margin-top: -20px;
  padding: 0 20px 24px;
  text-align: center;
}

.sale-lp__h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  /* Kim's comps rasterise Quicksand ~3% tighter than Chrome's default
     tracking; measured against the 1440 mockup (568px -> 550px line width). */
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #000000;
}

.sale-lp__strap {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #000000;
}

.sale-lp__intro {
  max-width: 980px;
  margin: 24px auto 0;
  font-size: 15px;
  line-height: 1.75;
}

.sale-lp__intro-more {
  display: none;
}

.sale-lp__intro.is-expanded .sale-lp__intro-short {
  display: none;
}

.sale-lp__intro.is-expanded .sale-lp__intro-more {
  display: block;
}

.sale-readmore,
.sale-readless {
  color: #e31a82;
  cursor: pointer;
  font-weight: 600;
}

/* --- The grid (tiles + full-width banners, one flow) ---------------------- */

.sale-lp__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

/* --- Tiles ---------------------------------------------------------------- */

.sale-tile {
  display: block;
  text-decoration: none;
}

.sale-tile__media {
  position: relative;
  display: block;
  /* The pro-label img compensates for artwork whitespace with small negative
     insets — clip so it can never widen the page. */
  overflow: hidden;
}

.sale-tile__media img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.sale-tile__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px; /* bottom of image to button: 30px */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Handover's "title to button: 20px" measures to the glyphs; the title's
     line box carries ~4px of bottom slack at 24px/1.2 (mockup-verified). */
  gap: 16px;
  pointer-events: none;
}

.sale-tile__title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  /* Kim's comps track tile titles slightly wider (mockup: 174px vs 168px). */
  letter-spacing: 0.015em;
  color: #ffffff;
  text-align: center;
}

.sale-tile__btn,
.sale-banner__btn {
  display: inline-block;
  background: #e31a82;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 21px; /* mockup pill: ~114x39 */
  border-radius: 999px;
  text-decoration: none;
  pointer-events: auto;
}

/* The banner button is itself an <a>, so the legacy global a:hover grey
   would swallow it (the tile pill is a span inside the card link and sets
   its own colour). Pin the pill's colours in every interactive state. */
.sale-tile__btn:hover,
.sale-tile__btn:focus,
.sale-tile:hover .sale-tile__btn,
a.sale-banner__btn:hover,
a.sale-banner__btn:focus,
a.sale-banner__btn:active {
  background: #e31a82;
  color: #ffffff;
  text-decoration: none;
}

/* --- Discount rosette ------------------------------------------------------ */

.sale-rosette {
  position: absolute;
  top: 14px; /* discount label inset: 14px top and right */
  right: 14px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  /* Mockup-measured blob: 107x107, quarter-circle sweep bottom-left. */
  padding: 18px 13px 27px 25px;
  border-radius: 30px 12px 28px 100%;
}

/* The designer's pro-label SVG (square artwork) replaces the CSS blob when
   badge_image is set. The SVG carries internal whitespace (drawn blob ≈ 91/107
   of the box, offset L7 T9 R13 B11 at this scale), so the img is sized and
   inset so the DRAWN blob lands at the mockup's 107px with the handover's
   14px top/right inset measured to the artwork. */
img.sale-rosette--img {
  width: 126px;
  height: 126px;
  top: 4px;
  right: 2px;
  padding: 0;
  background: none;
  border-radius: 0;
  display: block;
}

.sale-rosette__big {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.sale-rosette__pct {
  font-size: 26px;
}

.sale-rosette__small {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
}

/* --- Banners ---------------------------------------------------------------- */

.sale-banner {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden; /* see .sale-tile__media */
}

.sale-banner__media {
  display: block;
}

/* The whole banner links to its destination, not just the pill. The hit
   area sits over the artwork; the overlay text and the rosette let clicks
   fall through to it, and the pill (pointer-events: auto) stays on top. */
.sale-banner__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sale-banner__overlay,
.sale-banner .sale-rosette {
  pointer-events: none;
}

.sale-banner__overlay {
  z-index: 2;
}

.sale-banner__media img {
  aspect-ratio: 2200 / 540;
  object-fit: cover;
}

.sale-banner__overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 66.666%; /* text centred within the left two-thirds */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sale-banner__title {
  font-family: var(--font-promo, "Devant", sans-serif);
  font-weight: 500;
  font-size: 128px;
  line-height: 0.85;
  /* Measured against the 1440 mockup: Kim's comp tracks Devant ~1.1% wider
     (em-relative so the 52px mobile heading scales the same way). */
  letter-spacing: 0.011em;
  text-transform: uppercase;
  color: #ffffff;
}

.sale-banner__accent {
  color: #e31a82;
}

.sale-banner__sub {
  margin-top: -5px;
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
}

/* The handover centres the heading + subheading ONLY, with the button
   underneath: the negative bottom margin removes the button from the
   flex-centring maths (margin-top 13 + pill height 37 = 50). */
.sale-banner__btn {
  margin-top: 13px;
  margin-bottom: -50px;
}

/* --- FAQ -------------------------------------------------------------------- */

.sale-lp__faq {
  background: #f4f4f6;
  padding: 52px 20px 62px;
  margin-top: 40px;
}

.sale-lp__faq-inner {
  max-width: 1300px;
  margin: 0 auto;
}

.sale-lp__faq-title {
  font-family: var(--font-promo, "Devant", sans-serif);
  font-weight: 500;
  color: #e31a82;
  text-transform: uppercase;
  text-align: center;
  font-size: 112px;
  margin-bottom: 30px;
}

.sale-accordion .accordion-item {
  background: #ffffff;
  border: 0;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sale-accordion .accordion-button {
  background: #ffffff;
  box-shadow: none;
  font-weight: 600;
  color: #000000;
  padding: 18px 22px;
}

.sale-accordion .accordion-button:focus {
  box-shadow: none;
}

.sale-accordion .accordion-button::after {
  background-image: none;
  content: "+";
  font-size: 26px;
  line-height: 1;
  color: #e31a82;
  transform: none;
  width: auto;
  height: auto;
}

.sale-accordion .accordion-button:not(.collapsed)::after {
  content: "\2212";
}

.sale-accordion .accordion-body {
  padding: 0 22px 20px;
  color: #555555;
  line-height: 1.7;
}

/* ==========================================================================
   Mobile (reference view 390) — the handover's second column of values.
   ========================================================================== */

@media (max-width: 767px) {
  .sale-lp__heading {
    padding: 13px 16px 15px;
  }

  .sale-lp__h1 {
    font-size: 22px;
    /* Mobile comp tracks tighter still (mockup-measured: 324px line width). */
    letter-spacing: -0.04em;
  }

  .sale-lp__strap {
    margin-top: 3px;
    font-size: 15px;
    letter-spacing: -0.01em;
  }

  .sale-lp__intro-wrap {
    margin-top: -4px;
    padding: 0 16px 18px;
  }

  .sale-lp__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  /* Optional mobile reorder: a section's `order_mobile` arrives as --m-order
     on its grid child. Unset = 0 = DOM order, so pages without the key
     (blinds) are unaffected. Curtains: banners after every 4 tiles here vs
     every 6 on desktop. CSS order moves the visual order only — DOM/focus
     order stays the desktop sequence (accessibility trade-off, see the
     bf-curtains INTAKE log). */
  .sale-lp__grid > * {
    order: var(--m-order, 0);
  }

  .sale-tile__media img {
    aspect-ratio: 4 / 5;
  }

  /* A trailing odd tile sits alone on the 2-up grid — the design centres it
     at single-column width (class set data-driven in the Blade). */
  .sale-tile--centered {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 7px) / 2);
  }

  .sale-tile__overlay {
    /* The PDF says 12px/7px here, but the mobile mockup renders 16px to the
       pill and 13px glyph-gap — mockup wins pixel positions (INTAKE ruling,
       flagged for Kim in the MR). */
    bottom: 16px;
    gap: 10px;
  }

  .sale-tile__title {
    font-size: 15px;
  }

  .sale-tile__btn,
  .sale-banner__btn {
    font-size: 10px;
    padding: 8px 16px;
  }

  .sale-rosette {
    top: 6px; /* discount label inset: 6px top and right */
    right: 6px;
    /* Mockup-measured blob: 58x58. */
    padding: 9px 7px 14px 13px;
    border-radius: 16px 7px 15px 100%;
  }

  img.sale-rosette--img {
    /* Drawn blob 58px with the 6px artwork inset (same internal-whitespace
       compensation as desktop, scaled). */
    width: 68px;
    height: 68px;
    top: 1px;
    right: -1px;
    padding: 0;
  }

  .sale-rosette__big {
    font-size: 22px;
  }

  .sale-rosette__pct {
    font-size: 14px;
  }

  .sale-rosette__small {
    font-size: 12px;
  }

  .sale-banner__media img {
    aspect-ratio: 800 / 276;
  }

  .sale-banner__overlay {
    /* Mobile is padded, not centred. Kim's 12 Nov review amendments: title
       and subheading nudged up 9px then back down 3px — net 6px above the
       mockup position (24px -> 18px), button held where it was (its margin
       absorbs the 6px), for more breathing space before the button. */
    justify-content: flex-start;
    padding: 18px 0 18px;
  }

  .sale-banner__title {
    font-size: 52px;
  }

  .sale-banner__sub {
    margin-top: 1px;
    font-size: 10px;
  }

  .sale-banner__btn {
    margin-top: 9px; /* 3px + the net 6px the text block moved up (Kim, 12 Nov) */
    margin-bottom: 0;
  }

  /* ---- 247curtains (.sale-lp--curtains) mobile calibrations ----------
     Curtains mockup (C_BF_PROMO_MOBILE.jpg) draws both banner headings
     smaller than blinds: 48px (measured-from-mockup; Kim: "may need reducing
     a couple of pt"). Glyph height 31px vs blinds' 34px at 52px, and the
     word widths pin it: "BESTSELLING" is 114px in the curtains mockup vs
     124px in the blinds one (52 x 114/124 = 47.8). Kim's blinds net-6px
     amendment is NOT applied to curtains — the curtains mockup stands as
     drawn (INTAKE ruling, pending Kim). Calibrated 17 Nov against both
     curtains mockup banners with the compare runner's crops, aligned on the
     banner artwork:
     - padding-top 28px: the blinds mockup's 24px + 4px for the shorter line
       box, keeping the baseline 62px below the banner top where the curtains
       mockup draws it (contract: bannerBaselineMobile). Heading glyph rows
       land exactly on the mockup's.
     - letter-spacing 0.016em (base 0.011em): Kim's comp sets this smaller
       heading ~0.25px/letter wider again; word widths now match to 1px.
     - margin-left 2px on heading + button: both centred 1px left of the
       mockup (trailing letter-spacing, pill rounding); 2px of margin on a
       centred item moves it 1px. Both now land at dx 0.
     - sub margin-top -1px (base 1px): the mockup's two banners draw the
       subheading 1px and 2px higher than the as-drawn stack; -1px leaves
       +/-1px, the closest any single value gets.
     - button margin-top 6px: likewise the mockup's two pills sit 2px apart
       (Bestselling lower than Designer); 6px leaves Bestselling 2px high and
       Designer 1px low, the least worst single value. */
  .sale-lp--curtains .sale-banner__overlay {
    padding-top: 28px;
  }

  .sale-lp--curtains .sale-banner__title {
    font-size: 48px;
    letter-spacing: 0.016em;
    margin-left: 2px;
  }

  .sale-lp--curtains .sale-banner__sub {
    margin-top: -1px;
  }

  .sale-lp--curtains .sale-banner__btn {
    margin-top: 6px;
    margin-left: 2px;
  }

  .sale-lp__faq {
    padding: 36px 16px 44px;
    margin-top: 24px;
  }

  .sale-lp__faq-title {
    font-size: 56px;
    margin-bottom: 20px;
  }
}

/* ---- 247curtains (.sale-lp--curtains) tablet (768–1023px) -------------
   Tablet takes the desktop sizes, but the curtains titles are longer than
   the blinds ones: at 24px in a ~243px tile "Ready-Made", "Voile & Sheer",
   "Velvet & Velour" and "Stripe & Check Curtains" wrap to two lines and run
   ~30px up under the 30% OFF label (z-index 2). Scale the title with the
   viewport so the widest ("Velvet & Velour Curtains", ~11.8 x font-size)
   stays on one line: 2.4vw = 18.4px at 768 (~218px in a 243px tile), 24px
   again from 1000px. Curtains-only so blinds stays byte-identical at every
   width; INTAKE.md ruling (17 Nov, tablet titles), pending Kim. */
@media (min-width: 768px) and (max-width: 1023px) {
  .sale-lp--curtains .sale-tile__title {
    font-size: clamp(16px, 2.4vw, 24px);
  }
}
