:root {
  --bg: #f6f1e8;
  --card: #ffffff;
  --text: #2d2a26;
  --muted: #6b645c;
  --accent: #001058;
  --accent-dark: #001058;
  --banner: #001058;
  --border: #ddd2c4;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

.header,
.search-section,
.filters,
.recipes,
.form-section {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 24px;
}

.header {
  width: 100%;
  margin: 0 0 24px;
  background: var(--banner);
  color: #fff;
  padding: 0;
  box-shadow: var(--shadow);
}

.header-top {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-section,
.filters,
.recipes,
.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.search-section input {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filters label {
  font-weight: 700;
}

select,
input,
textarea,
button {
  font: inherit;
}

select,
input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  margin-bottom: 10px;
}

select:focus,
input:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(139, 69, 19, 0.2);
  border-color: var(--accent);
}

.recipes h2,
.form-section h2 {
  margin-top: 0;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.recipe-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: #fffdfa;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.recipe-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.recipe-card p {
  margin: 8px 0;
}

.recipe-section {
  margin-top: 14px;
}

.recipe-section strong {
  display: block;
  margin-bottom: 8px;
}

.recipe-section ul {
  margin: 0;
  padding-left: 20px;
}

.recipe-form {
  display: grid;
  gap: 14px;
}

.primary-button,
.secondary-button,
.recipe-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button,
.recipe-form button {
  border: none;
  background: #fff;
  color: var(--banner);
}

.primary-button:hover,
.recipe-form button:hover {
  background: #f5e7df;
}

.secondary-button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

@media (max-width: 640px) {
  .search-section,
  .filters,
  .recipes,
  .form-section {
    width: min(100% - 20px, 1100px);
  }

  .search-section,
  .filters,
  .recipes,
  .form-section {
    padding: 16px;
  }

  .header-top {
    width: min(100% - 20px, 1100px);
    padding: 16px 0;
    align-items: stretch;
  }

  .header-actions {
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .recipe-form button {
    width: 100%;
  }
}

.header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: #fff;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* PETERS PLATE LOGO */
.logo {
  height: 80px;
  width: 80px;
  object-fit: contain;
  border-radius: 50%;
}

.bottom-action {
  position: sticky;
  bottom: 0;
  z-index: 20;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 16px 0 0;
  background: linear-gradient(to top, var(--bg) 75%, rgba(246, 241, 232, 0));
}

.bottom-action button {
  position: relative;
  z-index: 21;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.logo-link {
  display: inline-flex;
}

.recipe-badge {
  display: inline-block;
  width: fit-content;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e6ebff;
  color: var(--banner);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.recipe-description {
  color: var(--muted);
}

.view-recipe-button {
  margin-top: auto;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.view-recipe-button:hover {
  background: var(--accent-dark);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-panel {
  position: relative;
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-header h2 {
  margin: 6px 0 10px;
}

.modal-category {
  margin: 0;
  color: var(--banner);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.modal-description {
  margin: 0;
  color: var(--muted);
}

.modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 14px;
  background: #f5f7ff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.modal-meta p {
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .modal-panel {
    padding: 22px 18px;
  }
}
/* Add Recipe Page Layout */
.add-recipe-layout {
  max-width: 900px;
}

.form-intro {
  margin-bottom: 18px;
}

.form-intro h2 {
  margin-bottom: 6px;
}

.form-intro p {
  margin: 0;
  color: var(--muted);
}

.form-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdfa;
}

.form-card h3 {
  margin-top: 0;
  margin-bottom: 22px;
}

.recipe-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.field-help {
  margin-top: -4px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 16px;
  }
}

.recipe-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.recipe-menu-wrapper {
  position: relative;
}

.recipe-menu-trigger {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.recipe-menu-trigger:hover {
  color: var(--banner);
}

.recipe-menu {
  position: absolute;
  top: 28px;
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
  z-index: 30;
}

.recipe-menu.menu-open {
  display: block;
}

.recipe-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

.recipe-menu-item:hover {
  background: #f5f7ff;
}

.recipe-menu-item.delete-item {
  color: #a12626;
}

.recipe-menu-item.delete-item:hover {
  background: #fff1f1;
}