/* recipes — the app's own stylesheet. Loaded after /static/kit.css, which owns
   every token and every shared component. This file sets the accent, and
   styles the few things only a recipe has: the search box, tag chips, the
   ingredient lists and the numbered method.

   THE ACCENT is a warm tomato red, white ink on a deep fill in both modes
   (the plate-and-glass structure: a red light enough for dark ink reads
   salmon). css_contrast_test.go measures every pair in both modes:
   light #c8381f under white 5.2:1, #a32a14 as text at least 5:1 on every
   ground; dark #cf3f26 under white 4.8:1, #ff7d61 as text at least 5.4:1.
   Edges use --accent-strong, never --accent (the kit's rule). */

:root {
  --accent: #c8381f;
  --accent-strong: #a32a14;
  --accent-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #cf3f26;
    --accent-strong: #ff7d61;
    --accent-contrast: #ffffff;
  }
}

/* ---- the list: search and tags ---- */

.search {
  margin: var(--space-2) 0 var(--space-3);
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.search-box:focus-within {
  border-color: var(--accent-strong);
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--font-base);
  padding: 10px 0;
  outline: none;
}

.tag-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-2);
  scrollbar-width: none;
}

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

.tag-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--font-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tag-chip.on {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--accent-contrast);
}

.recipe-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin: 2px 0 0;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.tag-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.recipe-card .badges {
  margin: 0;
  gap: var(--space-1);
}

/* ---- one recipe ---- */

.recipe-intro {
  font-size: 1.1rem;
  color: var(--text);
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
}

.recipe-meta > div {
  flex: 1 1 0;
  min-width: 90px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.recipe-meta dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.recipe-meta dd {
  margin: 0;
  font-weight: 600;
}

.recipe-section {
  margin: 0 0 var(--space-5);
}

.recipe-h {
  margin: 0 0 var(--space-2);
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--accent-strong);
}

.recipe-sub {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--font-base);
  font-weight: 700;
}

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

.recipe-list li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.recipe-list li:last-child {
  border-bottom: none;
}

/* A small accent dot, not a bullet glyph: the same at any font. */
.recipe-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.05em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

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

.recipe-step {
  display: flex;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.step-num {
  flex: 0 0 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  margin-top: 2px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-heading {
  margin: 4px 0 var(--space-1);
  font-size: var(--font-base);
  font-weight: 700;
  line-height: 1.4;
}

.step-body p {
  margin: 0 0 var(--space-2);
  line-height: 1.6;
}

.recipe-tags {
  margin: 0 0 var(--space-3);
}

.recipe-source {
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
  overflow-wrap: anywhere;
}

.recipe-source a {
  color: var(--accent-strong);
}

/* ---- the edit form ---- */

.field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.field-textarea.big {
  min-height: 12rem;
  font-size: 1rem;
  line-height: 1.5;
}

.paste-box {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}

.paste-box > summary {
  cursor: pointer;
  margin: 0;
}

.paste-box .field-hint {
  display: block;
  margin: var(--space-2) 0;
}

.paste-box .paste-input {
  width: 100%;
  margin-bottom: var(--space-3);
}

.lang-pick .field-hint {
  display: block;
  margin-top: var(--space-2);
}
