/*
 * Affiliate product page — hero sizing.
 *
 * The page's outbound link is carried above the fold by two things: the
 * summary paragraph moving below the buy box (in product.php) and the
 * floating pill bar, #sticky-cart-bar, which is up whenever the buy box is
 * off screen. This file handles the third: an image that was taller than the
 * screen it had to share.
 *
 * Plain CSS on purpose. /css/app.css is a compiled Tailwind build and only
 * contains classes that existed when it was generated, so a new utility class
 * would silently do nothing. This sheet is loaded after app.css, which is what
 * lets the rule below win against `aspect-[4/5]` at equal specificity.
 */

/*
 * `aspect-[4/5]` is right in the two-column desktop layout and wrong below it,
 * where the gallery is full-width and its height is therefore a ratio of the
 * viewport *width*. The wider the single-column window, the taller the image:
 * 470px on a 375px phone, and 881px — an entire screen — on a 768px tablet.
 *
 * So the cap runs to 1023px, not to the phone breakpoint. That is where
 * `lg:col-span-6` splits the row in two and the ratio starts behaving. Getting
 * this boundary wrong is invisible on a phone and obvious on an iPad, which is
 * the kind of gap that ships.
 *
 * The image is object-contain, so a shorter frame letterboxes it rather than
 * cropping anything out.
 */
@media (max-width: 1023px) {
  .so-pdp-gallery {
    aspect-ratio: auto;
    height: min(46vh, 400px);
  }
}

/* ------------------------------------------------- 2. short description */

/*
 * The value proposition was set at text-xl in muted grey — three lines of
 * large low-contrast type doing the work of a deck. Large and grey is the
 * worst pairing available: it takes the space of a headline and reads with
 * the authority of a caption.
 *
 * Slightly smaller, noticeably darker, and measure-limited so the line length
 * stays in the 60-75 character band that people actually read at speed.
 */
.so-pdp-deck {
  margin: 0 0 1.25rem;
  max-width: 36rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 500;
  color: var(--color-secondary-text, #5F6978);
}

/* --------------------------------------------------- 3. proof points */

/*
 * The three strongest `pros`, lifted above the fold.
 *
 * They already existed on the page — 800px down, under a heading. Next to the
 * button they answer "why this one" while the reader is deciding, which is the
 * only moment the answer is worth anything. Three, not five: past three the
 * list stops being scanned and starts being skipped, and the fourth item
 * always costs a fold.
 */
.so-pdp-proof {
  list-style: none;
  margin: 0 0 1.375rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.so-pdp-proof li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--color-primary-navy, #071B45);
}

.so-pdp-proof svg {
  width: 1.0625rem;
  height: 1.0625rem;
  flex: none;
  margin-top: 0.1875rem;
  color: var(--color-natural-accent, #667051);
}

/* ------------------------------------------------------- 4. buy box */

/*
 * Overrides the shared card's Tailwind utilities by loading after app.css at
 * equal specificity, so the markup keeps one class list and only affiliate
 * pages get this treatment.
 *
 * Two shadows rather than one: a 1px contact shadow to seat the card on the
 * page, and a wide soft one for lift. A single `shadow-sm` gives a card that
 * floats without ever touching down.
 */
.so-buybox {
  position: relative;
  padding: 1.375rem;
  border-radius: 20px;
  border: 1px solid var(--color-soft-border, #DED5C9);
  background: var(--color-card-surface, #FFFDF9);
  box-shadow: 0 1px 2px rgba(7, 27, 69, 0.04), 0 14px 34px -14px rgba(7, 27, 69, 0.16);
}

/*
 * "Best for" was the largest thing in the card — a full sentence set in bold
 * text-xl, in the slot a price would occupy. It is a qualifier, not a
 * headline: it tells you whether to keep reading, and it was shouting.
 */
.so-buybox__label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted-text, #858B94);
}

.so-buybox__bestfor {
  margin: 0 0 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-primary-navy, #071B45);
}

/* How the page was built, kept next to the button where it does the work. */
.so-buybox__trust {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.125rem;
  padding-bottom: 1.125rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-soft-border, #DED5C9) 60%, transparent);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-secondary-text, #5F6978);
}

.so-buybox__trust svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  margin-top: 0.125rem;
  color: var(--color-natural-accent, #667051);
}

/*
 * The reassurance line. "Opens in a new tab" is not decoration — the unknown
 * an outbound button carries is where it takes you and whether you lose the
 * page you are on, and answering it costs one line.
 */
.so-buybox__reassure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-muted-text, #858B94);
}

.so-buybox__reassure svg {
  width: 0.875rem;
  height: 0.875rem;
  flex: none;
}

/* --------------------------------------------------------- 5. title */

/*
 * 44px in a 460px column is not a premium heading, it is an oversized one.
 * The title wrapped to three lines and took 165px — a fifth of a laptop
 * screen — before the reader had learned anything, and pushed the button off
 * the fold on its own.
 *
 * At 36px the same title sets in two lines, holds more presence per line, and
 * gives the measure a sane 30-40 characters. The h1 stays the largest thing on
 * the page; it just stops being the loudest.
 */
.so-pdp-title {
  margin: 0 0 0.875rem;
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
  .so-pdp-title {
    font-size: 2.25rem;
  }
}
