/* =========================================================
HOME HIGHLIGHTS
Free-form skyline packed gallery styling for home.html
========================================================= */

/* 1. SECTION WRAPPER */

.home-highlights {
  position: relative;
  padding: 2rem 0;
  overflow: hidden;
}

.home-highlights .container {
  width: min(100% - 2rem, 1280px) !important;
  max-width: 100%;
  margin: 0 auto;
}

/* 2. SECTION HEADER */

.home-highlights .section-header {
  max-width: 760px;
  margin: 0 0 2.5rem;
  text-align: left;
}

.home-highlights .section-title {
  margin: 0;
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.1;
  letter-spacing: 0.02em;
  color: #ff2d2d;
  -webkit-text-stroke: 2px #ffd93d;
  text-shadow:
    0 3px 0 #1f49ff,
    0 6px 0 rgba(0, 0, 0, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.42);
  text-wrap: balance;
}

.home-highlights .section-title span {
  color: #ffd93d;
  -webkit-text-stroke: 2px #ff2d2d;
  text-shadow:
    0 3px 0 #1f49ff,
    0 6px 0 rgba(0, 0, 0, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.42);
}

.home-highlights .section-desc {
  margin: 0.9rem 0 0;
  max-width: 42rem;
  font-family: "Outfit", sans-serif;
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  font-weight: 500;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.84);
  text-wrap: pretty;
}

/* 3. PACKED GRID CONTAINER (DESKTOP) */

#highlights-grid {
  position: relative;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  border-radius: 12px;
  background-color: #000;
  background-image: radial-gradient(#ffd93d 2px, transparent 3px);
  --dotsize: 20px;
  background-size: var(--dotsize) var(--dotsize);
  background-position: 0 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 3px solid #1919A6;
  box-shadow: 0 0 10px #1919A6, inset 0 0 10px #1919A6;

  contain: layout style;
  will-change: transform;
  backface-visibility: hidden;
}

/* 4. HIGHLIGHT CARD (DESKTOP) */

.highlight-card {
  position: absolute;
  display: block;
  margin: 0;
  border: 3px solid #1919A6;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  background: #000;
  box-shadow: 0 0 8px #1919A6, inset 0 0 8px #1919A6;
  filter: saturate(1);
  transition: transform 0.3s ease, filter 0.3s ease;
  backface-visibility: hidden;
  box-sizing: border-box;
}

.highlight-card::after {
  display: none;
}

.highlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
}

/* 5. CARD MEDIA */

.highlight-card-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(110deg, #1a214f 8%, #252d65 18%, #1a214f 33%);
  background-size: 200% 100%;
  animation: highlights-shimmer 1.5s linear infinite;
}

@keyframes highlights-shimmer {
  to {
    background-position-x: -200%;
  }
}

.highlight-card-media img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  background: #d9d9d9;
  object-fit: cover !important;
  object-position: center !important;
  transform: scale(1);
  transition: transform 0.45s ease;
}

.highlight-card.is-portrait .highlight-card-media img,
.highlight-card.is-landscape .highlight-card-media img {
  object-position: center center;
}

/* 6. CARD CONTENT */

.highlight-card-body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: block;
  padding: 1rem 1rem 1.05rem;
  text-align: left;
  pointer-events: none;
}

.highlight-card-title {
  margin: 0;
  color: #ffffff;
  font-family: "Press Start 2P", cursive;
  font-size: clamp(0.66rem, 0.8vw, 0.78rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.highlight-card-subtitle {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Outfit", sans-serif;
  font-size: clamp(0.8rem, 0.9vw, 0.9rem);
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.48);
}

.highlight-card.is-portrait .highlight-card-title {
  font-size: clamp(0.64rem, 0.76vw, 0.74rem);
}

.highlight-card.is-landscape .highlight-card-title {
  font-size: clamp(0.68rem, 0.84vw, 0.8rem);
}

/* 7. TOUCH / MOBILE POLISH (TABLET) */

@media (max-width: 1199.98px) {
  .home-highlights {
    padding: clamp(3.75rem, 6vw, 5rem) 0;
  }

  .home-highlights .section-header {
    margin-bottom: 2.25rem;
  }

  .highlight-card {
    border-radius: 1rem;
  }
}

/* 8. TOUCH / MOBILE POLISH + SLIDER (PHONE) */
@media (max-width: 767.98px) {
  /* Title & description – your existing settings */
  .home-highlights .section-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
  }

  .home-highlights .section-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    -webkit-text-stroke: 1.6px #ffd93d;
  }

  .home-highlights .section-desc {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  /* Remove board frame on mobile */
  #highlights-grid {
    border-radius: 0;
    background-image: none;
    border: none;
    box-shadow: none;
    background-color: transparent;
    overflow: visible;
  }

  /*
    Viewport: clips the scrolling strip, does NOT animate.
    overflow:hidden here — NOT on the animated element.
  */
  #highlights-grid.mobile-slider-active {
    display: block !important;
    overflow: hidden;
    width: calc(100% + 2rem); 
    max-width: none; 
    margin-left: -1rem;    /* break out of .container's 1rem padding */
    padding: 0.5rem 0;
    animation: none !important;
    height: auto;
  }

  /*
    Animated strip: width:max-content means -50% = exactly one full
    set of cards. The strip is doubled in JS → zero-jump seamless loop.
  */
  .slider-track {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    width: max-content;
    animation: highlights-marquee 60s linear infinite; /* duration set by JS */
  }

  .slider-track .highlight-card {
    position: relative !important;
    flex: 0 0 auto;
    width: 230px !important;
    height: 310px !important;
    border-radius: 1rem;
    overflow: hidden;
  }

  .slider-track .highlight-card.is-portrait {
    width: 190px !important;
    height: 310px !important;
  }

  .slider-track .highlight-card-media {
    position: absolute;
    inset: 0;
  }

  .slider-track .highlight-card-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  @keyframes highlights-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
}

/* 9. REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  .highlight-card,
  .highlight-card-media img {
    transition: none;
  }

  .highlight-card-media {
    animation: none;
    background-position: 0 0;
  }

  #highlights-grid.mobile-slider-active .slider-track,
  #highlights-grid.mobile-slider-active {
    animation: none;
    transform: none;
  }
}

/* 10. PACMAN ANIMATION (unchanged) */

#pacman-actor {
  will-change: left, top;
  transition: none !important;
}

@keyframes pac-dot-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 1;
  }
}

.pac-dot[data-alive="1"] {
  animation: pac-dot-pulse 2s ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

.pacman-ghost {
  will-change: left, top;
}

@media (prefers-reduced-motion: reduce) {
  #pacman-actor,
  .pacman-ghost {
    display: none !important;
  }
  .pac-dot {
    animation: none !important;
  }
}