/* ==========================================================================
   WellsRoad Recipe Box — design tokens
   Retheme to match the Boomer Buggy listing site: near-black background,
   warm gold accent, serif display type with italic flourishes, small
   tracked-uppercase labels. Signature element carried over from the
   original design: the colored category tab that mimics a recipe-box
   divider card, now rendered as jewel tones against the dark page.
   ========================================================================== */
:root {
  --bg: #15120F;
  --bg-card: #1E1A16;
  --bg-card-hover: #241F19;
  --bg-input: #1A1613;
  --ink: #F3EEE4;
  --ink-soft: #9A9184;
  --ink-faint: #6E675C;
  --gold: #D9A354;
  --gold-dark: #B9822E;
  --gold-soft: rgba(217,163,84,0.14);
  --line: #2C2721;
  --line-strong: #3B342B;
  --danger: #C1653A;
  --danger-bg: rgba(193,101,58,0.14);
  --danger-border: rgba(193,101,58,0.4);
  --success: #7C9A6F;

  --font-display: 'Fraunces', Georgia, serif;
  --font-label: 'Archivo Black', 'Fraunces', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lift: 0 2px 6px rgba(0,0,0,0.35), 0 18px 40px rgba(0,0,0,0.45);
}

/* Category tab colors — cycled by category name hash, see inline style in
   views. Jewel tones chosen to read clearly on the near-black background. */
.tab-1 { background: var(--gold); color: #1A1310; }
.tab-2 { background: #C1653A; color: #fff; }
.tab-3 { background: #6E9A78; color: #0F1710; }
.tab-4 { background: #6E85A8; color: #0E1420; }
.tab-5 { background: #9B7AAE; color: #16111C; }
.tab-6 { background: #4F9A94; color: #0B1817; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.4em; color: var(--ink); }

button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.site-header {
  background: var(--bg);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--gold) 50%, var(--ink) 50%);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-line1 { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); }
.brand-line2 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

.header-search { flex: 1 1 260px; display: flex; max-width: 460px; }
.header-search input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--ink);
}
.header-search input::placeholder { color: var(--ink-faint); }
.header-search button {
  border: 1px solid var(--gold-dark);
  background: var(--gold);
  color: #1A1310;
  padding: 0 14px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 15px;
}
.header-search button:hover { background: var(--gold-dark); }

.header-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.inline-form { display: inline; }

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
}
.btn-primary { background: var(--gold); color: #1A1310; }
.btn-primary:hover { background: var(--gold-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--bg-card); text-decoration: none; }
.btn-text { background: transparent; color: var(--ink-soft); text-decoration: underline; padding: 9px 4px; }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-secondary:hover { background: var(--bg-card); }

/* ---------------------------------------------------------------------
   Filter bar + recipe grid (index page)
   --------------------------------------------------------------------- */
.page-body { padding: 32px 0 64px; }

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 28px;
  font-size: 14px;
}
.filter-bar select {
  padding: 8px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--ink);
}
.filter-bar .result-count { color: var(--ink-soft); margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; }
.filter-bar .clear-link { color: var(--gold); font-weight: 600; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.recipe-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); text-decoration: none; }

.card-tab {
  position: absolute;
  top: 14px;
  left: -6px;
  padding: 3px 12px 3px 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 2;
}

.card-photo {
  height: 150px;
  background: var(--line) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
}
.card-photo.no-photo { background: repeating-linear-gradient(135deg, #201B16, #201B16 10px, #241F19 10px, #241F19 20px); }

.card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 17px; font-weight: 600; color: var(--ink); font-family: var(--font-display); }
.card-meta { font-size: 12.5px; color: var(--ink-soft); font-family: var(--font-mono); }
.card-servings { margin-top: auto; font-size: 12.5px; color: var(--gold); font-weight: 600; }

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--ink-soft);
}
.empty-state h3 { color: var(--ink); }

/* ---------------------------------------------------------------------
   Recipe detail
   --------------------------------------------------------------------- */
.recipe-header {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.recipe-photo {
  width: 280px;
  height: 210px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--line) center/cover no-repeat;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}
.recipe-photo.no-photo { background: repeating-linear-gradient(135deg, #201B16, #201B16 12px, #241F19 12px, #241F19 24px); }

.recipe-identity { flex: 1; min-width: 260px; }
.recipe-tab-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.recipe-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.recipe-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 5px;
}
.chip-outline {
  background: transparent;
  color: var(--ink-soft);
  border: 1.3px solid var(--line-strong);
}
.recipe-title { font-size: 38px; margin-bottom: 6px; line-height: 1.08; }
.recipe-title em, .recipe-title .accent { font-style: italic; color: var(--gold); font-weight: 400; }
.recipe-number { font-family: var(--font-mono); color: var(--ink-soft); font-size: 13px; }

.recipe-facts {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 20px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.fact + .fact { border-left: none; }
.fact:first-child { border-radius: 8px 0 0 8px; }
.fact:last-child { border-radius: 0 8px 8px 0; }
.fact-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.fact-value { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); }

.recipe-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.recipe-notes {
  margin: 24px 0;
  padding: 14px 18px;
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
  color: var(--ink);
}

.recipe-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  margin-top: 30px;
  align-items: start;
}
@media (max-width: 880px) {
  .recipe-columns { grid-template-columns: 1fr; }
}

