/**
 * Homepage — Shop by Category.
 * Scoped under .v-sbc / .v-home-section--shop-by-category.
 * Editorial mosaic: one tall featured card + three supporting cards.
 */

/* --------------------------------------------------------------------------
   Section shell
   -------------------------------------------------------------------------- */

.v-home-section--shop-by-category {
  overflow: hidden;
}

.v-sbc {
  display: flex;
  flex-direction: column;
  gap: var(--v-space-8);
}

/* --------------------------------------------------------------------------
   Header — restrained, left-aligned
   -------------------------------------------------------------------------- */

.v-sbc__header {
  display: flex;
  flex-direction: column;
  gap: var(--v-space-3);
  max-width: 36rem;
}

.v-sbc__eyebrow {
  margin: 0;
  letter-spacing: 0.22em;
}

.v-sbc__heading {
  margin: 0;
  font-family: var(--v-font-display);
  font-weight: var(--v-font-weight-regular);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--v-color-ink);
}

.v-sbc__desc {
  margin: 0;
  max-width: 28rem;
  font-size: var(--v-text-md);
  line-height: var(--v-leading-relaxed);
  color: var(--v-color-ink-muted);
  font-weight: var(--v-font-weight-light);
}

/* --------------------------------------------------------------------------
   Mosaic — mobile: single column; desktop: featured + stack
   -------------------------------------------------------------------------- */

.v-sbc__mosaic {
  display: flex;
  flex-direction: column;
  gap: var(--v-space-4);
}

.v-sbc__featured,
.v-sbc__stack {
  display: flex;
  flex-direction: column;
  gap: var(--v-space-4);
  min-width: 0;
}

.v-sbc__stack-item {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Cards — fully clickable, sharp corners, image-first
   -------------------------------------------------------------------------- */

.v-sbc__card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0;
  color: var(--v-color-paper);
  text-decoration: none;
  isolation: isolate;
  min-height: 44px;
  outline: none;
}

.v-sbc__card:focus-visible {
  box-shadow: var(--v-shadow-focus);
  z-index: 1;
}

.v-sbc__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--v-color-forest-deep, #1c302a);
}

/* Featured: tall vertical campaign */
.v-sbc__card--featured .v-sbc__media {
  aspect-ratio: 3 / 4;
}

/* Supporting: slightly wider editorial crops on mobile, landscape-ish strip on desktop */
.v-sbc__card--support .v-sbc__media {
  aspect-ratio: 4 / 5;
}

.v-sbc__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform var(--v-duration-slow, 0.55s) var(--v-ease-standard, ease);
  will-change: transform;
}

.v-sbc__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(12, 14, 12, 0.58) 0%,
    rgba(12, 14, 12, 0.18) 42%,
    rgba(12, 14, 12, 0.06) 100%
  );
  transition: background-color var(--v-duration-normal) var(--v-ease-standard),
    opacity var(--v-duration-normal) var(--v-ease-standard);
}

.v-sbc__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--v-space-5) var(--v-space-5) var(--v-space-5);
  pointer-events: none;
  transition: transform var(--v-duration-normal) var(--v-ease-standard);
}

.v-sbc__title {
  font-family: var(--v-font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  font-weight: var(--v-font-weight-regular);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.v-sbc__card--featured .v-sbc__title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
}

.v-sbc__subtitle {
  font-size: 0.6875rem;
  font-weight: var(--v-font-weight-medium);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0.92;
  transform: translateY(0.15rem);
  transition:
    opacity var(--v-duration-normal) var(--v-ease-standard),
    transform var(--v-duration-normal) var(--v-ease-standard);
}

/* Hover / focus — subtle zoom + label emphasis (no hover-only interaction) */
@media (hover: hover) and (pointer: fine) {
  .v-sbc__card:hover .v-sbc__img,
  .v-sbc__card:focus-visible .v-sbc__img {
    transform: scale(1.04);
  }

  .v-sbc__card:hover .v-sbc__overlay,
  .v-sbc__card:focus-visible .v-sbc__overlay {
    background: linear-gradient(
      to top,
      rgba(12, 14, 12, 0.68) 0%,
      rgba(12, 14, 12, 0.28) 48%,
      rgba(12, 14, 12, 0.1) 100%
    );
  }

  .v-sbc__card:hover .v-sbc__label,
  .v-sbc__card:focus-visible .v-sbc__label {
    transform: translateY(-0.15rem);
  }

  .v-sbc__card:hover .v-sbc__subtitle,
  .v-sbc__card:focus-visible .v-sbc__subtitle {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Touch / coarse pointers — labels always fully visible, no zoom reliance */
@media (hover: none), (pointer: coarse) {
  .v-sbc__subtitle {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Tablet — two-up for supporting cards under featured
   -------------------------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 1023.98px) {
  .v-sbc {
    gap: var(--v-space-9);
  }

  .v-sbc__stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--v-space-4);
  }

  .v-sbc__stack-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .v-sbc__card--support .v-sbc__media {
    aspect-ratio: 3 / 4;
  }
}

/* --------------------------------------------------------------------------
   Desktop — balanced asymmetrical mosaic (~780–900px)
   Left:  featured card spanning full mosaic height
   Right: 1 wide card on top + 2 equal cards side-by-side below
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  .v-sbc {
    gap: var(--v-space-8);
  }

  .v-sbc__header {
    gap: var(--v-space-3);
  }

  .v-sbc__mosaic {
    --v-sbc-mosaic-h: clamp(780px, 82vh, 900px);

    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    grid-template-rows: var(--v-sbc-mosaic-h);
    gap: var(--v-space-4);
    align-items: stretch;
    height: var(--v-sbc-mosaic-h);
  }

  .v-sbc__featured,
  .v-sbc__stack {
    min-height: 0;
    height: 100%;
  }

  .v-sbc__card--featured {
    display: flex;
    height: 100%;
  }

  .v-sbc__card--featured .v-sbc__media {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .v-sbc__card--featured .v-sbc__img {
    object-position: center 18%;
  }

  /*
   * Right column grid:
   *   [     wide top      ]
   *   [  left  ][  right  ]
   */
  .v-sbc__stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--v-space-4);
  }

  .v-sbc__stack-item {
    min-width: 0;
    min-height: 0;
    display: flex;
  }

  /* First supporting card spans full width (wide top) */
  .v-sbc__stack-item:first-child {
    grid-column: 1 / -1;
  }

  .v-sbc__stack-item .v-sbc__card {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    display: flex;
  }

  .v-sbc__card--support .v-sbc__media {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .v-sbc__card--support .v-sbc__img {
    object-position: center 22%;
  }

  .v-sbc__label {
    padding: var(--v-space-5);
  }

  .v-sbc__card--featured .v-sbc__label {
    padding: var(--v-space-6);
  }
}

@media (min-width: 1280px) {
  .v-sbc__mosaic {
    --v-sbc-mosaic-h: clamp(800px, 80vh, 900px);
    gap: var(--v-space-5);
  }

  .v-sbc__stack {
    gap: var(--v-space-5);
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .v-sbc__img,
  .v-sbc__overlay,
  .v-sbc__label,
  .v-sbc__subtitle {
    transition: none !important;
  }

  .v-sbc__card:hover .v-sbc__img,
  .v-sbc__card:focus-visible .v-sbc__img {
    transform: none;
  }
}
