.ylgp-gallery > p:empty, .ylgp-gallery > br { display: none !important; }
/* Only explicitly created publisher galleries are affected. Plain HTML remains readable without JavaScript. */
.ylgp-gallery.ylgp-gallery { display: grid !important; grid-template-columns: minmax(0,1fr); gap: 20px; width: 100%; max-width: 100%; clear: both; margin: 1.6em auto; padding: 0; box-sizing: border-box; }
.ylgp-gallery.ylgp-layout-grid2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.ylgp-gallery.ylgp-layout-grid3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ylgp-gallery.ylgp-layout-grid4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.ylgp-gallery .ylgp-gallery-item { display: block !important; float: none !important; min-width: 0; width: auto !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; text-align: center; box-sizing: border-box; }
.ylgp-gallery .ylgp-gallery-link, a.ylgp-single-link { display: block; width: 100%; border: 0; cursor: zoom-in; position: relative; overflow: hidden; border-radius: 10px; text-decoration: none; }
a.ylgp-single-link { display: inline-block; width: auto; max-width: 100%; }
img[class*="wp-image-"]:not(.ylgp-fbt-img) { cursor: zoom-in; }
.ylgp-gallery .ylgp-gallery-item img { display: block !important; float: none !important; width: 100% !important; max-width: 100% !important; height: auto !important; max-height: none !important; aspect-ratio: auto !important; object-fit: contain !important; margin: 0 auto !important; border-radius: 10px; box-sizing: border-box; transition: transform .28s ease; }
.ylgp-gallery .ylgp-gallery-link:hover img { transform: scale(1.025); }
.ylgp-gallery .ylgp-gallery-item figcaption { display: block; width: auto; position: static; margin: .55em 0 0 !important; padding: 0; font-size: 1em; line-height: 1.6; color: #263448; overflow-wrap: anywhere; }

/* Standard Equal Grids (grid2, grid3, grid4) */
.ylgp-gallery:is(.ylgp-layout-grid2, .ylgp-layout-grid3, .ylgp-layout-grid4) { gap: 18px; align-items: start; }
.ylgp-gallery:is(.ylgp-layout-grid2, .ylgp-layout-grid3, .ylgp-layout-grid4) .ylgp-gallery-link { position: relative; display: block; width: 100%; height: auto; min-height: 0; aspect-ratio: 4 / 3; overflow: hidden; box-sizing: border-box; border: 1px solid var(--line, #e5d9bc); background: var(--soft, #fbf2d9); border-radius: 10px; box-shadow: 0 3px 10px rgba(22,61,120,.07); }
.ylgp-gallery:is(.ylgp-layout-grid2, .ylgp-layout-grid3, .ylgp-layout-grid4) .ylgp-gallery-item img { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; min-width: 0; min-height: 0; max-width: 100% !important; max-height: 100% !important; object-fit: cover !important; object-position: center; margin: 0 !important; border: 0; border-radius: 0; padding: 0; }
.ylgp-gallery:is(.ylgp-layout-grid2, .ylgp-layout-grid3, .ylgp-layout-grid4) .ylgp-gallery-item figcaption { margin: 10px 0 0 !important; text-align: left; font-size: 17px; line-height: 1.7; color: var(--muted, #665b50); }

/* ==========================================================================
   Facebook Dynamic Collage Layout (.ylgp-layout-fb & .ylgp-layout-fb4)
   ========================================================================== */
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
  background: #fffdf8;
  padding: 8px !important;
  border: 1px solid #e5d9bc;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(22, 61, 120, 0.08);
}
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) .ylgp-gallery-item.ylgp-fb-extra-item {
  display: none !important;
}
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) .ylgp-gallery-link {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #f3efe6;
}
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) .ylgp-gallery-item img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) .ylgp-gallery-item figcaption {
  display: none;
}
/* 1 photo */
.ylgp-gallery.ylgp-layout-fb[data-fb-count="1"] figure.ylgp-gallery-item:nth-of-type(1) { grid-column: 1 / 7; }
.ylgp-gallery.ylgp-layout-fb[data-fb-count="1"] .ylgp-gallery-link { aspect-ratio: auto; max-height: 75vh; }
.ylgp-gallery.ylgp-layout-fb[data-fb-count="1"] .ylgp-gallery-item img { position: static !important; width: 100% !important; height: auto !important; max-height: 75vh !important; object-fit: contain !important; }
/* 2 photos: 50% + 50% */
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="2"] figure.ylgp-gallery-item:nth-of-type(1) { grid-column: 1 / 4; }
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="2"] figure.ylgp-gallery-item:nth-of-type(2) { grid-column: 4 / 7; }
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="2"] .ylgp-gallery-link { aspect-ratio: 1 / 1; }
/* 3 photos: 1 large on left (4 cols, 2 rows) + 2 stacked on right (2 cols each) */
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="3"] figure.ylgp-gallery-item:nth-of-type(1) { grid-column: 1 / 5; grid-row: 1 / 3; }
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="3"] figure.ylgp-gallery-item:nth-of-type(1) .ylgp-gallery-link { height: 100%; aspect-ratio: auto; min-height: 340px; }
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="3"] figure.ylgp-gallery-item:nth-of-type(2) { grid-column: 5 / 7; grid-row: 1 / 2; }
.ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="3"] figure.ylgp-gallery-item:nth-of-type(3) { grid-column: 5 / 7; grid-row: 2 / 3; }
/* 4 photos in .ylgp-layout-fb: 1 hero top + 3 bottom */
.ylgp-gallery.ylgp-layout-fb[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(1) { grid-column: 1 / 7; }
.ylgp-gallery.ylgp-layout-fb[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(1) .ylgp-gallery-link { aspect-ratio: 16 / 9; }
.ylgp-gallery.ylgp-layout-fb[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(2) { grid-column: 1 / 3; }
.ylgp-gallery.ylgp-layout-fb[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(3) { grid-column: 3 / 5; }
.ylgp-gallery.ylgp-layout-fb[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(4) { grid-column: 5 / 7; }
/* 4 photos in .ylgp-layout-fb4: 2x2 grid */
.ylgp-gallery.ylgp-layout-fb4[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(1),
.ylgp-gallery.ylgp-layout-fb4[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(3) { grid-column: 1 / 4; }
.ylgp-gallery.ylgp-layout-fb4[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(2),
.ylgp-gallery.ylgp-layout-fb4[data-fb-count="4"] figure.ylgp-gallery-item:nth-of-type(4) { grid-column: 4 / 7; }
/* 5+ photos in .ylgp-layout-fb: Classic FB 2 top (3 cols each) + 3 bottom (2 cols each) */
.ylgp-gallery.ylgp-layout-fb:not([data-fb-count]) figure.ylgp-gallery-item:nth-of-type(1),
.ylgp-gallery.ylgp-layout-fb[data-fb-count="5"] figure.ylgp-gallery-item:nth-of-type(1) { grid-column: 1 / 4; }
.ylgp-gallery.ylgp-layout-fb:not([data-fb-count]) figure.ylgp-gallery-item:nth-of-type(2),
.ylgp-gallery.ylgp-layout-fb[data-fb-count="5"] figure.ylgp-gallery-item:nth-of-type(2) { grid-column: 4 / 7; }
.ylgp-gallery.ylgp-layout-fb:not([data-fb-count]) figure.ylgp-gallery-item:nth-of-type(3),
.ylgp-gallery.ylgp-layout-fb[data-fb-count="5"] figure.ylgp-gallery-item:nth-of-type(3) { grid-column: 1 / 3; }
.ylgp-gallery.ylgp-layout-fb:not([data-fb-count]) figure.ylgp-gallery-item:nth-of-type(4),
.ylgp-gallery.ylgp-layout-fb[data-fb-count="5"] figure.ylgp-gallery-item:nth-of-type(4) { grid-column: 3 / 5; }
.ylgp-gallery.ylgp-layout-fb:not([data-fb-count]) figure.ylgp-gallery-item:nth-of-type(5),
.ylgp-gallery.ylgp-layout-fb[data-fb-count="5"] figure.ylgp-gallery-item:nth-of-type(5) { grid-column: 5 / 7; }
/* +N Overlay Badge on last visible tile */
.ylgp-gallery .ylgp-fb-more-badge {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 24, 38, 0.62);
  backdrop-filter: blur(2px);
  color: #fff;
  text-align: center;
  padding: 12px;
  transition: background .2s ease;
}
.ylgp-gallery .ylgp-gallery-link:hover .ylgp-fb-more-badge {
  background: rgba(22, 61, 120, 0.75);
}
.ylgp-gallery .ylgp-fb-more-badge strong {
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: .02em;
}
.ylgp-gallery .ylgp-fb-more-badge span {
  font-size: 14px;
  margin-top: 4px;
  opacity: .92;
}

/* ==========================================================================
   Featured Main Stage + Filmstrip (.ylgp-layout-featured)
   ========================================================================== */
.ylgp-gallery.ylgp-is-featured {
  display: block !important;
  background: #fffdf8;
  border: 1px solid #e5d9bc;
  border-radius: 14px;
  padding: 14px !important;
  box-shadow: 0 4px 16px rgba(22, 61, 120, 0.07);
}
.ylgp-gallery .ylgp-featured-stage {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #141c26;
  margin-bottom: 12px;
}
.ylgp-gallery .ylgp-featured-main-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(62vh, 560px);
  cursor: zoom-in;
  position: relative;
}
.ylgp-gallery .ylgp-featured-main-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
.ylgp-gallery .ylgp-featured-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(15, 24, 36, 0.72);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
}
.ylgp-gallery .ylgp-featured-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(15, 24, 36, 0.65);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.ylgp-gallery .ylgp-featured-prev { left: 12px; }
.ylgp-gallery .ylgp-featured-next { right: 12px; }
.ylgp-gallery .ylgp-featured-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scroll-snap-type: x mandatory;
}
.ylgp-gallery .ylgp-featured-thumb-item {
  flex: 0 0 88px !important;
  width: 88px !important;
  height: 66px !important;
  border-radius: 6px;
  overflow: hidden;
  opacity: .58;
  border: 2px solid transparent;
  transition: opacity .2s, border-color .2s;
}
.ylgp-gallery .ylgp-featured-thumb-item.is-active {
  opacity: 1;
  border-color: #b47a15;
}
.ylgp-gallery .ylgp-featured-thumb-item .ylgp-gallery-link {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}
.ylgp-gallery .ylgp-featured-thumb-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 4px !important;
}

/* ==========================================================================
   Masonry Waterfall Layout (.ylgp-layout-masonry)
   ========================================================================== */
.ylgp-gallery.ylgp-layout-masonry {
  display: block !important;
  column-count: 3;
  column-gap: 16px;
}
.ylgp-gallery.ylgp-layout-masonry .ylgp-gallery-item {
  break-inside: avoid;
  margin-bottom: 16px !important;
  background: #fffdf8;
  border: 1px solid #e5d9bc;
  border-radius: 10px;
  padding: 8px !important;
  box-shadow: 0 2px 8px rgba(22, 61, 120, 0.06);
}

/* ==========================================================================
   Carousel Layout (.ylgp-is-carousel)
   ========================================================================== */
.ylgp-gallery.ylgp-is-carousel { display: block !important; }
.ylgp-gallery .ylgp-gallery-track { display: flex; direction: ltr; gap: 0; width: 100%; min-width: 0; box-sizing: border-box; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; border: 1px solid #ddd7c9; border-radius: 12px; background: #fffdf8; box-shadow: 0 3px 12px rgba(22,61,120,.06); }
.ylgp-gallery .ylgp-gallery-track > .ylgp-gallery-item { flex: 0 0 100%; scroll-snap-align: start; padding: 14px !important; align-self: flex-start; }
.ylgp-gallery .ylgp-gallery-track img { height: min(66vh,650px) !important; width: 100% !important; object-fit: contain !important; }
.ylgp-gallery .ylgp-gallery-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 12px 0; }
.ylgp-gallery .ylgp-gallery-controls button { min-width: 44px; min-height: 44px; width: auto; height: auto; margin: 0; padding: 8px 16px; border: 1px solid #244a89; border-radius: 8px; background: #fff; color: #173d78; font: 600 17px/1.4 sans-serif; white-space: normal; text-decoration: none; cursor: pointer; }
.ylgp-gallery :focus-visible, .ylgp-fb-theater :focus-visible { outline: 3px solid #f59e0b !important; outline-offset: 2px; }
.ylgp-gallery .ylgp-gallery-counter { color: #263448; font: 600 17px/1.5 sans-serif; padding: 0 8px; }
.ylgp-gallery .ylgp-gallery-hint { margin: .4em 0; text-align: center; color: #46536a; font: 16px/1.6 sans-serif; }
.ylgp-gallery [hidden], .ylgp-fb-theater[hidden], .ylgp-fb-theater [hidden] { display: none !important; }

/* ==========================================================================
   Facebook-Style Fullscreen Popup Theater (.ylgp-fb-theater)
   Matches FB Theater UI: Top-Left Circular X Close, Top-Right + / - Zoom & Fullscreen
   ========================================================================== */
.ylgp-fb-theater {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 2147483640 !important;
  background: rgba(0, 0, 0, 0.95) !important;
  color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  user-select: none;
  -webkit-user-select: none;
  animation: ylgpTheaterFadeIn 0.16s ease-out;
}
@keyframes ylgpTheaterFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ylgp-fb-theater .ylgp-fbt-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 10 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 18px !important;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0) 100%);
}
.ylgp-fb-theater .ylgp-fbt-left,
.ylgp-fb-theater .ylgp-fbt-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  pointer-events: auto;
}
/* Top-left Facebook white circular X button */
.ylgp-fb-theater button.ylgp-fbt-close {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: #e4e6eb !important;
  color: #050505 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45) !important;
  transition: background 0.15s ease, transform 0.15s ease !important;
}
.ylgp-fb-theater button.ylgp-fbt-close:hover {
  background: #ffffff !important;
  transform: scale(1.06);
}
.ylgp-fb-theater .ylgp-fbt-counter {
  font: 600 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: #f1f5f9 !important;
  background: rgba(255, 255, 255, 0.14) !important;
  padding: 7px 13px !important;
  border-radius: 999px !important;
  backdrop-filter: blur(4px);
}
/* Top-right Facebook circular translucent zoom & fullscreen buttons */
.ylgp-fb-theater button.ylgp-fbt-icon-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, opacity 0.15s ease !important;
}
.ylgp-fb-theater button.ylgp-fbt-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.28) !important;
}
.ylgp-fb-theater button.ylgp-fbt-icon-btn:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
}
.ylgp-fb-theater button.ylgp-fbt-zoom-badge {
  height: 38px !important;
  min-height: 38px !important;
  min-width: 58px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
  font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  cursor: pointer !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}
