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

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;
}

/* ---------- UI ---------- */

.brand-link {
  position: fixed;
  top: var(--corner-offset);
  left: var(--corner-offset);
  z-index: 40;
  text-decoration: none;
  color: #fff;
  padding: var(--corner-pad-y) var(--corner-pad-x);
  border-radius: 8px;
  background: transparent;
  line-height: 1;
}

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

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

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

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

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

/* ---------- IMAGE PAGE ---------- */

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

.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 ---------- */

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

/* ---------- TEXT PAGE (DESKTOP) ---------- */

.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);
  }
}

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

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

.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;
}

/* ---------- MOBILE & TABLET ---------- */

@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;
  }

  /* CUT LINE (bez blur, rovnaká farba) */
.gallery-page[data-type="text"] .page-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 56px;
  background: inherit;
  pointer-events: none;
  z-index: 25;
}

  /* SCROLL AREA */
  .info {
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    padding-top: 72px;
    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;
  }

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

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

  .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;
  }

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

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

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

/* ---------- MOBILE UI ---------- */

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