/* Royal Stone CMS Pro 10.2.0 — Unified Gallery & Mobile Portfolio Experience */
html.rs-gallery-open,
body.rs-gallery-open {
  overscroll-behavior: none;
}

body.rs-gallery-v10200 .rs-gallery-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.rs-gallery-v10200 .rs-gallery-media {
  position: relative !important;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity .17s ease, filter .17s ease;
}

body.rs-gallery-v10200 .rs-gallery-media.rs-gallery-media--changing {
  opacity: .82;
  filter: saturate(.88);
}

body.rs-gallery-v10200 .rs-gallery-media.rs-gallery-media--dragging {
  cursor: grabbing;
}

body.rs-gallery-v10200 .rs-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0 0 4px;
  transform: translateY(-50%);
  border: 1px solid rgba(244, 212, 123, .62);
  border-radius: 999px;
  background: rgba(8, 7, 6, .72);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .42);
  color: #fffaf0;
  font: 400 42px/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .18s ease, color .18s ease, transform .18s ease, opacity .18s ease;
}

body.rs-gallery-v10200 .rs-gallery-nav:hover,
body.rs-gallery-v10200 .rs-gallery-nav:focus-visible {
  background: #e2bc62;
  color: #17120d;
  outline: 2px solid rgba(255, 255, 255, .88);
  outline-offset: 2px;
}

body.rs-gallery-v10200 .rs-gallery-nav:active {
  transform: translateY(-50%) scale(.94);
}

body.rs-gallery-v10200 .rs-gallery-nav--previous { left: 14px; }
body.rs-gallery-v10200 .rs-gallery-nav--next { right: 14px; }
body.rs-gallery-v10200 .rs-gallery-nav[hidden] { display: none !important; }

body.rs-gallery-v10200 .rs-gallery-counter {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 11;
  min-width: 62px;
  padding: 8px 11px;
  border: 1px solid rgba(244, 212, 123, .50);
  border-radius: 999px;
  background: rgba(8, 7, 6, .76);
  color: #fffaf0;
  font: 800 12px/1.1 Inter, Manrope, system-ui, sans-serif;
  text-align: center;
  letter-spacing: .08em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.rs-gallery-v10200 .rs-gallery-counter[hidden] { display: none !important; }

body.rs-gallery-v10200 .rs-gallery-strip {
  display: flex;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 11px 12px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 188, 98, .62) rgba(255, 255, 255, .08);
  background: rgba(9, 8, 7, .96);
  border-top: 1px solid rgba(244, 212, 123, .18);
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

body.rs-gallery-v10200 .rs-gallery-strip[hidden] { display: none !important; }
body.rs-gallery-v10200 .rs-gallery-strip::-webkit-scrollbar { height: 5px; }
body.rs-gallery-v10200 .rs-gallery-strip::-webkit-scrollbar-track { background: rgba(255, 255, 255, .06); }
body.rs-gallery-v10200 .rs-gallery-strip::-webkit-scrollbar-thumb { background: rgba(226, 188, 98, .62); border-radius: 999px; }

body.rs-gallery-v10200 .rs-gallery-thumb {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 78px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  scroll-snap-align: center;
  border: 1px solid rgba(244, 212, 123, .24);
  border-radius: 10px;
  background-color: #15120f;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
  cursor: pointer;
  opacity: .70;
  transition: opacity .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

body.rs-gallery-v10200 .rs-gallery-thumb:hover,
body.rs-gallery-v10200 .rs-gallery-thumb:focus-visible,
body.rs-gallery-v10200 .rs-gallery-thumb.is-active,
body.rs-gallery-v10200 .rs-gallery-thumb[aria-current="true"] {
  opacity: 1;
  border-color: rgba(244, 212, 123, .92);
  box-shadow: 0 0 0 2px rgba(226, 188, 98, .20), 0 12px 28px rgba(0, 0, 0, .32);
}

body.rs-gallery-v10200 .rs-gallery-thumb:hover { transform: translateY(-2px); }
body.rs-gallery-v10200 .rs-gallery-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Portfolio: the whole card remains inside the viewport and its text is scrollable. */
body.rs-gallery-v10200 .rs-portfolio-modal {
  padding: 12px !important;
}

body.rs-gallery-v10200 .rs-portfolio-modal__dialog {
  display: flex !important;
  flex-direction: column !important;
  width: min(1120px, 100%) !important;
  height: min(920px, calc(100dvh - 24px)) !important;
  max-height: calc(100dvh - 24px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 22px !important;
}

body.rs-gallery-v10200 .rs-portfolio-modal__image {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: clamp(310px, 54dvh, 560px) !important;
  min-height: 0 !important;
  background-position: center !important;
  background-size: cover !important;
}

body.rs-gallery-v10200 .rs-portfolio-modal__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-content: start !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 188, 98, .55) rgba(255, 255, 255, .06);
}

body.rs-gallery-v10200 .rs-portfolio-modal__body > div:first-child {
  min-width: 0;
}

body.rs-gallery-v10200 .rs-portfolio-modal__body h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.rs-gallery-v10200 .rs-portfolio-modal__body p,
body.rs-gallery-v10200 .rs-portfolio-modal__body li {
  overflow-wrap: anywhere;
}

body.rs-gallery-v10200 .rs-portfolio-modal__thumbs.rs-gallery-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  max-height: 282px;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
  border: 0;
}