.ylgp-fb-theater button.ylgp-fbt-zoom-badge.is-active {
  background: rgba(245, 158, 11, 0.28) !important;
  border-color: rgba(245, 158, 11, 0.7) !important;
  color: #fde68a !important;
}
.ylgp-fb-theater button.ylgp-fbt-zoom-badge:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Stage & Viewport */
.ylgp-fb-theater .ylgp-fbt-stage {
  position: relative !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
.ylgp-fb-theater .ylgp-fbt-viewport {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  touch-action: none;
}
.ylgp-fb-theater .ylgp-fbt-img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 28px) !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 2px !important;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.65);
  transform-origin: center center !important;
  will-change: transform;
  cursor: zoom-in;
}
.ylgp-fb-theater.has-footer .ylgp-fbt-img {
  max-height: calc(100dvh - 104px) !important;
}
.ylgp-fb-theater.is-zoomed .ylgp-fbt-img {
  cursor: grab !important;
}
.ylgp-fb-theater.is-zoomed.is-dragging .ylgp-fbt-img {
  cursor: grabbing !important;
}

/* Prev / Next circular buttons */
.ylgp-fb-theater button.ylgp-fbt-nav {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 8 !important;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(24, 25, 26, 0.68) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.15s ease !important;
}
.ylgp-fb-theater button.ylgp-fbt-nav svg {
  width: 26px !important;
  height: 26px !important;
}
.ylgp-fb-theater button.ylgp-fbt-nav:hover {
  background: rgba(255, 255, 255, 0.26) !important;
}
.ylgp-fb-theater button.ylgp-fbt-prev { left: 18px !important; }
.ylgp-fb-theater button.ylgp-fbt-next { right: 18px !important; }

