/*
 * The cocktail pages (/cocktail/<id>/) and the list of them all (/cocktails/): the app's cocktail
 * page on the web. Same palette, same order, same pieces: the photo with the name on it, amounts
 * in brass jiggers, glass / method / garnish, numbered steps, the story on a smoked slab. The
 * pages themselves are written by scripts/build-site-cocktails.ts in the app's repository.
 */

:root {
  --bar: #17120f;
  --deep: #0a0706;
  --smoke-top: #1e1713;
  --smoke-bottom: #110d0b;
  --field: rgba(30, 23, 19, 0.94);
  --well: #0d0a08;
  --edge: rgba(255, 214, 160, 0.09);
  --cream: #f2e6d3;
  --cream-soft: #bfaf99;
  --cream-muted: #8a7b6a;
  --brass: #d9574b;
  --on-brass: #1f0807;
  --gold: #d9b26a;
  --gold-rim: rgba(217, 178, 106, 0.45);

  --raised:
    0 18px 30px rgba(0, 0, 0, 0.5), 0 6px 10px rgba(0, 0, 0, 0.4),
    0 -1px 0 rgba(255, 220, 170, 0.07);
  --bevel: inset 0 1px 1px rgba(255, 230, 190, 0.16), inset 0 0 0 1px rgba(255, 214, 160, 0.06);
  --recessed:
    inset 0 3px 8px rgba(0, 0, 0, 0.7), inset 0 -1px 0 rgba(255, 220, 170, 0.05),
    0 1px 0 rgba(255, 220, 170, 0.06);

  --font-display: 'Karantina', 'Assistant', 'Arial Narrow', sans-serif;
  --font-body: 'Assistant', 'Segoe UI', Arial, sans-serif;

  --pad: 24px;
  --column: 520px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* A phone's width, also on a computer: the page is the app's page. */
.page {
  position: relative;
  max-width: var(--column);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 150px;
  background: linear-gradient(180deg, var(--bar) 0%, var(--deep) 100%);
}

/* ---------- The buttons over the photo ---------- */

.top {
  position: absolute;
  z-index: 3;
  top: 14px;
  inset-inline: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--field);
  color: var(--cream);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.pill img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

/* ---------- The photo, with the name on it ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--smoke-top), var(--smoke-bottom));
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The same warm bar light on every photo, then the photo melting into the page. */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero::before {
  background: rgba(201, 133, 58, 0.24);
  mix-blend-mode: soft-light;
}

.hero::after {
  background: linear-gradient(
    180deg,
    rgba(23, 18, 15, 0.5) 0%,
    rgba(23, 18, 15, 0) 24%,
    rgba(23, 18, 15, 0) 46%,
    rgba(23, 18, 15, 0.9) 90%,
    var(--bar) 100%
  );
}

.hero-title {
  position: relative;
  z-index: 2;
  padding: 0 var(--pad) 16px;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.3px;
}

.latin {
  margin: 6px 0 0;
  color: var(--cream-soft);
  font-size: 16px;
  font-weight: 600;
}

.badge {
  flex: none;
  margin-bottom: 6px;
  padding: 3px 12px;
  border: 1px solid var(--gold-rim);
  border-radius: 999px;
  background: var(--field);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ---------- The recipe ---------- */

.body {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding: 34px var(--pad) 0;
}

/* The brass rule before a quiet label: the app's signature. */
.label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.label::before {
  content: '';
  flex: none;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--brass);
}

.ings,
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ings li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
}

/* The amount in a small well, like a jigger. */
.jigger {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 96px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: var(--recessed);
  color: var(--brass);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.ing {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.ing small {
  display: block;
  color: var(--cream-muted);
  font-size: 14px;
  font-weight: 400;
}

/* What's in the glass: three readings in one low well, like the app's; the "i" opens the note. */
.glass summary {
  display: flex;
  align-items: center;
  padding: 8px 0 8px 12px;
  border-radius: 16px;
  background: var(--well);
  box-shadow: var(--recessed);
  cursor: pointer;
  list-style: none;
}

.glass summary::-webkit-details-marker {
  display: none;
}

.glass summary span {
  flex: 1;
  padding: 0 4px;
  color: var(--cream-soft);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.glass summary span + span {
  border-inline-start: 1px solid var(--edge);
}

.glass summary b {
  display: block;
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
  line-height: 22px;
}

.glass summary i {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0 12px;
  border: 1.5px solid var(--cream-muted);
  border-radius: 50%;
  color: var(--cream-muted);
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.glass[open] summary i {
  border-color: var(--brass);
  color: var(--brass);
}

.glass p {
  margin: 12px 0 0;
  color: var(--cream-soft);
  font-size: 14px;
  line-height: 20px;
}

.specs {
  margin: 0;
}

.specs div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
}

.specs div + div {
  border-top: 1px solid var(--edge);
}

.specs dt {
  flex: none;
  width: 64px;
  color: var(--cream-soft);
}

.specs dd {
  flex: 1;
  margin: 0;
  font-weight: 600;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  flex: none;
  min-width: 24px;
  color: var(--brass);
  font-size: 22px;
  font-weight: 800;
}

/* The story, apart from the recipe on its own smoked slab. */
.story {
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--smoke-top), var(--smoke-bottom));
  box-shadow: var(--raised), var(--bevel);
}

.story p {
  margin: 0;
  color: var(--cream-soft);
}

.screen b {
  display: block;
  font-weight: 600;
}

.screen span,
.faq p {
  color: var(--cream-soft);
}

.screen span {
  font-size: 15px;
}

.faq h3 {
  margin: 18px 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.faq h3:first-of-type {
  margin-top: 0;
}

.faq p {
  margin: 0;
}

.sources,
.updated {
  margin: 0;
  color: var(--cream-muted);
  font-size: 14px;
}

.updated {
  text-align: center;
}

/* ---------- More cocktails: tiles in a row that scrolls sideways ---------- */

.row {
  display: flex;
  gap: 16px;
  margin: -12px calc(var(--pad) * -1);
  padding: 12px var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
}

.row::-webkit-scrollbar {
  display: none;
}

.tile {
  position: relative;
  flex: none;
  width: 150px;
  height: 188px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--smoke-bottom);
  box-shadow: var(--raised);
  text-decoration: none;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(10, 7, 6, 0) 45%, rgba(10, 7, 6, 0.88) 100%);
  box-shadow: var(--bevel);
}

