/*!
 * LumiaBox v2.0.0 — Stylesheet
 */

/* ============================================================
   BODY LOCK
   ============================================================ */

.lmb-body-open {
  overflow: hidden;
}

/* ============================================================
   OVERLAY
   ============================================================ */

.lmb-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;

  display: flex;
  align-items:     center;
  justify-content: center;

  background: linear-gradient(180deg, rgba(10,10,10,0.95) 0%, rgba(0,0,0,0.98) 100%);

  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  opacity: 0;
  transition: opacity 0.30s ease;
}

.lmb-overlay * {
  box-sizing: border-box;
}

.lmb-overlay--visible  { opacity: 1; }
.lmb-overlay--closing  { opacity: 0; transition: opacity 0.30s ease; }

/* Inline / modal mode: slightly lighter background, allows card to stand out */
.lmb-overlay--inline-mode {
  background: rgba(0, 0, 0, 0.75);
}

/* ============================================================
   SLIDESHOW PROGRESS BAR
   ============================================================ */

.lmb-progress {
  position: absolute;
  top:  0;
  left: 0;
  height: 3px;
  width: var(--lmb-p, 0%);
  background: rgba(255, 255, 255, 0.85);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lmb-progress--on {
  opacity: 1;
}

/* ============================================================
   TOP BAR
   ============================================================ */

.lmb-topbar {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 50px;
  z-index: 20;

  display: flex;
  align-items:     center;
  justify-content: space-between;

  background: linear-gradient(180deg, rgba(0,0,0,0.60) 0%, transparent 100%);
  pointer-events: none;
}

/* ============================================================
   COUNTER
   ============================================================ */

.lmb-counter {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 10px 14px;

  font-family: Arial, Helvetica, sans-serif;
  font-size:   15px;
  line-height: 1;
  color: #c8c8c8;
  pointer-events: auto;
}

.lmb-counter__cur { font-weight: 700; color: #eee; }
.lmb-counter__sep { opacity: 0.5; margin: 0 2px; }

/* ============================================================
   TOOLBAR
   ============================================================ */

.lmb-toolbar {
  display: flex;
  align-items: center;
  height: 100%;
  pointer-events: auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.lmb-btn {
  display: inline-flex;
  align-items:     center;
  justify-content: center;

  width:  48px;
  height: 48px;
  padding: 0;

  border:     none;
  background: rgba(18, 18, 18, 0.60);
  cursor:     pointer;
  outline:    none;

  transition: background 0.15s ease;
  position: relative;
}

.lmb-btn + .lmb-btn {
  border-left: 1px solid rgba(255,255,255,0.04);
}

.lmb-btn:hover {
  background: rgba(55, 55, 55, 0.80);
}

.lmb-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.45);
  outline-offset: -2px;
}

.lmb-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.lmb-btn svg {
  width:  20px;
  height: 20px;
  fill:   #b8b8b8;
  pointer-events: none;
  transition: fill 0.15s ease;
}

.lmb-btn:not(:disabled):hover svg {
  fill: #ffffff;
}

.lmb-btn--active svg,
.lmb-btn--zoomed svg {
  fill: #ffffff;
}

/* Individual button icon sizes (matching original proportions) */
.lmb-btn--thumbs svg    { width: 17px; height: 17px; }
.lmb-btn--zoom-in svg,
.lmb-btn--zoom-out svg  { width: 20px; height: 20px; }
.lmb-btn--slideshow svg { width: 14px; height: 14px; }
.lmb-btn--fs svg        { width: 18px; height: 18px; }
.lmb-btn--close svg     { width: 19px; height: 19px; }

/* ============================================================
   STAGE
   ============================================================ */

.lmb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items:     center;
  justify-content: center;
  overflow: hidden;
}

/* ============================================================
   SLIDES
   ============================================================ */

.lmb-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items:     center;
  justify-content: center;

  opacity:   0;
  transform: translateX(0);
  transition:
    opacity   0.30s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.30s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.lmb-slide--visible  { opacity: 1; transform: translateX(0); }
.lmb-slide--enter-r  { opacity: 0; transform: translateX(100%); }
.lmb-slide--enter-l  { opacity: 0; transform: translateX(-100%); }
.lmb-slide--exit-l   { opacity: 0; transform: translateX(-100%); }
.lmb-slide--exit-r   { opacity: 0; transform: translateX(100%); }

/* Inline/modal slides — no transition shift, just fade */
.lmb-slide--inline {
  transform: none !important;
}

/* ============================================================
   MEDIA ELEMENTS
   ============================================================ */

