:root {
  color-scheme: light;
  --ink: #293747;
  --ink-soft: #5c6975;
  --blue: #7189a2;
  --blue-dark: #435d78;
  --blue-pale: #dfe8ef;
  --cream: #f7f3e9;
  --paper: #fffefa;
  --tape: #eee9d7;
  --line: #aab9c6;
  --danger: #9b433e;
  --shadow: 0 18px 45px rgb(43 55 67 / 15%);
  --hand: "Snell Roundhand", "Apple Chancery", "URW Chancery L", "Segoe Script", cursive;
  --body: Avenir, "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: #f4f1e9;
  background-image:
    linear-gradient(rgb(113 137 162 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(113 137 162 / 3.5%) 1px, transparent 1px);
  background-size: 34px 34px;
  font: 16px/1.6 var(--body);
}

a { color: var(--blue-dark); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

.gingham-band {
  height: 18px;
  border-bottom: 1px solid #8fa2b5;
  background-color: #d9e3eb;
  background-image:
    linear-gradient(90deg, rgb(255 255 255 / 62%) 50%, transparent 50%),
    linear-gradient(rgb(255 255 255 / 62%) 50%, transparent 50%);
  background-size: 18px 18px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1.25rem, calc((100vw - 1120px) / 2));
  border-bottom: 3px double var(--blue);
  background: rgb(255 254 250 / 95%);
}

.site-name {
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-name span {
  display: inline-block;
  margin-right: .25rem;
  color: var(--blue-dark);
  font: 1.8rem/1 var(--hand);
  letter-spacing: 0;
  text-transform: none;
  transform: rotate(-2deg);
}

.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-actions form { margin: 0; }
.text-button {
  border: 0;
  padding: .35rem;
  color: var(--blue-dark);
  background: transparent;
  box-shadow: none;
  font-size: .72rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.text-button:hover { color: var(--ink); background: transparent; }

.page {
  width: min(1120px, calc(100% - 2.5rem));
  min-height: calc(100vh - 180px);
  margin: 2.5rem auto;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 50px solid transparent;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    repeating-conic-gradient(#b3c2cc 0 25%, #f0f1ed 0 50%) 0 / 34px 34px border-box;
  box-shadow: var(--shadow);
  outline: 2px solid #879dac;
  outline-offset: -57px;
}

.site-footer {
  padding: 1rem 1.25rem 2.5rem;
  color: var(--ink-soft);
  font-size: .72rem;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
}

h1, h2 { color: #29343e; line-height: 1.2; }
h1 { margin: 0 0 .5rem; font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.02em; }
h1 span { font-family: var(--hand); font-weight: 500; }
h2 { font-family: var(--hand); font-weight: 600; }

.eyebrow, .category-label, .recipe-filters label {
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.section-title {
  margin-bottom: 1.1rem;
  color: var(--ink);
  font: 500 clamp(1.65rem, 3vw, 2.2rem)/1.15 var(--hand);
  letter-spacing: .02em;
  text-align: center;
}

.button, button {
  display: inline-block;
  border: 1px solid var(--blue-dark);
  border-radius: 2px;
  padding: .65rem 1rem;
  color: white;
  background: var(--blue-dark);
  box-shadow: 3px 3px 0 var(--blue-pale);
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--ink); }
.button-secondary { color: var(--blue-dark); background: var(--paper); }
.button-danger { border-color: var(--danger); background: var(--danger); }

.intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin: 0 auto 2rem; text-align: center; }
.intro > div { width: 100%; }
.intro h1 { display: inline-block; position: relative; padding: .1rem 2.6rem .25rem; }
.intro h1::before {
  position: absolute;
  z-index: -1;
  inset: .1em 0 0;
  background: var(--tape);
  content: "";
  transform: rotate(-1.5deg);
}
.intro p:last-child, .lead { color: var(--ink-soft); font-size: 1.05rem; }

.recipe-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(160px, 1fr) auto auto;
  align-items: end;
  gap: .8rem;
  margin: 0 0 2.3rem;
  padding: 1.15rem;
  border: 1px solid #cdd7dd;
  border-radius: 3px;
  background: #eef2f2;
  box-shadow: 4px 4px 0 #e2e8ea;
}
.recipe-filters label { display: block; margin-bottom: .28rem; }
.clear-link { align-self: center; font-size: .85rem; }

input, textarea, select {
  width: 100%;
  border: 1px solid #8799aa;
  border-radius: 1px;
  padding: .67rem .75rem;
  color: var(--ink);
  background: rgb(255 255 255 / 90%);
  font: inherit;
}
input:focus, textarea:focus, select:focus, button:focus, a:focus { outline: 3px solid #bfd0dd; outline-offset: 2px; }
textarea { resize: vertical; }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 1.5rem; }
.recipe-card {
  position: relative;
  overflow: hidden;
  border: 3px double var(--blue);
  border-radius: 0 12px 0 12px;
  background: var(--paper);
  box-shadow: 5px 7px 0 #dce5eb;
}
.recipe-card > a { display: block; height: 100%; color: inherit; text-decoration: none; }
.recipe-card img, .image-placeholder { width: 100%; height: 185px; object-fit: cover; border-bottom: 1px solid var(--line); }
.image-placeholder {
  display: grid;
  place-items: center;
  color: var(--blue);
  background-color: #edf2f4;
  background-image:
    linear-gradient(45deg, #d6e0e7 25%, transparent 25%, transparent 75%, #d6e0e7 75%),
    linear-gradient(45deg, #d6e0e7 25%, transparent 25%, transparent 75%, #d6e0e7 75%);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  font-size: 2rem;
}
.card-body { padding: 1.1rem 1.2rem 1.35rem; }
.card-body h2 { margin: .2rem 0 .35rem; font-size: 1.55rem; }
.card-body p:not(.category-label) { color: var(--ink-soft); }
.card-body small { color: var(--ink-soft); }
.recipe-card:hover { transform: translateY(-3px) rotate(-.3deg); transition: transform .15s ease; }
.category-label { display: inline-block; margin: 0; text-decoration: none; }

.empty-state, .confirmation { padding: 4rem 1rem; text-align: center; }
.empty-state h1, .confirmation h1 { font-size: 2.5rem; }
.notice { margin: 0 1rem 1.5rem; border: 1px solid var(--blue); padding: .8rem 1rem; background: #edf3f6; box-shadow: 3px 3px 0 #dbe5eb; }
.notice-error { border-color: var(--danger); background: #f7eae7; }
.narrow { width: min(760px, 100%); margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 1.5rem; }

.login-card { width: min(500px, 100%); margin: 3rem auto; text-align: center; }
.login-card > p:not(.eyebrow) { color: var(--ink-soft); }
.login-card form { margin-top: 2rem; padding: 1.5rem; border: 1px solid #cdd7dd; background: #eef2f2; box-shadow: 5px 5px 0 #e2e8ea; text-align: left; }
.login-card label { display: block; margin-bottom: .4rem; font-weight: 700; }
.login-card button { width: 100%; margin-top: 1rem; }

.recipe-form { margin-top: 2rem; padding-top: .5rem; border-top: 1px dashed var(--blue); }
.recipe-form > label, .form-row label { display: block; margin: 1.2rem 0 .35rem; color: var(--ink); font-weight: 700; }
.field-help { margin: -.2rem 0 .35rem; color: var(--ink-soft); font-size: .88rem; }
.form-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.current-image { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.current-image img { width: 130px; height: 90px; border: 3px double var(--blue); object-fit: cover; }
.current-image .checkbox { margin: 0; font-weight: 400; }
.checkbox input { width: auto; }

.recipe-detail { width: min(950px, 100%); margin: 0 auto; }
.recipe-heading { max-width: 760px; margin: 0 auto 2.75rem; text-align: center; }
.recipe-heading h1 span { display: inline-block; margin-top: .2rem; padding: .05rem 2rem .2rem; background: var(--tape); transform: rotate(-1deg); }
.recipe-heading .lead { max-width: 650px; margin: .8rem auto 0; }
.recipe-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 3rem;
  border-bottom: 2px dashed var(--blue);
}
.recipe-essentials { min-width: 0; }
.recipe-photo {
  position: relative;
  margin: 0;
  padding: .55rem;
  border: 2px solid var(--blue-dark);
  background: var(--paper);
  box-shadow: 7px 8px 0 var(--blue-pale);
  transform: rotate(1deg);
}
.recipe-photo::before {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 72px;
  height: 25px;
  background: rgb(238 233 215 / 88%);
  content: "";
  transform: translateX(-50%) rotate(-2deg);
}
.recipe-photo img { display: block; width: 100%; max-height: 390px; object-fit: cover; }
.recipe-photo-placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--blue);
  background: #edf2f4;
  font-size: 2rem;
}
.recipe-facts {
  display: flex;
  justify-content: flex-start;
  gap: clamp(1rem, 4vw, 2.5rem);
  margin: 0 0 2.25rem;
  padding: 1.15rem 1.35rem;
  border: 1px solid #cdd7dd;
  border-radius: 3px;
  background: #eef2f2;
  box-shadow: 4px 4px 0 #e2e8ea;
}
.recipe-facts div { min-width: 5.5rem; text-align: left; }
.recipe-facts dt { color: var(--blue-dark); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.recipe-facts dd { margin: .15rem 0 0; font: 1rem var(--body); }
.ingredients, .instructions { padding-left: 1.4rem; }
.ingredients li, .instructions li { margin-bottom: .7rem; padding-left: .3rem; }
.recipe-instructions { max-width: 820px; margin: 2.8rem auto 0; }
.instructions {
  padding-left: 2rem;
  color: #292722;
  font-family: "Times New Roman", Times, "Nimbus Roman No9 L", serif;
  font-size: 1.12rem;
  line-height: 1.72;
}
.instructions li { margin-bottom: 1.15rem; padding-left: .55rem; }
.notes {
  margin-top: 2.5rem;
  padding: 1.5rem 2rem;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(transparent 0 30px, #cbd5dc 31px), #faf9f2;
  transform: rotate(-.25deg);
}
.notes p { font-family: var(--hand); font-size: 1.05rem; }
.preserve-lines { white-space: pre-line; }
.source { overflow-wrap: anywhere; }
.recipe-actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 2.5rem; }
.danger-link { color: var(--danger); }
.confirmation form { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .recipe-filters { grid-template-columns: 1fr 1fr; }
  .filter-search { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .page { width: calc(100% - 1rem); margin: 1rem auto; padding: 2rem 1.35rem; border-width: 24px; outline-offset: -31px; }
  .site-name { letter-spacing: .08em; }
  .site-name span { font-size: 1.45rem; }
  .header-actions { gap: .35rem; }
  .form-row, .recipe-overview { grid-template-columns: 1fr; gap: 2.5rem; }
  .recipe-photo { width: min(330px, 100%); margin: 0 auto; }
  .recipe-facts { flex-wrap: wrap; gap: 1rem; }
  .recipe-heading .button { align-self: start; }
}

@media (max-width: 500px) {
  .recipe-filters { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .site-header .button { padding: .55rem .7rem; }
}
