:root {
  color-scheme: light;
  --ink: #211d18;
  --muted: #6f665c;
  --line: #e0d4c3;
  --paper: #fff9ee;
  --panel: #ffffff;
  --panel-warm: #fff3dd;
  --accent: #2d765f;
  --accent-dark: #174d3f;
  --warm: #c84e32;
  --gold: #f2b84b;
  --shadow: 0 18px 45px rgba(70, 42, 21, 0.12);
  --soft-shadow: 0 10px 28px rgba(70, 42, 21, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(242, 184, 75, 0.22), transparent 28rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0 25%, transparent 25% 50%, rgba(255, 255, 255, 0.45) 50% 75%, transparent 75%),
    var(--paper);
  background-size: auto, 18px 18px, auto;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

button,
.button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover,
.button:hover {
  box-shadow: 0 8px 22px rgba(23, 77, 63, 0.22);
  transform: translateY(-1px);
}

.site-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(255, 249, 238, 0.86);
  border-bottom: 1px solid rgba(224, 212, 195, 0.8);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 5vw;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--warm);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(200, 78, 50, 0.22);
  color: #fff;
  display: inline-flex;
  font-size: 0.9rem;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.site-header nav {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.site-header form {
  margin: 0;
}

.site-header button {
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
}

main {
  margin: 0 auto;
  max-width: 1120px;
  padding: 2rem 5vw 4rem;
}

.search-band,
.admin-toolbar {
  align-items: end;
  background: linear-gradient(135deg, rgba(255, 243, 221, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(224, 212, 195, 0.82);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  margin-bottom: 2rem;
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  position: relative;
}

.search-band::after {
  background:
    linear-gradient(90deg, var(--warm), var(--gold), var(--accent)),
    var(--gold);
  bottom: 0;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
}

.eyebrow {
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 6vw, 4.85rem);
  font-weight: 800;
  max-width: 11ch;
}

h2 {
  font-size: 1.18rem;
}

.search-form {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
}

input,
textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(129, 111, 91, 0.28);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 0.75rem;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 118, 95, 0.14);
  outline: 0;
}

.lede {
  font-size: 1.08rem;
  max-width: 48rem;
}

.results-note {
  color: var(--muted);
  font-weight: 700;
  margin: -0.5rem 0 1.25rem;
}

.recipe-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recipe-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(70, 42, 21, 0.04);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.recipe-card:hover {
  border-color: rgba(200, 78, 50, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.recipe-card-media {
  align-items: center;
  aspect-ratio: 1.08 / 1;
  background:
    radial-gradient(circle at 70% 28%, rgba(255, 255, 255, 0.44), transparent 7rem),
    linear-gradient(135deg, #fff8ec, #f7ead7);
  color: #fff;
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 15vw, 7rem);
  font-weight: 800;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
  text-decoration: none;
}

.recipe-card-media img {
  display: block;
  height: auto;
  max-height: 88%;
  max-width: 88%;
  object-fit: contain;
  transition: transform 240ms ease;
  width: auto;
}

.recipe-card:hover .recipe-card-media img {
  transform: scale(1.02);
}

.recipe-card > img {
  aspect-ratio: 1.08 / 1;
  background: linear-gradient(135deg, #fff8ec, #f7ead7);
  display: block;
  height: auto;
  margin: 1rem auto 0;
  max-width: calc(100% - 2rem);
  object-fit: contain;
  padding: 0.5rem;
  width: auto;
}

.recipe-card div {
  padding: 1rem;
}

.recipe-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.recipe-card h2 a:hover {
  color: var(--warm);
}

.recipe-card p,
.lede,
.empty {
  color: var(--muted);
}

.recipe-detail {
  align-items: start;
  display: grid;
  gap: 0 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  max-width: 1120px;
}

.recipe-detail > :not(.hero-image):not(.recipe-detail-layout) {
  grid-column: 1;
}

.recipe-detail > .hero-image {
  align-self: start;
  background: linear-gradient(135deg, #fff8ec, #f7ead7);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: block;
  grid-column: 2;
  grid-row: 1 / span 4;
  justify-self: end;
  margin: 0;
  max-height: 520px;
  max-width: 360px;
  object-fit: contain;
  padding: 0.75rem;
  position: sticky;
  top: 88px;
  width: 100%;
}

.recipe-detail-layout {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
}

.recipe-copy {
  min-width: 0;
}

.recipe-side-image {
  align-self: start;
  background: linear-gradient(135deg, #fff8ec, #f7ead7);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  justify-self: end;
  margin-left: auto;
  max-width: 360px;
  padding: 0.75rem;
  position: sticky;
  top: 88px;
  width: 100%;
}

.recipe-side-image img,
.recipe-side-image .hero-placeholder {
  display: block;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  width: 100%;
}

.recipe-heading {
  background: rgba(255, 249, 238, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.recipe-heading h1 {
  max-width: 16ch;
}

.hero-placeholder {
  align-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.36), transparent 11rem),
    linear-gradient(135deg, var(--warm), var(--accent-dark));
  color: #fff;
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7rem, 20vw, 13rem);
  font-weight: 800;
  justify-content: center;
}

.recipe-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}

.ingredients-panel,
.instructions-panel,
.recipe-columns > section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(224, 212, 195, 0.78);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.ingredients-panel {
  align-self: start;
  background: var(--panel-warm);
}

.recipe-columns > section:first-child {
  align-self: start;
  background: var(--panel-warm);
}

.ingredients-panel ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.ingredients-panel li,
.instruction-list li {
  margin-top: 0.65rem;
}

.instruction-list {
  counter-reset: steps;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.instruction-list li {
  border-bottom: 1px solid rgba(224, 212, 195, 0.72);
  counter-increment: steps;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 2rem minmax(0, 1fr);
  padding: 0 0 0.9rem;
}

.instruction-list li::before {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  content: counter(steps);
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 800;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.admin-panel,
.table-wrap {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: 1.25rem;
}

.admin-panel.narrow {
  max-width: 440px;
}

.admin-panel form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.checkbox {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.checkbox input {
  width: auto;
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions,
.actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.actions form {
  margin: 0;
}

.flash-list {
  margin: 1rem auto 0;
  max-width: 1120px;
  padding: 0 5vw;
}

.flash {
  border-radius: 6px;
  border: 1px solid rgba(224, 212, 195, 0.8);
  padding: 0.75rem 1rem;
}

.flash.success {
  background: #e7f5ee;
}

.flash.error {
  background: #ffe9e2;
}

@media (max-width: 760px) {
  .search-band,
  .admin-toolbar,
  .recipe-detail,
  .recipe-detail-layout,
  .recipe-columns,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

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

  .recipe-side-image {
    position: static;
  }

  .recipe-detail > .hero-image {
    grid-column: 1;
    grid-row: auto;
    max-width: 100%;
    position: static;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    padding-top: 0.85rem;
  }
}
