:root {
  --color-bg: #faf7f2;
  --color-surface: #ffffff;
  --color-text: #2b2420;
  --color-text-muted: #6b6058;
  --color-accent: #5e8e50;
  --color-accent-dark: #46693b;
  --color-accent-soft: #eef4ec;
  --color-border: #e8e0d6;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  --max-width: 1100px;
  --reading-width: 680px;
  --shadow-hover: 0 8px 24px rgba(43, 36, 32, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

main {
  flex: 1;
  width: 100%;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

/* Accent-dark is used for text and buttons so contrast stays above 4.5:1. */
a {
  color: var(--color-accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

:focus-visible {
  outline: 3px solid var(--color-accent-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--color-text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Header / nav */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--color-text);
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  color: var(--color-text);
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
}

.nav-links a:hover {
  background: var(--color-accent-soft);
  text-decoration: none;
}

.nav-links a[aria-current='page'] {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-weight: 600;
}

.nav-links .nav-cta {
  background: var(--color-accent-dark);
  color: #fff;
  font-weight: 600;
  margin-left: 0.5rem;
}

.nav-links .nav-cta:hover {
  background: #385530;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1.4rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  color: var(--color-text);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 0.5rem 0 0.75rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius);
  }

  .nav-links .nav-cta {
    margin: 0.5rem 0 0;
    text-align: center;
  }
}

/* Buttons */

.btn {
  display: inline-block;
  background: var(--color-accent-dark);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: 2px solid var(--color-accent-dark);
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.3;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover {
  background: #385530;
  border-color: #385530;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent-dark);
}

.btn-outline:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Hero */

.hero {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  max-width: 24ch;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 1.75rem;
}

/* How it works */

.steps-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: how;
}

.steps-strip li {
  counter-increment: how;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.steps-strip li::before {
  content: counter(how);
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-accent-dark);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.steps-strip strong {
  display: block;
}

.steps-strip span {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

@media (max-width: 720px) {
  .steps-strip {
    grid-template-columns: 1fr;
  }
}

/* Section headings */

.section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head .section-title {
  margin: 0;
}

.section-link {
  font-weight: 600;
  white-space: nowrap;
}

.page-intro {
  color: var(--color-text-muted);
  max-width: 600px;
  margin: -0.75rem 0 1.5rem;
}

/* Recipe filters */

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  max-width: 420px;
  font: inherit;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.search-input:focus-visible {
  border-color: var(--color-accent-dark);
  outline-offset: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.95rem;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-transform: capitalize;
}

.chip:hover {
  border-color: var(--color-accent-dark);
}

.chip[aria-pressed='true'] {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
}

.result-count {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Card grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

.card:focus-visible {
  outline-offset: 3px;
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--color-border);
}

.card-body {
  padding: 1rem 1.1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 1.2rem;
  color: var(--color-text);
}

.card:hover .card-body h3 {
  color: var(--color-accent-dark);
}

.card-body p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex: 1;
  margin: 0 0 0.5rem;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.tag {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  color: var(--color-accent-dark);
  text-transform: capitalize;
}

/* Loading skeletons */

.skeleton {
  min-height: 330px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #f0ebe3 25%, #f7f3ec 50%, #f0ebe3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Detail pages */

.detail-wrap {
  max-width: 920px;
}

.detail-wrap.is-post {
  max-width: var(--reading-width);
}

.detail-header {
  padding: 0.5rem 0 1rem;
}

.detail-header h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
}

.detail-header p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.detail-image {
  width: 100%;
  height: auto;
  max-height: 420px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  background: var(--color-border);
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 0;
}

.recipe-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.recipe-layout h2 {
  font-size: 1.3rem;
  margin-top: 0;
}

.recipe-layout section {
  padding-top: 1.25rem;
}

.ingredients-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

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

.ingredient-list li {
  border-bottom: 1px solid var(--color-border);
}

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

.ingredient-list label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  cursor: pointer;
}

.ingredient-list input {
  margin-top: 0.3rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-accent-dark);
  flex: none;
}

.ingredient-list input:checked + span {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 3rem;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-dark);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.order-callout {
  margin-top: 2rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.order-callout p {
  margin: 0;
}

.detail-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 1.25rem;
}

.detail-content h2,
.detail-content h3,
.detail-content h4,
.md-preview h2,
.md-preview h3,
.md-preview h4 {
  font-family: var(--font-heading, inherit);
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

.detail-content h2,
.md-preview h2 {
  font-size: 1.5rem;
}

.detail-content h3,
.md-preview h3 {
  font-size: 1.25rem;
}

.detail-content ul,
.detail-content ol,
.md-preview ul,
.md-preview ol {
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.detail-content blockquote,
.md-preview blockquote {
  margin: 0 0 1.25rem;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--color-accent);
  color: var(--color-text-muted);
}

.detail-content blockquote p,
.md-preview blockquote p {
  margin-bottom: 0.5rem;
}

.detail-content hr,
.md-preview hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

.detail-content a,
.md-preview a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Owner's live preview of Markdown, under the box she types in. */
.md-preview {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.md-preview > :first-child {
  margin-top: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 600;
}

@media (max-width: 760px) {
  .recipe-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .recipe-layout section {
    padding-top: 0;
  }
}

/* Admin */

.admin-wrap {
  max-width: 820px;
}

.admin-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.admin-narrow {
  max-width: 480px;
  margin: 0 auto;
}

.admin-bar,
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.admin-bar {
  margin-bottom: 1rem;
}

.admin-bar p {
  margin: 0;
}

.admin-head {
  margin: 1.25rem 0 1rem;
}

.admin-head .section-title {
  margin: 0;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-wrap label {
  display: block;
  font-weight: 600;
  margin: 1.1rem 0 0.35rem;
}

/* 16px inputs: phones don't zoom the page when one is focused. */
.admin-wrap input[type='text'],
.admin-wrap input[type='password'],
.admin-wrap input[type='date'],
.admin-wrap input[type='file'],
.admin-wrap textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #b9ad9f;
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
}

.admin-wrap textarea {
  resize: vertical;
  line-height: 1.5;
}

.admin-wrap input:focus-visible,
.admin-wrap textarea:focus-visible {
  border-color: var(--color-accent-dark);
  outline-offset: 0;
}

.admin-wrap form > .btn,
.admin-wrap form > .admin-actions {
  margin-top: 1.25rem;
}

.field-hint {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

.admin-notice,
.admin-error {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.admin-notice {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  color: #2f4a27;
}

.admin-error {
  background: #fbeeee;
  border: 1px solid #c98a8a;
  color: #8a2525;
}

.admin-error[hidden] {
  display: none;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.admin-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.admin-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-row-text span,
.admin-confirm {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.admin-back {
  background: none;
  border: none;
  padding: 0.5rem 0;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  color: var(--color-accent-dark);
  cursor: pointer;
}

.turnstile-box {
  min-height: 65px; /* the widget's height, so the page doesn't jump when it appears */
  margin: 1.1rem 0 0;
}

.photo-field {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin: 1.25rem 0 0;
}

.photo-field legend {
  font-weight: 600;
  padding: 0 0.4rem;
}

.photo-field img {
  width: 240px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--color-border);
}

.photo-field label {
  margin-top: 0.75rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  min-height: 44px;
  font-size: 0.95rem;
}

.btn-danger {
  background: #8a2525;
  border-color: #8a2525;
}

.btn-danger:hover {
  background: #6e1c1c;
  border-color: #6e1c1c;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 2rem 0;
  margin-top: 3rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--color-text-muted);
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--color-accent-dark);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Empty state */

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem 1rem;
  grid-column: 1 / -1;
}

.empty-state .btn {
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Print: a clean recipe card for the kitchen */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .detail-actions,
  .order-callout,
  .back-link {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .recipe-layout {
    grid-template-columns: 1fr;
  }

  .detail-image {
    max-height: 220px;
  }

  .ingredients-box {
    border: none;
    padding: 0;
  }
}

/* Customer accounts */

.nav-account[hidden] {
  display: none;
}

.admin-wrap input[type='email'] {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #b9ad9f;
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
}

.admin-wrap input[type='email']:focus-visible {
  border-color: var(--color-accent-dark);
  outline-offset: 0;
}

/* Password box with its Show/Hide button beside it. */
.password-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.password-row input {
  flex: 1;
  min-width: 0;
}

/* A field only a bot would fill in: out of sight and out of the tab order. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.admin-wrap .admin-card + .admin-card {
  margin-top: 1.25rem;
}

.account-danger {
  border-color: #c98a8a;
}

.admin-card h2 {
  margin-top: 0;
}
