:root {
  --ink: #202725;
  --muted: #66716d;
  --line: #dce2dd;
  --paper: #fff;
  --wash: #f7f8f4;
  --forest: #194f43;
  --soft: #e5f1ec;
  --teal: #087e73;
  --tomato: #bc513f;
  --gold: #d39b2e;
  --blue: #425f93;
  --shadow: 0 20px 60px rgba(32, 39, 37, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.stats,
.filters,
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.banner {
  background: #fff;
  aspect-ratio: 2172 / 724;
  overflow: hidden;
  position: relative;
}
.banner img {
  display: block;
  height: auto;
  max-width: none;
  object-fit: cover;
  width: 100%;
}
.share-button {
  align-items: center;
  background: #c51f1a;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(197, 31, 26, 0.24);
  color: #fff;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  line-height: 1.15;
  min-height: 48px;
  padding: 0 20px;
  text-decoration: none;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.share-button:hover,
.share-button:focus-visible {
  background: #a91410;
  box-shadow: 0 18px 42px rgba(197, 31, 26, 0.32);
  outline: none;
  transform: translateY(-1px);
}
.banner-share {
  left: 64.5%;
  position: absolute;
  top: 66.5%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.banner-share:hover,
.banner-share:focus-visible {
  transform: translate(-50%, calc(-50% - 1px));
}
.button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 850;
  min-height: 46px;
  padding: 0 16px;
  text-decoration: none;
}
.eyebrow {
  color: var(--tomato);
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: 5rem;
  letter-spacing: 0;
  line-height: 0.96;
  margin-bottom: 18px;
}
.button { border: 0; }
.primary { background: var(--forest); color: #fff; }
.secondary, .reset { background: var(--soft); color: var(--forest); }

.stats {
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-left: 0;
  padding-right: 0;
}
.stats div { border-left: 1px solid var(--line); padding: 22px 24px; }
.stats div:last-child { border-right: 1px solid var(--line); }
.stats strong { color: var(--forest); display: block; font-size: 2.2rem; line-height: 1; }
.stats span { color: var(--muted); font-size: 0.78rem; font-weight: 850; text-transform: uppercase; }

.filters { padding-top: 32px; }
.filter-grid {
  align-items: end;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1.45fr) minmax(190px, 0.8fr) minmax(170px, 0.7fr) auto;
  padding: 14px;
}
.field { display: grid; gap: 7px; }
.field span, .check-field span {
  color: #5d6864;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field input, .field select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 46px;
  padding: 0 12px;
  width: 100%;
}
.check-field {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
}
.check-field input { accent-color: var(--teal); height: 18px; width: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; }
.chip {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  min-height: 38px;
  padding: 0 12px;
}
.chip.active { background: var(--forest); border-color: var(--forest); color: #fff; }

.section { padding-top: 54px; }
.section-head {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-head .eyebrow { margin-bottom: 0; }
.result-pill {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--forest);
  font-weight: 850;
  margin: 0;
  padding: 8px 11px;
}
.featured-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.recipe-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .contributor-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover, .card:focus-visible, .contributor-card:hover, .contributor-card:focus-visible {
  border-color: rgba(8, 126, 115, 0.55);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-2px);
}
.food-image { aspect-ratio: 4 / 3; background: var(--soft); overflow: hidden; }
.food-image img { height: 100%; object-fit: cover; width: 100%; }
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  background: #edf4f0;
  border-radius: 8px;
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 850;
  padding: 5px 8px;
}
.tag.dessert { background: #fff0d8; color: #7b5410; }
.tag.chutney { background: #f7e4de; color: #8d3528; }
.tag.beverage { background: #e6eff9; color: #1d4f84; }
.card h3 { font-size: 1.15rem; line-height: 1.22; margin-bottom: 8px; }
.ingredient { color: var(--tomato); font-weight: 850; margin-bottom: 10px; }
.excerpt {
  color: var(--muted);
  display: -webkit-box;
  font-size: 0.94rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.card-footer { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-top: auto; padding-top: 14px; }
.avatar-name { align-items: center; display: flex; gap: 8px; min-width: 0; }
.avatar { border-radius: 50%; height: 32px; object-fit: cover; width: 32px; }
.avatar-name span { font-size: 0.86rem; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read { background: var(--soft); border: 0; border-radius: 8px; color: var(--forest); font-size: 0.84rem; font-weight: 850; min-height: 34px; padding: 0 11px; }

.contributor-grid { display: grid; gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.contributor-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 292px;
  overflow: visible;
  padding: 18px 16px 20px;
  position: relative;
  text-align: center;
}
.contributor-face {
  background: linear-gradient(135deg, #fff7df, #e3f1ed);
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 168px;
  margin-bottom: 14px;
  padding: 5px;
  width: 168px;
}
.contributor-photo {
  background: var(--soft);
  border-radius: 50%;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.contributor-copy h3 {
  font-size: 1.05rem;
  line-height: 1.18;
  margin-bottom: 7px;
  overflow-wrap: anywhere;
}
.contributor-copy p {
  color: var(--tomato);
  font-size: 0.82rem;
  font-weight: 850;
  margin: 0;
}
.contributor-popover {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(25, 79, 67, 0.18);
  border-radius: 8px;
  bottom: 14px;
  box-shadow: var(--shadow);
  left: 14px;
  opacity: 0;
  padding: 10px;
  pointer-events: none;
  position: absolute;
  right: 14px;
  text-align: left;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 4;
}
.contributor-card:hover .contributor-popover,
.contributor-card:focus-visible .contributor-popover {
  opacity: 1;
  transform: translateY(0);
}
.popover-food {
  background: var(--soft);
  border-radius: 8px;
  margin-bottom: 9px;
  overflow: hidden;
}
.popover-food img {
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  width: 100%;
}
.contributor-popover span {
  color: var(--tomato);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.contributor-popover strong {
  color: var(--forest);
  display: block;
  line-height: 1.18;
}
.contributor-popover p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  margin: 5px 0 0;
}

dialog { border: 0; border-radius: 8px; box-shadow: var(--shadow); max-height: 92vh; max-width: 94vw; overflow: auto; padding: 0; }
dialog::backdrop { background: rgba(12, 22, 20, 0.58); }
.close { background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); float: right; font-size: 1.25rem; font-weight: 850; height: 38px; position: sticky; right: 14px; top: 14px; width: 38px; z-index: 5; }
.photo-viewer { background: var(--paper); display: grid; grid-template-columns: minmax(340px, 1.1fr) minmax(280px, 0.75fr); min-height: 580px; width: min(980px, 94vw); }
.large-photo { background: var(--soft); min-height: 580px; overflow: hidden; }
.large-photo img { height: 100%; object-fit: cover; width: 100%; }
.photo-copy { align-self: center; padding: 34px; }
.photo-copy h2, .story-copy h2 { font-size: 2.1rem; line-height: 1.08; margin-bottom: 12px; }
.photo-contributor { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 12px; margin: 20px 0 24px; padding-top: 18px; }
.photo-contributor img { border-radius: 50%; height: 54px; object-fit: cover; width: 54px; }
.story-layout { background: var(--paper); display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr); width: min(1040px, 94vw); }
.story-media { background: var(--forest); display: grid; grid-template-rows: minmax(320px, 1fr) auto; }
.story-media > img { height: 100%; object-fit: cover; width: 100%; }
.chef-block { align-items: center; color: #fff; display: flex; gap: 12px; padding: 18px; }
.chef-block img { border: 2px solid rgba(255, 255, 255, 0.65); border-radius: 50%; height: 62px; object-fit: cover; width: 62px; }
.story-copy { padding: 44px 38px 38px; }
.story-section { border-top: 1px solid var(--line); padding-top: 18px; }
.story-section + .story-section { margin-top: 20px; }
.story-section p { color: #3b4643; line-height: 1.62; white-space: pre-wrap; }
.load-row { display: flex; justify-content: center; padding-top: 26px; }
.share-cta {
  display: flex;
  justify-content: center;
  padding-bottom: 64px;
  padding-top: 42px;
}
.active-filters { color: var(--muted); margin-bottom: 14px; }
.active-filters:empty { display: none; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: 8px; grid-column: 1 / -1; padding: 28px; }

@media (max-width: 1060px) {
  .featured-grid, .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contributor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .section-head { align-items: flex-start; flex-direction: column; }
  .stats, .filters, .section { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 3.45rem; }
  .stats { grid-template-columns: repeat(2, 1fr); padding-left: 0; padding-right: 0; }
  .stats div { padding: 14px 10px; }
  .stats strong { font-size: 1.52rem; }
  .stats span { font-size: 0.68rem; }
  .banner {
    aspect-ratio: auto;
    overflow: visible;
  }
  .banner img {
    aspect-ratio: 2172 / 724;
    object-fit: cover;
  }
  .banner-share {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    box-shadow: none;
    display: flex;
    font-size: 0.7rem;
    left: auto;
    min-height: 36px;
    padding: 0 12px;
    position: static;
    text-align: center;
    top: auto;
    transform: none;
    white-space: normal;
    width: 100%;
  }
  .banner-share:hover,
  .banner-share:focus-visible {
    transform: none;
  }
  .contributor-face { height: 150px; width: 150px; }
  .filter-grid, .featured-grid, .contributor-grid, .recipe-grid, .photo-viewer, .story-layout { grid-template-columns: 1fr; }
  .large-photo { min-height: 320px; }
  .photo-copy, .story-copy { padding: 24px 20px 28px; }
}
