/* ==========================================================================
   MAGNETIE — Homepage Composition (Function C)
   Styles for the exact homepage scroll order:
     01 Hero -> 01b Benefit strip -> 02 Featured Products -> 03/04
     Campaign+Preview (FW26, SS26, Hot Picks) -> 05 Information / Footer.
   Markup for 02/03/04 is generated by js/home.js from a single data set;
   these rules target the class names that renderer emits. Hero is static
   markup in index.html; the global footer lives in css/footer.css +
   js/footer.js.
   ========================================================================== */

/* ==========================================================================
   01 — HERO
   ========================================================================== */

/* Its own block under the header, with no visible text: the banner carries its
   own copy, so it is shown whole at its file's ratio: 1920x835, and 750x1150 for
   the phone file (<picture> in index.html). The whole hero is one link (.hero__link, added by js/home.js) to the FW26
   page. */
.hero {
  position: relative;
  aspect-ratio: 1920 / 835;
  background: var(--color-bg-cool);
  overflow: hidden;
}

.hero__link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__link:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: -6px;
}

.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .hero {
    aspect-ratio: 750 / 1150;
  }
}

/* ==========================================================================
   01b — BENEFIT STRIP
   ========================================================================== */

/* Four service highlights right under the hero: one row, two by two on
   phones. */
.benefit-strip {
  padding-block: var(--space-5);
  background: var(--color-surface);
  border-bottom: var(--border-hairline);
}

.benefit-strip__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.benefit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 0;
}

.benefit svg {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  color: var(--color-ink);
}

/* Same type as the header nav (.site-nav a). */
.benefit__title {
  font-size: var(--fs-nav);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink);
}

.benefit__text {
  margin-top: 2px;
  font-size: var(--fs-nav);
  line-height: var(--lh-snug);
  color: var(--color-ink-soft);
}

@media (max-width: 768px) {
  .benefit-strip {
    padding-block: var(--space-4);
  }

  .benefit-strip__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--space-2);
  }

  .benefit {
    justify-content: flex-start;
    gap: 6px;
  }

  .benefit svg {
    width: 22px;
    height: 22px;
  }

  .benefit__title {
    font-size: clamp(0.5625rem, 2.7vw, 0.6875rem);
    letter-spacing: 0;
  }

  .benefit__text {
    font-size: clamp(0.5625rem, 2.9vw, 0.75rem);
  }
}

/* ==========================================================================
   02 — FEATURED PRODUCTS
   ========================================================================== */

.featured {
  padding-block: var(--space-7) var(--space-6);
  background: var(--color-surface);
}

.featured[hidden] {
  display: none;
}

.featured__head {
  text-align: center;
}

.featured__title {
  font-family: var(--font-display);
  font-size: var(--fs-display-lg);
}

.featured__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-7);
  margin-top: var(--space-5);
}

/* Same type as the header nav and the benefit strip. */
.featured__tab {
  padding-block: var(--space-1);
  border-bottom: 1px solid transparent;
  font-size: var(--fs-nav);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.featured__tab:hover,
.featured__tab[aria-pressed="true"] {
  color: var(--color-ink);
}

.featured__tab[aria-pressed="true"] {
  border-bottom-color: var(--color-ink);
}

.featured__rail {
  position: relative;
  margin-top: var(--space-5);
}

/* Four cards per view (three on tablets, two on phones); the rest scroll in. */
.featured__track {
  --featured-gap: var(--space-4);
  --featured-cols: 4;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--featured-cols) - 1) * var(--featured-gap)) / var(--featured-cols));
  gap: var(--featured-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.featured__track::-webkit-scrollbar {
  display: none;
}

.featured__track .product-card {
  min-width: 0;
  scroll-snap-align: start;
}

/* Web: round arrows in the page gutter, centred on the images (js/home.js sets
   the height from the rendered card). */
.featured__arrow {
  position: absolute;
  top: var(--featured-arrow-top, 40%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-ink);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-ink);
  transform: translateY(-50%);
}

.featured__arrow[hidden] {
  display: none;
}

.featured__arrow:disabled {
  border-color: var(--color-line);
  color: var(--color-line-strong);
  cursor: default;
}

.featured__arrow svg {
  width: 16px;
  height: 16px;
}

.featured__arrow--prev {
  left: -35px;
}

.featured__arrow--next {
  right: -35px;
}

@media (max-width: 1024px) {
  .featured__track {
    --featured-cols: 3;
  }
}

@media (max-width: 768px) {
  .featured {
    padding-block: var(--space-6) var(--space-5);
  }

  .featured__title {
    font-size: var(--fs-display-md);
  }

  /* One swipeable row of tabs, bleeding to the screen edges. */
  .featured__tabs {
    flex-wrap: nowrap;
    justify-content: safe center;
    gap: var(--space-5);
    margin-top: var(--space-4);
    margin-inline: calc(var(--container-pad) * -1);
    padding-inline: var(--container-pad);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .featured__tabs::-webkit-scrollbar {
    display: none;
  }

  .featured__tab {
    flex-shrink: 0;
  }

  /* The rail runs to the screen edges, two cards per view. Swiping is the
     browser's own scrolling; js/home.js only runs the rail while it is idle. */
  .featured__rail {
    margin-top: var(--space-4);
    margin-inline: calc(var(--container-pad) * -1);
  }

  .featured__track {
    --featured-gap: var(--space-2);
    --featured-cols: 2;
    scroll-snap-type: none;
  }

  .featured__arrow {
    display: none;
  }
}

/* ==========================================================================
   03 — CAMPAIGN (FW26, SS26, Hot Picks — reused)
   ========================================================================== */

/* A full-bleed banner: the image carries its own copy, so it is shown whole at
   the files' 1920x835 ratio, or 750x1150 where a banner has a phone file (js/home.js MOBILE_BANNERS). An empty .campaign__link stretched
   over it makes the whole banner the link. Same markup from js/home.js
   renderCampaign(). */
/* Tight vertical flow: ~48px desktop / ~32–40px phone between a section
   and the next banner (was 112–128px). */
.campaign {
  background: var(--color-surface);
  padding-top: var(--space-5);
}

.campaign__inner {
  position: relative;
  max-width: none;
  padding-inline: 0;
}

.campaign__media {
  aspect-ratio: 1920 / 835;
  background: var(--color-bg-cool);
}

.campaign__media picture {
  display: block;
  height: 100%;
}

.campaign__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Whole-banner link (empty <a> stretched over .campaign__inner). */
.campaign__link {
  position: absolute;
  inset: 0;
}

.campaign__link:focus-visible {
  outline: 2px solid var(--color-surface);
  outline-offset: -6px;
}

@media (max-width: 768px) {
  .campaign {
    padding-top: var(--space-4);
  }

  .campaign__media--portrait {
    aspect-ratio: 750 / 1150;
  }
}

/* ==========================================================================
   04 — PRODUCT PREVIEW (shell only — Function D owns real grid/card logic)
   ========================================================================== */

/* No heading: the product grid follows its campaign banner directly. */
.product-preview {
  padding-block: var(--space-5);
  background: var(--color-surface);
}

/* Card styles live only in css/product-grid.css (shared with shop.html);
   the duplicated .product-card* rules that used to sit here were removed
   in the frontend redesign so there is one source of truth. */
.product-grid-shell {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-8) var(--space-5);
}

@media (max-width: 1024px) {
  .product-grid-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-7) var(--space-4);
  }
}

@media (max-width: 768px) {
  .product-preview {
    padding-block: var(--space-4);
  }
}

@media (max-width: 480px) {
  .product-grid-shell {
    gap: var(--space-6) var(--space-3);
  }
}