body.rs-gallery-v10200 .rs-portfolio-modal__thumbs .rs-gallery-thumb {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  flex-basis: auto;
}

body.rs-gallery-v10200 .rs-portfolio-modal__close,
body.rs-gallery-v10200 .rs-product-modal__close,
body.rs-gallery-v10200 .rs-ml-lightbox-close {
  z-index: 20 !important;
  width: 46px !important;
  height: 46px !important;
  line-height: 1 !important;
  background: rgba(8, 7, 6, .78) !important;
  border-color: rgba(244, 212, 123, .62) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .34);
}

/* Products and materials: persistent image controls plus a thumbnail rail. */
body.rs-gallery-v10200 .rs-product-modal,
body.rs-gallery-v10200 .rs-ml-lightbox {
  padding: 12px !important;
}

body.rs-gallery-v10200 .rs-product-modal__dialog,
body.rs-gallery-v10200 .rs-ml-lightbox-dialog {
  display: flex !important;
  flex-direction: column !important;
  width: min(980px, 100%) !important;
  height: min(860px, calc(100dvh - 24px)) !important;
  max-height: calc(100dvh - 24px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 20px !important;
}

body.rs-gallery-v10200 .rs-product-modal__image,
body.rs-gallery-v10200 .rs-ml-lightbox-image {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: clamp(290px, 54dvh, 540px) !important;
  min-height: 0 !important;
  background-position: center !important;
  background-size: cover !important;
}

body.rs-gallery-v10200 .rs-product-modal__body,
body.rs-gallery-v10200 .rs-ml-lightbox-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 188, 98, .55) rgba(255, 255, 255, .06);
}

body.rs-gallery-v10200 .rs-product-modal__body h3,
body.rs-gallery-v10200 .rs-ml-lightbox-title {
  overflow-wrap: anywhere;
}

body.rs-gallery-v10200 .rs-gallery-strip--products,
body.rs-gallery-v10200 .rs-gallery-strip--materials {
  flex: 0 0 auto;
}

