* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: serif;
  line-height: 1.6;
  color: #222;
  background: #fff;
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-family: sans-serif;
  font-weight: normal;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-family: sans-serif;
  font-weight: normal;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-family: sans-serif;
  font-weight: normal;
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

a {
  color: #000;
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.recipe-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

#recipe-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: serif;
  font-size: 1rem;
  border: 1px solid #ddd;
  margin-bottom: 1rem;
}

.recipe-list {
  list-style: none;
  margin-left: 0;
  margin-top: 1rem;
  margin-bottom: 0;
}

.recipe-category {
  margin-bottom: 2rem;
}

.recipe-list li {
  margin-bottom: 0.5rem;
}

.recipe-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.recipe-list li a:hover span {
  text-decoration: underline;
}

/* Recipe thumbnails — hidden by default */
.recipe-thumb {
  display: none;
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.show-photos .recipe-thumb {
  display: block;
}

.show-photos .recipe-list li {
  margin-bottom: 0.75rem;
}

/* Controls bar */
.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.controls #recipe-search {
  flex: 1;
  margin-bottom: 0;
}

/* Toggle switch — top-right, scrolls with page */
.toggle {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.85rem;
  user-select: none;
}

.toggle input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: #444;
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.note {
  padding: 1rem;
  margin: 1.5rem 0;
  border: 1px solid #ddd;
  font-style: italic;
}

@media print {
  body {
    max-width: 100%;
    padding: 1rem;
  }

  .back-link {
    display: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
