/*
 * GoHam website. One stylesheet for every page.
 * Colours, radii and type sizes are the app's (src/theme/tokens.ts):
 * cream page, navy ink, one yellow, one blue family, red only for a hard pass.
 * Light theme only. The brand face is for the wordmark; the rest is the
 * system font.
 */

:root {
  color-scheme: light;

  --page: #fffbf0;
  --surface: #ffffff;
  --ink: #14284b;
  --ink-secondary: #56627a;
  --field: #f3ecd9;
  --hairline: #e9e2d0;
  --yellow: #ffd23f;
  --blue: #1f6fa8;
  --blue-tint: #d9edfb;
  --red: #c0392b;
  --on-ink: #ffffff;

  --radius-control: 12px;
  --radius-card: 20px;
  --shadow-card: 0 1px 2px rgba(20, 40, 75, 0.05), 0 6px 18px rgba(20, 40, 75, 0.07);

  --gutter: 20px;
  --measure: 40rem;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --font-display: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
table {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.2;
}

p,
li,
dd {
  text-wrap: pretty;
}

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

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-control);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* The wordmark: the system's rounded face at 800 (as in the app), navy with a blue "a". */

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span {
  color: var(--blue);
}

/* Masthead and footer */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  width: 100%;
  max-width: 66rem;
  margin: 0 auto;
  padding: 12px var(--gutter) 0;
}

.masthead .wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* The links' own padding hangs outside the column, so their text lines up
   with the wordmark when the menu wraps under it on a narrow phone. */
.masthead nav {
  display: flex;
  gap: 4px;
  margin: 0 -10px;
}

.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.masthead nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.masthead nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.footer {
  width: 100%;
  max-width: 66rem;
  margin: auto auto 0;
  padding: 48px var(--gutter) 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  color: var(--ink-secondary);
  font-size: 0.9375rem;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
}

.footer span {
  margin-right: auto;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 120ms ease-out,
    background-color 120ms ease-out;
}

.button:hover {
  background: #f7c625;
}

.button:active {
  transform: scale(0.98);
}

.button--ink {
  background: var(--ink);
  color: var(--on-ink);
}

.button--ink:hover {
  background: #1d3866;
}

.button--outline {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.button--outline:hover {
  background: var(--field);
}

.store-badge {
  display: inline-block;
  line-height: 0;
}

.store-badge img {
  height: 52px;
  width: auto;
}

.store-soon {
  font-weight: 600;
}

/* Home: the wordmark, one yellow card, nothing else. */

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 39rem;
  margin: 0 auto;
  padding: 48px var(--gutter) 16px;
}

.home .wordmark {
  display: block;
  font-size: clamp(3.75rem, 19vw, 6rem);
  margin: 0 0 24px 2px;
}

.pitch {
  background: var(--yellow);
  border-radius: var(--radius-card);
  padding: 28px 24px;
}

.pitch h1 {
  font-size: clamp(1.75rem, 6.4vw, 2.375rem);
  line-height: 1.12;
  font-weight: 800;
}

.pitch p {
  margin-top: 12px;
  max-width: 30em;
}

.pitch .store-slot {
  margin-top: 24px;
}

.pitch .store-soon {
  margin-top: 0;
}

@media (min-width: 600px) {
  .pitch {
    padding: 40px;
  }
}

/* Reading pages: privacy and support. A calm column at a real measure. */

.doc {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 40px var(--gutter) 0;
}

.doc h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
}

.doc .updated {
  margin-top: 12px;
  color: var(--ink-secondary);
  font-size: 0.9375rem;
}

.doc .lede {
  margin-top: 20px;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.doc h2 {
  margin-top: 56px;
  font-size: 1.5rem;
  font-weight: 700;
}

.doc h3 {
  margin-top: 28px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
}

.doc p,
.doc ul,
.doc ol,
.doc dl,
.doc .table {
  margin-top: 14px;
}

.doc h3 + p,
.doc h3 + ul {
  margin-top: 6px;
}

.doc ul,
.doc ol {
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 6px;
}

.doc li::marker {
  color: var(--blue);
}

.doc strong {
  font-weight: 700;
}

/* The heading a link jumped to. */
.doc h2:target,
.doc h3:target {
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 4px;
  text-underline-offset: 6px;
}

/* The short version: the app's yellow card. */

.summary {
  margin-top: 32px;
  padding: 24px;
  background: var(--yellow);
  border-radius: var(--radius-card);
}

.doc .summary h2 {
  margin-top: 0;
  font-size: 1.375rem;
  font-weight: 800;
}

.doc .summary ul {
  margin-top: 12px;
}

.doc .summary li::marker {
  color: var(--ink);
}

.summary a {
  color: var(--ink);
}

@media (min-width: 600px) {
  .summary {
    padding: 32px;
  }
}

/* On this page */

.contents {
  margin-top: 40px;
}

.doc .contents h2 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.doc .contents ul {
  margin-top: 4px;
  padding-left: 0;
  list-style: none;
}

.doc .contents li + li {
  margin-top: 0;
}

.contents a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 600px) {
  .doc .contents ul {
    columns: 2;
    column-gap: 32px;
  }

  .contents a {
    min-height: 36px;
  }
}

