/* =========================
   HERO (INDEX PAGE ONLY)
========================= */

.hero {
  position: relative;
  width: 100vw;
  aspect-ratio: 16 / 9;
  overflow: visible;

  /* full-bleed centering trick */
  left: 50%;
  margin-left: -50vw;

  background-color: #000;
  z-index: 2;
}

/* =========================
   HERO LAYERS
========================= */

.hero-bg,
.hero-character {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  width: 110vw;
  height: 100%;

  background-repeat: no-repeat;
  background-size: contain;
  background-position: center top;
}

/* scenery layer */
.hero-bg {
  background-image: url('../images/hero-bg-market.png');
  z-index: 10;
}

/* character layer */
.hero-character {
  background-image: url('../images/hero_character.png');
  z-index: 50;
  pointer-events: none;
}

/* =========================
   HEADER INSIDE HERO
========================= */

/* override base header positioning ONLY when inside hero */
.hero .site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

/* =========================
   STORY CAROUSEL (INDEX ONLY)
========================= */

.story-carousel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -70%);

  width: min(900px, calc(100% - 36px));
  padding: 36px 64px;

  border-radius: 14px;
  background: rgba(243, 230, 204, 0.965);
  border: 1px solid rgba(90, 52, 18, 0.22);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);

  z-index: 1000;
  pointer-events: auto;
}

/* =========================
   CAROUSEL TRACK
========================= */

.carousel-track {
  display: flex;
  gap: 18px;

  overflow: hidden;
  scroll-behavior: smooth;

  justify-content: flex-start;
  align-items: center;
}

/* =========================
   CAROUSEL ITEMS
========================= */

.carousel-item {
  min-width: 165px;
  height: 130px;

  border-radius: 6px;
  overflow: hidden;

  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  cursor: pointer;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================
   CAROUSEL ARROWS
========================= */

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  background: transparent;
  border: none;

  font-size: 2.4rem;
  padding: 4px 10px;
  cursor: pointer;

  color: #2f1c0d;
  text-shadow: 1px 2px 4px rgba(0,0,0,0.18);
  z-index: 1001;
}

.carousel-arrow.left  { left: 10px; }
.carousel-arrow.right { right: 10px; }

/* =========================
   RESPONSIVE — HERO INDEX
========================= */

@media (max-width: 820px) {
  .story-carousel {
    width: calc(100% - 22px);
    padding: 28px 52px;
    transform: translate(-50%, -66%);
  }

  .carousel-track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .carousel-item {
    min-width: 140px;
    height: 110px;
  }
}

@media (max-width: 520px) {
  .story-carousel {
    padding: 22px 44px;
    transform: translate(-50%, -62%);
  }

  .carousel-arrow.left  { left: 6px; }
  .carousel-arrow.right { right: 6px; }
}

/* Keep the artwork and carousel usable across screen sizes. */
.hero { width: 100%; left: auto; margin-left: 0; margin-bottom: 6rem; }
.hero-bg, .hero-character { width: 100%; }
.carousel-item { flex: 0 0 165px; padding: 0; border: 0; background: #2f1c0d; }
.carousel-item:focus-visible, .carousel-arrow:focus-visible { outline: 3px solid #824b1b; outline-offset: 3px; }
@media (max-width: 820px) {
  .carousel-item { flex-basis: 140px; }
  .story-carousel { box-sizing: border-box; }
}
@media (max-width: 520px) {
  .hero { margin-bottom: 7rem; min-height: 250px; }
  .hero-bg, .hero-character { background-size: cover; }
  .hero-character { background-size: contain; }
  .carousel-item { flex-basis: 120px; height: 110px; }
}
