/* Portfolio "Photo stills" viewer: row of small photos (2026-10-23). Loaded by almano-portfolio-thumbs.php.
   Selectors start with #portfolio-plb so they win over the Portfolio page CSS box (.portfolio-plb__* rules). */

#portfolio-plb.has-thumbs .portfolio-plb__stage {
  height: min(80vh, calc(100vh - 210px)) !important;
}

#portfolio-plb .portfolio-plb__thumbs {
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 14px 0 0 !important;
  padding: 5px 4px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain !important;
  scrollbar-width: none !important;
  box-sizing: border-box !important;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%) !important;
  mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%) !important;
}

#portfolio-plb .portfolio-plb__thumbs[hidden] {
  display: none !important;
}

#portfolio-plb .portfolio-plb__thumbs::-webkit-scrollbar {
  display: none !important;
}

#portfolio-plb .portfolio-plb__thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: block !important;
  flex: 0 0 auto !important;
  width: 88px !important;
  height: 60px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #222222 !important;
  box-shadow: none !important;
  transform: none !important;
  line-height: 0 !important;
  opacity: 0.45 !important;
  cursor: pointer !important;
  transition: opacity 0.2s ease, box-shadow 0.2s ease !important;
}

/* centres the row when a category has only a few photos; no effect once the row scrolls */
#portfolio-plb .portfolio-plb__thumb:first-child {
  margin-left: auto !important;
}

#portfolio-plb .portfolio-plb__thumb:last-child {
  margin-right: auto !important;
}

#portfolio-plb .portfolio-plb__thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#portfolio-plb .portfolio-plb__thumb:hover {
  opacity: 0.85 !important;
}

#portfolio-plb .portfolio-plb__thumb:focus {
  outline: none !important;
}

#portfolio-plb .portfolio-plb__thumb:focus-visible {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px #111111, 0 0 0 4px #ffffff !important;
}

#portfolio-plb .portfolio-plb__thumb.is-active {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px #111111, 0 0 0 4px #F8C757 !important;
}

/* phone landscape and other short windows: smaller row so the photo keeps its room */
@media (max-height: 520px) and (min-width: 601px) {
  #portfolio-plb.has-thumbs .portfolio-plb__stage {
    height: calc(100vh - 170px) !important;
  }

  #portfolio-plb .portfolio-plb__thumbs {
    margin-top: 8px !important;
    gap: 6px !important;
  }

  #portfolio-plb .portfolio-plb__thumb {
    width: 60px !important;
    height: 40px !important;
  }
}

/* phone: photo centred in the free space, name + row pinned to the bottom of the screen */
@media (max-width: 600px) {
  #portfolio-plb.has-thumbs .portfolio-plb__box {
    height: 100% !important;
    padding: 44px 0 max(6px, env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
  }

  #portfolio-plb.has-thumbs .portfolio-plb__stage {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
  }

  #portfolio-plb .portfolio-plb__thumbs {
    gap: 6px !important;
    margin-top: 12px !important;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%) !important;
    mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%) !important;
  }

  #portfolio-plb .portfolio-plb__thumb {
    width: 56px !important;
    height: 56px !important;
    border-radius: 5px !important;
  }
}
