/**
 * CloudFold AI - Frontend Gallery Styles
 * Covers all layouts + lightbox + hover effects + animations
 */

/* ─── CSS Variables ──────────────────────────────────────────────────── */
:root {
  --cf-lb-bg:        rgba(0, 0, 0, .92);
  --cf-lb-text:      #fff;
  --cf-lb-radius:    4px;
  --cf-lb-nav-size:  52px;
  --cf-transition:   .3s ease;
}

html {
  scrollbar-gutter: stable;
}

/* ─── Gallery Wrapper ────────────────────────────────────────────────── */
.cloudfold-gallery-wrap {
  --cloudfold-safe-gutter: clamp(10px, 2vw, 20px);
  width: 100%;
  width: calc(100% - (var(--cloudfold-safe-gutter) * 2));
  max-width: var(
    --cloudfold-gallery-max-width,
    var(
      --wp--style--global--content-size,
      var(--theme-container-width, var(--container-max-width, 100%))
    )
  );
  margin: 0 auto 24px;
  border-radius: 20px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.01) 100%);
  box-sizing: border-box;
  overflow: hidden;
}

/* Builder integrations should use their own section/container gutters. */
.cloudfold-elementor-gallery-widget .cloudfold-gallery-wrap,
.cloudfold-divi-gallery-widget .cloudfold-gallery-wrap {
  width: 100%;
  --cloudfold-safe-gutter: 0px;
}

/* These layouts should not be clipped by outer wrapper; each tile controls its own radius. */
.cloudfold-gallery-wrap.cloudfold-layout-grid,
.cloudfold-gallery-wrap.cloudfold-layout-justified,
.cloudfold-gallery-wrap.cloudfold-layout-masonry,
.cloudfold-gallery-wrap.cloudfold-layout-mosaic,
.cloudfold-gallery-wrap.cloudfold-layout-metro,
.cloudfold-gallery-wrap.cloudfold-layout-story {
  border-radius: 0;
  overflow: visible;
}

.cloudfold-gallery-inner {
  --cloudfold-columns: 3;
  --cloudfold-gutter:  10px;
  --cloudfold-border-radius: 8px;
  width: 100%;
  padding: 2px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none;
}

/* Keep content visible; JS layout pass may run async with dynamic media. */
.cloudfold-gallery-inner {
  opacity: 1;
}
.cloudfold-layout-ready .cloudfold-gallery-inner {
  opacity: 1;
  transition: opacity .3s;
}

/* ─── Gallery Item ───────────────────────────────────────────────────── */
.cloudfold-item {
  position: relative;
  overflow: visible;
  line-height: 1.4;
  margin: 0;
}

.cloudfold-item-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--cloudfold-border-radius);
  clip-path: inset(0 round var(--cloudfold-border-radius));
  -webkit-clip-path: inset(0 round var(--cloudfold-border-radius));
  isolation: isolate;
  background: transparent;
  border: 0;
  box-shadow: none;
  line-height: 0;
  transition: box-shadow .24s ease, border-color .24s ease;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.cloudfold-item-media > a,
.cloudfold-item-media > a > img,
.cloudfold-item-media > img {
  border-radius: var(--cloudfold-border-radius) !important;
}

.cloudfold-item-media > a {
  display: block;
  width: 100%;
  height: 100%;
}

.cloudfold-item-media > a > img,
.cloudfold-item-media > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cloudfold-layout-grid .cloudfold-item-media,
.cloudfold-layout-grid .cloudfold-item-media > a {
  height: 100%;
}

.cloudfold-item:hover .cloudfold-item-media {
  box-shadow: none;
  z-index: 2;
}

.cloudfold-item figure {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

.cloudfold-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .3s, transform var(--cf-transition);
  transform: translateZ(0);
  backface-visibility: hidden;
  transform-origin: 50% 50%;
  will-change: transform;
}

.cloudfold-lazy { opacity: 0 !important; }
.cloudfold-loaded { opacity: 1; }

/* ─── Overlay ────────────────────────────────────────────────────────── */
.cloudfold-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(to top, rgba(2, 6, 23, .82) 0%, rgba(2, 6, 23, .1) 62%, transparent 100%);
  opacity: 0;
  transition: opacity var(--cf-transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}

.cloudfold-pro-chip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.52);
  background: radial-gradient(circle at 35% 30%, rgba(254, 243, 199, .96) 0%, rgba(245, 158, 11, .92) 62%, rgba(180, 83, 9, .95) 100%);
  color: #5b2d00;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(6px);
}

.cloudfold-pro-chip svg {
  width: 15px;
  height: 15px;
  display: block;
}

.cloudfold-watermark {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  pointer-events: none;
  user-select: none;
  max-width: calc(100% - 54px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .95);
  background: rgba(2, 6, 23, .52);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: 6px 10px;
  backdrop-filter: blur(5px);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .22);
}


.cloudfold-item:hover .cloudfold-overlay {
  opacity: 1;
}
.cloudfold-item:focus-within .cloudfold-overlay,
.cloudfold-item:active .cloudfold-overlay {
  opacity: 1;
}

.cloudfold-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
  z-index: 6;
}
.cloudfold-video-play svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.35));
}
.cloudfold-item:hover .cloudfold-video-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.cloudfold-item:focus-within .cloudfold-video-play,
.cloudfold-item:active .cloudfold-video-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cloudfold-video-editor-placeholder {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 40%),
    linear-gradient(140deg, #0f172a 0%, #1e293b 55%, #334155 100%);
}

/* Elementor editor preview: keep tile rendering stable and avoid admin CSS conflicts. */
body.elementor-editor-active .cloudfold-video-play,
body.elementor-editor-preview .cloudfold-video-play {
  opacity: 1;
}

/* External embeds (YouTube/Vimeo) */
.cloudfold-video-embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.cloudfold-lb-media .cloudfold-video-embed {
  width: min(90vw, 1400px);
  height: min(75vh, 78vw);
  max-width: 90vw;
  max-height: 75vh;
  border-radius: var(--cf-lb-radius);
}

.cloudfold-caption {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.cloudfold-download-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, .58);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  transition: background var(--cf-transition), transform var(--cf-transition);
  backdrop-filter: blur(8px);
}
.cloudfold-download-btn:hover {
  background: rgba(15, 23, 42, .86);
  transform: translateY(-1px);
}

.cloudfold-share-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, .58);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--cf-transition), transform var(--cf-transition);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.cloudfold-share-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.cloudfold-share-btn:hover {
  background: rgba(15, 23, 42, .86);
  transform: translateY(-1px);
}
.cloudfold-share-btn.is-copied {
  background: rgba(5, 150, 105, .9);
  border-color: rgba(167, 243, 208, .8);
}

.cloudfold-share-open {
  overflow: hidden;
}

.cloudfold-share-modal {
  position: fixed;
  inset: 0;
  z-index: 1000002;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .22s ease;
}

.cloudfold-share-modal[hidden] {
  display: none !important;
}

.cloudfold-share-modal.is-open {
  opacity: 1;
}

.cloudfold-share-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, .34);
  opacity: 0;
  transition: opacity .24s ease;
}

.cloudfold-share-modal.is-open .cloudfold-share-modal-backdrop {
  opacity: 1;
}

