/* The app's palette (AccidentallyVegan/Views/Theme.swift): warm cream, deep green ink, and the
   four verdict tones. */
:root {
  --surface: #f7f3ec;
  --card: #ffffff;
  --ink: #1f2a1a;
  --on-ink: #f7f3ec;
  --feature: #1f2a1a;
  --on-feature: #f7f3ec;
  --leaf: #3d6b3a;
  --clay: #c9603a;
  --amber: #b9822f;
  --slate: #6e7566;
  --secondary: rgba(31, 42, 26, 0.6);
  --hairline: rgba(31, 42, 26, 0.1);
  --serif: "Instrument Serif", "Iowan Old Style", "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #14180f;
    --card: #1e2418;
    --ink: #ede7da;
    --on-ink: #14180f;
    --feature: #2a3a25;
    --on-feature: #ede7da;
    --leaf: #8cbf7f;
    --clay: #e08a63;
    --amber: #e8be6e;
    --slate: #9aa192;
    --secondary: rgba(237, 231, 218, 0.62);
    --hairline: rgba(237, 231, 218, 0.12);
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
a {
  color: inherit;
}
img {
  max-width: 100%;
}
main, .top, .foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 22px;
}
.brand img {
  border-radius: 8px;
}

.button {
  display: inline-block;
  background: var(--feature);
  color: var(--on-feature);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  white-space: nowrap;
}
.button.small {
  padding: 8px 14px;
  font-size: 14px;
}

.hero {
  padding: 24px 0 8px;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.1;
  margin: 0 0 12px;
}
.hero p {
  color: var(--secondary);
  max-width: 640px;
  margin: 0 0 20px;
}
.hero .free-note {
  margin: 16px 0 0;
  font-size: 15px;
}
.hero .free-note strong,
.hero .free-note a {
  color: var(--ink, inherit);
  font-weight: 600;
}
.section {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 28px 0 12px;
  font-weight: 600;
}

.search {
  display: flex;
  gap: 8px;
  max-width: 560px;
}
.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
.search button {
  font: inherit;
  font-weight: 600;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--feature);
  color: var(--on-feature);
  cursor: pointer;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border-radius: 14px;
  text-decoration: none;
  height: 100%;
  border: 1px solid var(--hairline);
}
.card:hover {
  border-color: var(--secondary);
}
/* A product's kind of food, in place of a photo: an emoji on a leaf-tinted tile, as in the app. */
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 72px;
  height: 72px;
  font-size: 36px;
  line-height: 1;
  border-radius: 14px;
  background: rgba(61, 107, 58, 0.1);
  background: color-mix(in srgb, var(--leaf) 12%, transparent);
}
.tile.large {
  width: 120px;
  height: 120px;
  font-size: 60px;
  border-radius: 22px;
}
.card-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.brand-name {
  color: var(--secondary);
  font-size: 14px;
  margin: 0;
}
.checked {
  color: var(--secondary);
  font-size: 13px;
  margin: 0;
}
.barcode {
  color: var(--secondary);
  font-size: 13px;
  margin: 4px 0 0;
}

.pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.leaf {
  color: var(--leaf);
  background: color-mix(in srgb, var(--leaf) 14%, transparent);
}
.pill.amber {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 16%, transparent);
}
.pill.clay {
  color: var(--clay);
  background: color-mix(in srgb, var(--clay) 14%, transparent);
}
.pill.slate {
  color: var(--slate);
  background: color-mix(in srgb, var(--slate) 16%, transparent);
}

.pages {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  color: var(--secondary);
}
.empty {
  color: var(--secondary);
}

.crumbs {
  margin: 8px 0 16px;
  font-size: 14px;
}
.product-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.product-head h1 {
  margin-bottom: 6px;
}

.verdict {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--card);
  border-left: 6px solid var(--slate);
}
.verdict.leaf {
  border-left-color: var(--leaf);
}
.verdict.amber {
  border-left-color: var(--amber);
}
.verdict.clay {
  border-left-color: var(--clay);
}
.verdict-text {
  font-family: var(--serif);
  font-size: 32px;
  margin: 0 0 6px;
}
.verdict p {
  margin: 4px 0;
}
/* The score switch (render.ts, scoreSwitch): two radio buttons, no script. */
.score-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.by-all,
#score-all:checked ~ .verdict-text .by-least,
#score-all:checked ~ .score-note.by-least {
  display: none;
}
#score-all:checked ~ .verdict-text .by-all,
#score-all:checked ~ .score-note.by-all {
  display: inline;
}
#score-all:checked ~ .score-note.by-all {
  display: block;
}
.score-by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 6px;
  font-size: 14px;
}
.score-by span {
  color: var(--secondary);
  margin-right: 2px;
}
.score-by label {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--secondary);
}
#score-least:checked ~ .score-by label[for="score-least"],
#score-all:checked ~ .score-by label[for="score-all"] {
  background: var(--feature);
  border-color: var(--feature);
  color: var(--on-feature);
}
#score-least:focus-visible ~ .score-by label[for="score-least"],
#score-all:focus-visible ~ .score-by label[for="score-all"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.score-note {
  color: var(--secondary);
  font-size: 14px;
}
.verdict.all-amber:has(#score-all:checked) {
  border-left-color: var(--amber);
}
.verdict.all-leaf:has(#score-all:checked) {
  border-left-color: var(--leaf);
}
.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--hairline);
}
.ingredients li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  align-items: center;
}
.ingredients li:first-child {
  border-top: 0;
}
.ingredient {
  overflow-wrap: anywhere;
}
.ingredients li.has-why {
  display: block;
  padding: 0;
}
.why summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.why summary::-webkit-details-marker {
  display: none;
}
.why summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  border-radius: 14px;
}
.q {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1.5px solid var(--slate);
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
}
.why[open] .q,
.why summary:hover .q {
  background: var(--slate);
  color: var(--card);
}
.why-body {
  padding: 0 16px 14px;
  font-size: 15px;
}
.why-body p {
  margin: 0;
}
.why-body .why-label {
  margin-bottom: 4px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fine {
  color: var(--secondary);
  font-size: 14px;
}

.cta {
  margin: 40px 0;
  padding: 24px;
  border-radius: 16px;
  background: var(--feature);
  color: var(--on-feature);
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cta h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 4px;
}
.cta p {
  margin: 0;
  opacity: 0.85;
}
.cta p.free {
  margin-top: 6px;
  opacity: 1;
  font-weight: 600;
}
.cta .button {
  background: var(--on-feature);
  color: var(--feature);
}

.prose {
  max-width: 680px;
}
.foot {
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--secondary);
  font-size: 14px;
  border-top: 1px solid var(--hairline);
  margin-top: 40px;
}

.verdict .question {
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  margin: 0 0 4px;
}
.brand-name a {
  color: inherit;
}
.brands {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brands a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--hairline);
  text-decoration: none;
}
.brands .count {
  color: var(--secondary);
  font-size: 13px;
}

/* Vegan alternatives on a product page: the app's saved suggestions, scored as the app does. */
.alternative {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--hairline);
}
.alternative a.name {
  color: inherit;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--secondary);
  border: 1px solid var(--hairline);
}
.tag.verified {
  color: var(--leaf);
  border-color: color-mix(in srgb, var(--leaf) 40%, transparent);
}
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.store {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--feature);
  color: var(--on-feature);
}
