/* ==========================================================================
   GoS Hero — homepage category block (loaded on the homepage only)

   Same composition as Paleo Passion's: a category panel and two large tiles,
   then a row of small tiles ending on the cross-link to the other shop. In
   Grain of Sand's light palette; the --gos-* tokens come from the child
   theme, and every var() has a fallback so this file stands alone.
   ========================================================================== */

.gos-hero {
  padding-block: var(--gos-space-xl, 3rem) var(--gos-space-lg, 2rem);
}

.gos-hero__top,
.gos-hero__bottom {
  display: grid;
  gap: var(--gos-space-md, 1.25rem);
}

.gos-hero__top {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: var(--gos-space-md, 1.25rem);
}

.gos-hero__bottom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Two columns on phones: an odd last tile (usually the Paleo Passion one)
   takes the whole row instead of sitting next to a hole. */
@media (max-width: 767.98px) {
  .gos-hero__bottom > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 768px) {
  .gos-hero__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gos-hero__bottom { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
  .gos-hero__top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gos-hero__top--no-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gos-hero__bottom { grid-template-columns: repeat(var(--gos-hero-cols, 5), minmax(0, 1fr)); }
}


/* --- Category panel ----------------------------------------------------- */

/* Below 992px the main menu already lists these, and the panel would push
   the pictures down a full screen; it shows from tablet-landscape up. */
.gos-hero__panel { display: none; }

@media (min-width: 992px) {
  .gos-hero__panel {
    display: block;
    background: var(--gos-card, #fff);
    border: 1px solid var(--gos-rule, #ded2be);
    border-radius: var(--gos-radius, 3px);
    padding: var(--gos-space-xs, 0.5rem) var(--gos-space-md, 1.25rem);
  }
}

.gos-hero__panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gos-hero__panel li + li {
  border-top: 1px solid var(--gos-rule, #ded2be);
}

/* Plain links, no expand toggles: the owner does not want accordions. */
.gos-hero__panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gos-space-xs, 0.5rem);
  padding: 0.85rem 0;
  color: var(--gos-ink, #3e3a35);
  font-size: var(--gos-text-sm, 0.8125rem);
  font-weight: 600;
  letter-spacing: var(--gos-track-label, 0.12em);
  text-transform: uppercase;
  text-decoration: none;
}

.gos-hero__panel a:hover,
.gos-hero__panel a:focus-visible {
  color: var(--gos-gold-text, #6b5426);
}

.gos-hero__panel .material-icons {
  font-size: 1.1rem;
  color: var(--gos-gold, #bfa274);
  transition: transform var(--gos-dur, 220ms) var(--gos-ease, ease);
}

.gos-hero__panel a:hover .material-icons { transform: translateX(3px); }


/* --- Tiles --------------------------------------------------------------- */

.gos-hero__tile {
  position: relative;
  display: block;
  overflow: hidden;
  height: 11rem;
  border: 1px solid var(--gos-rule, #ded2be);
  border-radius: var(--gos-radius, 3px);
  background: var(--gos-sand-soft, #f2ece1);
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

.gos-hero__tile--big { height: clamp(17rem, 26vw, 23rem); }

@media (min-width: 992px) {
  .gos-hero__tile--small { height: 13rem; }

  /* Beside the panel the big tiles grow to its height when it is the taller
     one (long category list, narrow desktop); the grid row stretches them. */
  .gos-hero__top .gos-hero__tile--big {
    height: auto;
    min-height: clamp(17rem, 26vw, 23rem);
  }
}

/* Picture box. container-type: size lets the letterbox rule below size the
   image from the box's own width and height (cqw / cqh). */
.gos-hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  container-type: size;
}

.gos-hero__media img {
  display: block;
  max-width: none;
  transition: transform 600ms var(--gos-ease, ease);
}

/* PrestaShop's product pictures are square files with the 4:3 photo
   letterboxed in white (12.5% bands above and below). Scaling the square so
   its middle 75% covers the box hides the bands whatever the box's shape:
   side = max(box width, box height / 0.75). */
.gos-hero__media--letterbox img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100cqw, 133.34cqh);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transform: translate(-50%, -50%);
}

.gos-hero__tile:hover .gos-hero__media--letterbox img {
  transform: translate(-50%, -50%) scale(1.05);
}

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

.gos-hero__tile:hover .gos-hero__media--cover img { transform: scale(1.05); }

/* Legibility: an ink gradient under the title, whatever the photo. */
.gos-hero__tile::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(62, 58, 53, 0.78), rgba(62, 58, 53, 0) 58%);
  pointer-events: none;
}

.gos-hero__title {
  position: absolute;
  left: var(--gos-space-md, 1.25rem);
  right: var(--gos-space-md, 1.25rem);
  bottom: var(--gos-space-md, 1.25rem);
  font-size: var(--gos-text-sm, 0.8125rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: var(--gos-track-label, 0.12em);
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.gos-hero__tile--big .gos-hero__title {
  font-size: var(--gos-text-lg, 1.05rem);
  letter-spacing: var(--gos-track-display, 0.18em);
}

.gos-hero__tile:focus-visible {
  outline: 2px solid var(--gos-gold-text, #6b5426);
  outline-offset: 3px;
}


/* --- Cross-link to Paleo Passion ------------------------------------------
   Dressed in Paleo Passion's own look (near-black ground, amber glow and
   rule), as PP's tile for Grain of Sand is: it reads as a door to the other
   shop rather than as one more category. */

.gos-hero__tile--xlink {
  background:
    radial-gradient(120% 90% at 70% 10%, rgba(245, 185, 26, 0.3), rgba(245, 185, 26, 0) 60%),
    #0d0e10;
  border-color: #c9a030;
}

.gos-hero__tile--xlink::after { display: none; }

.gos-hero__tile--xlink .gos-hero__title { text-shadow: none; }

.gos-hero__subtitle {
  display: block;
  margin-top: 0.35rem;
  color: #e8c46a;
  font-size: 0.75em;
  font-weight: 500;
  letter-spacing: var(--gos-track-display, 0.18em);
}

.gos-hero__tile--xlink:hover { border-color: #f5b91a; }


@media (prefers-reduced-motion: reduce) {
  .gos-hero__media img,
  .gos-hero__panel .material-icons { transition: none; }
  .gos-hero__tile:hover .gos-hero__media--letterbox img { transform: translate(-50%, -50%); }
  .gos-hero__tile:hover .gos-hero__media--cover img { transform: none; }
}
