/* --- Thumbnail strip --- */
.art-strip-wrapper { overflow: hidden; }
.art-strip {
  display: flex;
  gap: 12px;
  overflow: hidden;          /* JS controls scroll for smoothness */
  padding: 8px 2px 2px;
}

.art-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.08);
  background: #e9eded;
  transition: transform .15s ease;
  will-change: transform;
}
@media (prefers-color-scheme: dark){
  .art-thumb { border-color: rgba(255,255,255,.08); background: #111; }
}

.art-thumb img, .art-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.art-badge {
  position: absolute;
  right: 8px; bottom: 8px;
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.art-thumb.is-hovered {
  transform: scale(1.06);
  z-index: 2;
}

/* --- Lightbox overlay --- */
.art-lightbox[aria-hidden="true"] { display: none; }
.art-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1080;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: 64px 1fr 64px;
  align-items: center;
  justify-items: center;
}

.art-stage {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: grid;
  place-items: center;
  max-width: 92vw;
  max-height: 86vh;
}
.art-stage img, .art-stage video {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
  background: #111;
}

/* --- Controls --- */
.art-close {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
  justify-self: end;
  align-self: start;
  margin: 12px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}
.art-close:hover { opacity: 1; }

.art-nav {
  background: rgba(255,255,255,.1);
  color: #fff;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  cursor: pointer; font-size: 22px;
  display: grid; place-items: center;
  transition: background .15s;
}
.art-nav:hover { background: rgba(255,255,255,.2); }

.art-prev { grid-column: 1 / 2; grid-row: 2 / 3; }
.art-next { grid-column: 3 / 4; grid-row: 2 / 3; }

/* larger tap target for thumbs on mobile */
@media (hover: none) and (pointer: coarse) {
  .art-thumb { width: 240px; height: 172px; }
}

/* Allow natural horizontal panning on touch; show grab cursor on desktop */
.art-strip {
  touch-action: pan-x;
  cursor: grab;
}
.art-strip:active {
  cursor: grabbing;
}

/* (optional) Slightly larger thumbs on touch-only devices */
@media (hover: none) and (pointer: coarse) {
  .art-thumb { width: 240px; height: 172px; }
}

/* art.css additions / tweaks */

/* Prevent page from scrolling while swiping the strip; nicer cursor feedback */
.art-strip {
  touch-action: none;            /* block native page pan when dragging strip */
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.art-strip.is-dragging { cursor: grabbing; }

/* Lightbox: ensure perfect centering and no cutoff on mobile */
.art-lightbox {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: 64px 1fr 64px;
  place-items: center;
}
.art-stage {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: grid;
  place-items: center;
  max-width: 92vw;
  max-height: 86vh;
}
.art-stage img,
.art-stage video {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Collapse to single column on small screens and overlay navs so media is centered */
@media (max-width: 768px) {
  .art-lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 56px;
  }
  .art-stage {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    max-width: 96vw;
    max-height: 82vh;
  }
  .art-stage img,
  .art-stage video {
    max-width: 96vw;
    max-height: 82vh;
  }
  .art-prev, .art-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1090;
  }
  .art-prev { left: 10px; }
  .art-next { right: 10px; }
  .art-close { position: fixed; top: 8px; right: 8px; }
}

/* art.css additions / tweaks */

/* Prevent page from scrolling while swiping the strip; nicer cursor feedback */
.art-strip {
  touch-action: none;            /* block native page pan when dragging strip */
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.art-strip.is-dragging { cursor: grabbing; }

/* Lightbox: ensure perfect centering and no cutoff on mobile */
.art-lightbox {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: 64px 1fr 64px;
  place-items: center;
}
.art-stage {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: grid;
  place-items: center;
  max-width: 92vw;
  max-height: 86vh;
}
.art-stage img,
.art-stage video {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Collapse to single column on small screens and overlay navs so media is centered */
@media (max-width: 768px) {
  .art-lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 56px;
  }
  .art-stage {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    max-width: 96vw;
    max-height: 82vh;
  }
  .art-stage img,
  .art-stage video {
    max-width: 96vw;
    max-height: 82vh;
  }
  .art-prev, .art-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1090;
  }
  .art-prev { left: 10px; }
  .art-next { right: 10px; }
  .art-close { position: fixed; top: 8px; right: 8px; }
}

.art-strip {
  /* you already have touch-action + cursor; add this to avoid smooth jumps */
  scroll-behavior: auto;
}

/* center the strip vertically inside its wrapper */
.art-strip-wrapper { display: flex; align-items: center; }

/* small balanced padding so it's not stuck to the bottom */
.art-strip { padding: 10px; scroll-behavior: auto; } /* auto ensures instant wrap */

/* Ensure stable layout so wrap math is correct */
.art-strip { 
  display:flex; 
  overflow-x:auto; 
  scroll-snap-type: none;   /* avoid snap fighting wrap */
  -webkit-overflow-scrolling: touch;
}
.art-thumb { 
  flex: 0 0 auto; 
  width: 168px;            /* pick a size you like */
  margin-right: 12px;
}
.art-thumb img { 
  display:block; 
  width: 100%; 
  height: 120px;           /* or auto; if you prefer fixed height */
  object-fit: cover; 
}

/* Must NOT be set on the strip */
#artStrip { scroll-snap-type: none !important; direction: ltr !important; }

/* Hide horizontal scrollbar, keep programmatic scrolling */
.art-strip {
  overflow: hidden;             /* no visible scrollbar */
}

/* Cross-browser scrollbar hiding (in case overflow:auto is used elsewhere) */
.art-strip::-webkit-scrollbar { display: none; }  /* Chrome/Safari */
.art-strip { 
  -ms-overflow-style: none;                       /* IE/Edge (old) */
  scrollbar-width: none;                          /* Firefox */
}

