/* Standalone component: no inherited carousel transforms or fullscreen geometry. */
.os-gallery {
  --og-bg: #f0f2ed;
  position: relative;
  max-width: 100%;
  color: #243220;
}
.os-gallery *, .os-gallery-modal * {
  box-sizing: border-box;
}
.os-gallery__grid {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--og-bg);
}
.os-gallery figure {
  margin: 0;
  min-width: 0;
  position: relative;
}
.os-gallery__tile>a {
  display: block;
  position: relative;
  overflow: hidden;
}
.os-gallery__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.os-gallery__primary>a {
  aspect-ratio: 3/2;
}
.os-gallery__primary figcaption {
  padding: 10px 14px;
  font-size: 14px;
  background: #f0f2ed;
  line-height: 1.5;
}
.os-gallery__secondary {
  display: none;
}
.os-gallery__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0008;
  color: white;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  padding: 14px;
}
.os-gallery__inline-controls {
  position: absolute;
  inset: 0 10px auto;
  top: calc((100cqw * 2 / 3) / 2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}
.os-gallery {
  container-type: inline-size;
}
.os-gallery button,.os-gallery-modal button {
  font: inherit;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #ffffff70;
  border-radius: 50%;
  background: #17201cda;
  color: #fff;
  line-height: 1;
  font-size: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 8px;
  pointer-events: auto;
}
.os-gallery [hidden],.os-gallery-modal [hidden] {
  display: none!important;
}
.os-gallery button:disabled,.os-gallery-modal button:disabled {
  opacity: .35;
  cursor: default;
}
.os-gallery a:focus-visible,.os-gallery button:focus-visible,.os-gallery-modal :focus-visible {
  outline: 3px solid #95d438;
  outline-offset: 3px;
}
.os-gallery__inline-controls [data-gallery-expand] {
  position: absolute;
  right: 0;
  transform: translateY(calc(-100cqw / 3 + 40px));
  font-size: 24px;
}
/* Keep controls inside the photo in engines predating container query units. */
@supports not (width: 1cqw) {
  .os-gallery__inline-controls {
    top: 12px;
    transform: none;
  }
  .os-gallery__inline-controls [data-gallery-expand] {
    right: 54px;
    transform: none;
  }
}
.os-gallery__strip-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  position: relative;
  margin-top: 10px;
}
.os-gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scroll-padding: 4px;
  position: relative;
  min-width: 0;
  padding: 5px 3px 8px;
  flex: 1;
}
.os-gallery__thumbs>a {
  display: block;
  width: 80px;
  height: 58px;
  flex: 0 0 80px;
  position: relative;
  background: #d9ded5;
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid transparent;
  color: #21321c;
  text-decoration: none;
}
.os-gallery__thumbs>a[aria-current] {
  border-color: #71a919;
  box-shadow: 0 0 0 1px #71a919;
}
.os-gallery__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media(hover:hover) and (pointer:fine) {
  .os-gallery__thumbs,.os-gallery__thumbs>a {
    cursor: grab;
    user-select: none;
  }
  .os-gallery__thumbs.is-dragging,.os-gallery__thumbs.is-dragging>a {
    cursor: grabbing;
  }
}
.os-gallery__thumb-number {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #142019df;
  color: white;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px 0 0 0;
}
.os-gallery .os-gallery__strip-arrow,.os-gallery-modal .os-gallery__strip-arrow {
  font-size: 25px;
  width: 44px;
}
.os-gallery__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.os-gallery.is-single .os-gallery__strip-shell,.os-gallery.is-single [data-gallery-prev],.os-gallery.is-single [data-gallery-next] {
  display: none;
}
.os-gallery-modal {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  background: #101612;
  color: #fff;
  overflow: hidden;
  grid-template-rows: auto minmax(0,1fr) auto;
  font-family: inherit;
}
.os-gallery-modal[open] {
  display: grid;
  gap: 8px;
}
.os-gallery-modal::backdrop {
  background: #101612;
}
.os-gallery-modal__top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  font-size: 15px;
}
.os-gallery-modal__counter {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.os-gallery-modal__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: zoom-in;
  border-radius: 4px;
  outline-offset: -3px!important;
}
.os-gallery-modal__stage.is-zoomed {
  cursor: grab;
}
.os-gallery-modal__viewport {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.os-gallery-modal__viewport img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
}
.os-gallery-modal__prev,.os-gallery-modal__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.os-gallery-modal__prev {
  left: 4px;
}
.os-gallery-modal__next {
  right: 4px;
}
.os-gallery-modal__status {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
  padding: 0 52px;
  font-size: 14px;
}
.os-gallery-modal__stage>button:not(.os-gallery-modal__prev):not(.os-gallery-modal__next) {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  border-radius: 6px;
  padding: 8px 16px;
}
.os-gallery-modal footer {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 4px 12px;
  min-width: 0;
}
.os-gallery-modal__caption {
  align-self: center;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  max-height: 30dvh;
  overflow-y: auto;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}