.tile span {
  position: absolute;
  z-index: 1;
  inset-inline: 12px;
  bottom: 12px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Into the app ---------- */

.cta {
  position: fixed;
  z-index: 5;
  bottom: 0;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  padding: 36px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 7, 6, 0), var(--deep) 46%);
  pointer-events: none;
}

.cta-in {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: calc(var(--column) - 32px);
  pointer-events: auto;
}

.btn {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--brass);
  color: var(--on-brass);
  box-shadow: var(--raised);
}

.btn-quiet {
  border: 1px solid var(--edge);
  background: var(--field);
  color: var(--cream);
}

/* ---------- The list of all cocktails ---------- */

.list-head {
  padding: 86px var(--pad) 0;
}

.list-head h1 {
  font-size: 56px;
}

.list-head p {
  margin: 12px 0 0;
  color: var(--cream-soft);
}

.group {
  margin: 0;
}

.group h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--brass);
  font-size: 22px;
  font-weight: 800;
}

.group h2 small {
  color: var(--cream-muted);
  font-size: 14px;
  font-weight: 400;
}

.names {
  margin: 0;
  padding: 0;
  list-style: none;
}

.names li + li {
  border-top: 1px solid var(--edge);
}

.names a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
}

.names b {
  font-size: 20px;
  font-weight: 600;
}

.names i {
  margin-inline-start: 8px;
  color: var(--cream-muted);
  font-size: 14px;
  font-style: normal;
}

.names span {
  display: block;
  color: var(--cream-soft);
  font-size: 15px;
}

.group h2 a {
  color: inherit;
  text-decoration: none;
}

/* Links to the pages that list cocktails: by base spirit, by flavor, the collections. */
.kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-head .kinds {
  margin-top: 18px;
}

.kind {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--field);
  color: var(--cream-soft);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.kind[aria-current='page'] {
  border-color: var(--brass);
  color: var(--cream);
}

/* Every way into the catalog, under a list. */
.browse h3 {
  margin: 18px 0 8px;
  color: var(--cream-muted);
  font-size: 15px;
  font-weight: 600;
}

/* What an ingredient is, over the list of its cocktails. */
.what p {
  margin: 0;
  color: var(--cream-soft);
}

.what p + p {
  margin-top: 8px;
}

.what .sources {
  color: var(--cream-muted);
}

/* An ingredient's name on a recipe leads to its page. */
.ing a {
  text-decoration: underline dotted rgba(242, 230, 211, 0.35);
  text-underline-offset: 5px;
}

/* Under a cocktail's line in a list: how much of the ingredient it takes. */
.names em {
  display: block;
  margin-top: 2px;
  color: var(--cream-muted);
  font-size: 14px;
  font-style: normal;
}

/* An ingredient without a page of its own: its line, and the cocktails it's in. */
.names .entry {
  padding: 12px 0;
}

.names .entry em a {
  color: var(--cream-soft);
}

/* Where the page stands in the site. */
.crumbs {
  color: var(--cream-muted);
  font-size: 14px;
}

.crumbs a {
  color: var(--cream-soft);
}

.foot {
  margin-top: 40px;
  padding: 20px var(--pad) 0;
  border-top: 1px solid var(--edge);
  color: var(--cream-muted);
  font-size: 14px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

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

.foot p {
  margin: 8px 0 0;
}

a:focus-visible {
  outline: 2px solid #e3a94b;
  outline-offset: 3px;
}

@media (max-width: 380px) {
  :root {
    --pad: 20px;
  }

  h1 {
    font-size: 52px;
  }

  .jigger {
    min-width: 88px;
  }

  .ing {
    font-size: 20px;
  }
}