/* Optional bottom caption + thumbnail strip */
.ylgp-fb-theater .ylgp-fbt-footer {
  flex: 0 0 auto !important;
  z-index: 9 !important;
  padding: 6px 16px 12px !important;
  background: rgba(0, 0, 0, 0.78) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ylgp-fb-theater .ylgp-fbt-caption {
  color: #e2e8f0 !important;
  font: 15px/1.45 sans-serif !important;
  text-align: center !important;
  margin: 0 0 6px !important;
  overflow-wrap: anywhere;
}
.ylgp-fb-theater .ylgp-fbt-thumbs {
  display: flex !important;
  justify-content: center;
  gap: 6px !important;
  overflow-x: auto !important;
  padding: 2px 2px !important;
  scroll-snap-type: x mandatory;
}
.ylgp-fb-theater button.ylgp-fbt-thumb {
  flex: 0 0 58px !important;
  width: 58px !important;
  height: 44px !important;
  min-width: 58px !important;
  min-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 2px solid transparent !important;
  border-radius: 5px !important;
  overflow: hidden !important;
  background: #1e293b !important;
  opacity: 0.5 !important;
  cursor: pointer !important;
  transition: opacity 0.15s ease, border-color 0.15s ease !important;
}
.ylgp-fb-theater button.ylgp-fbt-thumb.is-active {
  opacity: 1 !important;
  border-color: #f59e0b !important;
}
.ylgp-fb-theater button.ylgp-fbt-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
}

