/* Down Sea Charters: the shared full-width photo hero (Inshore, Nearshore, Deep Sea, Fishing Trips, About).
   Figma hero frames 248:8 / 248:55 / 248:102 / 248:150 / 248:207 and the phone first screens (photo 248:31, copy 248:33).
   Load it before the page's own stylesheet (front matter: css: phero, trip).

   Markup:
     <div class="phero-top">                                   (optional wrapper: only needed when a breadcrumb sits above the hero)
       <nav class="…-crumb" aria-label="Breadcrumb">…</nav>     (the page's own breadcrumb; a 48px row above the hero on desktop)
       <section class="phero phero--70" style="--pos: 12% 14%; --zoom: 1.3; --pos-phone: 80% 0%; --zoom-phone: 1.15">
         <picture class="phero__media"><source media="(max-width: 767px)" …><img … fetchpriority="high"></picture>
         <div class="wrap phero__in">
           <p class="phero__rating">…</p>
           <h1 class="d phero__h1">…</h1>
           <p class="phero__lead">…</p>
           <p class="phero__price"><strong>From $450</strong> <span>per trip, up to 3 anglers</span></p>   (optional; never a heading)
           <div class="phero__btns"><a class="btn btn--fill" …>Request a booking</a><a class="btn btn--line" …>Call …</a></div>
         </div>
       </section>
     </div>

   Height: phero--70 = 70vh (546px in a 1440x780 window), phero--60 = 60vh (468px). It is a min-height: the copy block
   (plus 40px above and below) always fits, so nothing is clipped in short windows or with large text.

   Photo position. In the Figma the photo sits uncropped in a clipping frame, usually a little larger than "cover":
     --pos   x% y%   x = left offset / (frame width - photo width), y = top offset / (frame height - photo height)
     --zoom  n       photo width / frame width when the photo is wider than the frame (1 = plain cover; optional)
     --pos-phone / --zoom-phone   the same two numbers from the 390x300 phone photo frame (default: the desktop ones / 1)
   The image is object-fit: cover at --pos, then scaled by --zoom around the same point, which reproduces the Figma
   offsets exactly at 1440 and keeps the same part of the photo in view at other sizes.

   Widths:
     >= 1440       the Figma sizes; the copy stays in the 1280 wrap and the scrim follows the wrap. The copy moves right
                   on wide screens while the photo stays edge to edge, so a page whose subject sits close to the copy
                   shifts --pos in its own stylesheet (see Inshore in trip.css).
     1024 to 1439  the 1440 composition scaled with the window (copy widths, headline and buttons in vw, with floors),
                   so the copy covers the same part of the photo as in the Figma.
     768 to 1023   no Figma frame. Photo band on top, copy on navy below with the two buttons (the phone logic): at this
                   width the copy would cover most of the photo and sit on faces and fish.
     < 768         the phone frame: photo 300px tall, then breadcrumb, rating, 44px H1, 16px lead, price. No buttons:
                   the phone dock carries Call and Book. */

.phero { --phero-l: max(var(--pad), calc((100vw - 1280px) / 2)); position: relative; isolation: isolate; display: flex; align-items: center; min-height: 70vh; background: var(--deep); overflow: hidden; }
.phero--60 { min-height: 60vh; }
.phero__media { position: absolute; inset: 0; z-index: -1; display: block; overflow: hidden; }
.phero__media img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--zoom, 1)); transform-origin: var(--pos, 50% 50%); }
/* Scrim: the Figma's 0.85 -> 0.68 at 30% of a 1440 frame, written from the wrap's left edge (30% of 1440 = wrap + 352px)
   so it stays behind the copy on screens wider than 1440, and in vw below 1440 so it scales with the copy.
   Departure from the Figma (which fades straight to 0 at 54% = wrap + 698px, leaving 0.27 behind the end of the lead):
   the fade holds 0.46 at the lead's right edge (wrap + 560px) and is clear at wrap + 750px (57.6% at 1440). With the
   Figma stops, white 18px text measured 3.7:1 on the Deep Sea sky and 3.6 to 4.0 on Nearshore at 1280 / 1920 / 2560
   (WCAG AA needs 4.5).
   Per-page tuning: --phero-a1 (alpha at wrap + 352px), --phero-a2 (alpha at wrap + 560px), --phero-x3 (where it clears). */
.phero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 9, 66, .85) calc(var(--phero-l) - 80px), rgba(0, 9, 66, var(--phero-a1, .68)) calc(var(--phero-l) + min(352px, 24.44vw)), rgba(0, 9, 66, var(--phero-a2, .46)) calc(var(--phero-l) + min(560px, 38.89vw)), rgba(0, 9, 66, 0) calc(var(--phero-l) + min(var(--phero-x3, 750px), 52.08vw))); }

.phero__in { position: relative; padding-block: 40px; }
.phero__rating { font: 500 15px/1.45 var(--body); letter-spacing: .03em; }
.phero__h1 { max-width: min(600px, 41.67vw); margin-top: 14px; font-size: clamp(46px, 4.444vw, 64px); line-height: .9; }
.phero__lead { max-width: min(560px, 38.89vw); margin-top: 19px; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.55; }
.phero__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; margin-top: 24px; font-size: 16px; line-height: 1.45; }
.phero__price strong { font: 800 clamp(34px, 2.778vw, 40px)/1 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.phero__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.phero__lead + .phero__btns { margin-top: 28px; }
.phero__btns .btn { width: min(264px, 18.33vw); min-height: 56px; padding: 15px 20px; }

/* small desktop: the buttons are narrower than their Figma 264px, so the label is set a little smaller */
@media (min-width: 1024px) and (max-width: 1279px) {
  .phero__btns .btn { padding-inline: 8px; font-size: 13px; letter-spacing: .06em; }
}

/* tablet and phone: photo band on top, copy on navy below */
@media (max-width: 1023px) {
  .phero, .phero--60 { display: block; min-height: 0; overflow: visible; }
  .phero__media { position: relative; inset: auto; z-index: auto; height: clamp(340px, 46vw, 460px); }
  .phero__media::after { content: none; }
  .phero__in { padding-block: 40px 48px; }
  .phero__h1 { max-width: 640px; font-size: 56px; }
  .phero__lead { max-width: 640px; font-size: 18px; }
  .phero__price strong { font-size: 40px; }
  .phero__btns .btn { width: 264px; }
}

/* phone: photo 300px tall, then (breadcrumb,) rating, 44px H1, 16px lead, price */
@media (max-width: 767px) {
  .phero__media { height: 300px; }
  .phero__media img { object-position: var(--pos-phone, var(--pos, 50% 50%)); transform: scale(var(--zoom-phone, 1)); transform-origin: var(--pos-phone, var(--pos, 50% 50%)); }
  .phero .phero__in { padding: 24px 24px 28px; }
  .phero__rating { font-size: 13px; }
  .phero__h1 { max-width: none; margin-top: 10px; font-size: 44px; }
  .phero__lead { max-width: none; margin-top: 13px; font-size: 16px; }
  .phero__price { gap: 0 10px; margin-top: 17px; font-size: 14px; }
  .phero__price strong { font-size: 32px; }
  .phero__btns { display: none; }

  /* with a breadcrumb: photo first, then the breadcrumb, then the copy (the Figma's order) */
  .phero-top { display: flex; flex-direction: column; background: var(--deep); }
  .phero-top > .phero { display: contents; }
  .phero-top .phero__media { order: 1; }
  .phero-top > nav { order: 2; }
  .phero-top .phero__in { order: 3; padding-top: 12px; }
}
