:root {
  --ink: #26322d;
  --muted: #6f7772;
  --paper: #fffdf9;
  --cream: #f5eee4;
  --terracotta: #bd4b30;
  --sage: #dae3d3;
  --line: #e7ded3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background: var(--paper);
}
.shell {
  width: min(1140px, calc(100% - 40px));
  margin: auto;
}
.site-header {
  height: 76px;
  background: var(--paper);
  display: flex;
  align-items: center;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-family: "Playfair Display", serif;
  color: var(--ink);
  font-size: 25px;
  font-weight: 700;
  text-decoration: none;
}
.brand span {
  color: var(--terracotta);
  font-family: Arial;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 6px #26322d1f;
  vertical-align: -7px;
  margin-right: 10px;
}
.nav nav {
  display: flex;
  align-items: center;
  gap: 25px;
}
.nav nav > a:not(.button),
.back {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.button {
  background: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 5px;
  color: #fff;
  padding: 12px 18px;
  text-decoration: none;
  font: 600 14px "DM Sans";
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.button:hover,
.remove-row:hover,
.tag-checks label:hover {
  background: var(--terracotta);
  color: white;
}
.button-small {
  padding: 9px 13px;
}
.button-dark {
  background: var(--ink);
  border-color: var(--ink);
}
.button-outline {
  background: transparent;
  color: var(--terracotta);
  border-color: var(--terracotta);
}
.button-link {
  border: 0;
  background: none;
  color: #9b4938;
  font: 600 14px "DM Sans";
  cursor: pointer;
  padding: 10px;
}
.hero {
  min-height: 400px;
  background: var(--cream);
  position: relative;
  overflow: hidden;
}
.hero:after {
  content: "✳";
  position: absolute;
  right: 8%;
  top: 17px;
  font: 300px Georgia;
  color: #ead9c4;
  opacity: 0.7;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 68px 0;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: var(--terracotta);
  margin: 0 0 13px;
}
.hero h1,
.recipe-hero h1,
.form-heading h1 {
  font:
    700 clamp(38px, 5vw, 62px)/1.04 "Playfair Display",
    serif;
  letter-spacing: -1.8px;
  margin: 0;
}
.hero h1 em {
  color: var(--terracotta);
  font-style: normal;
}
.hero p:not(.eyebrow) {
  color: #626963;
  max-width: 470px;
  font-size: 17px;
  line-height: 1.6;
  margin: 19px 0 27px;
}
.listing {
  padding: 0 0 80px;
}
.filters {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr auto;
  gap: 10px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 25px #33200a0b;
  position: relative;
}
.filters input,
.filters select,
.recipe-form input,
.recipe-form textarea,
.recipe-form select {
  min-width: 0;
  width: 100%;
  padding: 12px;
  border: 1px solid #dcd5ca;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: 14px "DM Sans";
  outline-color: var(--terracotta);
}
.search {
  position: relative;
}
.search span {
  position: absolute;
  left: 13px;
  top: 7px;
  font-size: 25px;
  color: var(--muted);
}
.search input {
  padding-left: 38px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 55px 0 23px;
}
.section-heading h2,
.form-card h2,
.detail-grid h2 {
  font: 700 30px "Playfair Display";
  margin: 0;
}
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.recipe-card {
  border: 1px solid var(--line);
  background: #fff;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px #5d37141a;
}
.card-image {
  height: 195px;
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
}
.card-image span,
.hero-image span {
  font-size: 58px;
  filter: saturate(0.8);
}
.card-image img,
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-content {
  padding: 19px 20px 22px;
}
.tag-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.tag {
  padding: 4px 8px;
  border-radius: 20px;
  background: #eef2e9;
  color: #496044;
  font-weight: 700;
}
.tag-2 {
  background: #faecd1;
  color: #98651b;
}
.tag-3 {
  background: #f5dfd9;
  color: #a14531;
}
.muted {
  color: var(--muted);
}
.card-content h3 {
  font: 700 23px "Playfair Display";
  margin: 13px 0 8px;
}
.card-content h3 a {
  color: inherit;
  text-decoration: none;
}
.card-content p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
.notice {
  margin: 22px 0 -18px;
  padding: 13px 16px;
  background: #e8f1e2;
  border-left: 3px solid #72915a;
  color: #405535;
}
.empty {
  text-align: center;
  padding: 75px 20px;
  background: #fff;
  border: 1px dashed #d6cabb;
}
.empty div {
  font-size: 45px;
}
.empty h2 {
  font: 700 30px "Playfair Display";
  margin: 12px 0 7px;
}
.empty p {
  color: var(--muted);
  margin: 0 0 24px;
}
.recipe-hero {
  background: var(--cream);
  padding: 23px 0 48px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 36px;
}
.breadcrumb a {
  color: var(--terracotta);
  text-decoration: none;
}
.breadcrumb span {
  margin: 0 8px;
}
.recipe-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 70px;
  align-items: center;
}
.recipe-hero h1 {
  font-size: 54px;
}
.lead {
  font-size: 17px;
  line-height: 1.6;
  color: #5c665f;
  max-width: 570px;
}
.stats {
  display: flex;
  gap: 25px;
  margin: 25px 0;
  font-size: 14px;
  color: var(--muted);
}
.stats b {
  color: var(--ink);
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.actions form {
  margin: 0;
}
.hero-image {
  height: 340px;
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 90px;
  padding: 65px 0 90px;
}
.ingredients {
  background: #f7f2ea;
  padding: 29px;
}
.ingredients h2,
.instructions h2 {
  margin-bottom: 24px;
}
.ingredients ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ingredients li {
  border-top: 1px solid #ded5c7;
  padding: 13px 0;
  font-size: 14px;
  line-height: 1.45;
}
.ingredients li span {
  color: var(--terracotta);
  font-weight: 700;
  margin-right: 2px;
}
.recipe-notes {
  font-size: 16px;
  line-height: 1.85;
  color: #4f5a53;
  max-width: 650px;
}
.form-page {
  padding: 42px 0 85px;
}
.back {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--terracotta);
}
.form-heading {
  margin-bottom: 32px;
}
.form-heading h1 {
  font-size: 48px;
}
.form-heading p:not(.eyebrow),
.form-card-title p {
  color: var(--muted);
  margin: 8px 0 0;
}
.recipe-form {
  display: grid;
  gap: 18px;
}
.form-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 27px;
}
.form-card h2 {
  font-size: 27px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
  margin-top: 20px;
}
.form-grid label {
  font-size: 13px;
  font-weight: 700;
  color: #56605a;
  display: grid;
  gap: 7px;
}
.full {
  grid-column: 1/-1;
}
.form-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ingredient-fields {
  margin-top: 19px;
  display: grid;
  gap: 9px;
}
.ingredient-row {
  display: grid;
  grid-template-columns: 26px 2fr 0.72fr 0.8fr 1.25fr 35px;
  gap: 8px;
}
.related-row {
  grid-template-columns: minmax(0, 3fr) minmax(210px, 1.5fr) 35px;
}
.related-section {
  padding: 48px 0 85px;
}
.related-section h2 {
  margin: 0 0 20px;
}
.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.related-card {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  min-width: 0;
  gap: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px #33200a12;
}
.related-card-image {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--cream);
  font-size: 25px;
}
.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-card-content {
  min-width: 0;
}
.related-card-content p {
  margin: 0 0 4px;
  font-size: 12px;
}
.related-card-content h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 19px 'Playfair Display';
}
.row-order {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.row-order button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  color: var(--muted);
  width: 26px;
  height: 17px;
  line-height: 14px;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
}
.row-order button:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}
.row-order button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.remove-row {
  border: 1px solid #e7d3cc;
  background: #fff7f5;
  border-radius: 4px;
  color: var(--terracotta);
  font-size: 21px;
  cursor: pointer;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
}
.form-actions > a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
footer {
  background: #26322d;
  color: #d9dfd6;
  padding: 25px 0;
  font-size: 13px;
}
@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 1140px);
  }
  .site-header {
    height: 66px;
  }
  .nav nav > a:not(.button) {
    display: none;
  }
  .hero {
    min-height: 340px;
  }
  .hero-inner {
    padding: 53px 0;
  }
  .filters {
    grid-template-columns: 1fr;
    margin-top: -28px;
  }
  .recipe-grid {
    grid-template-columns: 1fr;
  }
  .section-heading {
    margin-top: 42px;
  }
  .recipe-layout,
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .recipe-hero h1 {
    font-size: 42px;
  }
  .hero-image {
    height: 250px;
  }
  .detail-grid {
    padding: 45px 0;
  }
  .form-page {
    padding-top: 30px;
  }
  .form-heading h1 {
    font-size: 39px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .ingredient-row {
    grid-template-columns: 26px 1fr 72px 80px 1fr 35px;
  }
  .related-row {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) 35px;
  }
  .form-card {
    padding: 19px;
  }
  .form-card-title {
    align-items: flex-start;
    gap: 10px;
  }
  .stats {
    gap: 13px;
    flex-wrap: wrap;
  }
}
@media (max-width: 480px) {
  .ingredient-row {
    grid-template-columns: 26px 1fr 1fr 34px;
  }
  .ingredient-row select:nth-child(2) {
    grid-column: 2/-1;
  }
  .related-row select:first-child {
    grid-column: 1/-1;
  }
  .related-row select:nth-child(2) {
    grid-column: 1/4;
  }
  .ingredient-row input:nth-child(5) {
    grid-column: 2/4;
  }
  .row-order {
    grid-row: 1/-1;
  }
  .hero h1 {
    font-size: 39px;
  }
  .button {
    padding: 11px 14px;
  }
}
.logout {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
}
.access-page {
  min-height: calc(100vh - 126px);
  display: grid;
  place-items: center;
  padding: 45px 20px;
  background: var(--cream);
}
.access-card {
  width: min(440px, 100%);
  background: var(--paper);
  padding: 42px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px #40271214;
}
.access-card .brand {
  display: inline-block;
  margin-bottom: 42px;
}
.access-card h1 {
  font: 700 37px/1.1 "Playfair Display";
  margin: 0 0 12px;
}
.access-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 26px;
}
.access-card form {
  display: grid;
  gap: 20px;
}
.access-card label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #56605a;
}
.access-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #dcd5ca;
  border-radius: 4px;
  font: 15px "DM Sans";
  outline-color: var(--terracotta);
}
.access-card .button {
  width: 100%;
}
.login-error {
  padding: 11px 13px;
  background: #f8e4df;
  border-left: 3px solid var(--terracotta);
  color: #803725;
  font-size: 13px;
  margin: 0 0 18px;
}
.filters {
  grid-template-columns: 1.45fr 1fr 1fr 1fr auto;
}
.notice-error {
  background: #f8e4df;
  border-left-color: var(--terracotta);
  color: #803725;
}
.tag-category-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.tag-field {
  border: 1px solid var(--line);
  padding: 14px;
  margin: 0;
}
.tag-field legend {
  font-size: 13px;
  font-weight: 700;
  color: #56605a;
  padding: 0 6px;
}
.tag-checks {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.tag-checks label,
.recipe-tags a {
  border: 1px solid #ead8cf;
  background: #fff7f4;
  color: #8f3d29;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tag-checks input {
  width: auto;
  margin-right: 5px;
}
.recipe-tags {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}
.recipe-tags div {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.recipe-tags span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.recipe-tags a {
  text-decoration: none;
}
.tags-admin {
  display: grid;
  gap: 18px;
}
.tags-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.inline-admin-form {
  grid-template-columns: 1fr 120px auto;
  align-items: end;
  margin-top: 20px;
}
.inline-admin-form.tag-create {
  grid-template-columns: 1fr 1fr 90px auto;
}
.inline-admin-form label {
  font-size: 13px;
  font-weight: 700;
  color: #56605a;
  display: grid;
  gap: 7px;
}
.admin-category-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.admin-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.category-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.admin-tags {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}
.admin-tags .muted {
  margin: 0;
}
.tag-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.row-icon {
  font-size: 17px;
  line-height: 1;
}
.admin-edit-row {
  display: grid;
  grid-template-columns: 1fr 90px auto;
  gap: 8px;
  align-items: center;
}
.admin-edit-row.tag-edit {
  grid-template-columns: 150px 1fr 80px auto;
}
.admin-delete-form {
  margin: 0;
}
.admin-edit-row input,
.admin-edit-row select {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcd5ca;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: 14px "DM Sans";
  outline-color: var(--terracotta);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.icon-btn:hover {
  border-color: #d7c9ba;
  background: #fff8f1;
}
.icon-btn-danger:hover {
  border-color: #e3b9ad;
  background: #fdf0ec;
  color: #bd4b30;
}
.nav-menu {
  position: relative;
}
.menu-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: 700 22px/1 "DM Sans";
  cursor: pointer;
}
.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  border-color: #d7c9ba;
  background: #fff8f1;
}
.menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 170px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 35px #33200a18;
  z-index: 20;
  padding: 7px;
}
.nav-menu.is-open .menu-panel {
  display: grid;
}
.menu-panel a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 4px;
}
.menu-panel a:hover {
  background: #f7f2ea;
}
.menu-panel .logout {
  color: #9b4938;
}
@media (max-width: 980px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters .search,
  .filters button {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  .filters {
    grid-template-columns: 1fr;
  }
  .tags-create-grid {
    grid-template-columns: 1fr;
  }
  .inline-admin-form {
    grid-template-columns: 1fr;
  }
  .category-head,
  .tag-row {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
  .category-head .admin-edit-row,
  .tag-row .admin-edit-row {
    grid-template-columns: 1fr 70px auto;
  }
  .tag-edit select {
    grid-column: 1/-1;
  }
  .row-icon {
    display: none;
  }
  .tag-checks {
    display: grid;
  }
  .recipe-tags div {
    align-items: flex-start;
  }
}
@media (max-width: 760px) {
  .nav nav .menu-panel a {
    display: block;
  }
  .nav nav {
    gap: 10px;
  }
  .menu-panel {
    right: 0;
  }
}
