/* Hormuud University — Multi-Photo Article Gallery & Interactive Lightbox
   Shared cleanly across Public Reading page, Admin Preview, and TipTap Editor. */

/* ---- Container & Surface Reset ------------------------------------------------------------ */
.hu-gal,
.pub-prose figure.hu-gal,
.ap-body figure.hu-gal,
.ProseMirror figure.art-fig--gallery {
  position: relative !important;
  margin: 1.75em 0 !important;
  padding: 0 !important;
  border: 1px solid var(--pub-border-3, var(--cf-border, rgba(16, 24, 19, 0.1))) !important;
  border-radius: 14px !important;
  background: var(--pub-bg-2, var(--cf-surface-2, #eef1ef)) !important;
  overflow: hidden;
  box-shadow: 0 2px 14px -6px rgba(10, 22, 16, 0.08);
}

:root[data-theme="dark"] .hu-gal,
:root[data-theme="dark"] .ap-body figure.hu-gal,
:root[data-theme="dark"] .ProseMirror figure.art-fig--gallery {
  background: var(--cf-surface-2, #1b1d1b) !important;
  border-color: var(--cf-border, rgba(255, 255, 255, 0.1)) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal {
    background: var(--pub-bg-2, #1b1d1b) !important;
    border-color: var(--pub-border-3, rgba(255, 255, 255, 0.1)) !important;
  }
}

.hu-gal__stage {
  position: relative;
  overflow: hidden;
  border-radius: 13px 13px 0 0;
}

.hu-gal:not(:has(figcaption)) .hu-gal__stage,
.hu-gal__stage--full {
  border-radius: 13px;
}

/* ---- Shared Tile & Hard Image Overrides (beat .pub-prose img & .ProseMirror img) -------- */
.hu-gal__grid {
  display: grid;
  gap: 3px;
  background: var(--pub-bg-2, var(--cf-surface-2, #eef1ef));
}

.hu-gal__item {
  position: relative;
  display: block;
  overflow: hidden;
  background: #102018;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hu-gal__item:focus-visible {
  outline: 3px solid #10b981;
  outline-offset: -3px;
  z-index: 3;
}

.hu-gal__img,
.pub-prose .hu-gal__img,
.pub-prose figure.hu-gal img,
.ap-body .hu-gal__img,
.ap-body figure.hu-gal img,
.ProseMirror .hu-gal__img,
.ProseMirror figure.art-fig--gallery .hu-gal__img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  object-fit: cover !important;
  object-position: center 22%;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #14261c;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}

.hu-gal__item:hover .hu-gal__img {
  transform: scale(1.038);
}

/* Hover per-photo caption strip */
.hu-gal__tilecap,
.pub-prose figure.hu-gal .hu-gal__tilecap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.5rem 0.7rem 0.55rem;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 14, 11, 0.78) 100%);
  color: #ffffff !important;
  font-size: 0.76rem;
  line-height: 1.32;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hu-gal__item:hover .hu-gal__tilecap,
.hu-gal__item:focus-visible .hu-gal__tilecap {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Facebook-Style Mosaic Layout (Default) ---------------------------------------------- */
.hu-gal--mosaic.hu-gal--n1 .hu-gal__grid {
  grid-template-columns: 1fr;
}
.hu-gal--mosaic.hu-gal--n1 .hu-gal__item {
  aspect-ratio: 16 / 10;
  max-height: 500px;
}

.hu-gal--mosaic.hu-gal--n2 .hu-gal__grid {
  grid-template-columns: 1fr 1fr;
  height: clamp(230px, 34vw, 350px);
}

.hu-gal--mosaic.hu-gal--n3 .hu-gal__grid {
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: clamp(270px, 42vw, 430px);
}
.hu-gal--mosaic.hu-gal--n3 .hu-gal__item:first-child {
  grid-row: 1 / span 2;
}

.hu-gal--mosaic.hu-gal--n4 .hu-gal__grid {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: clamp(310px, 48vw, 470px);
}

.hu-gal--mosaic.hu-gal--n5 .hu-gal__grid,
.hu-gal--mosaic.hu-gal--n5plus .hu-gal__grid {
  grid-template-columns: repeat(6, 1fr);
}
.hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(1),
.hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(2),
.hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(1),
.hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(2) {
  grid-column: span 3;
  height: clamp(180px, 25vw, 260px);
}
.hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(3),
.hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(4),
.hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(5),
.hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(3),
.hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(4),
.hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(5) {
  grid-column: span 2;
  height: clamp(130px, 18vw, 190px);
}
.hu-gal--mosaic .hu-gal__item:nth-child(n+6) {
  display: none !important;
}

/* ---- Uniform Clean Grid Layout ----------------------------------------------------------- */
.hu-gal--grid .hu-gal__grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 6px;
  gap: 6px;
}
.hu-gal--grid.hu-gal--n1 .hu-gal__grid { grid-template-columns: 1fr; }
.hu-gal--grid.hu-gal--n2 .hu-gal__grid,
.hu-gal--grid.hu-gal--n4 .hu-gal__grid { grid-template-columns: 1fr 1fr; }
.hu-gal--grid .hu-gal__item {
  aspect-ratio: 4 / 3;
  border-radius: 9px;
}
.hu-gal--grid.hu-gal--n1 .hu-gal__item {
  aspect-ratio: 16 / 10;
  max-height: 480px;
}
.hu-gal--grid .hu-gal__item:nth-child(n+7) {
  display: none !important;
}

/* ---- Horizontal Carousel Strip Layout ---------------------------------------------------- */
.hu-gal--strip .hu-gal__grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.hu-gal--strip .hu-gal__item {
  flex: 0 0 44%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  scroll-snap-align: start;
}
.hu-gal--strip.hu-gal--n1 .hu-gal__item { flex: 0 0 100%; }
.hu-gal--strip.hu-gal--n2 .hu-gal__item { flex: 0 0 calc(50% - 4px); }

.hu-gal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 20, 16, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}
.hu-gal__nav:hover {
  background: rgba(16, 129, 84, 0.92);
  transform: translateY(-50%) scale(1.06);
}
.hu-gal__nav--prev { left: 14px; }
.hu-gal__nav--next { right: 14px; }
.hu-gal__nav[hidden] { display: none; }

/* ---- Slider (Full Uncropped Frame + Arrows + Dots + Active Caption) ---------------------- */
.hu-gal__slider-viewport {
  position: relative;
  overflow: hidden;
  background: #0d1511;
}
.hu-gal--slider .hu-gal__grid {
  position: relative;
  display: block;
  height: clamp(270px, 48vw, 460px);
  background: #0d1511;
  overflow: hidden;
}
.hu-gal--slider .hu-gal__item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  background: #0d1511;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease;
  cursor: zoom-in;
}
.hu-gal--slider .hu-gal__item.is-active,
.hu-gal--slider:not([data-gal-init="1"]) .hu-gal__item:first-child,
.ProseMirror .hu-gal--slider .hu-gal__item:first-child {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
.hu-gal--slider .hu-gal__img,
.pub-prose figure.hu-gal.hu-gal--slider img,
.ap-body figure.hu-gal.hu-gal--slider img,
.ProseMirror figure.art-fig--gallery.hu-gal--slider .hu-gal__img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent !important;
  transform: none !important;
}
.hu-gal--slider .hu-gal__tilecap {
  display: none !important;
}
.hu-gal__slide-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  padding: 0.58rem 0.95rem;
  background: var(--pub-bg-1, var(--cf-surface, #ffffff));
  border-top: 1px solid var(--pub-border-3, var(--cf-border, rgba(16, 24, 19, 0.08)));
  text-align: start;
}
.hu-gal__slide-bar[hidden] {
  display: none;
}
.hu-gal__slide-meta {
  flex: 1 1 13rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.hu-gal__slide-cap {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.38;
  color: var(--pub-fg-1, var(--cf-text, #161d19));
}
.hu-gal__slide-cap--muted {
  color: var(--pub-fg-3, var(--cf-text-muted, #606a64));
  font-weight: 400;
}
.hu-gal__slide-credit {
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--pub-fg-3, var(--cf-text-muted, #606a64));
}
.hu-gal__dots {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.hu-gal__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--pub-border-2, var(--cf-border-strong, rgba(16, 24, 19, 0.22)));
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}
.hu-gal__dot:hover {
  background: var(--pub-fg-3, var(--cf-text-secondary, #5a635e));
}
.hu-gal__dot.is-active {
  width: 22px;
  background: var(--hu-green, #016136);
}
.hu-gal__slide-pill,
.pub-prose figure.hu-gal .hu-gal__slide-pill {
  display: inline-flex;
  align-items: center;
  margin-inline-start: auto;
  padding: 0.18rem 0.62rem;
  border-radius: 9999px;
  background: color-mix(in srgb, #148154 12%, transparent);
  color: var(--hu-green, #016136) !important;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Spotlight (Uncropped Featured Hero + Clickable Thumbnail Bar) ----------------------- */
.hu-gal__spot-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(250px, 46vw, 430px);
  padding: 0.45rem;
  background: #0d1511;
  overflow: hidden;
  cursor: zoom-in;
}
.hu-gal__spot-img,
.pub-prose figure.hu-gal.hu-gal--spotlight .hu-gal__spot-img,
.ap-body figure.hu-gal.hu-gal--spotlight .hu-gal__spot-img,
.ProseMirror figure.art-fig--gallery.hu-gal--spotlight .hu-gal__spot-img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  transition: opacity 0.18s ease;
}
.hu-gal__spot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding: 0.5rem 0.9rem;
  background: var(--pub-bg-1, var(--cf-surface, #ffffff));
  border-top: 1px solid var(--pub-border-3, var(--cf-border, rgba(16, 24, 19, 0.08)));
  font-size: 0.82rem;
  line-height: 1.38;
  color: var(--pub-fg-1, var(--cf-text, #161d19));
  text-align: start;
}
.hu-gal__spot-meta[hidden] {
  display: none;
}
.hu-gal__spot-cap {
  font-weight: 500;
}
.hu-gal__spot-credit {
  font-size: 0.74rem;
  color: var(--pub-fg-3, var(--cf-text-muted, #606a64));
}
.hu-gal--spotlight .hu-gal__grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  background: var(--pub-bg-2, var(--cf-surface-2, #eef1ef));
  border-top: 1px solid var(--pub-border-3, var(--cf-border, rgba(16, 24, 19, 0.08)));
}
.hu-gal--spotlight .hu-gal__item {
  flex: 0 0 84px;
  height: 58px;
  border-radius: 7px;
  border: 2px solid transparent;
  opacity: 0.65;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}
.hu-gal--spotlight .hu-gal__item:hover {
  opacity: 0.92;
}
.hu-gal--spotlight .hu-gal__item:hover .hu-gal__img {
  transform: none;
}
.hu-gal--spotlight .hu-gal__item.is-active {
  opacity: 1;
  border-color: var(--hu-green, #016136);
  box-shadow: 0 0 0 1px rgba(1, 97, 54, 0.25);
}
.hu-gal--spotlight .hu-gal__tilecap {
  display: none !important;
}

/* ---- Masonry (Natural-Aspect Waterfall for Mixed Posters & Photos) ----------------------- */
.hu-gal--masonry .hu-gal__grid {
  display: block !important;
  column-count: 3;
  column-gap: 8px;
  padding: 8px 8px 0;
  background: var(--pub-bg-2, var(--cf-surface-2, #eef1ef));
}
.hu-gal--masonry.hu-gal--n1 .hu-gal__grid { column-count: 1; }
.hu-gal--masonry.hu-gal--n2 .hu-gal__grid,
.hu-gal--masonry.hu-gal--n4 .hu-gal__grid { column-count: 2; }
.hu-gal--masonry .hu-gal__item {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 8px 0;
  border-radius: 10px;
  vertical-align: top;
}
.hu-gal--masonry .hu-gal__item:nth-child(n+10) {
  display: none !important;
}
.hu-gal--masonry .hu-gal__img,
.pub-prose figure.hu-gal.hu-gal--masonry img,
.ap-body figure.hu-gal.hu-gal--masonry img,
.ProseMirror figure.art-fig--gallery.hu-gal--masonry .hu-gal__img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* ---- Editorial Captioned Cards Layout ---------------------------------------------------- */
.hu-gal--cards .hu-gal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: var(--pub-bg-2, var(--cf-surface-2, #eef1ef));
}
.hu-gal--cards.hu-gal--n1 .hu-gal__grid {
  grid-template-columns: 1fr;
}
.hu-gal--cards .hu-gal__item {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--pub-border-3, var(--cf-border, rgba(16, 24, 19, 0.09)));
  background: var(--pub-bg-1, var(--cf-surface, #ffffff));
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(10, 22, 16, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.hu-gal--cards .hu-gal__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(10, 22, 16, 0.22);
  border-color: color-mix(in srgb, #148154 38%, transparent);
}
.hu-gal--cards .hu-gal__item.is-card-hidden {
  display: none !important;
}
.hu-gal--cards .hu-gal__tilecap {
  display: none !important;
}
.hu-gal__card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #102018;
  flex-shrink: 0;
}
.hu-gal--cards.hu-gal--n1 .hu-gal__card-media {
  aspect-ratio: 16 / 10;
  max-height: 440px;
}
.hu-gal--cards .hu-gal__card-media .hu-gal__img,
.pub-prose figure.hu-gal.hu-gal--cards .hu-gal__card-media img,
.ap-body figure.hu-gal.hu-gal--cards .hu-gal__card-media img,
.ProseMirror figure.art-fig--gallery.hu-gal--cards .hu-gal__card-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 18% !important;
}
.hu-gal__card-num,
.pub-prose figure.hu-gal .hu-gal__card-num {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 2;
  padding: 0.14rem 0.5rem;
  border-radius: 9999px;
  background: rgba(9, 17, 13, 0.72);
  backdrop-filter: blur(4px);
  color: #ffffff !important;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}
.hu-gal__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.65rem 0.78rem 0.75rem;
  text-align: start;
}
.hu-gal__card-cap {
  margin: 0 !important;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--pub-fg-1, var(--cf-text, #161d19));
}
.hu-gal__card-cap--muted {
  font-weight: 500;
  color: var(--pub-fg-3, var(--cf-text-muted, #606a64));
}
.hu-gal__card-credit,
.pub-prose figure.hu-gal .hu-gal__card-credit {
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--pub-fg-3, var(--cf-text-muted, #606a64)) !important;
}
.hu-gal__expand-wrap {
  display: flex;
  justify-content: center;
  padding: 0 10px 10px;
  background: var(--pub-bg-2, var(--cf-surface-2, #eef1ef));
}
.hu-gal__expand-hint {
  font-size: 0.74rem;
  color: var(--pub-fg-3, var(--cf-text-muted, #606a64));
}
.hu-gal__expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.95rem;
  border-radius: 9999px;
  border: 1px solid var(--pub-border-3, var(--cf-border-strong, rgba(16, 24, 19, 0.16)));
  background: var(--pub-bg-1, var(--cf-surface, #ffffff));
  color: var(--hu-green, #016136);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.hu-gal__expand-btn:hover {
  background: color-mix(in srgb, #148154 10%, var(--pub-bg-1, var(--cf-surface, #ffffff)));
  border-color: color-mix(in srgb, #148154 45%, transparent);
}

/* ---- Dark Mode Adjustments for New Layouts ----------------------------------------------- */
:root[data-theme="dark"] .hu-gal__grid,
:root[data-theme="dark"] .hu-gal--spotlight .hu-gal__grid,
:root[data-theme="dark"] .hu-gal--masonry .hu-gal__grid,
:root[data-theme="dark"] .hu-gal--cards .hu-gal__grid,
:root[data-theme="dark"] .hu-gal__expand-wrap,
:root[data-theme="dark"] .ap-body figure.hu-gal .hu-gal__grid,
:root[data-theme="dark"] .ProseMirror figure.art-fig--gallery .hu-gal__grid {
  background: var(--cf-surface-2, #1b1d1b);
  border-color: var(--cf-border, rgba(255, 255, 255, 0.1));
}
:root[data-theme="dark"] .hu-gal__slide-bar,
:root[data-theme="dark"] .hu-gal__spot-meta,
:root[data-theme="dark"] .hu-gal--cards .hu-gal__item,
:root[data-theme="dark"] .hu-gal__cap,
:root[data-theme="dark"] .hu-gal__expand-btn {
  background: var(--cf-surface, #161816);
  border-color: var(--cf-border, rgba(255, 255, 255, 0.1));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal .hu-gal__grid,
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal .hu-gal__expand-wrap {
    background: var(--pub-bg-2, #1b1d1b);
    border-color: var(--pub-border-3, rgba(255, 255, 255, 0.1));
  }
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal .hu-gal__slide-bar,
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal .hu-gal__spot-meta,
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal.hu-gal--cards .hu-gal__item,
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal figcaption.hu-gal__cap,
  :root:not([data-theme="light"]) .pub-prose figure.hu-gal .hu-gal__expand-btn {
    background: var(--pub-bg-1, #141715);
    border-color: var(--pub-border-3, rgba(255, 255, 255, 0.1));
  }
}

/* ---- +N Overflow Overlay (both CSS fallback via data-more & hydrated DOM overlay) -------- */
.hu-gal__item[data-more]:not(.has-more-el)::after {
  content: attr(data-more);
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(9, 17, 13, 0.62);
  backdrop-filter: blur(2px);
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hu-gal__more,
.pub-prose figure.hu-gal .hu-gal__more {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: rgba(9, 17, 13, 0.62);
  backdrop-filter: blur(2px);
  color: #ffffff !important;
  text-align: center;
  padding: 0.5rem;
  transition: background-color 0.2s ease;
  pointer-events: none;
}
.pub-prose figure.hu-gal .hu-gal__more strong,
.pub-prose figure.hu-gal .hu-gal__more span {
  color: #ffffff !important;
}
.hu-gal__item:hover .hu-gal__more {
  background: rgba(9, 17, 13, 0.5);
}
.hu-gal__more strong {
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hu-gal__more span {
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0.92;
}

/* ---- Top Photo Count Pill Badge ---------------------------------------------------------- */
.hu-gal__badge,
.pub-prose figure.hu-gal .hu-gal__badge {
  position: absolute;
  top: 11px;
  inset-inline-end: 11px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(9, 17, 13, 0.72);
  backdrop-filter: blur(6px);
  color: #ffffff !important;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.hu-gal__badge:hover {
  background: rgba(1, 97, 54, 0.92);
  transform: translateY(-1px);
}

/* ---- Caption Bar Below Mosaic ------------------------------------------------------------ */
.hu-gal__cap,
.pub-prose figcaption.hu-gal__cap,
.ap-body figcaption.hu-gal__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  margin: 0 !important;
  padding: 0.65rem 1rem !important;
  border-top: 1px solid var(--pub-border-3, var(--cf-border, rgba(16, 24, 19, 0.08)));
  background: var(--pub-bg-1, var(--cf-surface, #fff));
  color: var(--pub-fg-3, var(--cf-text-secondary, #5a635e));
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: start !important;
}

.hu-gal__cap-txt {
  flex: 1 1 14rem;
}

.hu-gal__viewall {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.62rem;
  border-radius: 9999px;
  border: 1px solid var(--pub-border-3, var(--cf-border-strong, rgba(16, 24, 19, 0.16)));
  background: transparent;
  color: var(--hu-green, #016136);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.hu-gal__viewall:hover {
  background: color-mix(in srgb, #148154 10%, transparent);
  border-color: color-mix(in srgb, #148154 45%, transparent);
}

/* ---- Click-to-zoom cursor cue on standalone article figures ------------------------------ */
.pub-prose img.hu-gal-zoomable,
.ap-body img.hu-gal-zoomable {
  cursor: zoom-in;
}

/* ---- Responsive Breakpoints -------------------------------------------------------------- */
@media (max-width: 680px) {
  .hu-gal--masonry .hu-gal__grid {
    column-count: 2;
  }
  .hu-gal--masonry.hu-gal--n1 .hu-gal__grid {
    column-count: 1;
  }
}

@media (max-width: 600px) {
  .hu-gal,
  .pub-prose figure.hu-gal,
  .ap-body figure.hu-gal {
    border-radius: 12px !important;
  }
  .hu-gal--mosaic.hu-gal--n2 .hu-gal__grid {
    height: 200px;
  }
  .hu-gal--mosaic.hu-gal--n3 .hu-gal__grid {
    height: 245px;
  }
  .hu-gal--mosaic.hu-gal--n4 .hu-gal__grid {
    height: 260px;
  }
  .hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(1),
  .hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(2),
  .hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(1),
  .hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(2) {
    height: 155px;
  }
  .hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(3),
  .hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(4),
  .hu-gal--mosaic.hu-gal--n5 .hu-gal__item:nth-child(5),
  .hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(3),
  .hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(4),
  .hu-gal--mosaic.hu-gal--n5plus .hu-gal__item:nth-child(5) {
    height: 110px;
  }
  .hu-gal--grid .hu-gal__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hu-gal--strip .hu-gal__item {
    flex: 0 0 78%;
  }
  .hu-gal--slider .hu-gal__grid {
    height: clamp(230px, 66vw, 340px);
  }
  .hu-gal__spot-hero {
    height: clamp(220px, 64vw, 330px);
  }
  .hu-gal--spotlight .hu-gal__item {
    flex: 0 0 68px;
    height: 48px;
  }
  .hu-gal__nav {
    width: 32px;
    height: 32px;
  }
  .hu-gal__nav--prev { left: 9px; }
  .hu-gal__nav--next { right: 9px; }
}

@media (max-width: 560px) {
  .hu-gal--cards .hu-gal__grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================================
   INTERACTIVE LIGHTBOX MODAL (.hu-glb)
   ========================================================================================== */
html.hu-glb-lock {
  overflow: hidden !important;
}

.hu-glb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(10, 13, 11, 0.96);
  color: #f4f6f4;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.hu-glb[hidden] { display: none !important; }
.hu-glb.is-open { opacity: 1; }

.hu-glb__top {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: rgba(16, 20, 18, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hu-glb__meta {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.hu-glb__counter {
  flex: none;
  padding: 0.22rem 0.62rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hu-glb__title {
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(244, 246, 244, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hu-glb__tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: nowrap;
}
.hu-glb__btn--close {
  flex: none;
}
.hu-glb__sep {
  width: 1px;
  height: 1.3rem;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 0.15rem;
}

.hu-glb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  height: 2.1rem;
  min-width: 2.1rem;
  padding: 0 0.55rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f6f4;
  text-decoration: none;
  font: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.hu-glb__btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}
.hu-glb__btn[aria-pressed="true"] {
  background: #0f766e;
  border-color: #14b8a6;
  color: #fff;
}
.hu-glb__btn--pct {
  font-variant-numeric: tabular-nums;
  min-width: 3.35rem;
}
.hu-glb__btn--close:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fee2e2;
}

/* Slideshow timer progress line */
.hu-glb__progwrap {
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex: none;
}
.hu-glb__prog {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* Stage */
.hu-glb__stage {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 4.25rem;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: zoom-in;
}
.hu-glb__stage.is-zoomed { cursor: grab; }
.hu-glb__stage.is-dragging { cursor: grabbing; }

.hu-glb__img {
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
  object-fit: contain !important;
  border-radius: 0.45rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  transform-origin: center center;
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.16s ease;
  will-change: transform;
}
.hu-glb__stage.is-dragging .hu-glb__img { transition: none; }
.hu-glb__stage.is-loading .hu-glb__img { opacity: 0.35; }

.hu-glb__spin {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #10b981;
  animation: hu-glb-spin 0.75s linear infinite;
  pointer-events: none;
}
.hu-glb__spin[hidden] { display: none; }
@keyframes hu-glb-spin { to { transform: rotate(360deg); } }

.hu-glb__err {
  position: absolute;
  padding: 0.7rem 1.1rem;
  border-radius: 0.65rem;
  background: rgba(180, 35, 24, 0.88);
  color: #fff;
  font-size: 0.84rem;
}
.hu-glb__err[hidden] { display: none; }

.hu-glb__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 20, 18, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.hu-glb__arrow:hover {
  background: rgba(16, 185, 129, 0.85);
  transform: translateY(-50%) scale(1.06);
}
.hu-glb__arrow--prev { left: 16px; }
.hu-glb__arrow--next { right: 16px; }
.hu-glb__arrow[hidden] { display: none; }

/* Grid overview mode inside lightbox */
.hu-glb__gridview {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow-y: auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  background: rgba(10, 13, 11, 0.97);
}
.hu-glb__gridview[hidden] { display: none !important; }
.hu-glb__gridcards {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.85rem;
}
.hu-glb__gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 0.7rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #141916;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.hu-glb__gcard:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
}
.hu-glb__gcard.is-active {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}
.hu-glb__gcard img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.hu-glb__gnum {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 0.12rem 0.46rem;
  border-radius: 9999px;
  background: rgba(10, 13, 11, 0.78);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.hu-glb__gcap {
  padding: 0.42rem 0.55rem;
  font-size: 0.74rem;
  color: rgba(244, 246, 244, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer caption + filmstrip */
.hu-glb__foot {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem 1rem 0.8rem;
  background: rgba(16, 20, 18, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hu-glb__capline {
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(244, 246, 244, 0.94);
  min-height: 1.15em;
}
.hu-glb__capline[hidden] { display: none; }
.hu-glb__credit {
  color: rgba(244, 246, 244, 0.62);
  font-size: 0.78rem;
}

.hu-glb__strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0.25rem;
  scrollbar-width: thin;
}
.hu-glb__strip[hidden] { display: none; }
.hu-glb__strip:has(> :nth-child(9)) {
  justify-content: flex-start;
}
.hu-glb__thumb {
  flex: none;
  width: 54px;
  height: 42px;
  padding: 0;
  border-radius: 0.42rem;
  border: 2px solid transparent;
  overflow: hidden;
  background: #1a211d;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.hu-glb__thumb:hover { opacity: 0.88; }
.hu-glb__thumb.is-active {
  opacity: 1;
  border-color: #10b981;
  transform: translateY(-2px);
}
.hu-glb__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hu-glb__toast {
  position: absolute;
  bottom: 5.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 10;
  padding: 0.42rem 0.9rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.94);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.hu-glb__toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 960px) {
  .hu-glb__btn span { display: none; }
  .hu-glb__btn { height: 2rem; min-width: 2rem; padding: 0 0.42rem; }
  .hu-glb__btn--pct { min-width: 3rem; }
  .hu-glb__tools { gap: 0.28rem; }
  .hu-glb__sep { margin: 0 0.1rem; }
  .hu-glb__stage { padding: 0.75rem 3.5rem; }
}

@media (max-width: 640px) {
  .hu-glb__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem 0.5rem;
    padding: 0.55rem 0.75rem;
  }
  .hu-glb__meta { grid-column: 1; grid-row: 1; }
  .hu-glb__btn--close { grid-column: 2; grid-row: 1; }
  .hu-glb__tools {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.05rem 0;
  }
  .hu-glb__tools::-webkit-scrollbar { display: none; }
  .hu-glb__sep,
  .hu-glb__btn--fs { display: none; }
  .hu-glb__btn { height: 2rem; min-width: 2rem; padding: 0 0.38rem; }
  .hu-glb__btn--pct { min-width: 2.85rem; font-size: 0.73rem; }
  .hu-glb__stage { padding: 0.5rem 2.75rem; }
  .hu-glb__arrow { width: 36px; height: 36px; }
  .hu-glb__arrow--prev { left: 8px; }
  .hu-glb__arrow--next { right: 8px; }
  .hu-glb__foot { padding: 0.5rem 0.75rem 0.65rem; gap: 0.4rem; }
  .hu-glb__thumb { width: 46px; height: 36px; }
}

@media (max-height: 760px) and (min-width: 641px) {
  .hu-glb__top { padding: 0.48rem 0.9rem; }
  .hu-glb__stage { padding: 0.65rem 4rem; }
  .hu-glb__foot { padding: 0.45rem 0.9rem 0.55rem; gap: 0.35rem; }
  .hu-glb__thumb { width: 48px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .hu-gal__img,
  .hu-gal--slider .hu-gal__item,
  .hu-gal__spot-img,
  .hu-gal--cards .hu-gal__item,
  .hu-gal__dot,
  .hu-glb,
  .hu-glb__img,
  .hu-glb__toast { transition: none !important; }
}
