/* ============================================================
   BLACK FRIDAY - TEMPORARY STYLESHEET
   Loaded after styles.css, so it only ADDS. Nothing in the main
   sheet is edited, which means deleting this one file plus the
   sale markup returns the site exactly to normal.
   ============================================================ */

/* ---------- the bar ----------
   Sits above the sticky header rather than inside it, so the header
   keeps its own layout and the brand mark doesn't move. */
.salebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem var(--gutter);
  background: var(--olive-dark);
  color: var(--cream-light);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: center;
  position: relative;
  z-index: 60;
}
.salebar:hover { background: var(--olive); }

.salebar__line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}

.salebar__tag {
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.66rem;
  background: var(--terracotta);
  color: #fff;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.salebar__main { font-weight: 500; }

.salebar__end {
  color: rgba(247, 241, 228, 0.68);
  font-size: 0.74rem;
  white-space: nowrap;
}

/* The digits change every second, so they get a tabular font and a fixed
   min-width - otherwise the whole bar twitches sideways on every tick. */
.salebar__clock {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(247, 241, 228, 0.14);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  min-width: 11.5ch;
  white-space: nowrap;
}
.salebar__clock[hidden] { display: none; }

@media (max-width: 430px) {
  .salebar { font-size: 0.8rem; padding-inline: 0.75rem; }
  .salebar__end { font-size: 0.68rem; }
  .salebar__clock { font-size: 0.74rem; }
}

/* the header is sticky; with a bar above it, it must stick BELOW the bar
   rather than over it, or the bar scrolls away under the header */
.site-header { top: 0; }

/* ---------- sale prices ---------- */
.price.is-sale,
.buybar__price.is-sale {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}

.price__was {
  color: var(--text-muted);
  font-family: var(--serif);
  font-size: 0.62em;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--terracotta);
}
.price__now { font-family: var(--serif); }

.price__badge {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--terracotta);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  align-self: center;
  white-space: nowrap;
}

/* the sticky bar is tight on a phone, so no badge there - the struck price
   and the deadline underneath already carry it */
.buybar__price.is-sale { font-size: 1.05rem; }
.buybar__price.is-sale .price__was { font-size: 0.72em; }
.buybar__price.is-sale small { flex-basis: 100%; }

/* ---------- a quiet line on the watermelon guide ---------- */
.sale-note {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--terracotta);
  font-weight: 500;
}

/* one line of urgency at the last decision point, sitting between the
   closing copy and the price so it reads as part of the offer */
.final__sale {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--terracotta);
  margin-top: 1.1rem;
}

/* ---------- the seal on the hero ----------
   A stamp on the product image reads before a single word does. Built in
   CSS rather than as an image so it stays crisp and costs nothing to load. */
.hero__figure { position: relative; }

.seal {
  position: absolute;
  top: 8%;
  right: 4%;
  width: clamp(4.75rem, 7vw, 6rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--cream-light);
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--sans);
  line-height: 1;
  /* a stamp is never perfectly upright */
  transform: rotate(-9deg);
  box-shadow: 0 12px 26px -12px rgba(63, 68, 48, 0.6);
  /* a thin ring of page colour lifts it off a busy photo */
  /* the ring sits close to the rim, so the type has room inside it -
     at -8px it cut straight through the top line */
  outline: 2.5px solid var(--cream-light);
  outline-offset: -5px;
  padding: 0 6%;
  pointer-events: none;
  z-index: 2;
}

.seal__top {
  font-size: clamp(0.56rem, 2vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.92;
}
.seal__big {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4.8vw, 2.1rem);
  font-weight: 500;
  margin-block: 0.12em 0.04em;
}
.seal__bot {
  font-size: clamp(0.46rem, 1.6vw, 0.62rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.92;
}

/* The hero image runs full-bleed on a phone, so a percentage inset would
   push the seal almost to the screen edge. Pull it back in there. */
@media (max-width: 859px) {
  .seal { top: 16%; right: 4%; width: clamp(5rem, 19vw, 7rem); }
}
@media (prefers-reduced-motion: reduce) { .seal { transform: none; } }

/* ---------- sticky bar: keep the button on one line ----------
   The sale price block is wider than the plain one it replaced (struck
   price + new price + deadline), which squeezed the button until
   "Get the e-book" broke across two lines. The button keeps its natural
   width and the price block gives way instead. */
.buybar .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
.buybar__price.is-sale {
  flex: 1 1 auto;
  min-width: 0;        /* without this a flex item refuses to shrink */
}
.buybar__price.is-sale small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* very narrow phones, or a larger iOS text size: tighten the price block
   rather than let anything wrap */
@media (max-width: 380px) {
  .buybar { gap: 0.6rem; }
  .buybar__price.is-sale { font-size: 0.98rem; }
  .buybar__price.is-sale small { font-size: 0.68rem; }
}