@media (max-width: 780px) {
  body.rs-gallery-v10200 .rs-portfolio-modal,
  body.rs-gallery-v10200 .rs-product-modal,
  body.rs-gallery-v10200 .rs-ml-lightbox {
    align-items: stretch !important;
    padding: max(7px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)) !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__dialog,
  body.rs-gallery-v10200 .rs-product-modal__dialog,
  body.rs-gallery-v10200 .rs-ml-lightbox-dialog {
    width: 100% !important;
    height: calc(100dvh - 14px) !important;
    max-height: calc(100dvh - 14px) !important;
    border-radius: 22px !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__image {
    height: clamp(280px, 48dvh, 470px) !important;
  }

  body.rs-gallery-v10200 .rs-product-modal__image,
  body.rs-gallery-v10200 .rs-ml-lightbox-image {
    height: clamp(260px, 46dvh, 450px) !important;
  }

  body.rs-gallery-v10200 .rs-gallery-nav {
    width: 46px;
    height: 46px;
    padding-bottom: 3px;
    font-size: 36px;
  }

  body.rs-gallery-v10200 .rs-gallery-nav--previous { left: 10px; }
  body.rs-gallery-v10200 .rs-gallery-nav--next { right: 10px; }
  body.rs-gallery-v10200 .rs-gallery-counter { right: 12px; bottom: 10px; }

  body.rs-gallery-v10200 .rs-portfolio-modal__body {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    padding: 18px !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__thumbs.rs-gallery-strip {
    order: -1;
    display: flex !important;
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    gap: 10px;
    padding: 0 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__thumbs .rs-gallery-thumb,
  body.rs-gallery-v10200 .rs-gallery-strip--products .rs-gallery-thumb,
  body.rs-gallery-v10200 .rs-gallery-strip--materials .rs-gallery-thumb {
    flex: 0 0 calc((100% - 10px) / 2) !important;
    width: calc((100% - 10px) / 2) !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    scroll-snap-align: start;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__body h3 {
    font-size: clamp(30px, 9vw, 44px) !important;
    line-height: 1.01 !important;
    margin-bottom: 12px !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__body p {
    font-size: 16px !important;
    line-height: 1.58 !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__body ul {
    margin: 16px 0 20px !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__body .rs-portfolio-btn {
    width: 100%;
    min-height: 50px;
  }

  body.rs-gallery-v10200 .rs-product-modal__body,
  body.rs-gallery-v10200 .rs-ml-lightbox-body {
    padding: 18px !important;
  }

  body.rs-gallery-v10200 .rs-product-modal__body h3,
  body.rs-gallery-v10200 .rs-ml-lightbox-title {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.06 !important;
  }

  body.rs-gallery-v10200 .rs-product-modal__body p,
  body.rs-gallery-v10200 .rs-ml-lightbox-desc {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }

  body.rs-gallery-v10200 .rs-ml-lightbox-body {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  body.rs-gallery-v10200 .rs-ml-lightbox-meta {
    justify-content: flex-start !important;
  }
}

@media (max-width: 460px) {
  body.rs-gallery-v10200 .rs-portfolio-modal__image {
    height: clamp(250px, 45dvh, 410px) !important;
  }

  body.rs-gallery-v10200 .rs-product-modal__image,
  body.rs-gallery-v10200 .rs-ml-lightbox-image {
    height: clamp(240px, 43dvh, 390px) !important;
  }

  body.rs-gallery-v10200 .rs-gallery-strip {
    padding: 9px 10px 10px;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__body {
    padding: 16px !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__close,
  body.rs-gallery-v10200 .rs-product-modal__close,
  body.rs-gallery-v10200 .rs-ml-lightbox-close {
    right: 9px !important;
    top: 9px !important;
  }
}

@media (max-height: 680px) and (orientation: landscape) {
  body.rs-gallery-v10200 .rs-portfolio-modal__dialog,
  body.rs-gallery-v10200 .rs-product-modal__dialog,
  body.rs-gallery-v10200 .rs-ml-lightbox-dialog {
    display: grid !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__image,
  body.rs-gallery-v10200 .rs-product-modal__image,
  body.rs-gallery-v10200 .rs-ml-lightbox-image {
    grid-column: 1;
    grid-row: 1 / span 2;
    height: 100% !important;
    min-height: 0 !important;
  }

  body.rs-gallery-v10200 .rs-portfolio-modal__body,
  body.rs-gallery-v10200 .rs-product-modal__body,
  body.rs-gallery-v10200 .rs-ml-lightbox-body {
    grid-column: 2;
    grid-row: 1;
    overflow-y: auto !important;
  }

  body.rs-gallery-v10200 .rs-gallery-strip--products,
  body.rs-gallery-v10200 .rs-gallery-strip--materials {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.rs-gallery-v10200 .rs-gallery-media,
  body.rs-gallery-v10200 .rs-gallery-nav,
  body.rs-gallery-v10200 .rs-gallery-thumb {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
