/* Keep page chrome still; only the reading area scrolls, including on mobile. */
body.scroll-page {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.scroll-page > .header,
.scroll-page > .header2,
.scroll-page > .language-selector,
.scroll-page > .news-nav {
  flex-shrink: 0;
}

.scroll-page :is(.legalText, .content) {
  box-sizing: border-box;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgb(0 0 0 / 20%) 0.375rem, rgb(0 0 0 / 80%) 1.125rem, #000 1.5rem, #000 calc(100% - 1.5rem), rgb(0 0 0 / 80%) calc(100% - 1.125rem), rgb(0 0 0 / 20%) calc(100% - 0.375rem), transparent);
  mask-image: linear-gradient(to bottom, transparent, rgb(0 0 0 / 20%) 0.375rem, rgb(0 0 0 / 80%) 1.125rem, #000 1.5rem, #000 calc(100% - 1.5rem), rgb(0 0 0 / 80%) calc(100% - 1.125rem), rgb(0 0 0 / 20%) calc(100% - 0.375rem), transparent);
}

/* Normal document flow prevents paragraphs shrinking to fit instead of scrolling. */
.scroll-page .legalText:not(.news-list) { display: block; }

.scroll-page > .footer {
  position: static;
  flex-shrink: 0;
}

/* Give About an explicit scroll viewport rather than relying on flex sizing. */
body.about-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.about-page > .header { grid-row: 1; }
.about-page > .legalText {
  grid-row: 2;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  font-size: max(1rem, 2vh);
  touch-action: pan-y;
}
.about-page > .footer { grid-row: 3; }
