/* ==========================================================================
   Notting Hill Vape — category tiles
   NHV-05 - Category Tiles

   Depends on the design tokens in ../nhv.css. No colour, font or spacing
   literal below — add a token there first.
   ========================================================================== */

/* Full-bleed textured band, cards untouched.

   The obvious approach — making .nhv-tiles itself 100vw — also drags the cards out
   of Bootstrap's .container (1170px here) and widens them to 1400px, leaving them
   misaligned with Featured below. So the SECTION stays in normal flow and only a
   ::before escapes: the band spans the viewport, the grid keeps exactly the width
   it had before this change.

   url() in a stylesheet resolves relative to the STYLESHEET, not to <base href>,
   so this path is relative and survives being installed in a subdirectory.

   The texture is decoration: no focal point, dark throughout (luma 43-117), so
   `cover` is safe at any aspect ratio and light content over it is never at risk.
   If it needs swapping seasonally it should become a module setting, not a CSS edit. */
.nhv-tiles {
  display: block;
  position: relative;
  padding: var(--nhv-section-pad) 0;
  /* No bottom margin — the Latest Products band sits directly beneath. */
}

.nhv-tiles::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background-color: var(--nhv-metal-ground);
  background-image: url('../../../../../../image/catalog/home-page/bg-hp-block.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* z-index lifts the cards above the ::before, which would otherwise paint over
   them. Width is deliberately NOT set here — the grid inherits whatever the page
   container gives it, which is what keeps the cards aligned with Featured below. */
.nhv-tiles-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--nhv-gutter);
}

/* The whole card is one link: one tab stop, one target, no nested anchors. */
.nhv-tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--nhv-navy);
  border-radius: var(--nhv-radius);
  color: var(--nhv-cream);
  text-decoration: none;
  transition: transform var(--nhv-transition);
}
.nhv-tile:hover,
.nhv-tile:focus { color: var(--nhv-cream); text-decoration: none; }

/* Visible keyboard focus — the default outline is lost against navy. */
.nhv-tile:focus-visible {
  outline: 2px solid var(--nhv-copper);
  outline-offset: 2px;
}

.nhv-tile-media { display: block; line-height: 0; }
.nhv-tile-media img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 300ms ease;
}
.nhv-tile:hover .nhv-tile-media img { transform: scale(1.04); }

/* Text sits over the lower half of the artwork, on a gradient so it stays
   readable whatever the image does underneath. */
.nhv-tile-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 18px 20px 22px;
  text-align: center;
  background: linear-gradient(to top, var(--nhv-navy) 0%, var(--nhv-navy-transparent) 100%);
}

/* Colour is sampled from the artwork: the baked-in "VAPE KITS" is #B49B74, which
   is within a few units of --nhv-copper-text (#B49172) and indistinguishable by
   eye. Reusing the token rather than adding a near-duplicate that would drift.

   SIZE MATTERS HERE. The title sits in the top of the gradient, where the panel is
   nearly transparent, so its real backdrop is the artwork (~rgb(37,52,60)) rather
   than solid navy. Measured contrast is 4.42:1 — which clears WCAG AA for LARGE
   text (>=18.66px bold) but not the 4.5:1 body threshold. 28px desktop / 23px
   mobile both qualify. Drop it below ~19px and this heading stops being
   accessible; use --nhv-white or --nhv-cream-bright if it ever needs to be small. */
.nhv-tile-title {
  margin: 0 0 6px;
  font-family: var(--nhv-font-display);
  font-size: 28px;
  font-weight: var(--nhv-fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--nhv-copper-text);
  transition: color var(--nhv-transition);
}
.nhv-tile:hover .nhv-tile-title,
.nhv-tile:focus .nhv-tile-title { color: var(--nhv-white); }

.nhv-tile-text {
  display: block;
  margin: 0 auto 10px;
  max-width: 34ch;
  font-family: var(--nhv-font-body);
  font-size: var(--nhv-fs-base);
  line-height: 1.4;
  color: var(--nhv-white);
}

.nhv-tile-cta {
  display: inline-block;
  font-family: var(--nhv-font-display);
  font-size: var(--nhv-fs-micro);
  font-weight: var(--nhv-fw-semi);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nhv-copper-text);
  border-bottom: 1px solid var(--nhv-copper);
  padding-bottom: 2px;
  transition: color var(--nhv-transition);
}
.nhv-tile:hover .nhv-tile-cta { color: var(--nhv-cream-bright); }

@media (max-width: 991px) {
  .nhv-tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .nhv-tile-title { font-size: 23px; }
}

@media (max-width: 600px) {
  .nhv-tiles { padding: calc(var(--nhv-section-pad) / 2) 0; }
  .nhv-tiles-grid { grid-template-columns: 1fr; }
  .nhv-tile-body { padding: 14px 16px 18px; }
}

/* Respect a reduced-motion preference: the zoom is decoration, not information. */
@media (prefers-reduced-motion: reduce) {
  .nhv-tile-media img,
  .nhv-tile { transition: none; }
  .nhv-tile:hover .nhv-tile-media img { transform: none; }
}
