/* Mobile and tablet hero for home and About.

   Every rule sits inside a max-width query, so the desktop artboard is
   untouched. The markup is the artboard's own - jodroc-hero-mobile.js only adds
   class names and gathers the trailing panels into a rail - so nothing here
   duplicates content or hides an H1. */

@media (max-width: 1024px) {

  /* ── the photograph ────────────────────────────────────────────
     Full-bleed out of the section's padding, with the copy sitting on the
     bottom third over a gradient that is dark enough to hold white text
     without flattening the picture. */
  .jd-m-hero {
    position: relative !important;
    min-height: min(78svh, 620px);
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    width: 100vw !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    isolation: isolate;
  }

  .jd-m-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--jd-shot);
    background-size: cover;
    background-position: var(--jd-shot-pos, 50% 40%);
    /* a slow drift keeps a still photograph from feeling like a placeholder */
    animation: jdDrift 26s ease-in-out infinite alternate;
    z-index: -2;
  }

  .jd-m-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to top,
        rgba(20, 22, 54, 0.94) 0%,
        rgba(20, 22, 54, 0.82) 26%,
        rgba(20, 22, 54, 0.42) 52%,
        rgba(20, 22, 54, 0.14) 78%,
        rgba(20, 22, 54, 0.34) 100%);
    z-index: -1;
  }

  @keyframes jdDrift {
    from { transform: scale(1.06) translate3d(0, 0, 0); }
    to   { transform: scale(1.14) translate3d(0, -1.5%, 0); }
  }
  @media (prefers-reduced-motion: reduce) {
    .jd-m-hero::before { animation: none; transform: scale(1.06); }
  }

  /* ── the words over it ───────────────────────────────────────── */
  .jd-m-hero .jd-hero-copy {
    padding: 0 20px 22px !important;
    color: #fff !important;
  }
  .jd-m-hero .jd-hero-copy > * { color: #fff !important; }

/* About's panel carries a ch-based measure inline; inside a photo hero the
     column should follow the picture, not a desktop reading width */
  .jd-m-hero, .jd-m-hero .jd-hero-copy { max-width: none !important; }
  .jd-m-hero .jd-hero-copy > span:first-child {
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 13.5px !important;
    letter-spacing: 0.14em !important;
    margin-bottom: 14px !important;
  }

  /* The artboard opens home's panel with a hairline rule - an empty element -
     which reads as a scratch on a photograph, so it becomes a short bright
     underline. About opens with a text kicker in that same position, hence
     :empty: without it the kicker gets squashed to 3px and collides with the
     headline underneath. */
  .jd-m-hero .jd-hero-copy > :first-child:empty {
    background: var(--brand-teal, #004F49) !important;
    height: 3px !important;
    width: 46px !important;
    border: 0 !important;
    margin-bottom: 18px !important;
    opacity: 1 !important;
  }

  .jd-m-hero h1 {
    font-size: clamp(34px, 9vw, 52px) !important;
    line-height: 1.03 !important;
    letter-spacing: -0.015em !important;
    margin: 0 0 14px !important;
    text-wrap: balance;
    text-shadow: 0 2px 24px rgba(10, 11, 28, 0.45);
  }

  .jd-m-hero p {
    font-size: 17px !important;
    line-height: 1.5 !important;
    max-width: 34ch !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 0 20px !important;
  }

  /* solid primary, glass secondary - both legible on a photograph */
  .jd-m-hero .btn {
    border-radius: 2px !important;
    font-size: 16px !important;
    padding: 14px 20px !important;
    min-height: 50px !important;
    border-width: 1px !important;
  }
  .jd-m-hero .btn-primary {
    background: var(--brand-teal, #004F49) !important;
    border-color: var(--brand-teal, #004F49) !important;
    color: #fff !important;
  }
  .jd-m-hero .btn-secondary,
  .jd-m-hero .btn:not(.btn-primary) {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.55) !important;
    color: #fff !important;
    backdrop-filter: blur(6px);
  }

  /* ── the category strip ──────────────────────────────────────
     Sits below the picture on the page's own ground: these are cut-out
     product shots on white and they need light behind them. The selector
     carries the id because jodroc-mobile.css already styles #jd-hero-rail as a
     two-column grid, and an id beats a class however late it is declared. */
  #jd-hero-rail.jd-m-strip {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 42vw !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    overflow-x: auto !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 22px 20px 4px !important;
    margin: 0 calc(50% - 50vw) !important;
    width: 100vw !important;
    border: 0 !important;
    align-items: start !important;
  }
  #jd-hero-rail.jd-m-strip::-webkit-scrollbar { display: none; }
  #jd-hero-rail.jd-m-strip > a {
    scroll-snap-align: start;
    min-height: 0 !important;
  }
  #jd-hero-rail.jd-m-strip .plate {
    border-radius: 3px !important;
    background: #fff !important;
  }
  #jd-hero-rail.jd-m-strip span,
  #jd-hero-rail.jd-m-strip a > span { font-size: 13.5px !important; }
  /* the "Scroll" hint is the last cell and has nothing to point at here */
  #jd-hero-rail.jd-m-strip > span:last-child { display: none !important; }

  /* ── the story rail ──────────────────────────────────────────
     The remaining panels were built to cross-fade over a drawing. Stacked on a
     phone they are a wall of text, so they become cards you swipe through -
     the same copy, a fraction of the scrolling. */
  .jd-m-rail {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: min(78vw, 340px) !important;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 26px 20px 30px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
  }
  .jd-m-rail::-webkit-scrollbar { display: none; }

  .jd-m-card {
    scroll-snap-align: center;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 24px 22px 26px !important;
    margin: 0 !important;
    border: 1px solid var(--color-divider, rgba(32,31,29,.16)) !important;
    border-top: 1px solid var(--color-divider, rgba(32,31,29,.16)) !important;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 22, 54, 0.04), 0 8px 24px rgba(20, 22, 54, 0.06);
    text-align: left !important;
  }
  .jd-m-card h2,
  .jd-m-card h3 {
    font-size: 23px !important;
    line-height: 1.14 !important;
    margin: 6px 0 10px !important;
    text-wrap: balance;
  }
  /* the page-wide body size is set for a full-width column; inside a card it
     makes the card taller than the screen, which defeats a swipe rail */
  .jd-m-card p {
    max-width: none !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  /* start the rails at their first item rather than wherever a focus or an
     anchor left the scroll position */
  #jd-hero-rail.jd-m-strip, .jd-m-rail { scroll-padding-left: 20px; }

  /* the leading "01," style label gets its own weight on a card */
  .jd-m-card > :first-child {
    color: var(--brand-teal, #004F49) !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase;
    font-size: 13.5px !important;
  }
}

/* a tablet has room for wider cards and a taller picture */
@media (min-width: 601px) and (max-width: 1024px) {
  .jd-m-hero { min-height: min(72svh, 700px); }
  .jd-m-hero .jd-hero-copy { padding: 0 40px 34px !important; }
  #jd-hero-rail.jd-m-strip { grid-auto-columns: 22vw !important; padding: 0 40px 28px !important; }
  .jd-m-rail { grid-auto-columns: min(52vw, 400px) !important; padding: 34px 40px 38px; }
}
