/* Reset, typography and layout helpers shared by the website and the dashboard. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}

p,
ul,
ol,
dl,
blockquote,
figure {
  margin: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--speed) var(--ease);
}

a:hover {
  color: var(--color-blue-dark);
  text-decoration-thickness: 2px;
}

strong {
  font-weight: var(--weight-semibold);
}

hr {
  border: 0;
  border-top: var(--border);
  margin: var(--space-6) 0;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--color-sage-soft);
  color: var(--color-deep-dark);
}

[hidden] {
  display: none !important;
}

/* Accessibility helpers */

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

.skip {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: calc(var(--z-toast) + 1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-deep);
  color: var(--color-white);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.skip:focus {
  top: var(--space-3);
  color: var(--color-white);
}

/* Layout helpers */

.wrap {
  width: 100%;
  max-width: calc(var(--width-page) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure {
  max-width: var(--width-text);
}

.stack > * + * {
  margin-top: var(--space-4);
}

.stack-lg > * + * {
  margin-top: var(--space-6);
}

.muted {
  color: var(--color-text-muted);
}

.small {
  font-size: var(--text-sm);
}

.nowrap {
  white-space: nowrap;
}

/* Text that is waiting on confirmation from the business */

.placeholder {
  background: var(--color-warning-bg);
  color: var(--color-text);
  border-bottom: 1px dashed var(--color-warning);
  padding: 0 0.2em;
  border-radius: 3px;
}

.placeholder::after {
  content: "To confirm";
  margin-left: 0.45em;
  padding: 0.05em 0.45em;
  border-radius: var(--radius-pill);
  background: var(--color-warning);
  color: var(--color-white);
  font-size: 0.68em;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  vertical-align: 0.15em;
  white-space: nowrap;
}

/* Icons are inline SVG, sized from the surrounding text */

.icon {
  display: inline-block;
  vertical-align: -0.2em;
  width: 1.15em;
  height: 1.15em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