.section-block { margin-bottom: 32px; }
.section-heading {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.ingredient-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.ingredient-list li:last-child { border-bottom: none; }
.ing-name { flex: 1; }
.ing-type { color: var(--ink-soft); font-size: 12.5px; }
.ing-qty { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; text-align: right; font-size: 13.5px; color: var(--ink); }
.ing-prep { display: block; color: var(--ink-soft); font-size: 12.5px; font-style: italic; }

.equipment-list { list-style: none; margin: 0; padding: 0; }
.equipment-list li { padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.equipment-list li:last-child { border-bottom: none; }
.equipment-list .eq-spec { color: var(--ink-soft); font-size: 12.5px; }

.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: #1A1310;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.step-text { font-size: 14.5px; color: var(--ink); }
.step-meta { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.step-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-soft);
  padding: 2px 8px;
  border-radius: 5px;
}
.ccp-flag {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------------------------------------------------------------------
   Nutrition Facts label — modeled on the FDA vertical label. Kept as an
   intentionally light, printed-paper card (like a spec sheet laid on a
   dark table) rather than dark-themed, for both authenticity and print.
   --------------------------------------------------------------------- */
.nutrition-label {
  border: 2px solid #1A1310;
  border-radius: 4px;
  background: #fff;
  padding: 10px 14px 14px;
  font-family: var(--font-body);
  color: #1A1310;
  max-width: 320px;
  box-shadow: var(--shadow-card);
}
.nutrition-label .nl-title {
  font-family: var(--font-label);
  font-size: 30px;
  line-height: 1;
  margin: 2px 0 4px;
  letter-spacing: -0.01em;
}
.nl-rule-thin { border: none; border-top: 1px solid #1A1310; margin: 6px 0; }
.nl-rule-thick { border: none; border-top: 8px solid #1A1310; margin: 6px 0; }
.nl-rule-mid { border: none; border-top: 5px solid #1A1310; margin: 6px 0; }
.nl-servings { font-size: 13px; margin: 2px 0; }
.nl-serving-size { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.nl-amount-per { font-size: 12px; font-weight: 700; margin-top: 6px; }
.nl-calories { display: flex; justify-content: space-between; align-items: baseline; }
.nl-calories .nl-cal-label { font-family: var(--font-label); font-size: 22px; }
.nl-calories .nl-cal-value { font-family: var(--font-label); font-size: 34px; }
.nl-dv-header { text-align: right; font-size: 11px; font-weight: 700; }
.nl-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; border-bottom: 1px solid #1A1310; }
.nl-row.indent-1 { padding-left: 14px; }
.nl-row.indent-2 { padding-left: 28px; font-weight: 400; }
.nl-row b { font-weight: 700; }
.nl-row.no-dv { border-bottom: 1px solid #1A1310; }
.nl-micro-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; border-bottom: 1px solid #1A1310; }
.nl-footnote { font-size: 10.5px; color: #1A1310; margin-top: 8px; line-height: 1.35; }
.nl-empty { font-size: 13px; color: var(--ink-soft); font-style: italic; }

/* ---------------------------------------------------------------------
   Forms (data entry)
   --------------------------------------------------------------------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 30px 34px;
}
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .form-grid, .form-grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  padding: 9px 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  font-size: 14.5px;
  background: var(--bg-input);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }

.repeat-section { margin-top: 26px; }
.repeat-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.repeat-row .field { margin-bottom: 0; flex: 1; }
.repeat-row .field-narrow { flex: 0 0 100px; }
.repeat-row .field-narrower { flex: 0 0 80px; }
.remove-row-btn {
  flex-shrink: 0;
  align-self: center;
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 19px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}
.remove-row-btn:hover { color: #D97C50; }
.ccp-check { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; align-self: center; color: var(--ink); }
.add-row-btn {
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  color: var(--gold);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  width: 100%;
  margin-top: 4px;
}
.add-row-btn:hover { background: var(--gold-soft); }

.form-actions { display: flex; gap: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.photo-preview { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; margin-top: 6px; box-shadow: var(--shadow-card); border: 1px solid var(--line); }

.danger-zone {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-strong);
}

/* ---------------------------------------------------------------------
   Login / import / misc
   --------------------------------------------------------------------- */
.narrow-card {
  max-width: 440px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px;
}
.import-help {
  background: var(--gold-soft);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.import-help code { background: rgba(255,255,255,0.08); color: var(--ink); padding: 1px 5px; border-radius: 4px; }
.error-text { color: var(--danger); font-size: 13.5px; margin-bottom: 14px; font-weight: 600; }
textarea.json-input { width: 100%; min-height: 300px; font-family: var(--font-mono); font-size: 12.5px; }

.footer {
  text-align: center;
  padding: 30px 0 50px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ---------------------------------------------------------------------
   Print — force back to a normal light printed page regardless of theme
   --------------------------------------------------------------------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #1A1310; }
  .wrap { max-width: 100%; padding: 0; }
  h1, h2, h3, h4 { color: #1A1310; }
  .recipe-title em, .recipe-title .accent { color: var(--gold-dark); }
  .recipe-photo { box-shadow: none; border-color: #ddd; }
  .recipe-card, .form-card { box-shadow: none; }
  .fact { background: #fff; border-color: #ddd; }
  .fact-value, .step-text, .ing-qty { color: #1A1310; }
  .nutrition-label { break-inside: avoid; box-shadow: none; }
  .step-item { break-inside: avoid; border-color: #ddd; }
  .step-num { background: var(--gold-dark); color: #fff; }
  a[href]:after { content: ""; }
}