/* Editor Previews inside TinyMCE */
body#tinymce .ylgp-layout-carousel,
body#tinymce .ylgp-layout-fb,
body#tinymce .ylgp-layout-fb4,
body#tinymce .ylgp-layout-featured,
body#tinymce .ylgp-layout-masonry { border: 2px dashed #8d9eb9; padding: 12px; border-radius: 10px; }
body#tinymce .ylgp-layout-fb::before { content: '【臉書經典動態拼貼】（點選任一照片再按上方「編輯圖片組／切換樣式」可調整順序或改樣式）'; display: block; grid-column: 1 / -1; font: 600 15px/1.6 sans-serif; color: #163d78; margin-bottom: 6px; }
body#tinymce .ylgp-layout-fb4::before { content: '【臉書四宮格拼貼】'; display: block; grid-column: 1 / -1; font: 600 15px/1.6 sans-serif; color: #163d78; margin-bottom: 6px; }
body#tinymce .ylgp-layout-featured::before { content: '【主圖精選＋下方縮圖列】'; display: block; font: 600 15px/1.6 sans-serif; color: #163d78; margin-bottom: 6px; }
body#tinymce .ylgp-layout-masonry::before { content: '【瀑布流藝術畫廊】'; display: block; font: 600 15px/1.6 sans-serif; color: #163d78; margin-bottom: 6px; }
body#tinymce .ylgp-layout-carousel::before { content: '【經典圖片輪播 (預覽時可切換)】'; display: block; font: 600 15px/1.6 sans-serif; color: #244a89; margin-bottom: 6px; }