/* Tables: the one place hairlines are used. */

.table {
  overflow-x: auto;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.45;
}

.doc th,
.doc td {
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}

.doc th:last-child,
.doc td:last-child {
  padding-right: 0;
}

.doc thead th {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-secondary);
  border-bottom-color: var(--ink);
}

.doc tbody th {
  width: 38%;
  font-weight: 600;
}

.contact {
  margin-top: 56px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.doc .contact h2 {
  margin-top: 0;
}

.contact .button {
  margin-top: 18px;
}

@media (min-width: 600px) {
  .contact {
    padding: 32px;
  }
}

/* The link page: what a friend sent, and one way in. */

.share {
  flex: 1;
  width: 100%;
  max-width: 27.5rem;
  margin: 0 auto;
  padding: 16px var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'head'
    'card'
    'act';
  align-content: start;
  gap: 20px;
}

.share__head {
  grid-area: head;
}

.share__card {
  grid-area: card;
  align-self: start;
}

.share__act {
  grid-area: act;
}

.share:focus {
  outline: none;
}

.sender {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--field);
}

.avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
}

.sender__name {
  font-weight: 600;
  line-height: 1.3;
}

.sender__username {
  color: var(--ink-secondary);
  font-size: 0.9375rem;
  line-height: 1.3;
}

.share h1 {
  font-size: clamp(1.75rem, 7.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.sender + h1 {
  margin-top: 16px;
}

.share__lede {
  margin-top: 10px;
}

.spot {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.spot__warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--red);
  color: var(--on-ink);
  font-weight: 700;
  line-height: 1.3;
}

.spot__warning span {
  font-weight: 400;
}

.spot__photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--field);
}

.spot__body {
  padding: 18px 20px 20px;
}

.spot__name {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.spot__meta {
  margin-top: 2px;
  color: var(--ink-secondary);
  font-size: 0.9375rem;
}

.verdict {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-weight: 600;
}

.verdict svg,
.spot__warning svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.verdict--yes svg {
  color: var(--blue);
}

.verdict--depends svg {
  color: var(--ink-secondary);
}

.spot__dish {
  margin-top: 12px;
}

.spot__dish span {
  color: var(--ink-secondary);
}

.spot__dish strong {
  font-weight: 600;
}

.spot__said {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.spot__said strong {
  font-weight: 600;
}

/* A list link: one row per spot, with the owner's gut call. */

.list-spots {
  list-style: none;
  padding: 0 20px 6px;
}

.list-spot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.list-spot__text {
  flex: 1 1 9rem;
  min-width: 0;
}

.list-spot__name {
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.list-spot__meta {
  color: var(--ink-secondary);
  font-size: 0.9375rem;
  line-height: 1.3;
}

.list-spot__call {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.list-spot__call svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.list-spot__call--none {
  color: var(--ink-secondary);
  font-weight: 400;
}

.list-spot__call.verdict--yes svg {
  color: var(--blue);
}

.list-spot__call.verdict--depends svg {
  color: var(--ink-secondary);
}

.list-spot__call.verdict--hard-pass svg {
  color: var(--red);
}

.share__pitch {
  font-size: 1.0625rem;
}

.share__actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.share__actions .store-soon {
  padding: 14px 16px;
  background: var(--field);
  border-radius: var(--radius-control);
}

.share__fine {
  margin-top: 14px;
  color: var(--ink-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.share__fine a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
}

.share__fine:empty {
  display: none;
}

/* A state with no card: expired, not found, can't load. */

.share--plain {
  grid-template-areas:
    'head'
    'act';
  padding-top: 40px;
}

/* Loading: sand blocks where the card will be. */

.skeleton {
  background: var(--field);
  border-radius: var(--radius-control);
}

.skeleton--line {
  height: 18px;
  width: 60%;
}

.skeleton--title {
  height: 34px;
  width: 85%;
  margin-top: 22px;
}

.skeleton--card {
  height: 320px;
  border-radius: var(--radius-card);
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: skeleton 1.4s ease-in-out infinite alternate;
  }

  @keyframes skeleton {
    from {
      opacity: 1;
    }
    to {
      opacity: 0.55;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

@media (min-width: 860px) {
  .share {
    max-width: 56rem;
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    grid-template-areas:
      'card head'
      'card act';
    grid-template-rows: auto 1fr;
    column-gap: 64px;
    row-gap: 28px;
    padding-top: 56px;
  }

  .share--plain {
    max-width: 34rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'head'
      'act';
    grid-template-rows: auto;
    row-gap: 20px;
    padding-top: 72px;
  }

  .share__head {
    align-self: end;
    padding-top: 8px;
  }

  .share--plain .share__head {
    padding-top: 0;
  }

  .share__actions {
    max-width: 22rem;
  }

  .spot__photo {
    aspect-ratio: 4 / 3;
  }
}

@media print {
  .masthead nav,
  .skip-link,
  .footer {
    display: none;
  }

  body {
    background: #fff;
  }
}