.cloudfold-share-card {
  position: relative;
  z-index: 2;
  width: min(100%, 390px);
  border-radius: 20px;
  border: 1px solid #e6e8ee;
  background: #fff;
  box-shadow: 0 20px 42px rgba(15, 23, 42, .16);
  padding: 56px 22px 22px;
  transform: translateY(10px) scale(.96);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.cloudfold-share-modal.is-open .cloudfold-share-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cloudfold-share-badge {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid #eceff5;
  background: #f4f6fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.cloudfold-share-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.cloudfold-share-title {
  margin: 0;
  text-align: center;
  color: #111827;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}

.cloudfold-share-subtitle {
  margin: 8px 0 18px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.cloudfold-share-label {
  margin: 0 0 8px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.cloudfold-share-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f7f8fb;
  padding: 8px 10px;
  margin-bottom: 18px;
}

.cloudfold-share-link-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 13px;
  outline: 0;
}

.cloudfold-share-copy-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.cloudfold-share-copy-btn.is-copied {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.cloudfold-share-platforms {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.cloudfold-share-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.cloudfold-share-platform-ico {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  background: #0f172a;
}

.cloudfold-share-platform[data-share-platform="facebook"] .cloudfold-share-platform-ico { background: #1877f2; }
.cloudfold-share-platform[data-share-platform="x"] .cloudfold-share-platform-ico { background: #000; }
.cloudfold-share-platform[data-share-platform="whatsapp"] .cloudfold-share-platform-ico { background: #25D366; }
.cloudfold-share-platform[data-share-platform="telegram"] .cloudfold-share-platform-ico { background: #2AABEE; }
.cloudfold-share-platform[data-share-platform="linkedin"] .cloudfold-share-platform-ico { background: #0a66c2; }

.cloudfold-share-platform-txt {
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

@media (prefers-reduced-motion: reduce) {
  .cloudfold-share-modal,
  .cloudfold-share-modal-backdrop,
  .cloudfold-share-card {
    transition: none !important;
  }
}

.cloudfold-exif-toggle-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(15, 23, 42, .58);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 6;
}

.cloudfold-exif-popover {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  z-index: 7;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.26);
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 32px rgba(2, 6, 23, .35);
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.cloudfold-exif-popover:not([hidden]) {
  transform: translateY(0);
  opacity: 1;
}
.cloudfold-exif-popover .cloudfold-exif-data {
  margin-top: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.cloudfold-exif-popover .cloudfold-exif-item,
.cloudfold-exif-popover .cloudfold-exif-label,
.cloudfold-exif-popover .cloudfold-exif-value {
  color: rgba(255,255,255,.95);
}
.cloudfold-exif-popover .cloudfold-exif-icon {
  opacity: .9;
}
@media (max-width: 640px) {
  .cloudfold-exif-popover {
    left: 8px;
    right: 8px;
    top: 8px;
  }
}

/* ─── Hover Effects ──────────────────────────────────────────────────── */
.cloudfold-hover-zoom:hover .cloudfold-img.cloudfold-loaded         { transform: scale(1.08); }
.cloudfold-hover-fade:hover .cloudfold-img.cloudfold-loaded         { opacity: .75; }
.cloudfold-hover-slide-up:hover .cloudfold-img.cloudfold-loaded     { transform: translateY(-6px); }
.cloudfold-hover-slide-down:hover .cloudfold-img.cloudfold-loaded   { transform: translateY(6px); }
.cloudfold-hover-blur:hover .cloudfold-img.cloudfold-loaded         { filter: blur(2px); }
.cloudfold-hover-grayscale:hover .cloudfold-img.cloudfold-loaded    { filter: grayscale(100%); }

/* ─── Load Animations ────────────────────────────────────────────────── */
.cloudfold-anim-fade {
  animation: cf-fadeIn .5s ease both;
}
.cloudfold-anim-zoom-in {
  animation: cf-zoomIn .45s ease both;
}
.cloudfold-anim-slide-up {
  animation: cf-slideUp .45s ease both;
}
.cloudfold-anim-bounce {
  animation: cf-bounce .6s cubic-bezier(.36,.07,.19,.97) both;
}

/* Run item entrance only after JS marks layout as ready. */
.cloudfold-gallery-wrap .cloudfold-item[class*="cloudfold-anim-"] {
  animation-play-state: paused;
}
.cloudfold-gallery-wrap.cloudfold-layout-ready .cloudfold-item[class*="cloudfold-anim-"] {
  animation-play-state: running;
}

@keyframes cf-fadeIn   { from { opacity: 0; }                    to { opacity: 1; } }
@keyframes cf-zoomIn   { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes cf-slideUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes cf-bounce   { 0%,100% { transform: none; } 50% { transform: scale(1.04); } }

/* Stagger children. */
.cloudfold-item:nth-child(1)  { animation-delay: .05s; }
.cloudfold-item:nth-child(2)  { animation-delay: .10s; }
.cloudfold-item:nth-child(3)  { animation-delay: .15s; }
.cloudfold-item:nth-child(4)  { animation-delay: .20s; }
.cloudfold-item:nth-child(5)  { animation-delay: .25s; }
.cloudfold-item:nth-child(6)  { animation-delay: .30s; }
.cloudfold-item:nth-child(n+7){ animation-delay: .35s; }

/* ─── Masonry ────────────────────────────────────────────────────────── */
.cloudfold-layout-masonry .cloudfold-gallery-inner {
  position: relative;
}

/* ─── Justified ──────────────────────────────────────────────────────── */
.cloudfold-layout-justified .cloudfold-gallery-inner {
  position: relative;
}

/* ─── Grid ───────────────────────────────────────────────────────────── */
.cloudfold-layout-grid .cloudfold-gallery-inner {
  display: grid;
  grid-template-columns: repeat(var(--cloudfold-columns), minmax(0, 1fr));
  gap: var(--cloudfold-gutter);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.cloudfold-layout-grid .cloudfold-item {
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: auto !important;
  max-width: 100% !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  position: relative !important;
  margin: 0 !important;
}
.cloudfold-layout-grid .cloudfold-item-media {
  aspect-ratio: 1;
}
.cloudfold-layout-grid .cloudfold-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Metro ──────────────────────────────────────────────────────────── */
.cloudfold-layout-metro .cloudfold-gallery-inner,
.cloudfold-layout-mosaic .cloudfold-gallery-inner {
  position: relative;
}

/* ─── Story ──────────────────────────────────────────────────────────── */
.cloudfold-layout-story .cloudfold-gallery-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cloudfold-layout-story .cloudfold-item {
  width: var(--cloudfold-story-bubble-size, 88px);
  height: var(--cloudfold-story-bubble-size, 88px);
  padding: 0;
  border-radius: var(--cloudfold-story-radius, 999px);
  border: none;
  box-shadow: none;
  overflow: hidden;
  clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
  -webkit-clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
}

.cloudfold-layout-story .cloudfold-item-media {
  width: 100%;
  height: 100%;
  padding: max(1px, var(--cloudfold-story-ring-width, 3px));
  border-radius: var(--cloudfold-story-radius, 999px);
  overflow: hidden;
  background: linear-gradient(135deg, var(--cloudfold-story-ring-color, #ff2d55), #f59e0b, #ef4444, var(--cloudfold-story-ring-color, #ff2d55));
  border: none;
  box-shadow: none;
  box-sizing: border-box;
  clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
  -webkit-clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
}
.cloudfold-layout-story .cloudfold-item.cloudfold-story-seen {
  filter: grayscale(.12) saturate(.65);
  opacity: .92;
}

.cloudfold-layout-story .cloudfold-item a {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--cloudfold-story-radius, 999px);
  overflow: hidden;
  border: var(--cloudfold-story-border-width, 2px) solid var(--cloudfold-story-border-color, #fff);
  box-sizing: border-box;
  clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
  -webkit-clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
}

.cloudfold-layout-story .cloudfold-img {
  border-radius: var(--cloudfold-story-radius, 999px);
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
  -webkit-clip-path: inset(0 round var(--cloudfold-story-radius, 999px));
}

.cloudfold-layout-story .cloudfold-overlay,
.cloudfold-layout-story .cloudfold-watermark,
.cloudfold-layout-story .cloudfold-download-btn {
  display: none !important;
}

.cloudfold-story-open {
  overflow: hidden;
}

.cloudfold-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  display: none;
  background: #000;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity .22s ease, transform .22s ease;
  --cloudfold-story-drag-y: 0px;
  --cloudfold-story-drag-opacity: 1;
}

.cloudfold-story-viewer.is-open {
  display: block;
  opacity: 1;
  transform: scale(1);
}

.cloudfold-story-viewer[data-platform="ios"] {
  transition-duration: .2s;
}

.cloudfold-story-viewer[data-platform="android"] {
  transition-duration: .23s;
}

.cloudfold-story-viewer.is-closing {
  opacity: 0;
  transform: scale(1.01);
}

.cloudfold-story-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-position: center;
  background-size: cover;
  filter: blur(28px) brightness(.45);
  transform: scale(1.08);
  transition: filter .24s ease, transform .24s ease;
}

.cloudfold-story-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .3);
}

.cloudfold-story-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 4;
  padding: 0;
}

.cloudfold-story-progress {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.cloudfold-story-progress-bar {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
}

.cloudfold-story-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--cloudfold-story-progress, 0) * 100%);
  background: #fff;
  transition: width .04s linear;
}

.cloudfold-story-progress-bar.is-done::after {
  width: 100%;
}

.cloudfold-story-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 6;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.35);
  color: var(--cf-lb-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.cloudfold-story-close:hover {
  background: rgba(255,255,255,.18);
  transform: scale(1.04);
}

.cloudfold-story-meta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.cloudfold-story-meta-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 3px;
}

.cloudfold-story-author {
  font-size: 11px;
  font-weight: 500;
  opacity: .84;
}

.cloudfold-story-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  right: auto;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(4, 12, 24, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,.96);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.cloudfold-story-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.95);
  object-fit: cover;
}

.cloudfold-story-media {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 22px;
  overflow: hidden;
}

.cloudfold-story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: cloudfold-story-img-in .2s cubic-bezier(.2,.7,.2,1);
}

.cloudfold-story-media-meta {
  position: absolute;
  left: 14px;
  right: 14px;
  max-width: none;
  bottom: 14px;
  z-index: 4;
  color: #fff;
  background: rgba(10, 14, 24, .52);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 10px 12px;
  border-radius: 14px;
  pointer-events: none;
}

.cloudfold-story-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 430px);
  height: min(88vh, 760px);
  transform: translate(-50%, -50%) translateY(var(--cloudfold-story-drag-y));
  opacity: var(--cloudfold-story-drag-opacity);
  transition: transform .18s ease, opacity .18s ease;
  border-radius: 22px;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
  background: #0b1020;
}

.cloudfold-story-media-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.36);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cloudfold-story-media-caption {
  font-size: 11px;
  line-height: 1.35;
  opacity: .88;
  text-shadow: 0 1px 2px rgba(0,0,0,.36);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes cloudfold-story-img-in {
  from { opacity: .82; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}

.cloudfold-story-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 0;
  background: transparent;
  z-index: 3;
  cursor: pointer;
  touch-action: pan-y;
  transition: background .12s ease;
}

.cloudfold-story-hit.is-tapped {
  background: rgba(255, 255, 255, .08);
}

.cloudfold-story-hit-left { left: 0; }
.cloudfold-story-hit-right { right: 0; }

.cloudfold-story-viewer.is-dragging-close .cloudfold-story-stage {
  opacity: .72;
  transition: opacity .12s ease;
}

@media (prefers-reduced-motion: reduce) {
  .cloudfold-story-viewer,
  .cloudfold-story-bg,
  .cloudfold-story-image,
  .cloudfold-story-progress-bar::after,
  .cloudfold-story-hit,
  .cloudfold-story-close {
    transition: none !important;
    animation: none !important;
  }
}

/* ─── Carousel ───────────────────────────────────────────────────────── */
.cloudfold-layout-carousel,
.cloudfold-layout-slider {
  position: relative;
  user-select: none;
}

.cloudfold-layout-carousel .cloudfold-gallery-inner,
.cloudfold-layout-slider   .cloudfold-gallery-inner {
  overflow: hidden;
  border-radius: var(--cloudfold-border-radius);
  padding: 0;
}

.cloudfold-layout-carousel .cloudfold-item {
  aspect-ratio: 16 / 10;
}

.cloudfold-layout-carousel .cloudfold-item,
.cloudfold-layout-carousel .cloudfold-item-media,
.cloudfold-layout-carousel .cloudfold-item-media > a {
  height: 100%;
}

.cloudfold-layout-carousel .cloudfold-item-media > a {
  display: block;
}

.cloudfold-layout-carousel .cloudfold-item-media {
  overflow: hidden;
  border: 0;
  border-radius: var(--cloudfold-border-radius);
  box-shadow: none;
}

.cloudfold-layout-carousel .cloudfold-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cloudfold-layout-carousel[data-carousel-height] .cloudfold-item,
.cloudfold-layout-carousel[data-carousel-height] .cloudfold-item-media,
.cloudfold-layout-carousel[data-carousel-height] .cloudfold-item-media > a,
.cloudfold-layout-carousel[data-carousel-height] .cloudfold-img {
  height: var(--cloudfold-carousel-height, auto);
}

.cloudfold-layout-slider .cloudfold-item {
  aspect-ratio: 16 / 9;
}

.cloudfold-layout-slider[data-tile-fit="cover"] .cloudfold-img {
  transform: scale(1.02);
  transform-origin: 50% 50%;
}

.cloudfold-layout-slider .cloudfold-item,
.cloudfold-layout-slider .cloudfold-item-media,
.cloudfold-layout-slider .cloudfold-item-media > a {
  height: 100%;
}

.cloudfold-layout-slider .cloudfold-item-media > a {
  display: block;
}

.cloudfold-layout-slider .cloudfold-item-media {
  background-color: #0b1738;
  background-blend-mode: multiply;
  border: 0;
  border-radius: var(--cloudfold-border-radius);
  box-shadow: none;
  overflow: hidden;
}

.cloudfold-layout-slider[data-tile-fit="cover"] .cloudfold-hover-zoom:hover .cloudfold-img {
  transform: scale(1.06);
}

/* ─── 3D Showcase ────────────────────────────────────────────────────── */
.cloudfold-layout-showcase-3d {
  position: relative;
  min-height: var(--cloudfold-showcase-3d-height, 460px);
  overflow: hidden;
  user-select: none;
  perspective: 1000px;
  touch-action: pan-y;
}

.cloudfold-layout-showcase-3d .cloudfold-gallery-inner {
  min-height: var(--cloudfold-showcase-3d-height, 460px);
  overflow: visible;
  border-radius: var(--cloudfold-border-radius);
  transform-style: preserve-3d;
}

.cloudfold-layout-showcase-3d .cloudfold-item {
  border-radius: var(--cloudfold-border-radius);
  outline: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.cloudfold-layout-showcase-3d .cloudfold-item-media,
.cloudfold-layout-showcase-3d .cloudfold-item-media > a,
.cloudfold-layout-showcase-3d .cloudfold-img {
  width: 100%;
  height: 100%;
  border-radius: var(--cloudfold-border-radius);
}

.cloudfold-layout-showcase-3d .cloudfold-item-media {
  position: relative;
  overflow: hidden;
  border: 0;
  background: #080b13;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.cloudfold-layout-showcase-3d .cloudfold-img {
  display: block;
  object-fit: cover;
  transform: none;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted {
  background: transparent;
  min-height: calc(var(--cloudfold-showcase-3d-height, 460px) + 48px);
  border-radius: var(--cloudfold-border-radius);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc {
  background: transparent;
  min-height: calc(var(--cloudfold-showcase-3d-height, 460px) + 56px);
  border-radius: var(--cloudfold-border-radius);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-gallery-inner {
  min-height: calc(var(--cloudfold-showcase-3d-height, 460px) + 48px);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-gallery-inner {
  min-height: calc(var(--cloudfold-showcase-3d-height, 460px) + 56px);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-item-media {
  box-shadow: 0 18px 48px rgba(15, 23, 42, .12);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-item-media {
  box-shadow: 0 16px 44px rgba(15, 23, 42, .10);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-showcase-3d-caption,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-showcase-3d-caption {
  position: absolute;
  left: 50%;
  bottom: 58px;
  z-index: 135;
  width: max-content;
  max-width: min(520px, calc(100% - 48px));
  transform: translateX(-50%);
  color: #242424;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav {
  top: auto;
  bottom: 8px;
  width: 42px;
  height: 42px;
  background: #ffffff;
  border: 0;
  color: #7a7a7a;
  font-size: 32px;
  font-weight: 600;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
  z-index: 145;
  transition: background var(--cf-transition), color var(--cf-transition), transform var(--cf-transition);
  cursor: pointer;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-nav {
  top: 50%;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(226, 232, 240, .88);
  color: #4b5563;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
  z-index: 145;
}

.cloudfold-nav-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.25;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav:hover,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav:focus-visible,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-nav:hover,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-nav:focus-visible {
  background: rgba(239, 239, 239, 0.42);
  border-color: transparent;
  color: #111827;
  transform: translateY(-50%) scale(1.04);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav:hover,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav:focus-visible {
  transform: none !important;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav-prev {
  left: calc(50% - 256px);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav-next {
  right: calc(50% - 256px);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-nav-prev {
  left: 18px;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-nav-next {
  right: 18px;
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-dots,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-dots {
  bottom: 7px;
  z-index: 135;
  min-height: 44px;
  min-width: 336px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 82px;
  background: rgba(245, 245, 245, 0.46);
  border: 1px solid rgba(231, 231, 231, 0.72);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-dot,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-dot {
  width: 8px;
  height: 8px;
  background: rgba(39, 39, 42, .28);
  transition: background var(--cf-transition), transform var(--cf-transition);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-dot.active,
.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-dot.active {
  width: 8px;
  background: #27272a;
  transform: scale(1.35);
}

.cloudfold-layout-showcase-3d.cloudfold-showcase-3d-reflection .cloudfold-item-media::after {
  content: "";
  position: absolute;
  inset: auto 0 -32% 0;
  height: 32%;
  background: linear-gradient(to bottom, rgba(255,255,255,.18), rgba(255,255,255,0));
  opacity: .32;
  transform: scaleY(-1);
  pointer-events: none;
}

.cloudfold-layout-showcase-3d .cloudfold-nav {
  z-index: 130;
}

.cloudfold-layout-showcase-3d .cloudfold-dots {
  bottom: 18px;
  z-index: 130;
}

.cloudfold-layout-showcase-3d[data-showcase-3d-arrows="0"] .cloudfold-nav,
.cloudfold-layout-showcase-3d[data-showcase-3d-arrows="false"] .cloudfold-nav {
  display: none !important;
}

.cloudfold-layout-showcase-3d[data-showcase-3d-dots="0"] .cloudfold-dots,
.cloudfold-layout-showcase-3d[data-showcase-3d-dots="false"] .cloudfold-dots {
  display: none !important;
}

@media (max-width: 640px) {
  .cloudfold-layout-showcase-3d {
    min-height: min(var(--cloudfold-showcase-3d-height, 420px), 520px);
  }

  .cloudfold-layout-showcase-3d .cloudfold-gallery-inner {
    min-height: min(var(--cloudfold-showcase-3d-height, 420px), 520px);
  }

  .cloudfold-layout-showcase-3d .cloudfold-nav {
    width: 40px;
    height: 40px;
  }

  .cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-showcase-3d-caption,
  .cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-showcase-3d-caption {
    bottom: 52px;
    font-size: 10px;
  }

  .cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-dots,
  .cloudfold-layout-showcase-3d.cloudfold-showcase-3d-arc .cloudfold-dots {
    min-width: 292px;
    gap: 8px;
    padding: 0 70px;
  }

  .cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav-prev {
    left: calc(50% - 142px);
  }

  .cloudfold-layout-showcase-3d.cloudfold-showcase-3d-tilted .cloudfold-nav-next {
    right: calc(50% - 142px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloudfold-layout-showcase-3d .cloudfold-gallery-inner,
  .cloudfold-layout-showcase-3d .cloudfold-item {
    transition: none !important;
    animation: none !important;
  }
}

.cloudfold-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: var(--cf-lb-nav-size);
  height: var(--cf-lb-nav-size);
  background: rgba(15, 23, 42, .62);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--cf-transition), transform var(--cf-transition), border-color var(--cf-transition);
  backdrop-filter: blur(10px);
}
.cloudfold-nav:hover {
  background: rgba(79, 70, 229, .84);
  border-color: rgba(199, 210, 254, .72);
  transform: translateY(-50%) scale(1.04);
}
.cloudfold-nav-prev     { left: 12px; }
.cloudfold-nav-next     { right: 12px; }

.cloudfold-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.cloudfold-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.42);
  border: none;
  cursor: pointer;
  transition: background var(--cf-transition), transform var(--cf-transition);
  padding: 0;
}
.cloudfold-dot.active {
  background: #6366f1;
  transform: scale(1.3);
}

/* ─── Filter Bar ─────────────────────────────────────────────────────── */
.cloudfold-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}
.cloudfold-filter-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 0;
  width: 100%;
}
.cloudfold-filter-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255, 255, 255, .82);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all var(--cf-transition);
}
.cloudfold-filter-btn:hover {
  border-color: rgba(100, 116, 139, .45);
  color: #1f2937;
  background: #fff;
}
.cloudfold-filter-btn.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

/* ─── Search Bar ─────────────────────────────────────────────────────── */
.cloudfold-search-bar {
  margin: 0 0 0 auto;
  flex: 0 1 320px;
  min-width: 260px;
}
.cloudfold-search-input {
  width: 100%;
  max-width: 100%;
  height: 40px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(100, 116, 139, .28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  line-height: 40px;
  letter-spacing: .01em;
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) 50%;
  background-size: 15px 15px;
  outline: none;
  transition: border-color var(--cf-transition), box-shadow var(--cf-transition), background var(--cf-transition), transform var(--cf-transition);
}
.cloudfold-search-input::placeholder {
  color: #6b7280;
  font-weight: 500;
  line-height: 40px;
}
.cloudfold-search-input:focus {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: none;
  background: #fff;
}

/* ─── Toolbar Style Presets ─────────────────────────────────────────── */
.cloudfold-gallery-wrap.cloudfold-toolbar-style-soft .cloudfold-filter-btn {
  background: #ffffff;
  border-color: #d6dee8;
  border-radius: 8px;
}
.cloudfold-gallery-wrap.cloudfold-toolbar-style-soft .cloudfold-filter-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  border-radius: 8px;
}
.cloudfold-gallery-wrap.cloudfold-toolbar-style-soft .cloudfold-search-input {
  border-radius: 8px;
  border-color: #cfd8e3;
  background: #fff;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-minimal .cloudfold-filter-btn {
  border-radius: 0;
}
.cloudfold-gallery-wrap.cloudfold-toolbar-style-minimal .cloudfold-filter-btn.active {
  border-radius: 0;
}
.cloudfold-gallery-wrap.cloudfold-toolbar-style-minimal .cloudfold-search-input {
  border-radius: 0;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-bold .cloudfold-filter-btn {
  font-weight: 700;
  border-width: 2px;
  border-radius: 999px;
}
.cloudfold-gallery-wrap.cloudfold-toolbar-style-bold .cloudfold-filter-btn.active {
  background: #020617;
  border-color: #020617;
  border-radius: 999px;
}
.cloudfold-gallery-wrap.cloudfold-toolbar-style-bold .cloudfold-search-input {
  border-width: 2px;
  border-color: #0f172a;
  background: #ffffff;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .cloudfold-filter-toolbar {
    gap: 8px;
    width: 100%;
    align-items: stretch;
  }
  .cloudfold-search-input {
    max-width: 100%;
  }
  .cloudfold-search-bar {
    margin: 0;
    flex: 1 1 100%;
    min-width: 0;
  }
  .cloudfold-filter-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* ─── Empty State ────────────────────────────────────────────────────── */
.cloudfold-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* ─── Password Gate ─────────────────────────────────────────────────── */
.cloudfold-lock-open {
  overflow: hidden !important;
}

.cloudfold-password-gate-shell {
  position: relative;
  width: 100%;
  margin: 0 0 24px;
}

.cloudfold-password-gate-preview {
  position: relative;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.cloudfold-password-gate-preview .cloudfold-gallery-wrap {
  margin-bottom: 0;
  filter: blur(3px) saturate(.92) brightness(.84);
}

.cloudfold-password-gate-fixed {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 28px);
}

.cloudfold-password-gate {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  margin: 0 auto;
}

.cloudfold-password-gate-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(2, 6, 23, .44) 0%, rgba(2, 6, 23, .62) 100%);
  backdrop-filter: blur(8px);
}

.cloudfold-password-gate-card {
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: clamp(16px, 2.2vw, 24px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 24px 48px rgba(2, 6, 23, .28);
  backdrop-filter: blur(12px);
}

.cloudfold-password-gate-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.cloudfold-password-gate-card p {
  margin: 0 0 14px;
  color: #475569;
  font-size: 14px;
}

.cloudfold-password-gate-error {
  color: #dc2626 !important;
  font-weight: 600;
}

.cloudfold-password-gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.cloudfold-password-gate-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
  background: rgba(255,255,255,.92);
}

.cloudfold-password-gate-btn {
  width: 100%;
  border: 1px solid #4f46e5;
  background: #4f46e5;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cloudfold-password-gate-btn:hover {
  background: #4338ca;
}

@media (max-width: 767px) {
  .cloudfold-password-gate-card {
    width: 100%;
    border-radius: 14px;
  }
}

/* ─── Lightbox ───────────────────────────────────────────────────────── */
body.cloudfold-lb-open {
  overflow: hidden;
  overscroll-behavior: contain;
}

.cloudfold-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: cf-lbIn .2s ease;
}

@keyframes cf-lbIn { from { opacity: 0; } to { opacity: 1; } }

.cloudfold-lightbox-dark  .cloudfold-lb-backdrop { background: var(--cf-lb-bg); }
.cloudfold-lightbox-light .cloudfold-lb-backdrop { background: rgba(255,255,255,.95); }
.cloudfold-lightbox-blurred .cloudfold-lb-backdrop {
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: none !important;
  opacity: 1;
  will-change: backdrop-filter;
}

.cloudfold-lightbox-blurred {
  animation: none !important;
}

.cloudfold-lb-backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.cloudfold-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 10;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--cf-transition);
  line-height: 1;
}
.cloudfold-lb-close:hover { background: rgba(255,255,255,.25); }
.cloudfold-lb-close:focus-visible,
.cloudfold-lb-exif-btn:focus-visible,
.cloudfold-lb-prev:focus-visible,
.cloudfold-lb-next:focus-visible,
.cloudfold-lb-info-btn:focus-visible,
.cloudfold-lb-thumb:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.cloudfold-lightbox-light .cloudfold-lb-close { color: #111; border-color: rgba(0,0,0,.2); }
.cloudfold-lightbox-light .cloudfold-lb-close:focus-visible,
.cloudfold-lightbox-light .cloudfold-lb-exif-btn:focus-visible,
.cloudfold-lightbox-light .cloudfold-lb-prev:focus-visible,
.cloudfold-lightbox-light .cloudfold-lb-next:focus-visible,
.cloudfold-lightbox-light .cloudfold-lb-info-btn:focus-visible,
.cloudfold-lightbox-light .cloudfold-lb-thumb:focus-visible,
.cloudfold-lightbox-minimal .cloudfold-lb-close:focus-visible,
.cloudfold-lightbox-minimal .cloudfold-lb-exif-btn:focus-visible,
.cloudfold-lightbox-minimal .cloudfold-lb-prev:focus-visible,
.cloudfold-lightbox-minimal .cloudfold-lb-next:focus-visible,
.cloudfold-lightbox-minimal .cloudfold-lb-info-btn:focus-visible,
.cloudfold-lightbox-minimal .cloudfold-lb-thumb:focus-visible {
  outline-color: #111;
}

.cloudfold-lb-exif-btn {
  position: absolute;
  top: 16px;
  right: 68px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.cloudfold-lb-exif-btn:hover { background: rgba(255,255,255,.22); }
.cloudfold-lightbox-light .cloudfold-lb-exif-btn,
.cloudfold-lightbox-minimal .cloudfold-lb-exif-btn {
  color: #111;
  border-color: rgba(0,0,0,.2);
  background: rgba(255,255,255,.9);
}

.cloudfold-lb-prev,
.cloudfold-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: var(--cf-lb-nav-size);
  height: var(--cf-lb-nav-size);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--cf-transition);
  line-height: 1;
}
.cloudfold-lb-prev:hover,
.cloudfold-lb-next:hover { background: rgba(255,255,255,.2); }
.cloudfold-lb-prev { left: 20px; }
.cloudfold-lb-next { right: 20px; }

.cloudfold-lb-stage {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 80vh;
  padding-bottom: 86px;
}

.cloudfold-lb-media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 75vh;
}

.cloudfold-lb-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--cf-lb-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: cf-lbImgIn .25s ease;
  display: block;
}
@keyframes cf-lbImgIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.cloudfold-lb-video {
  max-width: 90vw;
  max-height: 75vh;
  border-radius: var(--cf-lb-radius);
}

.cloudfold-lb-loading {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cloudfold-lb-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cf-spin .7s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }

.cloudfold-lb-caption {
  color: rgba(255,255,255,.85);
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  max-width: 72vw;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cloudfold-lightbox-light .cloudfold-lb-caption { color: #333; }

.cloudfold-lb-exif {
  position: absolute;
  top: 62px;
  right: 16px;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 11;
  width: min(56vw, 620px);
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.28);
  background:
    linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    0 14px 36px rgba(2, 6, 23, .35);
}

.cloudfold-lb-counter {
  color: rgba(255,255,255,.5);
  font-size: 12px;
  margin-top: 6px;
  letter-spacing: 1px;
}
.cloudfold-lightbox-light .cloudfold-lb-counter { color: #999; }

.cloudfold-lb-thumbs {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  gap: 6px;
  max-width: 80vw;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}
.cloudfold-lb-thumbs::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
  .cloudfold-lb-exif-btn {
    top: 8px;
    right: 58px;
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .cloudfold-lb-exif {
    top: 48px;
    right: 8px;
    width: min(92vw, 720px);
    padding: 8px 10px;
  }
  .cloudfold-lb-stage { padding-bottom: 0; }
  .cloudfold-lb-caption { max-width: 88vw; }
}

.cloudfold-lb-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  background: none;
  transition: border-color var(--cf-transition);
}
.cloudfold-lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cloudfold-lb-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.cloudfold-lb-thumb-media-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 177, 0, 0.32), rgba(255, 122, 0, 0.22));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.cloudfold-lb-thumb.active { border-color: #fff; }
.cloudfold-lb-thumb:hover  { border-color: rgba(255,255,255,.6); }
.cloudfold-lb-thumb-empty {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cloudfold-lb-error {
  color: #f87171;
  padding: 20px;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .cloudfold-lb-close,
  .cloudfold-lb-prev,
  .cloudfold-lb-next,
  .cloudfold-lb-thumb,
  .cloudfold-lb-stage-actions,
  .cloudfold-lb-info-btn {
    transition: none !important;
  }
  .cloudfold-lb-img,
  .cloudfold-lb-spinner {
    animation: none !important;
  }
}

/* ─── Album Grid ─────────────────────────────────────────────────────── */
.cloudfold-album-grid {
  display: grid;
  grid-template-columns: repeat(var(--cloudfold-columns, 3), minmax(0, 1fr));
  gap: var(--cloudfold-album-gap, 16px);
}
.cloudfold-album-item {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--cloudfold-album-radius, 12px);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease;
}
.cloudfold-album-item-overlay-subtle .cloudfold-album-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0));
  opacity: 0;
  transition: opacity .2s ease;
}
.cloudfold-album-item-overlay-subtle .cloudfold-album-link:hover::after { opacity: 1; }
.cloudfold-album-link {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.cloudfold-album-thumb {
  display: block;
  overflow: hidden;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.cloudfold-album-link:hover,
.cloudfold-album-link:focus,
.cloudfold-album-link:focus-visible,
.cloudfold-album-link:active,
.cloudfold-album-link:visited {
  color: inherit !important;
  text-decoration: none !important;
}
.cloudfold-album-link .cloudfold-album-title,
.cloudfold-album-link .cloudfold-album-count {
  color: inherit;
}
.cloudfold-album-link:hover .cloudfold-album-title,
.cloudfold-album-link:focus .cloudfold-album-title,
.cloudfold-album-link:focus-visible .cloudfold-album-title,
.cloudfold-album-link:active .cloudfold-album-title,
.cloudfold-album-link:visited .cloudfold-album-title {
  color: inherit !important;
}
.cloudfold-album-link img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transform: translateZ(0) scale(1);
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform var(--cf-transition);
}
.cloudfold-album-link .cloudfold-album-thumb-video {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.cloudfold-album-link:hover .cloudfold-album-thumb img { transform: scale(1.03); }
.cloudfold-album-meta {
  display: block;
  padding: 12px 14px;
}
.cloudfold-album-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
}
.cloudfold-album-title:empty {
  display: none;
}
.cloudfold-album-count {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.cloudfold-album-count:empty {
  display: none;
}
.cloudfold-album-ratio-16-9 .cloudfold-album-link img,
.cloudfold-album-ratio-16-9 .cloudfold-album-link .cloudfold-album-thumb-video,
.cloudfold-album-ratio-16-9 .cloudfold-no-thumb { aspect-ratio: 16 / 9; }
.cloudfold-album-ratio-1-1 .cloudfold-album-link img,
.cloudfold-album-ratio-1-1 .cloudfold-album-link .cloudfold-album-thumb-video,
.cloudfold-album-ratio-1-1 .cloudfold-no-thumb { aspect-ratio: 1 / 1; }
.cloudfold-album-ratio-4-3 .cloudfold-album-link img,
.cloudfold-album-ratio-4-3 .cloudfold-album-link .cloudfold-album-thumb-video,
.cloudfold-album-ratio-4-3 .cloudfold-no-thumb { aspect-ratio: 4 / 3; }
.cloudfold-no-thumb {
  width: 100%;
  display: block;
  background: #e5e7eb;
}
.cloudfold-album-layout-grid .cloudfold-album-item {
  background: #fff;
  border-color: #dbe3ec;
  border-radius: 10px;
  box-shadow: none;
}
.cloudfold-album-layout-grid .cloudfold-album-item:hover {
  border-color: #c5d1de;
  transform: none;
  box-shadow: none;
}
.cloudfold-album-layout-grid .cloudfold-album-meta {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.cloudfold-album-layout-minimal .cloudfold-album-item {
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.cloudfold-album-layout-minimal {
  gap: 14px;
}
.cloudfold-album-layout-minimal .cloudfold-album-link {
  display: block;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.cloudfold-album-layout-minimal .cloudfold-album-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px 0 0;
  border-top: 0;
}
.cloudfold-album-layout-cards .cloudfold-album-item {
  border-color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.18);
}
.cloudfold-album-layout-cards .cloudfold-album-item:hover {
  transform: translateY(0) scale(1);
  box-shadow: 0 28px 52px rgba(2, 6, 23, 0.24);
}
.cloudfold-album-layout-cards .cloudfold-album-meta {
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.cloudfold-album-layout-cards .cloudfold-album-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cloudfold-album-layout-cards .cloudfold-album-count {
  color: #475569;
}
.cloudfold-album-layout-cards .cloudfold-album-link img {
  transform: translateZ(0) scale(1);
}
.cloudfold-album-layout-cards .cloudfold-album-link:hover img {
  transform: translateZ(0) scale(1.02);
}
.cloudfold-album-layout-overlay .cloudfold-album-item {
  border: 0;
  border-radius: calc(var(--cloudfold-album-radius, 12px) + 2px);
  background: #0b1220;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.2);
}
.cloudfold-album-layout-overlay .cloudfold-album-link {
  overflow: hidden;
  border-radius: inherit;
}
.cloudfold-album-layout-overlay .cloudfold-album-thumb {
  border-radius: 0;
}
.cloudfold-album-layout-overlay .cloudfold-album-link::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(2, 6, 23, 0.78) 0%,
    rgba(2, 6, 23, 0.32) 42%,
    rgba(2, 6, 23, 0.08) 66%,
    rgba(2, 6, 23, 0) 100%
  );
  opacity: .9;
  transition: opacity .22s ease;
}
.cloudfold-album-layout-overlay .cloudfold-album-link:hover::before {
  opacity: 1;
}
.cloudfold-album-layout-overlay .cloudfold-album-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 14px 12px;
  background: transparent;
}
.cloudfold-album-layout-overlay .cloudfold-album-link,
.cloudfold-album-layout-overlay .cloudfold-album-link:hover,
.cloudfold-album-layout-overlay .cloudfold-album-link:focus,
.cloudfold-album-layout-overlay .cloudfold-album-link:focus-visible,
.cloudfold-album-layout-overlay .cloudfold-album-link:active,
.cloudfold-album-layout-overlay .cloudfold-album-link:visited {
  color: #fff !important;
}
.cloudfold-album-layout-overlay .cloudfold-album-title {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cloudfold-album-layout-overlay .cloudfold-album-count {
  color: rgba(255, 255, 255, 0.88);
  margin-top: 3px;
}
.cloudfold-album-layout-overlay .cloudfold-album-link:hover .cloudfold-album-thumb img {
  transform: translateZ(0) scale(1.05);
}
.cloudfold-album-layout-minimal .cloudfold-album-link img {
  height: auto;
  min-height: 0;
  border-radius: 0;
}
.cloudfold-album-layout-minimal .cloudfold-album-thumb {
  border-radius: calc(var(--cloudfold-album-radius, 12px) - 2px);
}
.cloudfold-album-layout-minimal .cloudfold-album-title {
  font-size: 15px;
  font-weight: 800;
}
.cloudfold-album-layout-minimal .cloudfold-album-count {
  margin-top: 6px;
  color: #64748b;
}
.cloudfold-album-layout-minimal .cloudfold-album-link:hover .cloudfold-album-thumb img {
  transform: translateZ(0) scale(1.015);
}

.cloudfold-album-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
}
.cloudfold-album-modal.is-open { display: block; }
.cloudfold-album-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(2px);
}
.cloudfold-album-modal__panel {
  position: relative;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cloudfold-album-modal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.cloudfold-album-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.cloudfold-album-modal__actions {
  margin-left: auto;
}
.cloudfold-album-modal__open-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155 !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
}
.cloudfold-album-modal__open-page:hover {
  border-color: #94a3b8;
  color: #0f172a !important;
}
.cloudfold-album-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.cloudfold-album-modal__body {
  padding: 16px;
  overflow: auto;
}
.cloudfold-album-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cloudfold-album-modal__item {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}
.cloudfold-album-modal__lightbox {
  position: relative;
  display: block;
}
.cloudfold-album-modal__item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.cloudfold-album-modal__item video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #0f172a;
}
.cloudfold-album-modal__play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%) scale(0.92);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.cloudfold-album-modal__play-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #fff;
}
.cloudfold-album-modal__lightbox:hover .cloudfold-album-modal__play-icon,
.cloudfold-album-modal__lightbox:focus-visible .cloudfold-album-modal__play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.cloudfold-album-modal__empty {
  margin: 8px 0;
  color: #64748b;
  font-size: 14px;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cloudfold-gallery-inner {
    --cloudfold-columns: 2 !important;
  }
  .cloudfold-lb-prev { left: 8px; }
  .cloudfold-lb-next { right: 8px; }
  .cloudfold-lb-close { top: 8px; right: 8px; }
  .cloudfold-lb-thumbs { display: none; }
  .cloudfold-album-modal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cloudfold-album-grid {
    grid-template-columns: repeat(var(--cloudfold-columns-tablet, 2), minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .cloudfold-gallery-inner {
    --cloudfold-columns: 1 !important;
  }
  .cloudfold-nav { width: 36px; height: 36px; font-size: 20px; }
  .cloudfold-album-modal__panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    border-radius: 14px;
  }
  .cloudfold-album-modal__grid { grid-template-columns: 1fr; }
  .cloudfold-album-modal__item img,
  .cloudfold-album-modal__item video { height: 200px; }
  .cloudfold-album-grid {
    grid-template-columns: repeat(var(--cloudfold-columns-mobile, 1), minmax(0, 1fr));
  }
}

/* ─── Lightbox minimal style ────────────────────────────────────────── */
.cloudfold-lightbox-minimal .cloudfold-lb-backdrop  { background: rgba(255,255,255,.98); }
.cloudfold-lightbox-minimal .cloudfold-lb-close,
.cloudfold-lightbox-minimal .cloudfold-lb-prev,
.cloudfold-lightbox-minimal .cloudfold-lb-next      { color: #111; border-color: #ddd; background: #fff; }
.cloudfold-lightbox-minimal .cloudfold-lb-img       { box-shadow: 0 4px 32px rgba(0,0,0,.12); }
.cloudfold-lightbox-minimal .cloudfold-lb-caption   { color: #444; }
.cloudfold-lightbox-minimal .cloudfold-lb-counter   { color: #aaa; }
.cloudfold-lightbox-light .cloudfold-lb-exif,
.cloudfold-lightbox-minimal .cloudfold-lb-exif {
  background: rgba(255,255,255,.94);
  border-color: rgba(15,23,42,.12);
}

/* ─── EXIF Data ─────────────────────────────────────────────────────── */
.cloudfold-exif-data {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
}
.cloudfold-lb-exif .cloudfold-exif-data {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.cloudfold-lb-exif .cloudfold-exif-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.cloudfold-lb-exif .cloudfold-exif-item {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: center;
  gap: 0 8px;
  padding: 9px 2px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.18);
  font-size: 13px;
  line-height: 1.35;
  color: #f8fafc;
}
.cloudfold-lb-exif .cloudfold-exif-label {
  display: inline;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}
.cloudfold-lb-exif .cloudfold-exif-value {
  color: #ffffff;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}
.cloudfold-lb-exif .cloudfold-exif-item:last-child,
.cloudfold-lb-exif .cloudfold-exif-item:nth-last-child(2) {
  border-bottom: 0;
}
.cloudfold-lightbox-light .cloudfold-lb-exif .cloudfold-exif-item,
.cloudfold-lightbox-minimal .cloudfold-lb-exif .cloudfold-exif-item {
  color: #0f172a;
  background: rgba(255,255,255,.86);
  border-color: rgba(15,23,42,.12);
}
.cloudfold-lightbox-light .cloudfold-lb-exif .cloudfold-exif-label,
.cloudfold-lightbox-minimal .cloudfold-lb-exif .cloudfold-exif-label {
  color: #111827;
}
.cloudfold-lightbox-light .cloudfold-lb-exif .cloudfold-exif-value,
.cloudfold-lightbox-minimal .cloudfold-lb-exif .cloudfold-exif-value {
  color: #334155;
}
.cloudfold-lightbox-light .cloudfold-lb-exif .cloudfold-exif-icon,
.cloudfold-lightbox-minimal .cloudfold-lb-exif .cloudfold-exif-icon {
  opacity: .75;
}
.cloudfold-lb-exif .cloudfold-exif-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: .98;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.18));
}
.cloudfold-lb-exif .cloudfold-exif-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
}
@media (max-width: 768px) {
  .cloudfold-lb-exif .cloudfold-exif-list {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cloudfold-lb-exif .cloudfold-exif-item {
    font-size: 12px;
  }
  .cloudfold-lb-exif .cloudfold-exif-item:nth-last-child(2) {
    border-bottom: 1px solid rgba(255,255,255,.14);
  }
}
.cloudfold-exif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
.cloudfold-exif-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #1f2937;
}
.cloudfold-exif-icon {
  width: 16px;
  text-align: center;
  opacity: .8;
}
.cloudfold-exif-label {
  font-weight: 600;
  color: #111827;
}
.cloudfold-exif-value {
  color: #374151;
}
@media (max-width: 640px) {
  .cloudfold-exif-list {
    grid-template-columns: 1fr;
  }
}

/* Final EXIF polish: clean glass panel + reliable icon sizing */
.cloudfold-lb-exif {
  top: 64px;
  right: 16px;
  left: auto;
  width: min(540px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.09));
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.cloudfold-lb-exif .cloudfold-exif-data {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.cloudfold-lb-exif .cloudfold-exif-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.cloudfold-lb-exif .cloudfold-exif-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.98);
}