.os-gallery-modal__tools {
  display: flex;
  gap: 6px;
  align-items: center;
}
.os-gallery-modal__tools button {
  font-size: 24px;
}
.os-gallery-modal .os-gallery__strip-shell {
  grid-column: 1/-1;
  margin: 0;
}
.os-gallery-modal .os-gallery__thumbs>a {
  background: #364238;
}
.os-gallery-modal .os-gallery__thumbs>a[aria-current] {
  border-color: #a2d656;
  box-shadow: 0 0 0 1px #a2d656;
}
@media(min-width:768px) {
  .os-gallery--mosaic .os-gallery__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: minmax(0,1fr) minmax(0,1fr);
    gap: 8px;
    aspect-ratio: 3/1;
  }
  .os-gallery--mosaic .os-gallery__primary {
    grid-row: 1/3;
  }
  .os-gallery--mosaic .os-gallery__primary>a {
    height: 100%;
    aspect-ratio: auto;
  }
  .os-gallery--mosaic .os-gallery__secondary {
    display: block;
  }
  .os-gallery--mosaic .os-gallery__secondary>a,.os-gallery--mosaic .os-gallery__secondary picture {
    display: block;
    height: 100%;
  }
  .os-gallery--mosaic .os-gallery__primary figcaption,.os-gallery--mosaic .os-gallery__inline-controls,.os-gallery--mosaic .os-gallery__strip-shell {
    display: none;
  }
  .os-gallery-modal {
    padding: 16px 32px;
    gap: 12px;
  }
  .os-gallery-modal footer {
    width: min(1100px,100%);
    justify-self: center;
  }
  .os-gallery-modal .os-gallery__thumbs>a {
    width: 88px;
    flex-basis: 88px;
    height: 64px;
  }
}
@media(max-width:767px) {
  .os-gallery__strip-arrow,.os-gallery-modal .os-gallery__strip-arrow {
    display: none!important;
  }
  .os-gallery-modal footer {
    grid-template-columns: minmax(0,1fr);
  }
  .os-gallery-modal__tools {
    grid-row: 1;
    justify-self: end;
  }
  .os-gallery-modal__caption {
    grid-row: 2;
    grid-column: 1/-1;
  }
  .os-gallery-modal .os-gallery__strip-shell {
    grid-row: 3;
  }
  .os-gallery-modal__top {
    font-size: 14px;
  }
  .os-gallery-modal__tools button {
    min-width: 44px;
    min-height: 44px;
  }
  .os-gallery-modal .os-gallery__thumbs {
    gap: 6px;
  }
  .os-gallery-modal .os-gallery__thumbs>a {
    width: 72px;
    flex-basis: 72px;
    height: 52px;
  }
}
@media(max-height:480px) {
  .os-gallery-modal {
    gap: 2px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .os-gallery-modal footer {
    grid-template-columns: minmax(0,1fr) auto;
  }
  .os-gallery-modal__tools {
    grid-row: 1;
    grid-column: 2;
  }
  .os-gallery-modal__caption {
    grid-row: 1;
    grid-column: 1;
  }
  .os-gallery-modal .os-gallery__strip-shell {
    grid-row: 2;
  }
  .os-gallery-modal .os-gallery__thumbs>a {
    height: 44px;
  }
  .os-gallery-modal__top {
    min-height: 44px;
  }
  .os-gallery-modal__caption {
    max-height: 25dvh;
  }
}
@media(prefers-reduced-motion:reduce) {
  .os-gallery *,.os-gallery-modal * {
    scroll-behavior: auto!important;
    transition: none!important;
  }
}
@media print {
  .os-gallery-modal,.os-gallery__strip-shell,.os-gallery__inline-controls {
    display: none!important;
  }
}
.os-gallery__primary>a {
  touch-action: pan-y pinch-zoom;
}
.os-gallery__primary figcaption button {
  font-size: 14px;
  border-radius: 6px;
  padding: 8px 12px;
}
.os-gallery:not(.os-gallery--mosaic) .os-gallery__primary img {
  object-fit: contain;
}
.os-gallery__primary figcaption {
  min-height: 3em;
  overflow-wrap: anywhere;
}
@media(max-width:767px) {
  .os-gallery__primary img {
    object-fit: contain;
  }
}
@media(min-width:768px) {
  .os-gallery--mosaic[data-gallery-count="1"] .os-gallery__grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    aspect-ratio: 3/2;
  }
  .os-gallery--mosaic[data-gallery-count="2"] .os-gallery__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    aspect-ratio: 3/1;
  }
  .os-gallery--mosaic[data-gallery-count="2"] .os-gallery__primary {
    grid-row: 1;
  }
  .os-gallery--mosaic[data-gallery-count="3"] .os-gallery__grid {
    grid-template-columns: 2fr 1fr;
  }
  .os-gallery--mosaic[data-gallery-count="4"] .os-gallery__tile:nth-child(2) {
    grid-row: 1/3;
  }
}
.os-gallery__tile {
  min-height: 0;
}
.os-gallery__tile>a>img,.os-gallery__tile>a>picture>img {
  position: absolute;
  inset: 0;
}
.os-gallery-modal__title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.os-gallery-modal__status.is-loading {
  font-size: 0;
}
.os-gallery-modal__status.is-loading::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #ffffff40;
  border-top-color: #fff;
  border-radius: 50%;
  animation: os-gallery-spin .75s linear infinite;
}
@keyframes os-gallery-spin {
  to {
    transform: rotate(360deg);
  }
}
@media(max-width:767px) {
  .os-gallery {
    width: 100vw;
    max-width: none;
    margin-inline: calc(50% - 50vw);
  }
  .os-gallery__grid {
    border-radius: 0;
  }
  .os-gallery__thumbs {
    padding-inline: 12px;
  }
  .os-gallery-modal {
    padding-left: 0;
    padding-right: 0;
  }
  .os-gallery-modal__top,.os-gallery-modal footer {
    padding-left: max(12px,env(safe-area-inset-left));
    padding-right: max(12px,env(safe-area-inset-right));
  }
  .os-gallery-modal__stage {
    border-radius: 0;
  }
  .os-gallery-modal__caption {
    max-height: 30dvh;
  }
}
@media(max-height:480px) {
  .os-gallery-modal__title {
    max-height: 3em;
    overflow-y: auto;
  }
  .os-gallery-modal__caption {
    max-height: 25dvh;
  }
}
@media(prefers-reduced-motion:reduce) {
  .os-gallery-modal__status.is-loading::before {
    animation: none;
  }
}
/* One optical size and stroke weight for all gallery controls. */
.os-gallery button.os-gallery__icon-button,.os-gallery-modal button.os-gallery__icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  border-color: #ffffff52;
  background: #17201cb8;
}
.os-gallery__icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
@media(hover:hover) {
  .os-gallery__icon-button:hover {
    background: #25372bef!important;
    border-color: #ffffff8c!important;
  }
}
/* Repeated taps operate gallery buttons, never Safari's page-zoom gesture.
   Scope none to button hit areas; page/text pinch zoom and thumbnail scrolling remain available. */
.os-gallery button,.os-gallery-modal button {
  touch-action: none;
}

@media (min-width:768px) {
  .os-gallery--mosaic.has-inline-error .os-gallery__primary figcaption {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
  }
}
