/* ==========================================================================
   PINNED HORIZONTAL SLIDER: OUR TOP ARTISTS (AWWWARDS / EDITORIAL STYLE)
   ========================================================================== */

/* Scoped variables for Instagram Slideshow (4:5) mathematical calculation */
#artists {
  /* Site header clearance (h-20 = 80px + 24px breathing space = 104px / 6.5rem) */
  --site-header-clearance: 6.5rem;
  /* Section title and controls space */
  --section-header-h: var(--measured-header-h, 5.25rem);
  /* Card metadata block under image (title, tags, inquire link): ~80px / 5rem */
  --card-meta-h: 5rem;
  /* Bottom breathing margin */
  --section-bottom-pad: 2rem;

  /* Total non-image vertical space deducted from viewport */
  --v-deduction: calc(var(--site-header-clearance) + var(--section-header-h) + var(--card-meta-h) + var(--section-bottom-pad));

  /* Available image height based on viewport height, clamped to safe editorial bounds */
  --artist-img-h: clamp(240px, calc(100vh - var(--v-deduction)), 560px);

  /* Instagram Slideshow Aspect Ratio: 4 : 5 (width : height = 0.8) */
  --artist-card-w: calc(var(--artist-img-h) * 0.8);
}

/* Desktop & Large Screens (Pinned Sticky Scroll) */
@media (min-width: 1024px) {
  #artists.artists-pinned-section {
    position: relative;
    width: 100%;
    /* Height dynamically assigned via JS for exact 1:1 scroll feel */
    height: 420vh;
    background-color: #000000;
  }

  #artists .artists-sticky-wrap {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: var(--site-header-clearance);
    padding-bottom: var(--section-bottom-pad);
    background-color: #000000;
  }

  #artists .artists-track-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-top: auto;
    margin-bottom: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  #artists #artists-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch; /* Stretch so all slides have exactly equal total height */
    will-change: transform;
    pointer-events: auto;
    padding-left: 4rem;
    padding-right: 8rem;
    gap: 2.25rem;
  }

  #artists .artist-slide {
    width: var(--artist-card-w);
    min-width: 240px;
    flex-shrink: 0;
    user-select: none;
    display: flex;
    flex-direction: column;
  }

  /* Photo box: strictly 4:5 Instagram slideshow proportion */
  #artists .artist-slide .artist-img-box {
    width: 100%;
    height: var(--artist-img-h);
    aspect-ratio: 4 / 5;
    flex-shrink: 0;
  }

  /* 12th dossier card: stretches to 100% of the slide height, matching photo + metadata */
  #artists .artist-slide .artist-dossier-box {
    width: 100%;
    height: 100%;
    min-height: 100%;
    flex: 1 1 auto;
  }
}

/* 4K and Ultra-wide Displays */
@media (min-width: 1920px) {
  #artists {
    --site-header-clearance: 7rem;
    --section-bottom-pad: 2.5rem;
    --artist-img-h: clamp(320px, calc(100vh - var(--v-deduction)), 640px);
  }
  #artists #artists-track {
    padding-left: 6rem;
    padding-right: 12rem;
    gap: 2.75rem;
  }
}

/* Mobile & Tablet (< 1024px): Fluid Horizontal Touch-Swipe */
@media (max-width: 1023px) {
  #artists.artists-pinned-section {
    height: auto !important;
    padding-top: 5rem;
    padding-bottom: 5rem;
    position: relative;
    background-color: #000000;
  }

  #artists .artists-sticky-wrap {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #artists .artists-track-container {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
  }

  #artists .artists-track-container::-webkit-scrollbar {
    display: none;
  }

  #artists #artists-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    transform: none !important;
    gap: 1.25rem !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  #artists .artist-slide {
    width: 76vw !important;
    max-width: 340px !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    user-select: none;
    display: flex !important;
    flex-direction: column !important;
  }

  #artists .artist-slide .artist-img-box {
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    height: auto !important;
    flex-shrink: 0 !important;
  }

  #artists .artist-slide .artist-dossier-box {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    flex: 1 1 auto !important;
  }
}
