/* =========================================================
   MSCinteract · mobile-warning.css
   The greeting for a reader on a phone: the explorer is drawn for a wide
   screen, and on a narrow one the pieces may fall out of place. The sheet says
   so before the reader takes the numbers for granted.
   ========================================================= */

.mwarn {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;                 /* over the toast (90), under nothing else */
  display: flex;
  justify-content: center;
  padding: 0 10px 10px;
  pointer-events: none;        /* the sheet alone takes the clicks */
}

.mwarn__sheet {
  pointer-events: auto;
  width: min(520px, 100%);
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  padding: 15px 16px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  animation: mwarn-up .3s cubic-bezier(.2, .75, .3, 1);
}

@keyframes mwarn-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* the head: the sign of the warning and the title of the sheet */
.mwarn__head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.mwarn__mark {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}

.mwarn__title {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.mwarn__text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* the button that lets the reader through */
.mwarn__ok {
  margin-top: 14px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease;
}
.mwarn__ok:hover { background: var(--accent-dark); }
.mwarn__ok:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The sheet stands in front of the page: the room it takes is kept free under
   the content, so that nothing hides behind it. The height is measured by the
   script and handed over as a variable. */
html.has-mobile-warning .site-main {
  padding-bottom: calc(var(--mwarn-h, 240px) + 20px);
}

/* The page behind the sheet stands still while the sheet is up: the reader
   reads the warning first, and the figures of the explorer do not move under
   the finger. The page is let go when the sheet has been acknowledged. */
html.has-mobile-warning {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
  .mwarn__sheet { animation: none; }
}
