/* Independent additions for the Misha Ugol portfolio */
html { scroll-behavior: smooth; }
body { background: #111; }
figure img[role="button"] { cursor: zoom-in; }
/* Fill grid cells without distortion: crop to the cell instead of stretching. */
.sb-image-crop:not(.sb-image-crop_placeholder) { object-fit: cover; object-position: 50% 50%; }
figure img[role="button"]:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
/* Keep the original desktop composition while making small-screen spacing deliberate. */
@media (max-width: 639px) {
  .s-slider-type-3__slide { min-height: 100svh; min-height: 100vh; }
  .s-slider-type-3__slide-content { padding-bottom: 92px; }
  .s-slider-type-3__row { padding-top: 32px; padding-bottom: 32px; }
  .s-gallery-type-4, .s-gallery-type-3 { padding-top: 32px; padding-bottom: 32px; }
  .s-gallery-type-4__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-gallery-type-4__item { min-width: 0; }
  .s-gallery-type-3 .sb-row { margin-left: -8px; margin-right: -8px; }
  .s-gallery-type-3 .sb-row > [class*="sb-col_"] { padding-left: 8px; padding-right: 8px; }
  .s-gallery-type-3__image-wrapper { overflow: hidden; }
  .s-gallery-type-3__description { font-size: 13px; line-height: 1.35; }
  .s-gallery__top { padding-left: 0; padding-right: 0; }
  .s-header-type-1 .sb-container, .s-header-type-2 .sb-container { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 380px) {
  .s-gallery-type-4__list { grid-template-columns: 1fr; }
}
/* Full-screen photo viewer */
.photo-viewer { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: 56px 72px 64px; background: rgba(0,0,0,.96); color: #fff; box-sizing: border-box; }
.photo-viewer.is-open { display: flex; }
.photo-viewer__figure { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; margin: 0; }
.photo-viewer__image { display: block; max-width: min(100%, 1500px); max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); width: auto; height: auto; object-fit: contain; cursor: default; }
.photo-viewer__caption { margin-top: 12px; color: rgba(255,255,255,.8); font: 13px/1.4 Inter, Arial, sans-serif; text-align: center; }
.photo-viewer__close, .photo-viewer__nav { position: absolute; z-index: 2; display: grid; place-items: center; color: #fff; background: transparent; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.photo-viewer__close { top: 14px; right: 22px; width: 44px; height: 44px; font: 36px/1 Arial, sans-serif; }
.photo-viewer__nav { top: 50%; width: 48px; height: 64px; transform: translateY(-50%); font: 54px/1 Arial, sans-serif; opacity: .8; }
.photo-viewer__nav:hover, .photo-viewer__close:hover { opacity: .65; }
.photo-viewer__prev { left: 12px; }
.photo-viewer__next { right: 12px; }
.photo-viewer__count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.55); font: 12px/1.4 Inter, Arial, sans-serif; }
@media (max-width: 639px) {
  .photo-viewer { padding: 44px 10px 58px; }
  .photo-viewer__image { max-width: 100%; max-height: calc(100svh - 112px); }
  .photo-viewer__close { top: 4px; right: 8px; }
  .photo-viewer__nav { width: 34px; height: 54px; font-size: 42px; background: rgba(0,0,0,.18); }
  .photo-viewer__prev { left: 0; }
  .photo-viewer__next { right: 0; }
}
body.viewer-open { overflow: hidden; }
