.sgal{position:relative;box-sizing:border-box;width:100%;
  --sgal-cols:3;--sgal-gap:3px;--sgal-radius:0px;--sgal-accent:#262626;--sgal-ratio:1/1;
  font-family:inherit;color:inherit;line-height:1.5}
.sgal *,.sgal *::before,.sgal *::after{box-sizing:border-box}
.sgal svg{display:block}
.sgal picture{display:block;width:100%;height:100%;line-height:0;margin:0 !important;padding:0 !important;border:0 !important}
.sgal--ratio-fixed picture .sgal-img{width:100%;height:100%;object-fit:cover}

/* ---------- защита от стиловете на темата ----------
   Темите често слагат рамки, сенки и падинг на figure и img.
   Това ги неутрализира, за да е решетката плътна като в Instagram. */
.sgal figure,.sgal figcaption,.sgal ul,.sgal li,
.sgal .sgal-cell,.sgal .sgal-shot,.sgal .sgal-open,.sgal .sgal-img{
  margin:0 !important;padding:0 !important;border:0 !important;
  box-shadow:none !important;background-image:none !important;
  outline:0;list-style:none;text-decoration:none}
.sgal .sgal-cell{border-radius:0 !important}
.sgal .sgal-open{display:block;width:100%;cursor:pointer;text-align:left;
  background-color:transparent !important;border-radius:0;
  -webkit-appearance:none;appearance:none;font:inherit;color:inherit;
  -webkit-tap-highlight-color:transparent}
.sgal .sgal-open--static{cursor:default}
.sgal .sgal-img{display:block;width:100%;max-width:100%;height:auto;
  border-radius:0 !important;filter:none;transition:transform .5s cubic-bezier(.22,1,.36,1)}

/* ---------- профилен хедър (като Instagram профил) ---------- */
.sgal-head{display:flex;align-items:center;gap:30px;margin:0 0 28px !important;
  padding:0 0 24px;border-bottom:1px solid rgba(0,0,0,.08)}
