/* Keep original gallery layout; only position overlays and fix sizing */
ul.gallery > li { position: relative; }

/* Title bar: exact width, larger height & font, centered over the image */
ul.gallery > li h3 {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;              /* match thumbnail width */
  height: 36px;              /* slightly taller for readability */
  line-height: 36px;         /* vertically center text */
  margin: 0;
  padding: 0 6px;
  box-sizing: border-box;
  color: #fff;
  text-align: center;
  font-size: 18px;           /* larger title text */
  font-weight: 600;
  background: url('../Images/linkbg.jpg') repeat-x top left;
  z-index: 3;
  pointer-events: none;
}

/* Ensure the play icon overlays the image (not below it) */
ul.gallery > li a.video-thumb {
  position: relative;
  display: block;            /* anchor wraps the image box */
  width: 260px;
  height: 200px;
}
ul.gallery > li a.video-thumb::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  pointer-events: none;
  z-index: 2; /* below the title bar */
  background: no-repeat center/contain
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'><circle cx='28' cy='28' r='26' fill='rgba(0,0,0,0.45)'/><polygon points='22,18 22,38 40,28' fill='%23ffffff'/></svg>");
}

/* Make sure the image itself doesn't introduce spacing */
ul.gallery > li img.top { display: block; }