:root {
  --bg: #fbf7ee;
  --surface: #ffffff;
  --band: #efe5cb;
  --ink: #2b2118;
  --quiet: #6f6355;
  --line: #e3d9c4;
  --accent: #8a4b1f;
  --accent-ink: #ffffff;
  --danger: #a3261b;
  --ok-bg: #eef4e4;
  --err-bg: #fbe9e6;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --page: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
}

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 16px 20px 64px;
}

h1,
h2,
h3,
.brand {
  font-family: var(--serif);
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0.6em 0 0.3em;
}

h2 {
  font-size: 1.5rem;
  margin: 1.8em 0 0.6em;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.2em;
}

h3.sub {
  margin-top: 1.4em;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

.quiet {
  color: var(--quiet);
  font-size: 0.92em;
  font-weight: normal;
}

.lead {
  font-size: 1.15rem;
}

/* ----- Page frame ----- */

.site-header {
  background: var(--band);
}

.site-header > .inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}

.site-footer {
  text-align: center;
  color: var(--quiet);
  font-size: 0.9rem;
  padding: 24px 16px;
}

/* Two columns on a wide screen, stacked on a phone. */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 0 48px;
  align-items: start;
}

.hero {
  text-align: center;
  padding: 4px 0;
}

.hero img {
  display: block;
  width: 100%;
  height: clamp(220px, 36vw, 440px);
  object-fit: cover;
  border-radius: 16px;
}

.hero .lead {
  max-width: 40em;
  margin: 0 auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

/* ----- Building blocks ----- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0;
}

.card.narrow {
  max-width: 360px;
}

.notice,
.error {
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--ok-bg);
}

.error {
  background: var(--err-bg);
  color: var(--danger);
}

button,
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 11px 20px;
  font: 600 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--accent);
}

button.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: normal;
  text-decoration: underline;
}

button.link.danger {
  color: var(--danger);
}

.badge {
  font: 600 0.8rem var(--sans);
  background: var(--band);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  vertical-align: middle;
}

.badge.warn {
  background: var(--err-bg);
  color: var(--danger);
}

.countdown {
  font: 700 1.6rem var(--serif);
  font-variant-numeric: tabular-nums;
}

/* ----- Forms ----- */

label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='datetime-local'],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #c9bda4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 1rem var(--sans);
}

label.check,
label.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: normal;
}

label.check input,
label.option input {
  margin-top: 5px;
  flex: none;
}

label.option {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  cursor: pointer;
}

label.option span span {
  display: block;
}

label.option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

fieldset {
  min-width: 0;
}

legend {
  font-weight: 700;
  padding: 0 6px;
}

/* ----- The menu ----- */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.item-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.item-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.item-head h3,
.item p {
  margin: 0;
}

.item .price {
  font-weight: 700;
}

.item-desc {
  padding: 6px 16px 0;
  color: var(--quiet);
  font-size: 0.95rem;
}

/* Pinned to the bottom so the controls line up across a row of cards. */
.item-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding: 14px 16px 16px;
}

.item .low {
  margin-right: auto;
  color: var(--danger);
  font-weight: 600;
}

.item.sold-out .item-photo,
.item.sold-out .item-head,
.item.sold-out .item-desc {
  opacity: 0.55;
}

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty input {
  width: 3.2em;
  margin: 0;
  padding: 9px 4px;
  text-align: center;
  font-size: 1.1rem;
  appearance: textfield;
}

.qty input::-webkit-inner-spin-button,
.qty input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.qty .step {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.qty .step[hidden] {
  display: none;
}

.checkout-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 14px 0;
  margin-top: 28px;
}

.checkout-bar .total {
  font-size: 1.25rem;
  margin: 0;
}

.checkout-bar .total .quiet {
  display: block;
  font-size: 0.85rem;
}

.checkout-bar button {
  flex: 1 1 240px;
  max-width: 420px;
}

/* ----- Lists and tables ----- */

.fulfilment-list,
.past {
  list-style: none;
  padding: 0;
}

.fulfilment-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.fulfilment-list strong,
.fulfilment-list span {
  display: block;
}

.past li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

details.card {
  border: 1px solid var(--line);
  padding: 12px 16px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

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

td,
th {
  text-align: left;
  padding: 8px 10px 8px 0;
  vertical-align: top;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary .total-row td {
  border-top: 1px solid var(--line);
  font-weight: 700;
}

/* The order page is a receipt, so it stays a readable column. */
.address {
  font: 700 1.25rem var(--serif);
  margin: 0;
}

.receipt {
  max-width: 620px;
  margin: 0 auto;
}

/* ----- Admin ----- */

table.grid th {
  font-size: 0.85rem;
  color: var(--quiet);
  border-bottom: 1px solid var(--line);
}

table.grid td {
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.grid.orders td {
  vertical-align: top;
}

input.small {
  width: 5.5em;
  margin: 0 0 0 auto;
  text-align: right;
}

tr.off td:not(:first-child) {
  opacity: 0.45;
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  vertical-align: middle;
  margin-right: 10px;
}

.area-map {
  height: 480px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
  /* Leaflet sets its own z-indexes; keep them under the page header. */
  isolation: isolate;
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 12px 0;
}

.photo-row img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 16px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 640px) {
  body.admin table.grid {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .site-header nav,
  form,
  .button {
    display: none;
  }
}