.sgal-ava-w{display:inline-flex;flex:0 0 auto;padding:3px;border-radius:50%;
  background:conic-gradient(from 210deg,#feda75,#fa7e1e,#d62976,#962fbf,#4f5bd5,#feda75)}
.sgal-ava{width:86px;height:86px;flex:0 0 86px;border-radius:50% !important;object-fit:cover;
  display:block;border:3px solid #fff;box-shadow:none !important;margin:0 !important}
.sgal-head-in{min-width:0}
.sgal-head-t{margin:0 0 7px !important;padding:0 !important;font-size:1.35rem;font-weight:500;
  letter-spacing:.01em;line-height:1.25;color:inherit}
.sgal-head-s{margin:0 !important;font-size:.92rem;color:rgba(0,0,0,.6);
  display:flex;gap:22px;flex-wrap:wrap}
.sgal-head-s strong{font-weight:700;color:rgba(0,0,0,.85)}
.sgal-head-b{margin:8px 0 0 !important;font-size:.9rem;line-height:1.55;color:rgba(0,0,0,.75)}
.sgal-vid{position:absolute;z-index:2;top:8px;right:8px;width:22px;height:22px;color:#fff;
  pointer-events:none;filter:drop-shadow(0 1px 3px rgba(0,0,0,.5))}
.sgal-vid svg{width:22px;height:22px}
video.sgal-img{display:block;background:#000}
.sgal--ratio-fixed video.sgal-img{width:100%;height:100%;object-fit:cover}
.sgal--ratio-auto video.sgal-img{width:100%;aspect-ratio:16/9;object-fit:cover}

/* ---------- видео (от 2.1.0) ---------- */
/* празна корица (вградено видео без картинка) */
.sgal-img--blank{display:block;width:100%;height:100%;background:linear-gradient(135deg,#1c1c1e,#3a3a3c)}
.sgal--ratio-auto .sgal-img--blank{aspect-ratio:16/9;height:auto}
/* значки: продължителност долу вдясно, „Ново“ горе вляво */
.sgal-dur{position:absolute;z-index:3;right:10px;bottom:10px;pointer-events:none;
  padding:3px 7px;border-radius:5px;background:rgba(0,0,0,.72);color:#fff;
  font-size:.72rem;font-weight:600;line-height:1.2;letter-spacing:.02em;font-variant-numeric:tabular-nums}
.sgal-new{position:absolute;z-index:3;left:10px;top:10px;pointer-events:none;
  padding:3px 8px;border-radius:999px;background:var(--sgal-accent);color:#fff;
  font-size:.66rem;font-weight:700;line-height:1.2;letter-spacing:.1em;text-transform:uppercase}
/* голям бутон ▶ по средата + заглавие в градиент отдолу (ефект „play“) */
.sgal-play{position:absolute;z-index:3;left:50%;top:50%;width:64px;height:64px;pointer-events:none;
  display:grid;place-items:center;border-radius:50%;color:#fff;
  background:rgba(0,0,0,.5);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
  box-shadow:0 6px 24px rgba(0,0,0,.35),inset 0 0 0 1.5px rgba(255,255,255,.35);
  transform:translate(-50%,-50%);transition:transform .3s cubic-bezier(.22,1,.36,1),background .3s ease}
.sgal-play svg{width:30px;height:30px;margin-left:3px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3))}
.sgal-cell--video:hover .sgal-play,.sgal-cell--video .sgal-open:focus-visible .sgal-play{
  transform:translate(-50%,-50%) scale(1.12);background:var(--sgal-accent)}
.sgal-play-t{position:absolute;z-index:2;left:0;right:0;bottom:0;pointer-events:none;
  padding:52px 14px 14px;background:linear-gradient(to top,rgba(0,0,0,.72),rgba(0,0,0,0));
  opacity:1;transition:opacity .25s ease}
.sgal-play-t:empty{display:none}
.sgal-play-cap{display:block;color:#fff;font-size:.95rem;font-weight:600;line-height:1.35;
  text-shadow:0 1px 6px rgba(0,0,0,.4);padding-right:58px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sgal--hover-play .sgal-veil{display:none}
.sgal--hover-play .sgal-cell:hover .sgal-img{transform:scale(1.04)}
.sgal--hover-play .sgal-img{transition:transform .6s cubic-bezier(.22,1,.36,1)}
/* видео пресет: сянка и заглавие под кадъра */
.sgal--preset-video .sgal-shot{box-shadow:0 10px 30px -14px rgba(0,0,0,.45);background:#111}
.sgal--preset-video .sgal-cell > .sgal-cap{margin-top:10px !important;font-size:.95rem;font-weight:600;opacity:.92;line-height:1.4}
.sgal--preset-video .sgal-cell--video .sgal-open{color:inherit}
/* първото видео едро отгоре */
.sgal--vfeat.sgal--grid .sgal-track > .sgal-cell--video:first-child{grid-column:1 / -1}
.sgal--vfeat.sgal--grid .sgal-track > .sgal-cell--video:first-child .sgal-play{width:88px;height:88px}
.sgal--vfeat.sgal--grid .sgal-track > .sgal-cell--video:first-child .sgal-play svg{width:42px;height:42px}
.sgal--vfeat.sgal--grid .sgal-track > .sgal-cell--video:first-child .sgal-play-cap{font-size:1.25rem;-webkit-line-clamp:2}
.sgal--vfeat.sgal--grid .sgal-track > .sgal-cell--video:first-child > .sgal-cap{font-size:1.1rem}
/* пускане на място: плейърът покрива корицата */
.sgal-inline{position:absolute;inset:0;z-index:5;display:block;background:#000}
.sgal-inline iframe,.sgal-inline video{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#000}
.sgal--ratio-auto .sgal-shot.is-playing{aspect-ratio:16/9}
.sgal .sgal-shot.is-playing.is-portrait{aspect-ratio:9/16 !important}
.sgal-shot.is-playing .sgal-img{visibility:hidden}
.sgal-shot.is-playing .sgal-play,.sgal-shot.is-playing .sgal-play-t,.sgal-shot.is-playing .sgal-vid,
.sgal-shot.is-playing .sgal-dur,.sgal-shot.is-playing .sgal-new,.sgal-shot.is-playing .sgal-veil,
.sgal-shot.is-playing .sgal-ig,.sgal-shot.is-playing .sgal-over{display:none}
.sgal .sgal-open--static.sgal-open[data-was-inline]{cursor:default}

/* ---------- табове (в стил профилните табове на Instagram) ---------- */
.sgal-tabs{display:flex;justify-content:center;flex-wrap:wrap;gap:36px;
  margin:0 0 22px;padding-top:2px;border-top:1px solid rgba(0,0,0,.10)}
.sgal-tab{position:relative;padding:14px 0;border:0;background:none;cursor:pointer;
  font-family:inherit;font-size:12px;font-weight:600;letter-spacing:.12em;
  text-transform:uppercase;line-height:1;color:rgba(0,0,0,.45);
  transition:color .2s ease}
.sgal-tab::after{content:"";position:absolute;left:0;right:0;top:-1px;height:1px;
  background:transparent;transition:background .2s ease}
.sgal-tab:hover{color:var(--sgal-accent)}
.sgal-tab.is-on{color:var(--sgal-accent)}
.sgal-tab.is-on::after{background:var(--sgal-accent)}
.sgal-tab:focus-visible{outline:1px solid var(--sgal-accent);outline-offset:4px}

/* ---------- оформления ---------- */
.sgal--grid .sgal-track{display:grid;grid-template-columns:repeat(var(--sgal-cols),1fr);gap:var(--sgal-gap)}
.sgal--masonry .sgal-track{column-count:var(--sgal-cols);column-gap:var(--sgal-gap)}
.sgal--masonry .sgal-cell{break-inside:avoid;margin-bottom:var(--sgal-gap) !important}
.sgal--carousel .sgal-track{display:flex;gap:var(--sgal-gap);overflow-x:auto;
  scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.sgal--carousel .sgal-track::-webkit-scrollbar{display:none}
.sgal--carousel .sgal-cell{flex:0 0 calc((100% - (var(--sgal-cols) - 1) * var(--sgal-gap)) / var(--sgal-cols));
  scroll-snap-align:start}

.sgal-cell{position:relative;min-width:0}
.sgal-cell.is-hidden{display:none}

/* ---------- плочка ---------- */
.sgal-shot{position:relative;display:block;overflow:hidden;line-height:0;
  border-radius:var(--sgal-radius);background:rgba(0,0,0,.04)}
.sgal--ratio-fixed .sgal-shot{aspect-ratio:var(--sgal-ratio)}
.sgal--ratio-fixed .sgal-img{width:100%;height:100%;object-fit:cover}
.sgal--ratio-auto .sgal-img{width:100%;height:auto}

/* тъмно було + бяла икона — точно както в Instagram */
.sgal-veil{position:absolute;inset:0;pointer-events:none;opacity:0;
  background:rgba(0,0,0,.34);transition:opacity .22s ease}
.sgal-zoom{position:absolute;z-index:2;left:50%;top:50%;pointer-events:none;
  width:30px;height:30px;color:#fff;
  opacity:0;transform:translate(-50%,-50%) scale(.86);
  transition:opacity .22s ease,transform .22s ease}
.sgal-zoom svg{width:30px;height:30px}
.sgal-over{position:absolute;z-index:2;left:0;right:0;bottom:0;padding:12px;pointer-events:none;
  opacity:0;transform:translateY(6px);transition:opacity .22s ease,transform .22s ease}
.sgal-over span{display:block;color:#fff;font-size:.84rem;line-height:1.4}

.sgal-cell:hover .sgal-veil,.sgal-open:focus-visible .sgal-veil{opacity:1}
/* ---- „инстаграм" ефект при посочване: затъмняване, сърце и надписът по средата ---- */
.sgal--hover-insta .sgal-veil{background:rgba(0,0,0,.34)}
/* сърцето е значка горе вдясно (в средата стои курсорът и се криеха взаимно),
   надписът е долу вляво — както в Инстаграм */
.sgal-ig{position:absolute;inset:0;z-index:2;pointer-events:none;color:#fff;
  opacity:0;transition:opacity .25s ease}
.sgal-ig svg{position:absolute;top:12px;right:12px;width:27px;height:27px;
  filter:drop-shadow(0 1px 6px rgba(0,0,0,.4));
  transform:translateY(-6px);transition:transform .25s ease}
.sgal-ig-t{position:absolute;left:14px;right:14px;bottom:12px;text-align:left;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
  font-size:.9rem;font-weight:600;line-height:1.45;text-shadow:0 1px 8px rgba(0,0,0,.45);
  transform:translateY(6px);transition:transform .25s ease}
.sgal--hover-insta .sgal-cell:hover .sgal-ig,
.sgal--hover-insta .sgal-open:focus-visible .sgal-ig{opacity:1}
.sgal--hover-insta .sgal-cell:hover .sgal-ig svg,
.sgal--hover-insta .sgal-cell:hover .sgal-ig-t,
.sgal--hover-insta .sgal-open:focus-visible .sgal-ig svg,
.sgal--hover-insta .sgal-open:focus-visible .sgal-ig-t{transform:none}
.sgal--hover-insta .sgal-cell:hover .sgal-img{transform:scale(1.03)}
.sgal--hover-insta .sgal-img{transition:transform .45s ease}

/* когато следват табове, разделител е тяхната линия — не и на хедъра */
.sgal-head:has(+ .sgal-tabs){border-bottom:0;padding-bottom:8px}

/* ---- инстаграм табове: тънка линия отгоре, редки главни букви ---- */
.sgal--preset-instagram .sgal-tabs{border-top:1px solid rgba(0,0,0,.12);margin-top:2px;gap:48px}
.sgal--preset-instagram .sgal-tab{text-transform:uppercase;letter-spacing:.14em;font-size:12px;
  font-weight:600;color:rgba(0,0,0,.38);padding:15px 0 12px}
.sgal--preset-instagram .sgal-tab::after{top:-1px;bottom:auto;height:1px}
.sgal--preset-instagram .sgal-tab.is-on{color:var(--sgal-accent)}

.sgal-cell:hover .sgal-zoom,.sgal-open:focus-visible .sgal-zoom{opacity:1;transform:translate(-50%,-50%) scale(1)}
.sgal-cell:hover .sgal-over,.sgal-open:focus-visible .sgal-over{opacity:1;transform:none}
.sgal-open:focus-visible{outline:1px solid var(--sgal-accent);outline-offset:2px}

/* по избор — само ако не е инстаграм пресетът */
.sgal--hover-zoom .sgal-cell:hover .sgal-img{transform:scale(1.05)}
.sgal--hover-lift .sgal-cell{transition:transform .35s cubic-bezier(.22,1,.36,1)}
.sgal--hover-lift .sgal-cell:hover{transform:translateY(-5px)}
.sgal--hover-dim .sgal-cell:hover .sgal-img{filter:brightness(.9)}

.sgal-cell > .sgal-cap{margin-top:8px !important;font-size:.84rem;line-height:1.5;opacity:.75}

/* ---------- стрелки на лентата ---------- */
.sgal-nav{position:absolute;z-index:4;top:50%;transform:translateY(-50%);
  width:38px;height:38px;display:grid;place-items:center;border:0;border-radius:50%;
  cursor:pointer;background:rgba(255,255,255,.95);color:#262626;
  box-shadow:0 2px 10px rgba(0,0,0,.16);transition:opacity .2s ease}
.sgal-nav svg{width:19px;height:19px}
.sgal-nav:hover{background:#fff}
.sgal-nav:focus-visible{outline:1px solid var(--sgal-accent);outline-offset:3px}
.sgal-nav[hidden]{display:none}
.sgal-nav--prev{left:-6px}
.sgal-nav--next{right:-6px}

/* ---------- зареди още ---------- */
.sgal-more-wrap{display:flex;justify-content:center;margin-top:20px}
.sgal-more{padding:10px 6px;border:0 !important;background:none;cursor:pointer;
  font-family:inherit;font-size:.9rem;font-weight:600;letter-spacing:.02em;
  color:var(--sgal-accent);transition:opacity .2s ease}
.sgal-more:hover{opacity:.55}
.sgal-more:focus-visible{outline:1px solid var(--sgal-accent);outline-offset:3px}
.sgal-more[hidden]{display:none}
.sgal-more[disabled]{opacity:.5;cursor:default}

/* ---------- лайтбокс ---------- */
/* ВАЖНО: когато е затворен, слоят трябва да е и невидим, и „прозрачен“ за
   мишката. Само opacity:0 оставяше цял екран невидим капак върху сайта и
   след първото затваряне нищо по страницата не се кликаше. */
.sgal-lb{position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;
  padding:26px;background:rgba(0,0,0,.94);opacity:0;visibility:hidden;pointer-events:none;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  transition:opacity .25s ease,visibility 0s linear .25s}
.sgal-lb.is-open{opacity:1;visibility:visible;pointer-events:auto;
  transition:opacity .25s ease,visibility 0s linear 0s}
.sgal-lb *{box-sizing:border-box}
.sgal-lb-stage{position:relative;margin:auto;max-width:100%;max-height:100%;
  display:flex;align-items:center;justify-content:center}
/* темите обичат да слагат рамки и сенки на img — тук ги неутрализираме */
.sgal-lb-img,.sgal-lb-video{border:0 !important;padding:0 !important;
  box-shadow:none !important;border-radius:0 !important}
.sgal-lb-img{max-width:100%;max-height:calc(100vh - 130px);width:auto;height:auto;display:block;
  cursor:default;opacity:0;transform:scale(.985);transition:opacity .25s ease,transform .25s ease}
.sgal-lb-img.is-ready{opacity:1;transform:none}
.sgal-lb.can-zoom .sgal-lb-img{cursor:zoom-in}
.sgal-lb-video{max-width:100%;max-height:calc(100vh - 130px);display:block;background:#000;outline:0}
.sgal-lb-video[hidden]{display:none}
/* мобилните браузъри крият част от 100vh под лентата с адреса */
@supports (height:100dvh){
  .sgal-lb-img{max-height:calc(100dvh - 130px)}
  .sgal-lb-video{max-height:calc(100dvh - 130px)}
}
/* ---- видео в лайтбокса: плейърът е 16:9 на цялата налична ширина ---- */
.sgal-lb.is-video{padding-bottom:30px}
/* Стейджът взема ПРОПОРЦИЯТА НА САМИЯ КЛИП (--sgal-vr = ширина/височина) и се
   побира в екрана: широк клип опира в ширината, висок — във височината. */
.sgal-lb.is-video .sgal-lb-stage{flex-direction:column;align-items:stretch;
  width:min(100%,calc((100vh - 150px) * var(--sgal-vr,1.7778)));max-width:1600px}
.sgal-lb-frame{position:relative;width:100%;aspect-ratio:16/9;background:#000;display:block;
  box-shadow:0 30px 80px rgba(0,0,0,.6)}
.sgal-lb-frame[hidden]{display:none}
.sgal-lb-iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.sgal-lb.has-strip{padding-bottom:150px}
.sgal-lb.has-strip .sgal-lb-img{max-height:calc(100vh - 230px)}
.sgal-lb.has-strip.is-video .sgal-lb-stage{width:min(100%,calc((100vh - 275px) * var(--sgal-vr,1.7778)))}
.sgal-lb.has-strip .sgal-lb-bar{bottom:96px}
/* ---- собствен плейър за качени клипове ---- */
.sgal-lb-player{position:relative;width:100%;aspect-ratio:var(--sgal-vr,1.7778);background:#000;border-radius:6px;overflow:hidden;
  box-shadow:0 30px 80px rgba(0,0,0,.6);user-select:none;-webkit-user-select:none}
.sgal-lb-player[hidden]{display:none}
.sgal-lb-player .sgal-lb-video{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;cursor:pointer}
.sgal-lb-player.is-full{border-radius:0;box-shadow:none}
.sgal-i-pause,.is-paused .sgal-i-play{display:block}
.sgal-i-play,.is-paused .sgal-i-pause{display:none}
.sgal-vp-big{position:absolute;left:50%;top:50%;width:84px;height:84px;margin:-42px 0 0 -42px;display:grid;place-items:center;
  border:0;border-radius:50%;cursor:pointer;color:#fff;background:rgba(0,0,0,.5);
  -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
  box-shadow:0 6px 24px rgba(0,0,0,.35),inset 0 0 0 1.5px rgba(255,255,255,.35);
  opacity:0;transform:scale(.9);transition:opacity .25s ease,transform .25s ease,background .25s ease}
.sgal-vp-big svg{width:40px;height:40px;margin-left:4px}
.sgal-vp-big .sgal-i-pause{margin-left:0}
.sgal-lb-player.is-paused .sgal-vp-big,.sgal-lb-player:hover .sgal-vp-big{opacity:1;transform:none}
.sgal-lb-player.is-paused .sgal-vp-big{background:var(--sgal-accent)}
.sgal-vp-big:hover{background:var(--sgal-accent)}
.sgal-vp-big:focus-visible{outline:1px solid #fff;outline-offset:3px}
.sgal-vp-unmute{position:absolute;top:14px;left:14px;display:inline-flex;align-items:center;gap:8px;padding:9px 14px 9px 11px;
  border:0;border-radius:999px;cursor:pointer;color:#111;background:#fff;font:inherit;font-size:.86rem;font-weight:600;
  box-shadow:0 4px 18px rgba(0,0,0,.35);transition:opacity .25s ease,transform .25s ease}
.sgal-vp-unmute svg{width:18px;height:18px}
.sgal-vp-unmute[hidden]{display:none}
.sgal-vp-unmute:hover{transform:translateY(-1px)}
.sgal-vp-bar{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:10px;padding:26px 12px 10px;
  background:linear-gradient(to top,rgba(0,0,0,.75),rgba(0,0,0,0));color:#fff;
  transition:opacity .25s ease,transform .25s ease}
.sgal-vp-bar button{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border:0;border-radius:50%;
  background:transparent;color:#fff;cursor:pointer;transition:background .2s ease}
.sgal-vp-bar button:hover{background:rgba(255,255,255,.18)}
.sgal-vp-bar button:focus-visible{outline:1px solid #fff;outline-offset:2px}
.sgal-vp-bar button svg{width:20px;height:20px}
.sgal-vp-time{flex:0 0 auto;font-size:.78rem;font-variant-numeric:tabular-nums;color:rgba(255,255,255,.85);white-space:nowrap}
.sgal-vp-prog{position:relative;flex:1 1 auto;height:22px;cursor:pointer;touch-action:none}
.sgal-vp-prog::before{content:"";position:absolute;left:0;right:0;top:9px;height:4px;border-radius:2px;background:rgba(255,255,255,.28)}
.sgal-vp-buf,.sgal-vp-fill{position:absolute;left:0;top:9px;height:4px;border-radius:2px;width:0;pointer-events:none}
.sgal-vp-buf{background:rgba(255,255,255,.35)}
.sgal-vp-fill{background:var(--sgal-accent)}
.sgal-vp-knob{position:absolute;top:5px;left:0;width:12px;height:12px;margin-left:-6px;border-radius:50%;background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.4);transform:scale(0);transition:transform .15s ease;pointer-events:none}
.sgal-vp-prog:hover .sgal-vp-knob,.sgal-vp-prog:focus-visible .sgal-vp-knob{transform:scale(1)}
.sgal-vp-prog:focus-visible{outline:1px solid #fff;outline-offset:2px;border-radius:4px}
.sgal-vp-prog:hover::before{height:6px;top:8px}
.sgal-vp-prog:hover .sgal-vp-buf,.sgal-vp-prog:hover .sgal-vp-fill{height:6px;top:8px}
.sgal-lb-player.is-muted .sgal-i-vol,.sgal-lb-player:not(.is-muted) .sgal-i-mute{display:none}
.sgal-lb-player.is-muted .sgal-i-mute,.sgal-lb-player:not(.is-muted) .sgal-i-vol{display:block}
/* надпис и визитка ПОД плейъра, не в дъното на екрана */
.sgal-lb-vcap{display:block;padding:12px 4px 0;text-align:left;color:rgba(255,255,255,.9)}
.sgal-lb-vcap[hidden]{display:none}
.sgal-lb-vmeta{display:block;font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.5);margin-bottom:4px}
.sgal-lb-vtitle{display:block;font-size:1rem;font-weight:600;line-height:1.35}
.sgal-lb-vtitle:empty{display:none}
.sgal-lb.is-video .sgal-lb-bar{display:none}
/* „кино“: при гледане без движение контролите, стрелките и ✕ се скриват */
.sgal-lb.is-idle{cursor:none}
.sgal-lb.is-idle .sgal-lb-btn,.sgal-lb.is-idle .sgal-vp-bar,.sgal-lb.is-idle .sgal-vp-big,
.sgal-lb.is-idle .sgal-vp-unmute,.sgal-lb.is-idle .sgal-lb-strip,.sgal-lb.is-idle .sgal-lb-vcap{opacity:0;pointer-events:none}
.sgal-lb-strip,.sgal-lb-vcap{transition:opacity .35s ease}

/* ---- плейлист лента с корици ---- */
.sgal-lb-strip{position:fixed;z-index:3;left:0;right:0;bottom:0;display:flex;gap:8px;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));overflow-x:auto;
  background:linear-gradient(to top,rgba(0,0,0,.85),rgba(0,0,0,0));
  scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.sgal-lb-strip::-webkit-scrollbar{display:none}
.sgal-lb-strip[hidden]{display:none}
.sgal-lb-th:first-child{margin-left:auto}
.sgal-lb-th:last-child{margin-right:auto}
.sgal-lb-th{position:relative;flex:0 0 auto;width:112px;height:63px;padding:0;border:2px solid transparent;
  border-radius:8px;overflow:hidden;background:#222;cursor:pointer;opacity:.55;scroll-snap-align:center;
  transition:opacity .2s ease,border-color .2s ease,transform .2s ease}
.sgal-lb-th img,.sgal-lb-th > span{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.sgal-lb-th:hover{opacity:.9}
.sgal-lb-th.is-on{opacity:1;border-color:#fff;box-shadow:0 0 0 2px var(--sgal-accent);transform:translateY(-2px)}
.sgal-lb-th:focus-visible{outline:1px solid #fff;outline-offset:2px}
.sgal-lb-th-p{position:absolute;left:50%;top:50%;width:22px;height:22px;transform:translate(-50%,-50%);
  border-radius:50%;background:rgba(0,0,0,.6)}
.sgal-lb-th-p::after{content:"";position:absolute;left:8px;top:6px;border-style:solid;border-width:5px 0 5px 8px;
  border-color:transparent transparent transparent #fff}
.sgal-lb-th em{position:absolute;right:4px;bottom:4px;padding:1px 4px;border-radius:3px;
  background:rgba(0,0,0,.75);color:#fff;font-style:normal;font-size:.62rem;font-weight:600;line-height:1.3}
.sgal-lb-spin{position:absolute;width:32px;height:32px;border-radius:50%;pointer-events:none;
  border:2px solid rgba(255,255,255,.22);border-top-color:#fff;animation:sgalSpin .8s linear infinite}
.sgal-lb-spin[hidden]{display:none}
@keyframes sgalSpin{to{transform:rotate(360deg)}}
.sgal-lb-err{margin:0;padding:0 20px;color:rgba(255,255,255,.8);font-size:.92rem;line-height:1.6;
  text-align:center}
.sgal-lb-err[hidden]{display:none}

/* ---- увеличено ---- */
/* Стейджът трябва да пусне ограниченията си, иначе уголемената снимка излиза
   извън него и слоят няма какво да скролира — снимката просто се отрязваше. */
/* display:block, а не flex — центриран flex елемент, който е по-широк от
   контейнера, „изяжда“ лявата си част и тя става недостижима при скрол. */
.sgal-lb.is-zoomed{display:block;overflow:auto;padding:0;
  cursor:zoom-out;touch-action:pan-x pan-y pinch-zoom}
.sgal-lb.is-zoomed .sgal-lb-stage{display:block;margin:0 auto;
  width:-moz-max-content;width:max-content;max-width:none;max-height:none}
.sgal-lb.is-zoomed .sgal-lb-img{max-width:none !important;max-height:none !important;
  height:auto;cursor:zoom-out;opacity:1;transform:none}
.sgal-lb.is-zoomed .sgal-lb-bar{display:none}

.sgal-lb-btn{position:fixed;z-index:3;display:grid;place-items:center;width:44px;height:44px;
  border:0;border-radius:50%;cursor:pointer;color:#fff;background:rgba(0,0,0,.38);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  transition:background .2s ease,transform .2s ease,opacity .35s ease}
.sgal-lb-btn svg{width:24px;height:24px}
.sgal-lb-btn:hover{background:rgba(255,255,255,.18)}
.sgal-lb-btn:active{transform:scale(.94)}
.sgal-lb-btn:focus-visible{outline:1px solid #fff;outline-offset:2px}
.sgal-lb-btn[hidden]{display:none}
.sgal-lb-close{top:14px;right:14px}
.sgal-lb-prev{left:10px;top:50%;margin-top:-22px}
.sgal-lb-next{right:10px;top:50%;margin-top:-22px}
/* ---- споделяне ---- */
.sgal-lb-share{top:14px;left:14px}
.sgal-lb-share[hidden]{display:none}
.sgal-lb-panel{position:fixed;z-index:4;top:66px;left:14px;width:230px;max-width:calc(100vw - 28px);
  padding:6px;border-radius:14px;background:#fff;color:#1a1a1a;
  box-shadow:0 18px 46px rgba(0,0,0,.42);
  opacity:0;transform:translateY(-6px);transition:opacity .18s ease,transform .18s ease}
.sgal-lb.has-panel .sgal-lb-panel{opacity:1;transform:none}
.sgal-lb-panel[hidden]{display:none}
.sgal-sh{display:flex;align-items:center;gap:11px;width:100%;padding:10px 12px;
  border:0;border-radius:10px;background:none;cursor:pointer;text-align:left;text-decoration:none;
  font:inherit;font-size:.92rem;line-height:1.2;color:#1a1a1a;
  transition:background .15s ease,color .15s ease}
.sgal-sh svg{width:19px;height:19px;flex:0 0 19px;color:#5a5a5a}
.sgal-sh span{min-width:0}
.sgal-sh:hover{background:rgba(0,0,0,.06)}
.sgal-sh:focus-visible{outline:2px solid var(--sgal-accent);outline-offset:-2px}
.sgal-sh[hidden]{display:none}
.sgal-sh-copy.is-done{color:#0a7d3c}
.sgal-sh-copy.is-done svg{color:#0a7d3c}
@media (max-width:600px){
  .sgal-lb-panel{top:auto;bottom:14px;left:14px;right:14px;width:auto}
  .sgal-sh{padding:13px 12px;font-size:.95rem}
}
@media (prefers-reduced-motion:reduce){
  .sgal-lb-panel{transition:none}
}

.sgal-lb-bar{position:fixed;z-index:2;left:0;right:0;bottom:18px;text-align:center;padding:0 70px;
  pointer-events:none;color:rgba(255,255,255,.86);font-size:.88rem;line-height:1.5}
.sgal-lb-count{display:block;font-size:.74rem;letter-spacing:.14em;text-transform:uppercase;
  color:rgba(255,255,255,.5);margin-top:4px}

/* ---------- адаптив ---------- */
/* Колоните се управляват от три променливи: --sgal-cols (компютър),
   --sgal-cols-t (таблет, до 1024px) и --sgal-cols-m (телефон, до 760px).
   Старите галерии нямат последните две — затова има резервни стойности,
   които повтарят точно предишното поведение. */
@media (max-width:1024px){
  .sgal--grid .sgal-track{grid-template-columns:repeat(var(--sgal-cols-t,min(var(--sgal-cols),4)),1fr)}
  .sgal--masonry .sgal-track{column-count:var(--sgal-cols-t,min(var(--sgal-cols),3))}
  .sgal--carousel .sgal-cell{flex-basis:calc((100% - 2 * var(--sgal-gap)) / 3)}
}
@media (max-width:760px){
  .sgal--grid .sgal-track{grid-template-columns:repeat(var(--sgal-cols-m,min(var(--sgal-cols),3)),1fr)}
  .sgal--masonry .sgal-track{column-count:var(--sgal-cols-m,2)}
  .sgal--carousel .sgal-cell{flex-basis:calc((100% - var(--sgal-gap)) / 2)}
  .sgal-tabs{gap:24px}
  .sgal-nav{width:34px;height:34px}
  .sgal-nav--prev{left:2px}
  .sgal-nav--next{right:2px}
  .sgal-lb{padding:14px}
  .sgal-lb-img,.sgal-lb-video{max-height:calc(100vh - 150px)}
  .sgal-lb.is-video .sgal-lb-stage{width:min(100%,calc((100vh - 170px) * var(--sgal-vr,1.7778)))}
  .sgal-lb.has-strip.is-video .sgal-lb-stage{width:min(100%,calc((100vh - 240px) * var(--sgal-vr,1.7778)))}
  .sgal-lb.is-video{padding-bottom:20px}
  .sgal-lb.has-strip{padding-bottom:110px}
  .sgal-vp-big{width:64px;height:64px;margin:-32px 0 0 -32px}
  .sgal-vp-big svg{width:30px;height:30px}
  .sgal-vp-bar{padding:20px 6px 6px;gap:4px}
  .sgal-vp-time{font-size:.7rem}
  .sgal-lb-vtitle{font-size:.92rem}
  .sgal-lb.is-video .sgal-lb-prev,.sgal-lb.is-video .sgal-lb-next{top:auto;bottom:112px;margin-top:0}
  .sgal-lb.has-strip .sgal-lb-bar{bottom:82px}
  .sgal-lb-th{width:84px;height:47px}
  .sgal-play{width:52px;height:52px}
  .sgal-play svg{width:24px;height:24px}
  .sgal-play-t{padding:40px 12px 12px}
  .sgal-play-cap{font-size:.86rem;padding-right:0}
  .sgal-lb-prev{left:4px}
  .sgal-lb-next{right:4px}
  .sgal-lb-bar{padding:0 18px}
}
@supports (height:100dvh){
  @media (max-width:760px){
    .sgal-lb-img,.sgal-lb-video{max-height:calc(100dvh - 150px)}
  }
}
@media (max-width:480px){
  .sgal-head{gap:16px;margin-bottom:20px !important;padding-bottom:18px}
  .sgal-ava{width:62px;height:62px;flex-basis:62px;border-width:2px}
  .sgal-ava-w{padding:2px}
  .sgal-head-s{gap:14px}
  .sgal--preset-instagram .sgal-tabs{gap:26px}
  .sgal-head-t{font-size:1.1rem}
  .sgal--carousel .sgal-cell{flex-basis:calc(100% - 40px)}
  /* на телефон табовете се плъзгат настрани като в Инстаграм, не се чупят на редове */
  .sgal-tabs{gap:22px;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;padding:0 2px}
  .sgal-tabs::-webkit-scrollbar{display:none}
  .sgal-tab{font-size:11px;letter-spacing:.09em;padding:12px 0;white-space:nowrap;flex:0 0 auto}
  .sgal-zoom,.sgal-zoom svg{width:24px;height:24px}
  .sgal-lb-btn{width:38px;height:38px}
}
@media (hover:none){
  .sgal-veil,.sgal-zoom,.sgal-over,.sgal-ig{display:none}
}
@media (prefers-reduced-motion:reduce){
  .sgal *,.sgal-lb *{transition:none !important;animation:none !important}
  .sgal--hover-zoom .sgal-cell:hover .sgal-img{transform:none}
  .sgal--hover-lift .sgal-cell:hover{transform:none}
  .sgal--hover-insta .sgal-cell:hover .sgal-img{transform:none}
  .sgal--hover-play .sgal-cell:hover .sgal-img{transform:none}
  .sgal-cell--video:hover .sgal-play{transform:translate(-50%,-50%)}
}
@media (hover:none){
  /* на телефон „hover“ залепва след докосване — докато върви, големият бутон стои скрит; докосване по клипа = пауза */
  .sgal-lb-player:not(.is-paused) .sgal-vp-big{opacity:0;transform:scale(.9)}
}