.cloudfold-lb-exif .cloudfold-exif-item:nth-last-child(-n+2) {
  border-bottom: 0;
}

.cloudfold-lb-exif .cloudfold-exif-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.96;
}

.cloudfold-lb-exif .cloudfold-exif-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
}

.cloudfold-lb-exif .cloudfold-exif-label {
  margin-right: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.cloudfold-lb-exif .cloudfold-exif-value {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .cloudfold-lb-exif {
    width: min(94vw, 700px);
    right: 8px;
    top: 52px;
    padding: 10px 12px;
  }
  .cloudfold-lb-exif .cloudfold-exif-list {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
  .cloudfold-lb-exif .cloudfold-exif-item:nth-last-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }
  .cloudfold-lb-exif .cloudfold-exif-item:last-child {
    border-bottom: 0;
  }
}

/* Pagination */
.cloudfold-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.cloudfold-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255, 255, 255, .82);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all var(--cf-transition);
}

.cloudfold-load-more-btn:hover {
  border-color: rgba(100, 116, 139, .45);
  color: #1f2937;
  background: #fff;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-soft .cloudfold-load-more-btn {
  background: rgba(255, 255, 255, .86);
  border-color: rgba(148, 163, 184, .26);
  color: #475569;
  border-radius: 8px;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-soft .cloudfold-load-more-btn:hover {
  background: #fff;
  border-color: rgba(100, 116, 139, .42);
  color: #1f2937;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-minimal .cloudfold-load-more-btn {
  background: transparent;
  border-color: rgba(148, 163, 184, .34);
  color: #475569;
  border-radius: 0;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-minimal .cloudfold-load-more-btn:hover {
  background: rgba(15, 23, 42, .04);
  border-color: rgba(100, 116, 139, .46);
  color: #0f172a;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-bold .cloudfold-load-more-btn {
  background: #111827;
  border-color: #111827;
  color: #fff;
  border-radius: 999px;
}

.cloudfold-gallery-wrap.cloudfold-toolbar-style-bold .cloudfold-load-more-btn:hover {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}

.cloudfold-load-more-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cloudfold-load-more-icon-plus::before {
  content: "+";
}

.cloudfold-load-more-icon-arrow::before {
  content: "↓";
}

.cloudfold-load-more-icon-chevron::before {
  content: "⌄";
}

.cloudfold-load-more-icon-dots::before {
  content: "⋯";
}

.cloudfold-load-more-btn[disabled] {
  opacity: .7;
  cursor: wait;
}

.cloudfold-load-more-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(15, 23, 42, 0.22);
  border-top-color: #0f172a;
  border-radius: 999px;
  animation: cloudfold-spin .7s linear infinite;
}

.cloudfold-infinite-sentinel {
  width: 100%;
  height: 1px;
}

@keyframes cloudfold-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Lightbox V2 Layout Modes ───────────────────────────────────────── */
.cloudfold-lb-info-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100002;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(0,0,0,.35);
  color: #fff;
  border-radius: 999px;
  height: 40px;
  min-width: 68px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cloudfold-lb-info-btn[hidden] {
  display: none !important;
}

.cloudfold-lb-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: min(430px, 32vw);
  max-width: 96vw;
  height: 100%;
  z-index: 100001;
  background: rgba(12, 16, 24, .92);
  border-left: 1px solid rgba(255,255,255,.12);
  color: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cloudfold-lb-sidebar[hidden] {
  display: none !important;
}
.cloudfold-lightbox-light .cloudfold-lb-sidebar,
.cloudfold-lightbox-minimal .cloudfold-lb-sidebar {
  background: rgba(255,255,255,.96);
  color: #0f172a;
  border-left-color: rgba(15,23,42,.14);
}
.cloudfold-lb-sidebar-head {
  padding: 22px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.cloudfold-lightbox-light .cloudfold-lb-sidebar-head,
.cloudfold-lightbox-minimal .cloudfold-lb-sidebar-head {
  border-bottom-color: rgba(15,23,42,.08);
}
.cloudfold-lb-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cloudfold-lb-sidebar-body {
  padding: 14px 18px 22px;
  overflow: auto;
  display: grid;
  gap: 14px;
}
.cloudfold-lb-desc {
  font-size: 13px;
  line-height: 1.6;
  opacity: .95;
}
.cloudfold-lb-exif-card h4 {
  margin: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  opacity: .8;
}
.cloudfold-lb-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cloudfold-lb-stage-actions {
  margin-top: 10px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 280px;
}

.cloudfold-lb-stage-actions[hidden] {
  display: none !important;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage-actions .cloudfold-lb-action,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions .cloudfold-lb-action {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, .46);
  border-color: rgba(255,255,255,.24);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage-actions .cloudfold-lb-action-primary,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions .cloudfold-lb-action-primary {
  background: linear-gradient(135deg, #0f172a 0%, #0b2349 100%);
  border-color: rgba(255,255,255,.2);
}

.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions {
  opacity: 0;
  transition: opacity .2s ease;
}

.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-stage-actions {
  opacity: 1;
}

/* Classic/Immersive actions aligned with thumbnail rail (right side) */
.cloudfold-lb-layout-classic,
.cloudfold-lb-layout-immersive {
  --cf-lb-rail-width: min(80vw, 1100px);
}

.cloudfold-lb-layout-classic .cloudfold-lb-thumbs,
.cloudfold-lb-layout-immersive .cloudfold-lb-thumbs {
  width: fit-content;
  max-width: var(--cf-lb-rail-width);
  min-width: 0;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage-actions,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions {
  position: fixed;
  right: 24px;
  bottom: 22px;
  left: auto;
  transform: none;
  width: auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  z-index: 100006;
  margin: 0;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage-actions .cloudfold-lb-action,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions .cloudfold-lb-action {
  position: static !important;
  width: auto !important;
  height: 42px !important;
  min-width: 122px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transform: none !important;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage-actions .cloudfold-lb-action svg,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions .cloudfold-lb-action svg {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
  flex: 0 0 14px !important;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage-actions .cloudfold-lb-action span,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions .cloudfold-lb-action span {
  display: inline !important;
  margin: 0 !important;
}

/* Sidebar layout: keep same panel UI across skins.
   Skin should affect only lightbox backdrop color/tone. */
.cloudfold-lb-layout-sidebar .cloudfold-lb-shell {
  background: #edf3fb !important;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-stage,
.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
  background: #edf3fb !important;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body {
  background: #f7f9fc !important;
  border-color: rgba(148, 163, 184, .16) !important;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy,
.cloudfold-lb-layout-sidebar .cloudfold-lb-panel,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card {
  background: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, .16) !important;
}

@media (max-width: 900px) {
  .cloudfold-lb-layout-classic,
  .cloudfold-lb-layout-immersive {
    --cf-lb-rail-width: calc(100vw - 20px);
  }

  .cloudfold-lb-layout-classic .cloudfold-lb-stage-actions,
  .cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions {
    right: 10px;
    bottom: 10px;
    gap: 8px;
  }

  .cloudfold-lb-layout-classic .cloudfold-lb-stage-actions .cloudfold-lb-action,
  .cloudfold-lb-layout-immersive .cloudfold-lb-stage-actions .cloudfold-lb-action {
    min-width: 112px;
  }
}
.cloudfold-lb-action {
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  text-align: center;
  background: rgba(255,255,255,.06);
}
.cloudfold-lightbox-light .cloudfold-lb-action,
.cloudfold-lightbox-minimal .cloudfold-lb-action {
  border-color: rgba(15,23,42,.14);
  background: rgba(15,23,42,.02);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-stage {
  width: calc(100% - min(430px, 30vw) - 40px);
  margin-right: auto;
}
.cloudfold-lb-layout-sidebar .cloudfold-lb-caption,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif {
  display: none;
}

.cloudfold-lb-layout-immersive .cloudfold-lb-thumbs,
.cloudfold-lb-layout-immersive .cloudfold-lb-caption,
.cloudfold-lb-layout-immersive .cloudfold-lb-counter {
  display: none;
}
.cloudfold-lb-layout-immersive .cloudfold-lb-close,
.cloudfold-lb-layout-immersive .cloudfold-lb-prev,
.cloudfold-lb-layout-immersive .cloudfold-lb-next {
  opacity: 0;
  transition: opacity .22s ease;
}
.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-close,
.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-prev,
.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-next {
  opacity: 1;
}

@media (max-width: 900px) {
  .cloudfold-lb-layout-sidebar .cloudfold-lb-stage {
    width: 100%;
    margin-right: 0;
  }
  .cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
    width: 100%;
    max-width: 100%;
    right: 0;
    top: auto;
    bottom: 0;
    height: min(65vh, 520px);
    transform: translateY(100%);
    transition: transform .24s ease;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .cloudfold-lb-layout-sidebar.cloudfold-lb-sidebar-open .cloudfold-lb-sidebar {
    transform: translateY(0);
  }
  .cloudfold-lb-layout-sidebar .cloudfold-lb-info-btn {
    display: inline-flex;
  }
}

/* ─── Lightbox Premium UI Polish ─────────────────────────────────────── */
:root {
  --cf-lb-glass-bg: rgba(17, 25, 40, .48);
  --cf-lb-glass-bd: rgba(255, 255, 255, .22);
  --cf-lb-btn-shadow: 0 14px 32px rgba(2, 8, 23, .34);
  --cf-lb-ease: cubic-bezier(.22,.78,.23,.99);
}

.cloudfold-lightbox {
  animation: cf-lbIn .28s var(--cf-lb-ease);
}

.cloudfold-lb-close,
.cloudfold-lb-prev,
.cloudfold-lb-next,
.cloudfold-lb-exif-btn,
.cloudfold-lb-info-btn {
  backdrop-filter: blur(10px) saturate(135%);
  -webkit-backdrop-filter: blur(10px) saturate(135%);
  box-shadow: var(--cf-lb-btn-shadow);
  transition: transform .22s var(--cf-lb-ease), background .22s var(--cf-lb-ease), border-color .22s var(--cf-lb-ease), opacity .22s var(--cf-lb-ease);
}

.cloudfold-lb-close:hover,
.cloudfold-lb-prev:hover,
.cloudfold-lb-next:hover,
.cloudfold-lb-exif-btn:hover,
.cloudfold-lb-info-btn:hover {
  transform: translateY(-1px) scale(1.03);
}

.cloudfold-lb-prev,
.cloudfold-lb-next {
  background: var(--cf-lb-glass-bg);
  border-color: var(--cf-lb-glass-bd);
}

.cloudfold-lightbox-light .cloudfold-lb-prev,
.cloudfold-lightbox-light .cloudfold-lb-next,
.cloudfold-lightbox-minimal .cloudfold-lb-prev,
.cloudfold-lightbox-minimal .cloudfold-lb-next,
.cloudfold-lightbox-light .cloudfold-lb-close,
.cloudfold-lightbox-minimal .cloudfold-lb-close {
  background: rgba(255,255,255,.9);
  border-color: rgba(15,23,42,.14);
  color: #0f172a;
}

.cloudfold-lb-stage {
  gap: 8px;
}

.cloudfold-lb-img {
  border-radius: 14px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .42);
}

.cloudfold-lb-caption {
  margin-top: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(2, 6, 23, .34);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: .01em;
}

.cloudfold-lightbox-light .cloudfold-lb-caption,
.cloudfold-lightbox-minimal .cloudfold-lb-caption {
  background: rgba(255,255,255,.84);
  border-color: rgba(15,23,42,.1);
}

.cloudfold-lb-counter {
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: .06em;
}

.cloudfold-lb-thumbs {
  border-radius: 14px;
  background: rgba(15, 23, 42, .42);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  padding: 8px;
  box-shadow: 0 12px 28px rgba(2, 8, 23, .28);
}

.cloudfold-lb-thumb {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border-width: 1px;
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  transition: transform .2s var(--cf-lb-ease), border-color .2s var(--cf-lb-ease), box-shadow .2s var(--cf-lb-ease), opacity .2s var(--cf-lb-ease);
  opacity: .88;
}

.cloudfold-lb-thumb:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(255,255,255,.58);
  opacity: 1;
}

.cloudfold-lb-thumb.active {
  border-color: rgba(255,255,255,.95);
  box-shadow: 0 0 0 2px rgba(147, 197, 253, .52), 0 8px 18px rgba(2, 8, 23, .34);
  opacity: 1;
}

.cloudfold-lb-thumb img {
  border-radius: inherit;
}

@media (max-width: 900px) {
  .cloudfold-lb-thumbs {
    padding: 6px;
    border-radius: 12px;
  }

  .cloudfold-lb-thumb {
    width: 44px;
    height: 44px;
    border-radius: 9px;
  }
}

.cloudfold-lb-sidebar {
  background: linear-gradient(180deg, rgba(7, 14, 29, .94), rgba(4, 8, 18, .9));
  border-left-color: rgba(255,255,255,.18);
  box-shadow: -18px 0 48px rgba(2, 8, 23, .36);
}

.cloudfold-lb-sidebar-head {
  padding-top: 20px;
}

.cloudfold-lb-title {
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.cloudfold-lb-desc {
  font-size: 13px;
  opacity: .88;
}

.cloudfold-lb-exif-card {
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}

.cloudfold-lb-action {
  border-radius: 999px;
  padding: 11px 12px;
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.25);
}

.cloudfold-lb-action:hover {
  background: rgba(255,255,255,.18);
}

.cloudfold-lb-layout-immersive .cloudfold-lb-img {
  border-radius: 8px;
  box-shadow: 0 34px 90px rgba(0,0,0,.55);
}

.cloudfold-lb-layout-immersive .cloudfold-lb-close,
.cloudfold-lb-layout-immersive .cloudfold-lb-prev,
.cloudfold-lb-layout-immersive .cloudfold-lb-next {
  transform: translateY(3px);
}

.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-close,
.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-prev,
.cloudfold-lb-layout-immersive.cloudfold-lb-controls-visible .cloudfold-lb-next {
  transform: translateY(0);
}

@media (max-width: 900px) {
  .cloudfold-lb-info-btn {
    top: 10px;
    left: 10px;
    height: 36px;
    min-width: 62px;
    font-size: 11px;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
    border-top-color: rgba(255,255,255,.2);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -26px 60px rgba(2, 8, 23, .38);
  }

  .cloudfold-lb-title {
    font-size: 20px;
  }
}

/* ─── Sidebar Reference Style ────────────────────────────────────────── */
.cloudfold-lb-layout-sidebar {
  align-items: center;
  justify-content: center;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-stage,
.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
  height: min(84vh, 820px);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: min(390px, 30vw);
  padding: 0;
  background: rgba(246, 246, 247, .96);
  color: #171717;
  border-radius: 18px;
  border: 0;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-stage {
  max-width: none;
  max-height: none;
  width: min(68vw, 1260px);
  padding: 10px;
  background: rgba(246, 246, 247, .96);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  margin-left: 20px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-media {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-img,
.cloudfold-lb-layout-sidebar .cloudfold-lb-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-head,
.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-head {
  display: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body {
  padding: 14px;
  gap: 12px;
  height: calc(100% - 8px);
}

.cloudfold-lb-meta {
  font-size: 12px;
  color: #6b7280;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-title {
  font-size: 26px;
  line-height: 1.15;
  color: #0f172a;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-desc {
  color: #4b5563;
  font-size: 14px;
}

.cloudfold-lb-panel {
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}

.cloudfold-lb-panel h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.cloudfold-lb-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cloudfold-lb-settings span {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card {
  background: #fff;
  border-color: rgba(15, 23, 42, .1);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #fff 75%, rgba(255,255,255,0));
  padding-top: 10px;
  grid-template-columns: minmax(0, 1fr);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions:has(.cloudfold-lb-action + .cloudfold-lb-action) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions.cloudfold-lb-actions-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions.cloudfold-lb-actions-dual {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action {
  border-radius: 10px;
  font-size: 14px;
  padding: 12px;
  border-color: rgba(15, 23, 42, .14);
  background: #fff;
  color: #111827;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action-primary {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .cloudfold-lb-layout-sidebar .cloudfold-lb-stage {
    width: 100%;
    height: auto;
    border-radius: 14px;
    background: transparent;
    padding: 0;
    margin-left: 0;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
    position: absolute;
    top: auto;
    right: 0;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
    padding: 8px;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-title {
    font-size: 22px;
  }
}

/* ─── Sidebar Stability Overrides ────────────────────────────────────── */
.cloudfold-lb-shell {
  width: 100%;
}

/* Keep Classic/Immersive truly centered (sidebar rules must not leak) */
.cloudfold-lb-layout-classic .cloudfold-lb-shell,
.cloudfold-lb-layout-immersive .cloudfold-lb-shell {
  width: auto;
  max-width: 90vw;
  margin: 0 auto;
  display: block;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage {
  margin-left: auto;
  margin-right: auto;
}

.cloudfold-lb-layout-sidebar {
  align-items: center;
  justify-content: center;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-shell {
  width: min(96vw, 1680px);
  height: min(86vh, 900px);
  max-height: min(86vh, 900px);
  min-height: min(86vh, 900px);
  display: flex;
  gap: 0;
  align-items: stretch;
  padding: 12px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 86px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  height: calc(min(86vh, 900px) - 28px);
  min-height: calc(min(86vh, 900px) - 28px);
  max-height: calc(min(86vh, 900px) - 28px);
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  background: #eaf1fa;
  overflow: hidden;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-media {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-img,
.cloudfold-lb-layout-sidebar .cloudfold-lb-video {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  box-shadow: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
  flex: 0 0 420px;
  width: 420px;
  min-width: 420px;
  max-width: 420px;
  height: calc(min(86vh, 900px) - 28px);
  min-height: calc(min(86vh, 900px) - 28px);
  max-height: calc(min(86vh, 900px) - 28px);
  padding: 14px;
  border-radius: 14px;
  border: 0;
  background: #eaf1fa;
  color: #0f172a;
  box-shadow: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}

.cloudfold-lb-layout-sidebar.cloudfold-lb-item-landscape .cloudfold-lb-stage {
  flex-basis: 72%;
}

.cloudfold-lb-layout-sidebar.cloudfold-lb-item-landscape .cloudfold-lb-sidebar {
  flex-basis: 420px;
}

.cloudfold-lb-layout-sidebar.cloudfold-lb-item-portrait .cloudfold-lb-stage {
  flex-basis: 62%;
}

.cloudfold-lb-layout-sidebar.cloudfold-lb-item-portrait .cloudfold-lb-sidebar {
  flex-basis: 420px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  align-items: stretch;
  justify-content: flex-start;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions {
  margin-top: auto;
  padding-top: 8px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-meta {
  font-size: 12px;
  color: #64748b;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-weight: 600;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-title {
  font-size: clamp(24px, 1.8vw, 36px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: #0f172a;
  margin: 0;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-panel {
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: none;
  padding: 10px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-settings span {
  border-color: rgba(148, 163, 184, .34);
  background: #fff;
  color: #1e293b;
  font-weight: 600;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action {
  border-radius: 12px;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action:hover {
  transform: translateY(-1px);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action-primary {
  background: linear-gradient(135deg, #0f172a 0%, #0b2349 100%);
  border-color: #0f172a;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .22);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-caption,
.cloudfold-lb-layout-sidebar .cloudfold-lb-counter {
  display: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-thumbs {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(86vw, 1280px);
  z-index: 100004;
}

@media (max-width: 1200px) {
  .cloudfold-lb-layout-sidebar .cloudfold-lb-shell {
    width: calc(100vw - 20px);
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
    flex-basis: 360px;
    width: 360px;
    max-width: 360px;
  }
}

@media (max-width: 900px) {
  .cloudfold-lb-layout-sidebar .cloudfold-lb-shell {
    display: block;
    width: calc(100vw - 10px);
    padding: 8px;
    border-radius: 16px;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 74px;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-stage {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: 0;
    padding: 0;
    max-height: 68vh;
    border-radius: 14px;
    background: transparent;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    width: 100%;
    max-width: 100%;
    max-height: 68vh;
    border-radius: 16px 16px 0 0;
    padding: 8px;
  }

  .cloudfold-lb-layout-sidebar.cloudfold-lb-sidebar-open .cloudfold-lb-sidebar {
    transform: translateY(0);
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-thumbs {
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* ─── Lightbox Final Polish Overrides ────────────────────────────────── */
.cloudfold-lb-prev,
.cloudfold-lb-next {
  z-index: 100003;
  top: 50%;
  transform: translateY(-50%);
}

.cloudfold-lb-prev:hover,
.cloudfold-lb-next:hover {
  transform: translateY(-50%) scale(1.03);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-prev {
  left: 28px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-next {
  right: 28px;
}

.cloudfold-lb-caption {
  max-width: min(92vw, 1100px);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  text-wrap: pretty;
}

@media (max-width: 900px) {
  .cloudfold-lb-prev,
  .cloudfold-lb-next {
    width: 48px;
    height: 48px;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-prev {
    left: 12px;
  }

  .cloudfold-lb-layout-sidebar .cloudfold-lb-next {
    right: 12px;
  }

  .cloudfold-lb-caption {
    max-width: 90vw;
    font-size: 11px;
  }
}

/* ─── Sidebar EXIF Stability ─────────────────────────────────────────── */
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card {
  overflow: hidden;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-data {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  width: 100%;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-item {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-label,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card .cloudfold-exif-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* ─── Minimal Fresh Sidebar Theme ───────────────────────────────────── */

.cloudfold-lb-layout-sidebar .cloudfold-lb-stage,
.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
  background: #edf3fb;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar {
  padding: 10px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body {
  background: #f7f9fc;
  border: 1px solid rgba(148, 163, 184, .16);
  box-shadow: none;
  border-radius: 12px;
  gap: 12px;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.55) rgba(226, 232, 240, 0.5);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.44);
  border-radius: 999px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.9) 0%, rgba(100, 116, 139, 0.88) 100%);
  border-radius: 999px;
  border: 1px solid rgba(241, 245, 249, 0.9);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-sidebar-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.96) 0%, rgba(71, 85, 105, 0.95) 100%);
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-meta {
  color: #64748b;
  font-size: 11px;
  letter-spacing: .04em;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-title {
  font-size: clamp(22px, 1.7vw, 32px);
  line-height: 1.12;
  color: #0f172a;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy,
.cloudfold-lb-layout-sidebar .cloudfold-lb-panel,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card {
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 10px;
  box-shadow: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy h4,
.cloudfold-lb-layout-sidebar .cloudfold-lb-panel h4,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card h4 {
  color: #334155;
  font-size: 12px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy-text {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-settings span {
  background: #fff;
  border-color: rgba(148, 163, 184, .28);
  color: #334155;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action {
  min-height: 44px;
  border-radius: 10px;
  box-shadow: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action-primary {
  background: #0f172a;
  border-color: #0f172a;
  box-shadow: none;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action-secondary {
  background: #ffffff;
  border-color: rgba(148, 163, 184, .3);
  color: #0f172a;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-thumbs {
  background: rgba(15, 23, 42, .5);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 8px 20px rgba(2, 8, 23, .2);
}

/* Keep close button pinned above all sidebar variants */
.cloudfold-lightbox .cloudfold-lb-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100010;
}

/* Strict center lock for non-sidebar layouts */
.cloudfold-lb-layout-classic,
.cloudfold-lb-layout-immersive {
  justify-content: center;
  align-items: center;
}

.cloudfold-lb-layout-classic .cloudfold-lb-shell,
.cloudfold-lb-layout-immersive .cloudfold-lb-shell {
  width: auto !important;
  max-width: none;
  margin: 0 auto;
  display: block;
}

.cloudfold-lb-layout-classic .cloudfold-lb-stage,
.cloudfold-lb-layout-immersive .cloudfold-lb-stage {
  width: fit-content;
  max-width: min(90vw, 1400px);
  margin-left: auto !important;
  margin-right: auto !important;
  align-items: center;
}

.cloudfold-lb-layout-classic .cloudfold-lb-media,
.cloudfold-lb-layout-immersive .cloudfold-lb-media {
  max-width: min(90vw, 1400px);
  margin-left: auto;
  margin-right: auto;
}

/* ─── Sidebar Data Blocks + SVG Icons ───────────────────────────────── */
.cloudfold-lb-layout-sidebar .cloudfold-lb-panel h4,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card h4,
.cloudfold-lb-layout-sidebar .cloudfold-lb-copy h4 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-panel h4 svg,
.cloudfold-lb-layout-sidebar .cloudfold-lb-exif-card h4 svg,
.cloudfold-lb-layout-sidebar .cloudfold-lb-copy h4 svg {
  width: 14px;
  height: 14px;
  opacity: .82;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy {
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-settings-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-setting-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(255,255,255,.85);
  color: #334155;
  font-size: 12px;
  line-height: 1;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-setting-chip strong {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy[hidden] {
  display: none !important;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-copy-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action {
  gap: 8px;
}

.cloudfold-lb-layout-sidebar .cloudfold-lb-action svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

