/* p8riot Core 0.2.0 - Alpha 1
   Appearance-neutral browser, viewport, accessibility, and responsive
   foundations. Product styles should load after Core and module structural CSS. */

:root {
  --p8-safe-top: env(safe-area-inset-top, 0px);
  --p8-safe-right: env(safe-area-inset-right, 0px);
  --p8-safe-bottom: env(safe-area-inset-bottom, 0px);
  --p8-safe-left: env(safe-area-inset-left, 0px);
  --p8-visual-height: 100dvh;
  --p8-visual-width: 100vw;
  --p8-visual-offset-top: 0px;
  --p8-visual-offset-left: 0px;
  --p8-visual-scale: 1;
  --p8-touch-target: 44px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  /* 0.1 compatibility default. A configured 0.2 runtime adds
     .p8-overflow-modern and removes reliance on root clipping. */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: var(--p8-visual-height);
  overflow-x: clip;
  margin: 0;
}

/* New 0.2-configured products must expose real overflow so diagnostics and
   responsive QA catch it rather than hiding it. */
html.p8-overflow-modern,
html.p8-overflow-modern body {
  overflow-x: visible;
}

img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

button,
[role="button"],
input,
select,
textarea,
a {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.p8-safe-inline {
  padding-left: max(var(--p8-safe-left), var(--p8-safe-inline-min, 0px));
  padding-right: max(var(--p8-safe-right), var(--p8-safe-inline-min, 0px));
}

.p8-safe-block {
  padding-top: max(var(--p8-safe-top), var(--p8-safe-top-min, 0px));
  padding-bottom: max(var(--p8-safe-bottom), var(--p8-safe-bottom-min, 0px));
}

.p8-scroll-x {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.p8-no-overflow {
  min-width: 0;
  max-width: 100%;
}

@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: 16px;
  }

  button,
  [role="button"],
  input[type="button"],
  input[type="submit"] {
    min-height: var(--p8-touch-target);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@supports not (height: 100dvh) {
  :root {
    --p8-visual-height: calc(var(--p8-vh, 1vh) * 100);
  }
}
