/*
 * Reset and base element styles.
 *
 * Deliberately small: this is a static build with no framework, so anything that can be
 * expressed as a sensible default on an element lives here rather than being repeated as a
 * class on every tag.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

body {
  min-height: 100%;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: -0.011em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

svg {
  /* Icons are stroked, sized by width/height, and inherit the text colour. */
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/*
 * Every icon from js/icons.js carries this alongside its size class.
 *
 * It exists so an icon can never be squeezed by a flex parent and never picks up a stray
 * baseline gap — both of which show up as a one-pixel wobble down a column of table rows.
 */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

dl,
dd,
dt {
  margin: 0;
}

pre,
code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tabular figures everywhere a number is compared down a column: member IDs, money,
   days remaining, visit counts. Proportional digits make a table impossible to scan. */
.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

/* The member holds the phone at arm's length under gym lighting — never shrink this. */
.qr-surface {
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-raised) 25%,
    var(--border) 37%,
    var(--surface-raised) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 0.5rem;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

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