@media (min-width: 601px) and (max-width: 900px) {
  .ylgp-gallery.ylgp-layout-grid4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ylgp-gallery.ylgp-layout-masonry { column-count: 2; }
}
@media (max-width: 600px) {
  .ylgp-gallery.ylgp-layout-grid2, .ylgp-gallery.ylgp-layout-grid3, .ylgp-gallery.ylgp-layout-grid4 { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .ylgp-gallery.ylgp-layout-masonry { column-count: 1; }
  .ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4)[data-fb-count="3"] figure.ylgp-gallery-item:nth-of-type(1) .ylgp-gallery-link { min-height: 200px; }
  .ylgp-gallery .ylgp-gallery-track > .ylgp-gallery-item { padding: 8px !important; }
  .ylgp-gallery .ylgp-gallery-track img { height: 52vh !important; }
  .ylgp-fb-theater .ylgp-fbt-topbar { padding: 10px 12px !important; }
  .ylgp-fb-theater button.ylgp-fbt-nav { width: 42px !important; height: 42px !important; min-width: 42px !important; min-height: 42px !important; }
  .ylgp-fb-theater button.ylgp-fbt-prev { left: 8px !important; }
  .ylgp-fb-theater button.ylgp-fbt-next { right: 8px !important; }
  .ylgp-fb-theater .ylgp-fbt-thumbs { justify-content: flex-start; }
}
@media print {
  .ylgp-gallery .ylgp-gallery-track { display: block !important; overflow: visible !important; }
  .ylgp-gallery .ylgp-gallery-track img { height: auto !important; }
  .ylgp-gallery .ylgp-gallery-controls, .ylgp-gallery .ylgp-gallery-hint, .ylgp-fb-theater { display: none !important; }
}

body#tinymce .ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
body#tinymce .ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) figure.ylgp-gallery-item {
  grid-column: auto !important;
  grid-row: auto !important;
}
body#tinymce .ylgp-gallery:is(.ylgp-layout-fb, .ylgp-layout-fb4) .ylgp-gallery-link {
  aspect-ratio: 4 / 3 !important;
  min-height: 0 !important;
}
