.stgrtc-activity-copy {
  position: relative;
  margin: 1.5rem 0 2rem;
  padding: 1.35rem 1.5rem 1.35rem 1.75rem;
  overflow: hidden;
  border: 1px solid rgba(0, 50, 113, .1);
  border-radius: .75rem;
  background: linear-gradient(135deg, #fff 0%, #f5f8fc 100%);
  box-shadow: 0 8px 24px rgba(0, 50, 113, .07);
}

.stgrtc-activity-copy::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: #f4bd18;
  content: "";
}

.stgrtc-activity-copy p {
  margin: 0;
  color: #344054;
  font-size: 1rem;
  line-height: 1.95;
  text-align: justify;
}

.stgrtc-gallery {
  clear: both;
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.stgrtc-gallery h3 {
  margin-bottom: 1.25rem;
  color: #003271;
  font-weight: 700;
}

.stgrtc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stgrtc-gallery-grid > div {
  width: auto;
  max-width: none;
  padding: 0;
}

.stgrtc-gallery-item {
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 50, 113, .08);
  border-radius: .75rem;
  background: #f4f6f8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.stgrtc-gallery-item a {
  display: block;
  cursor: zoom-in;
}

.stgrtc-gallery-item img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  transition: transform .25s ease, opacity .25s ease;
}

.stgrtc-gallery-item a:hover img,
.stgrtc-gallery-item a:focus img {
  opacity: .9;
  transform: scale(1.04);
}

.stgrtc-gallery-item figcaption {
  padding: .65rem .75rem;
  color: #667085;
  font-size: .8rem;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 991.98px) {
  .stgrtc-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
  .stgrtc-activity-copy { margin: 1rem 0 1.5rem; padding: 1rem 1rem 1rem 1.25rem; }
  .stgrtc-activity-copy p { font-size: .94rem; line-height: 1.85; }
  .stgrtc-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .stgrtc-gallery-item img { height: 140px; }
  .stgrtc-gallery-item figcaption { font-size: .75rem; }
}

@media (max-width: 359.98px) {
  .stgrtc-gallery-grid { grid-template-columns: 1fr; }
  .stgrtc-gallery-item img { height: 190px; }
}

/* Modern activity filters shared by the Khmer and English gallery pages. */
:is(.page-49 .tplBesley.TzContent #tz_options168, .page-54 .tplBesley.TzContent #tz_options169) {
  position: relative;
  margin: 0 0 2.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(0, 50, 113, .1);
  border-radius: 1rem;
  background: linear-gradient(135deg, #f8faff 0%, #fff 68%);
  box-shadow: 0 12px 35px rgba(0, 50, 113, .08);
}

:is(.page-49 .tplBesley.TzContent #tz_options168, .page-54 .tplBesley.TzContent #tz_options169)::before {
  display: block;
  margin-bottom: .9rem;
  color: #003271;
  content: "ជ្រើសរើសប្រភេទសកម្មភាព";
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.page-54 .tplBesley.TzContent #tz_options169::before {
  content: "Select an activity category";
}

:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169).option-set {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: center;
}

:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169).option-set::before,
:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169).option-set::after {
  display: none;
}

:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169) .btn {
  display: inline-flex;
  min-height: 44px;
  margin: 0;
  padding: .65rem 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 50, 113, .05);
  color: #24415f;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169) .btn:hover,
:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169) .btn:focus-visible {
  border-color: #f4bd18;
  background: #fffaf0;
  box-shadow: 0 7px 18px rgba(0, 50, 113, .1);
  color: #003271;
  outline: none;
  transform: translateY(-2px);
}

:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169) .btn.selected {
  border-color: #003271;
  background: linear-gradient(135deg, #003271 0%, #0b559f 100%);
  box-shadow: 0 8px 18px rgba(0, 50, 113, .22);
  color: #fff;
}

:is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169) .btn.selected::before {
  margin-right: .45rem;
  content: "✓";
  color: #f4bd18;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  :is(.page-49 .tplBesley.TzContent #tz_options168, .page-54 .tplBesley.TzContent #tz_options169) {
    margin-right: -.75rem;
    margin-left: -.75rem;
    padding: 1rem .75rem;
    border-radius: .8rem;
  }

  :is(.page-49 .tplBesley.TzContent #tz_options168, .page-54 .tplBesley.TzContent #tz_options169)::before {
    text-align: left;
  }

  :is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169).option-set {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0 0 .4rem;
    overflow-x: auto;
    scroll-padding-left: .25rem;
    scroll-snap-type: x proximity;
    scrollbar-color: #bdc9d8 transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  :is(.page-49 .tplBesley.TzContent #filter168, .page-54 .tplBesley.TzContent #filter169) .btn {
    min-height: 42px;
    flex: 0 0 auto;
    max-width: 82vw;
    padding: .58rem .9rem;
    scroll-snap-align: start;
    white-space: nowrap;
  }
}

/* Gallery cards open only the image preview; article links stay hidden. */
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .TzInner {
  overflow: hidden;
  border-radius: .85rem;
  box-shadow: 0 8px 24px rgba(0, 50, 113, .1);
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .TzArticleMedia,
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .tz_portfolio_plus_image {
  position: relative;
  overflow: hidden;
  border-radius: .85rem;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .TzPortfolioTitle,
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .iconhover .white-rounded:nth-child(n + 2),
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .TzPortfolioDescription {
  display: none !important;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .ImageOverlayMg,
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .besley-title,
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .iconhover {
  position: absolute;
  inset: 0 !important;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .iconhover .white-rounded:first-child {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  transform: none !important;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .ImageOverlayMg {
  background: rgba(0, 50, 113, 0);
  transition: background .22s ease;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item {
  position: absolute;
  inset: 0 !important;
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  color: transparent;
  cursor: zoom-in;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item .tps {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  background: rgba(0, 50, 113, .9);
  box-shadow: 0 6px 18px rgba(0, 31, 70, .24);
  color: #fff;
  font-size: 0;
  opacity: 0;
  transform: scale(.9);
  transition: opacity .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item .tps::before {
  width: 20px;
  height: 20px;
  background: #fff;
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .TzArticleMedia:hover .ImageOverlayMg,
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item:focus-visible {
  background: rgba(0, 50, 113, .2);
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .TzArticleMedia:hover .popup-item .tps,
:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item:focus-visible .tps {
  opacity: 1;
  transform: scale(1);
}

:is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item:hover .tps {
  background: #f4bd18;
  box-shadow: 0 8px 22px rgba(0, 31, 70, .3);
}

@media (hover: none) {
  :is(.page-49 .tplBesley.TzContent #portfolio168, .page-54 .tplBesley.TzContent #portfolio169) .popup-item .tps {
    width: 40px;
    height: 40px;
    opacity: .9;
    transform: scale(1);
  }
}
