:root {
  --ui-color: #5a2ca0;
  --cross-px: 100px;
  --bg: #121212;
  --gallery-vh: 100dvh;
  --touch-ui-bottom-gap: calc(16px + var(--corner-pad-y) + var(--corner-pad-y) + var(--corner-offset) + var(--corner-offset) + env(safe-area-inset-bottom, 0px));
  --text-stack-gap: 16px;
  --corner-offset: 10px;
  --corner-pad-y: 6px;
  --corner-pad-x: 8px;
  --nav-arrow-inset: 110px;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: #fff;
}

.gallery-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: var(--gallery-vh);
}

.gallery-slider {
  display: flex;
  width: 100%;
  height: 100%;
  transition: none;
}

.gallery-page {
  flex: 0 0 100vw;
  height: 100vh;
  height: var(--gallery-vh);
  position: relative;
  overflow: hidden;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  z-index: 20;
  cursor: pointer;
  display: none;
  padding: 0;
}

.arrow.left {
  left: var(--nav-arrow-inset);
  transform: translateY(-50%);
}

.arrow.right {
  right: var(--nav-arrow-inset);
  transform: translateY(-50%);
}

.arrow[disabled] {
  opacity: .35;
  pointer-events: none;
}

.arrow svg {
  width: 42px;
  height: 42px;
  color: #fff;
  stroke: currentColor;
  fill: none;
  display: block;
  pointer-events: none;
}

.cross-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--cross-px);
  height: var(--cross-px);
  z-index: 30;
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.cross-btn svg {
  width: 100%;
  height: 100%;
  fill: var(--ui-color);
}

.page-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  overflow: hidden;
}

@media (max-width: 1194px) {
  html,
  body {
    width: 100%;
    height: var(--gallery-vh);
    background: var(--bg);
  }

  .gallery-page[data-type="text"] {
    overflow: hidden;
  }

  .gallery-page[data-type="text"] .page-wrap {
    position: relative;
    height: 100%;
    min-height: 100%;
    align-items: flex-start;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
  }

  .gallery-page[data-type="text"] .page-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--touch-ui-bottom-gap);
    background: inherit;
    pointer-events: none;
    z-index: 25;
  }
}

.page-inner {
  display: inline-block;
  flex: 0 0 auto;
  min-width: max-content;
  min-height: max-content;
  max-width: none;
}

.page-inner img {
  width: auto;
  display: block;
  max-width: none;
  flex: 0 0 auto;
}

.scroll-y {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.info {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.info-col {
  width: 33.333%;
  height: 100%;
  box-sizing: border-box;
  padding: 1rem;
  overflow: auto;
  min-height: 0;
}

@media (min-width: 1195px) {
  .info-col {
    scrollbar-width: thin;
    -ms-overflow-style: none;
    scrollbar-color: transparent transparent;
  }

  .info-col::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .info-col::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
  }

  .info-col::-webkit-scrollbar-track {
    background: transparent;
  }

  .info-col:hover {
    scrollbar-color: color-mix(in srgb, currentColor 45%, transparent) transparent;
  }

  .info-col:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, currentColor 45%, transparent);
  }
}

@media (max-width: 1194px) {
  .info {
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0 0;
    padding-bottom: var(--touch-ui-bottom-gap);
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: var(--text-stack-gap);
  }

  .info::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .info-col {
    width: 100%;
    height: auto;
    min-height: auto;
    overflow: visible;
    padding: 0 1rem;
  }

  .info-col.is-empty {
    display: none;
  }
}

.subwrap {
  display: flex;
  gap: var(--text-stack-gap);
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.subwrap.has-two-subs {
  flex-direction: row;
}

@media (max-width: 1194px) {
  .subwrap {
    flex-direction: column;
    height: auto !important;
    min-height: 0;
    align-items: stretch;
    gap: var(--text-stack-gap);
  }

  .subwrap.has-two-subs {
    flex-direction: row;
  }

  .subwrap .sub {
    width: auto;
    flex: 1 1 0;
    min-height: 0;
  }
}

.sub {
  flex: 1;
  overflow: visible;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

.sub img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
}

.sub a {
  color: inherit;
  font: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.sub strong,
.sub b {
  font-weight: 700;
}

.sub > :first-child {
  margin-top: 0;
}

.sub > :last-child {
  margin-bottom: 0;
}

.sub .ql-align-center {
  text-align: center;
}

.sub .ql-align-right {
  text-align: right;
}

.sub .ql-align-justify {
  text-align: justify;
}

@media (max-width: 1194px) {
  .sub {
    flex: 1 1 0;
    width: auto;
    overflow: visible;
  }
}

@media (max-width: 600px) {
  .subwrap,
  .subwrap.has-two-subs {
    flex-direction: column !important;
  }

  .subwrap .sub,
  .sub {
    width: 100%;
    flex: 0 0 auto;
  }
}

.touch-btn {
  position: fixed;
  bottom: calc(var(--corner-offset) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: none;
  text-decoration: none;
  background: transparent;
  padding: var(--corner-pad-y) var(--corner-pad-x);
  border-radius: 10px;
  letter-spacing: .2px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 1194px) {
  .touch-btn {
    bottom: calc(var(--corner-offset) + env(safe-area-inset-bottom, 0px));
  }
}

.touch-btn.menu {
  left: calc(var(--corner-offset) + env(safe-area-inset-left, 0px));
}

.touch-btn.back {
  right: calc(var(--corner-offset) + env(safe-area-inset-right, 0px));
}

@media (max-width: 1194px) {
  .arrow {
    display: none !important;
  }

  .cross-btn {
    display: none !important;
  }

  .touch-btn {
    display: inline-block;
  }
}

.subwrap.stacked-mobile-tablet {
  flex-direction: column !important;
  height: auto !important;
  min-height: 0;
  align-items: stretch;
}

.subwrap.stacked-mobile-tablet .sub {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
}
