:root {
  color-scheme: light;
  --ink: #20302b;
  --muted: #64716b;
  --paper: #fbf8f1;
  --card: #fffefa;
  --green: #172d2a;
  --green-soft: #29443d;
  --accent: #c56742;
  --line: #e7e2d7;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a {
  color: #155e53;
}

a:hover {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-180%);
  color: var(--green);
  background: white;
  border-radius: 0.5rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  color: #fffaf0;
  background:
    radial-gradient(ellipse at 86% 8%, rgb(197 103 66 / 24%), transparent 30rem),
    linear-gradient(135deg, var(--green), #203c36);
}

.header-inner,
.main-content,
.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 2.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #f0b391;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 8vw, 5.3rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.intro {
  max-width: 42rem;
  margin: 1rem 0 2rem;
  color: #e2e8dd;
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.search-panel {
  max-width: 46rem;
  padding: 1rem;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 0.9rem;
  box-shadow: 0 16px 40px rgb(0 0 0 / 14%);
}

.search-panel label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: 0.6rem;
}

input[type="search"] {
  min-width: 0;
  flex: 1;
  padding: 0.8rem 0.9rem;
  color: var(--ink);
  background: white;
  border: 1px solid #b8c2bb;
  border-radius: 0.55rem;
  font: inherit;
}

input[type="search"]:focus-visible,
button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #e08b62;
  outline-offset: 3px;
}

button {
  padding: 0.7rem 0.95rem;
  color: white;
  background: var(--green-soft);
  border: 0;
  border-radius: 0.55rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #38594f;
}

.results-count {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-panel {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.filter-label {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  color: var(--green);
  background: #f1eee5;
  border: 1px solid #d6d1c5;
  border-radius: 999px;
  font-size: 0.86rem;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  color: white;
  background: var(--green-soft);
  border-color: var(--green-soft);
}

.category-count {
  opacity: 0.75;
  font-size: 0.78rem;
}

.main-content {
  min-height: 45vh;
  padding: 2rem 0 4rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 1.15rem;
  align-items: start;
}

.recipe-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: 0 5px 16px rgb(41 48 40 / 5%);
}

.recipe-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #eee8dc;
}

.recipe-body {
  padding: 1.1rem 1.15rem 1.2rem;
}

.category-badge {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0.55rem;
  color: #155e53;
  background: #e8f0e9;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.recipe-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.15;
}

.servings {
  margin: 0.45rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.recipe-card details {
  border-top: 1px solid var(--line);
}

.recipe-card summary {
  padding: 0.8rem 0 0.15rem;
  color: #155e53;
  font-weight: 700;
  cursor: pointer;
}

.recipe-card summary:hover {
  color: var(--accent);
}

.recipe-details h3 {
  margin: 1rem 0 0.35rem;
  color: var(--green);
  font-size: 0.98rem;
}

.recipe-details ul,
.recipe-details ol {
  margin: 0;
  padding-left: 1.25rem;
}

.recipe-details li {
  margin: 0.3rem 0;
}

.recipe-details li::marker {
  color: var(--accent);
}

.source-line {
  margin: 0.65rem 0;
  white-space: pre-line;
}

.recipe-details h3:not(:first-child) {
  margin-top: 1.15rem;
}

.empty-state {
  padding: 2rem;
  color: var(--muted);
  text-align: center;
  background: var(--card);
  border: 1px dashed #b8c2bb;
  border-radius: 0.8rem;
}

.site-footer {
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0.35rem 0;
}

@media (max-width: 520px) {
  .header-inner,
  .main-content,
  .site-footer {
    width: min(100% - 1.25rem, 1120px);
  }

  .search-row {
    flex-direction: column;
  }

  .search-row button {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
