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

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.6;
  color: #2d2d2d;
  background: #fafaf8;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: #2d2d2d;
  text-decoration: none;
}

.nav-logo {
  height: 16px;
  width: auto;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links a {
  color: #2d2d2d;
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-links a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 480px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 0.75rem;
  }
}

main {
  min-height: 60vh;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 1rem;
}

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

main li {
  margin-bottom: 0.3rem;
}

figure {
  margin-bottom: 1.5rem;
}

figure .recipe-hero {
  margin-bottom: 0;
}

figcaption {
  font-style: italic;
  color: #888;
  font-size: 0.85rem;
  margin-top: 0.35rem;
  text-align: right;
}

.link-grid {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.link-grid-3col {
  grid-template-columns: repeat(3, 1fr);
}

.link-grid-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #2d2d2d;
  transition: border-color 0.15s, background 0.15s;
}

.link-grid-item a:hover {
  border-color: #1a5c2e;
  background: #f0f7f2;
}

.link-grid-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.link-grid-arrow {
  color: #1a5c2e;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .link-grid {
    grid-template-columns: 1fr;
  }

  .link-grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }
}

.recipe-search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.home-search-wrap {
  margin-bottom: 1.5rem;
}

.recipe-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #999;
  pointer-events: none;
}

.recipe-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem 0.55rem 2.1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

.recipe-search:focus {
  outline: none;
  border-color: #1a5c2e;
  box-shadow: 0 0 0 2px rgba(26, 92, 46, 0.15);
}

.recipe-filters {
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: #f7f7f7;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.filter-row select {
  grid-column: 2 / -1;
  font-size: 0.9rem;
  padding: 0.4rem 1.75rem 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 0.5l4 4.5 4-4.5' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 0.6rem center;
  appearance: none;
}

.filter-row select:focus {
  outline: none;
  border-color: #1a5c2e;
  box-shadow: 0 0 0 2px rgba(26, 92, 46, 0.15);
}

.recipe-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.btn-primary,
.btn-secondary {
  display: block;
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: #1a5c2e;
  color: #fff;
}

.btn-primary:hover {
  background: #155024;
}

.btn-secondary {
  background: #fff;
  color: #1a5c2e;
  border: 1px solid #1a5c2e;
}

.btn-secondary:hover {
  background: #f0f7f2;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.feature-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: #e8f5e9;
  color: #1a5c2e;
  line-height: 1.4;
  text-decoration: none;
}

a.feature-tag:hover {
  background: #c8e6c9;
}

.category-tag, a.category-tag:hover {
  background: #f0f0f0;
  color: #888;
}

a.category-tag:hover {
  background: #e4e4e4;
}

.feature-toggles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
}

#category-toggles {
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}

.feature-toggles-label {
  font-size: 0.75rem;
  color: #999;
  display: flex;
  align-items: center;
}

.feature-toggle {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  background: #f7f7f7;
  color: #999;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.feature-toggle:hover {
  border-color: #aaa;
  color: #555;
}

.feature-toggle.active {
  background: #e8f5e9;
  border-color: #b6d8bf;
  color: #2d6a3f;
}

@media (max-width: 500px) {
  .feature-toggles,
  .filter-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .feature-toggles-label {
    grid-column: 1 / -1;
  }

  .filter-row select {
    grid-column: 1 / -1;
  }
}

.recipe-card .feature-tags {
  margin-top: 0.3rem;
}

.recipe-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recipe-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s;
  max-width: 100%;
}

.recipe-card:hover {
  border-color: #b0b0b0;
}

.recipe-card a {
  display: flex;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.recipe-card-img {
  width: 120px;
  aspect-ratio: 4/3;
  object-fit: cover;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 0 5px 5px 0;
}

.recipe-card-placeholder {
  display: block;
  background: #e8e8e8;
  background-image: url("/static/logo.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 32px;
  opacity: 0.3;
}

.recipe-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.recipe-card-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #1a5c2e;
}

.recipe-card .description {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.recipe-header {
  margin-bottom: 1.5rem;
}

.recipe-header h1 {
  margin-bottom: 0.25rem;
}

.recipe-page-description {
  color: #666;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.recipe-page-tags {
  margin-bottom: 0;
}

.recipe-hero {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.recipe-card-flags {
  position: absolute;
  top: 0.5rem;
  right: calc(120px + 0.5rem);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.star-icon {
  width: 1rem;
  height: 1rem;
  color: #d4a017;
}

.no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
}

.no-results .btn-secondary {
  display: inline-block;
  margin-top: 0.5rem;
}

.landing-disclaimer {
  margin-top: 1rem;
  font-style: italic;
  font-size: 0.85rem;
  color: #999;
}

.recipe-blurb {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 0.75rem;
}

.recipe-blurb a {
  color: #999;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  color: #999;
  font-size: 0.85rem;
}

footer a {
  color: #999;
}

footer p:last-child a {
  margin-right: 1rem;
}

/* Comparison table */

.comparison-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: 1rem;
  padding-right: 1rem;
}

.comparison-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
  margin: 0 auto;
}

.comparison-table th,
.comparison-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  text-align: center;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: none;
}

.comparison-table th {
  font-weight: 600;
  font-size: 0.75rem;
  color: #666;
}

.comparison-table th a {
  color: #1a5c2e;
  text-decoration: none;
}

.comparison-table th a:hover {
  text-decoration: underline;
}

.comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.comparison-table td:first-child a {
  color: #1a5c2e;
  text-decoration: none;
}

.comparison-table td:first-child a:hover {
  text-decoration: underline;
}

.comparison-table .check {
  color: #1a5c2e;
}

.appliance-links-cell {
  text-align: left;
  display: flex;
  gap: 0.4rem;
}

.appliance-links-cell a {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border: 1px solid #1a5c2e;
  border-radius: 4px;
  color: #1a5c2e;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.appliance-links-cell a:hover {
  background: #f0f7f2;
}

/* 404 */

.not-found {
  text-align: center;
  padding: 4rem 1rem;
}

.not-found h1 {
  font-size: 5rem;
  color: #ddd;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.not-found p {
  color: #777;
  margin-bottom: 1.5rem;
}

.not-found .btn-primary {
  display: inline-block;
  background: #1a5c2e;
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
}

.not-found .btn-primary:hover {
  background: #155024;
}

/* Gallery */

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.gallery-item {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  transition: border-color 0.15s;
}

.gallery-item:hover {
  border-color: #b0b0b0;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.gallery-item-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  background: #e8e8e8;
  background-image: url("/static/logo.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 64px;
  opacity: 0.5;
}

.gallery-item-label {
  padding: 0.6rem 0.8rem;
  font-weight: 500;
  color: #1a5c2e;
}
