/*
 * Styles for the public pages. Load /site/theme.css first: it holds the app's Mantine theme as CSS variables
 * (generated from react-app/src/theme.ts) and Mantine's base styles, so these pages match the app. Values below
 * mirror the Mantine components the app uses; use theme variables rather than new colours or sizes.
 */

/* Colours Mantine sets per component and colour scheme, as on AppShell, Card and Paper. */
:root {
  --site-border: var(--mantine-color-gray-3);
  --site-surface: var(--mantine-color-white);
}

@media (prefers-color-scheme: dark) {
  :root {
    --site-border: var(--mantine-color-dark-4);
    --site-surface: var(--mantine-color-dark-6);
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--mantine-color-anchor);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--mantine-primary-color-filled);
  outline-offset: calc(0.125rem * var(--mantine-scale));
}

/* Like the app's AppShell.Header with a size="md" Container. */
.site-header {
  height: calc(3.75rem * var(--mantine-scale));
  border-bottom: 1px solid var(--site-border);
}

.site-header > div {
  height: 100%;
  max-width: calc(60rem * var(--mantine-scale));
  margin: 0 auto;
  padding: 0 var(--mantine-spacing-md);
  display: flex;
  align-items: center;
}

.brand,
.brand:hover {
  font-weight: 700;
  font-size: var(--mantine-font-size-lg);
  color: var(--mantine-color-text);
  text-decoration: none;
}

/* Like the app's AppShell.Main around a size="sm" Container, which has no padding of its own. */
.page {
  flex: 1;
  width: 100%;
  max-width: calc(45rem * var(--mantine-scale) + 2 * var(--mantine-spacing-md));
  margin: 0 auto;
  padding: var(--mantine-spacing-xl) var(--mantine-spacing-md);
}

h1 {
  font-family: var(--mantine-font-family-headings);
  font-size: var(--mantine-h2-font-size);
  line-height: var(--mantine-h2-line-height);
  font-weight: var(--mantine-h2-font-weight);
  margin: 0 0 var(--mantine-spacing-md);
}

.hero h1 {
  font-size: var(--mantine-h1-font-size);
  line-height: var(--mantine-h1-line-height);
  font-weight: var(--mantine-h1-font-weight);
  margin-top: var(--mantine-spacing-xl);
}

h2 {
  font-family: var(--mantine-font-family-headings);
  font-size: var(--mantine-h4-font-size);
  line-height: var(--mantine-h4-line-height);
  font-weight: var(--mantine-h4-font-weight);
  margin: var(--mantine-spacing-xl) 0 var(--mantine-spacing-xs);
}

p,
ul {
  margin: 0 0 var(--mantine-spacing-md);
}

.lead {
  font-size: var(--mantine-font-size-lg);
  color: var(--mantine-color-dimmed);
  margin-bottom: var(--mantine-spacing-xl);
}

.dimmed {
  font-size: var(--mantine-font-size-sm);
  color: var(--mantine-color-dimmed);
}

/* Labelled facts: label above value on phones, side by side on wider screens. */
.facts {
  margin: 0 0 var(--mantine-spacing-md);
}

.facts dt {
  font-size: var(--mantine-font-size-sm);
  color: var(--mantine-color-dimmed);
}

.facts dd {
  margin: 0 0 var(--mantine-spacing-sm);
}

@media (min-width: 36em) {
  .facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--mantine-spacing-xs) var(--mantine-spacing-lg);
  }

  .facts dt {
    font-size: inherit;
  }

  .facts dd {
    margin: 0;
  }
}

/* Like a filled Mantine Button, size="md". */
.button,
.button:hover {
  display: inline-flex;
  align-items: center;
  height: calc(2.625rem * var(--mantine-scale));
  padding: 0 calc(1.375rem * var(--mantine-scale));
  border-radius: var(--mantine-radius-default);
  background: var(--mantine-primary-color-filled);
  color: var(--mantine-primary-color-contrast);
  font-size: var(--mantine-font-size-md);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--mantine-primary-color-filled-hover);
}

.button:active {
  transform: translateY(calc(0.0625rem * var(--mantine-scale)));
}

.button + .dimmed {
  margin-top: var(--mantine-spacing-sm);
}

/* Like the app's bordered Cards in a Stack. */
.cards {
  list-style: none;
  padding: 0;
  margin: var(--mantine-spacing-xl) 0 0;
  display: grid;
  gap: var(--mantine-spacing-sm);
}

.cards li {
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: var(--mantine-radius-default);
  padding: var(--mantine-spacing-md);
}

.cards strong {
  display: block;
  font-weight: 600;
}

.cards span {
  font-size: var(--mantine-font-size-sm);
  color: var(--mantine-color-dimmed);
}

/* The same footer is in the app: react-app/src/components/SiteFooter.tsx. */
.site-footer {
  border-top: 1px solid var(--site-border);
  padding: var(--mantine-spacing-md);
  font-size: var(--mantine-font-size-sm);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--mantine-spacing-xs) var(--mantine-spacing-lg);
}

.site-footer a {
  color: var(--mantine-color-dimmed);
}
