/*
 * The pages of Mise en Place (miseenplace.berdiosolutions.app), in the app's default theme
 * "Vineyard" (mobile/src/theme/colors.ts) with its type scale, radii and background pattern
 * (mobile/src/constants/theme.ts, mobile/assets/images). Light and dark follow the device.
 */
:root {
  --background: #f6f1e4;
  --surface: #fffcf5;
  --tint: #e4d9b8;
  --primary: #647136;
  --on-primary: #ffffff;
  --accent: #b05b3c;
  --text: #33341e;
  --text-secondary: #5a5a3a;
  --pattern: url("vineyard-pattern.svg");
  --pattern-opacity: 0.55;
  --radius-control: 10px;
  --radius-surface: 18px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1b1a14;
    --surface: #262519;
    --tint: #3a3828;
    --primary: #a9ba63;
    --on-primary: #1b1a14;
    --accent: #dc8761;
    --text: #efead8;
    --text-secondary: #bdb89e;
    --pattern: url("vineyard-pattern-dark.svg");
    --pattern-opacity: 0.6;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  font: 500 16px/24px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* The theme's pattern, faded as in the app (Vineyard 0.55 light, 0.6 dark), as texture behind the cards. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--pattern);
  background-size: 400px 800px;
  opacity: var(--pattern-opacity);
  pointer-events: none;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

/* Top bar: the app icon and name, like the app's header. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 24px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
}

/* Screen title: the app's "display" type. */
h1 {
  font-size: 32px;
  line-height: 38px;
  font-weight: 800;
  margin: 0 0 8px;
}

.lead {
  color: var(--text-secondary);
  margin: 0 0 24px;
}

/* A grouped surface, like a section in the app. */
.card {
  background: var(--surface);
  border-radius: var(--radius-surface);
  padding: 16px 20px;
  margin: 0 0 16px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

/* Section headings: the app's "overline" type. */
.card h2 {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 4px 0 8px;
}

h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  margin: 16px 0 4px;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin: 4px 0;
}

a {
  color: var(--primary);
  font-weight: 600;
  text-underline-offset: 3px;
}

strong {
  font-weight: 700;
}

/* Chips: the app's compact pills (labels, filters). */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.chips li {
  margin: 0;
}

.chips a {
  display: inline-block;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  text-decoration: none;
}

/* Big tappable rows, like the app's list rows. */
.rows {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rows li {
  margin: 0;
  border-top: 1px solid var(--tint);
}

.rows li:first-child {
  border-top: 0;
}

.rows a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  color: var(--text);
  text-decoration: none;
}

.rows a::after {
  content: "›";
  color: var(--text-secondary);
  font-size: 22px;
}

.rows small {
  display: block;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
}

/* The primary button. */
.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

/* A highlighted note (the accent is for small highlights only, never body text). */
.note {
  border-left: 4px solid var(--accent);
}

.note h2 {
  color: var(--accent);
}

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

/* Text still to be filled in: visible on purpose, so nothing unfinished goes live unnoticed. */
.draft {
  background: #fde2dc;
  color: #8a1f11;
  border-radius: 4px;
  padding: 0 4px;
}

footer {
  margin-top: 24px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

footer a {
  color: var(--text-secondary);
}
