/* =========================================================
   Gallery enhancement styles — Vertex Cranes
   Load AFTER css/style.css. Scoped to #work so it never
   touches the rest of the site's layout.
   ========================================================= */

#work {
  --vx-blue: #1fa7db;
  --vx-blue-dark: #147da8;
  --vx-ink: #1c2a33;
  --vx-muted: #6b7a84;
  --vx-card-radius: 12px;
  --vx-gap: 20px;
}

/* ---- Section rhythm ---------------------------------------------------- */
#work .sr-main1 {
  margin-bottom: 56px;
}
#work .sr-main1:last-child {
  margin-bottom: 0;
}
#work .title-box {
  margin-bottom: 28px;
}
#work .title-a {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}
#work .title-a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 3px;
  background: var(--vx-blue);
  transform: translateX(-50%);
  border-radius: 2px;
}

/* ---- Sub-headings within a section (e.g. "Launching Girder Trolley"
   inside the Load Test tab) ------------------------------------------------ */
#work .gallery-subtitle {
  font-size: 17px;
  font-weight: 700;
  color: var(--vx-blue-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 8px 0 20px;
}

/* ---- Filter tabs -------------------------------------------------------- */
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 40px;
}
.gallery-tab {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--vx-ink);
  background: #fff;
  border: 1.5px solid #e2e8ec;
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.gallery-tab:hover {
  border-color: var(--vx-blue);
  color: var(--vx-blue-dark);
  transform: translateY(-1px);
}
.gallery-tab.active {
  background: var(--vx-blue);
  border-color: var(--vx-blue);
  color: #fff;
}
.gallery-tab:focus-visible {
  outline: 2px solid var(--vx-blue-dark);
  outline-offset: 2px;
}

/* ---- Grid & cards --------------------------------------------------------
   The old markup let every photo keep its native aspect ratio, so rows
   never lined up. Fixing every thumbnail to the same 4:3 window and
   cropping with object-fit:cover makes every row align regardless of the
   source photo's shape. */
#work .gallery-row {
  row-gap: var(--vx-gap);
}
#work .gallery-item {
  margin-bottom: var(--vx-gap);
}
#work .work-box {
  height: 100%;
  border-radius: var(--vx-card-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(18, 38, 51, 0.08);
  transition: transform .28s ease, box-shadow .28s ease;
}
#work .work-box:hover,
#work .work-box:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(18, 38, 51, 0.16);
}
#work .work-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eef2f4; /* letterbox colour, rarely seen since we crop to cover */
}
#work .work-img img,
#work .work-img video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
#work .work-box:hover .work-img img {
  transform: scale(1.06);
}

/* Videos keep native controls visible/usable, so skip the hover zoom-scale
   and the image-only zoom-icon overlay used on photos. */
#work .work-img video {
  background: #000;
}
#work .work-img:has(video) .work-zoom {
  display: none;
}

/* Zoom affordance so it's obvious the photo opens larger */
#work .work-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  background: linear-gradient(180deg, rgba(15,26,33,0) 55%, rgba(15,26,33,.55) 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
#work .work-box:hover .work-zoom,
#work .work-box:focus-within .work-zoom {
  opacity: 1;
}

/* ---- Responsive tweaks --------------------------------------------------- */
@media (max-width: 767px) {
  #work .gallery-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    margin-left: -4px;
    margin-right: -4px;
  }
  #work .gallery-tab {
    flex: 0 0 auto;
  }
  #work .sr-main1 {
    margin-bottom: 40px;
  }
}

/* Respect users who've asked for reduced motion */
@media (prefers-reduced-motion: reduce) {
  #work .work-box,
  #work .work-img img,
  #work .work-zoom,
  .gallery-tab {
    transition: none !important;
  }
}