.lmb-media {
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lmb-media--ready { opacity: 1; }

/* --- Image --- */
.lmb-media--image {
  max-width:  calc(100vw - 120px);
  max-height: calc(100vh - 160px);
  width:  auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 2px;
  transition:
    opacity   0.25s ease,
    transform 0.22s ease;
  will-change: transform;
}

/* Reduce height when thumbs bar is showing */
.lmb-overlay:not(.lmb-overlay--inline-mode) .lmb-media--image {
  max-height: calc(100vh - 230px);
}

/* --- Video --- */
.lmb-media--video {
  max-width:  calc(100vw - 120px);
  max-height: calc(100vh - 160px);
  width:  auto;
  height: auto;
  background: #000;
  border-radius: 2px;
}

/* --- iframe (YouTube, Vimeo, VK, custom) --- */
.lmb-media--iframe {
  border:     none;
  background: #000;
  border-radius: 2px;

  /* Responsive 16:9 */
  width:  min(82vw, 1280px);
  height: min(46.125vw, 720px);  /* 16:9 ratio */
}

/* Custom iframe (Google Maps etc.) fills its wrapper */
.lmb-media--iframe-ext {
  width:  100%;
  height: 100%;
  max-width:  none;
  max-height: none;
}

/* ============================================================
   LOADER / SPINNER
   ============================================================ */

.lmb-loader {
  position: absolute;
  top:  50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.lmb-loader__ring {
  position: relative;
  width:  58px;
  height: 58px;
}

.lmb-loader__ring div {
  box-sizing:    border-box;
  display:       block;
  position:      absolute;
  width:  48px;
  height: 48px;
  margin: 5px;
  border:        4px solid transparent;
  border-top-color: #808080;
  border-radius: 50%;
  animation: lmb-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.lmb-loader__ring div:nth-child(1) { animation-delay: -0.45s; }
.lmb-loader__ring div:nth-child(2) { animation-delay: -0.30s; }
.lmb-loader__ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes lmb-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   ARROWS
   ============================================================ */

.lmb-arrow {
  position: absolute;
  top:       50%;
  transform: translateY(-50%);
  z-index:   15;

  display: flex;
  align-items:     center;
  justify-content: center;

  width:  56px;
  height: 88px;
  padding: 12px;

  border:     none;
  background: transparent;
  cursor:     pointer;
  outline:    none;

  transition: opacity 0.2s ease;
}

.lmb-arrow:focus-visible {
  outline: 2px solid rgba(255,255,255,0.35);
}

.lmb-arrow svg {
  width:  32px;
  height: 32px;
  fill:   #a0a0a0;
  filter: drop-shadow(0 1px 5px rgba(0,0,0,0.95));
  transition: fill 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.lmb-arrow:hover svg          { fill: #ffffff; }
.lmb-arrow--prev              { left: 0; }
.lmb-arrow--prev:hover svg    { transform: translateX(-2px); }
.lmb-arrow--next              { right: 0; }
.lmb-arrow--next:hover svg    { transform: translateX(2px); }

@media (min-width: 768px) {
  .lmb-arrow { width: 66px; height: 110px; padding: 18px; }
  .lmb-arrow svg { width: 36px; height: 36px; }
}

/* ============================================================
   THUMBNAILS BAR
   ============================================================ */

.lmb-thumbsbar {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  z-index: 10;
  height: 108px;

  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.75) 100%);
  padding: 8px 0 10px;

  /* Animate in/out */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Gallery with 1 item: completely gone */
.lmb-thumbsbar--none {
  display: none;
}

/* User toggled off */
.lmb-thumbsbar--hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* ---- Track ---- */
.lmb-thumbsbar__track {
  display: flex;
  align-items:  center;
  height:       100%;
  gap:          6px;

  overflow-x:  auto;
  overflow-y:  hidden;
  scroll-behavior: smooth;

  /* Scrollbar hidden */
  scrollbar-width: none;
  -ms-overflow-style: none;

  /* Padding controlled by JS for centering */
  padding: 2px 8px;
}

.lmb-thumbsbar__track::-webkit-scrollbar { display: none; }

/* ============================================================
   THUMBNAIL
   ============================================================ */

.lmb-thumb {
  position:    relative;
  flex-shrink: 0;
  height:      72px;
  cursor:      pointer;
  border-radius: 3px;
  overflow:    hidden;

  border: 2px solid transparent;
  opacity: 0.55;
  transition:
    opacity      0.20s ease,
    border-color 0.20s ease,
    transform    0.15s ease;
}

.lmb-thumb:hover {
  opacity:   0.85;
  transform: scaleY(1.05);
}

.lmb-thumb--active {
  opacity:      1;
  border-color: rgba(255,255,255,0.90);
}

.lmb-thumb__img {
  display:    block;
  height:     100%;
  width:      auto;
  min-width:  80px;
  max-width:  140px;
  object-fit: cover;
  pointer-events: none;
}

/* Video placeholder (no thumbnail available) */
.lmb-thumb__ph {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  gap:            3px;

  width:  90px;
  height: 72px;

  background: rgba(255,255,255,0.08);
  color: #777;
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.lmb-thumb__ph svg {
  width:  20px;
  height: 20px;
  fill:   #666;
}

/* ============================================================
   CAPTION
   ============================================================ */

.lmb-caption {
  position:  absolute;
  bottom:    0;
  left:      50%;
  width:     100%;
  z-index:   9;

  transform: translateX(-50%) translateY(8px);
  opacity:   0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;

  /* Sit above thumbs bar */
  padding-bottom: 115px;
}

.lmb-caption--visible {
  opacity:   1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.lmb-caption__text {
  margin:  0 auto;
  padding: 12px 30px 16px;
  max-width: 860px;

  color:      #e0e0e0;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size:   14px;
  line-height: 1.65;

  -webkit-user-select: text;
  user-select: text;
}

/* ============================================================
   INLINE MODAL CARD
   ============================================================ */

.lmb-inline-card {
  position: relative;
  display:  block;
  opacity: 0;

  background:    #ffffff;
  border-radius: 10px;
  padding:       32px 36px 36px;
  max-width:     min(780px, calc(100vw - 32px));
  max-height:    calc(100vh - 60px);
  overflow-y:    auto;

  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  transition: opacity 0.28s ease;

  /* Allow text selection inside modal */
  -webkit-user-select: text;
  user-select: text;
}

.lmb-inline-card.lmb-media--ready {
  opacity: 1;
}

/* Scrollbar styling inside card */
.lmb-inline-card::-webkit-scrollbar {
  width: 5px;
}
.lmb-inline-card::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* ============================================================
   IFRAME BOX (custom iframe: maps, etc.)
   ============================================================ */

.lmb-iframe-box {
  position:      relative;
  border-radius: 6px;
  overflow:      hidden;
  box-shadow:    0 20px 60px rgba(0,0,0,0.6);
  background:    #111;
}

/* ============================================================
   YOUTUBE ERROR STATE
   ============================================================ */

.lmb-yt-error {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  gap:            12px;

  padding:    40px 36px;
  background: rgba(255,255,255,0.04);
  border:     1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  text-align: center;
  max-width:  360px;
}

.lmb-yt-error__icon {
  font-size: 36px;
  color:     #cc0000;
  line-height: 1;
}

.lmb-yt-error__msg {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size:   15px;
  color:       #d0d0d0;
  line-height: 1.5;
}

.lmb-yt-error__sub {
  margin: 0;
  font-size: 12px;
  color:     #666;
}

.lmb-yt-error__link {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 22px;
  background: #cc0000;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.lmb-yt-error__link:hover {
  background: #e80000;
}

/* ============================================================
   GENERIC ERROR
   ============================================================ */

.lmb-error {
  display: flex;
  align-items:     center;
  justify-content: center;
  padding:   28px 36px;
  color:     #686868;
  font-family: Arial, Helvetica, sans-serif;
  font-size:   15px;
  text-align:  center;
  line-height: 1.55;
}

/* ============================================================
   RESPONSIVE — mobile
   ============================================================ */

@media (max-width: 480px) {
  .lmb-topbar  { height: 46px; }
  .lmb-btn     { width: 42px; height: 46px; }
  .lmb-btn svg { width: 17px; height: 17px; }

  .lmb-counter        { font-size: 13px; padding: 8px 10px; }
  .lmb-thumbsbar      { height: 88px; }
  .lmb-thumb          { height: 58px; }
  .lmb-thumb__img     { min-width: 60px; max-width: 100px; }

  .lmb-media--image,
  .lmb-media--video   {
    max-width:  calc(100vw - 10px);
    max-height: calc(100vh - 170px);
  }

  .lmb-media--iframe  { width: 96vw; height: 54vw; }

  .lmb-inline-card    { padding: 20px 18px 24px; }

  .lmb-arrow          { width: 46px; height: 76px; padding: 8px; }
  .lmb-arrow svg      { width: 26px; height: 26px; }
}

/* ============================================================
   RESPONSIVE — large monitors
   ============================================================ */

@media (min-width: 1600px) {
  .lmb-topbar         { height: 56px; }
  .lmb-btn            { width: 54px; height: 56px; }
  .lmb-btn svg        { width: 22px; height: 22px; }
  .lmb-counter        { font-size: 18px; padding: 14px 18px; }
  .lmb-thumbsbar      { height: 120px; }
  .lmb-thumb          { height: 84px; }
  .lmb-thumb__img     { max-width: 160px; }
  .lmb-caption__text  { font-size: 15px; }
}

/* ============================================================
   ACCESSIBILITY: reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .lmb-overlay,
  .lmb-slide,
  .lmb-media,
  .lmb-caption,
  .lmb-thumb,
  .lmb-btn,
  .lmb-arrow svg,
  .lmb-loader,
  .lmb-thumbsbar,
  .lmb-inline-card {
    transition:  none !important;
    animation:   none !important;
  }

  .lmb-loader__ring div {
    animation: none !important;
    opacity: 0.5;
  }
}
