/* Shared styles for every page. Colours and sizes come from tokens.css. */

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}

h1, h2, h3 { margin: 0; }
p { margin: 0; }
svg { flex-shrink: 0; }

.hand { font-family: var(--font-hand); font-weight: 700; line-height: 1.05; }

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

/* Header and navigation */

.site-header, .page {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}
.site-header {
  padding-top: 20px;
  padding-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 34px;
}
.logo:hover { color: var(--ink); }
.logo-mark { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a {
  padding: 10px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

/* Who is signed in, and Sign out, at the right end of the header */

.signout { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.signout .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

.page { padding-top: 16px; padding-bottom: 56px; }

/* The sign-in page: one note in the middle */

.signin { max-width: 480px; margin: 48px auto 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.signin h1 { font-size: 44px; line-height: 1; }
.signin p { margin: 0; }

/* Two columns that become one on narrow screens */

.columns { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.columns > .main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.columns > .side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* Shop picker (brochures, prices) */

.shop-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.tab:hover { border-color: var(--teal); color: var(--teal-dark); }
.tab[aria-current="page"] { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.tab.more { background: transparent; border-color: transparent; color: var(--teal); }

/* Notes and cards */

.note {
  position: relative;
  background: var(--note-butter);
  border-radius: var(--radius-note);
  box-shadow: var(--shadow-note);
  padding: 24px 22px;
  transform: rotate(var(--tilt, 0.8deg));
}
.note::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 20px;
  margin-left: -36px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(41, 37, 36, 0.08);
}
.note.mint { background: var(--note-mint); }
.note.rose { background: var(--note-rose); }
.note.sky { background: var(--note-sky); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
}

.card-title { font-size: 30px; }

/* A link back to the list a detail page came from */

.back { margin-bottom: 12px; }
.back a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; min-height: 44px; }

/* Buttons */

.button, .icon-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-button);
  font-weight: 700;
  text-decoration: none;
}
.button { padding: 0 16px; }
.icon-button { width: 44px; }
.primary { background: var(--teal); color: #FFFFFF; }
.primary:hover { background: var(--teal-dark); color: #FFFFFF; }
.secondary { border: 2px solid var(--teal); color: var(--teal); background: var(--card); }
.secondary:hover { background: var(--note-mint); color: var(--teal-dark); }
.disabled { border: 2px solid var(--line); color: var(--muted); background: var(--card); }

/* Pills and status dots */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.pill.on { background: var(--note-mint); color: var(--teal-dark); }
.pill.soon { background: var(--note-sky); color: #075985; }
.pill.over { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }

.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.state.ok { color: var(--good); }
.state.failed { color: var(--bad); }
.state.other { color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 14px; }

code, .command {
  font-family: var(--font-code);
  font-size: 13px;
}
.command {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 14px;
  overflow-wrap: anywhere;
}
/* What a failed run saved, under the plain sentence: for fixing the adapter. */
.error .detail { margin-top: 4px; font-size: 13px; }

@media (max-width: 640px) {
  .site-header, .page { padding-left: 16px; padding-right: 16px; }
  /* On a phone, Sign out sits beside the logo and the menu gets its own row below; the
     email would crowd that row, so the button alone says enough. */
  .signout .who { display: none; }
  .site-header .nav { order: 2; flex-basis: 100%; }
}
