﻿:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #25362d;
  background: #f8f1e4;
  --forest: #213e32;
  --red: #a3382d;
  --line: #ded0ba;
  --muted: #66584a;
}
* { box-sizing: border-box; }
body { margin: 0; }
main {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: max(2.25rem, env(safe-area-inset-top))
    max(1.5rem, env(safe-area-inset-right))
    max(3.5rem, env(safe-area-inset-bottom))
    max(1.5rem, env(safe-area-inset-left));
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--forest);
  color: #fff4db;
  box-shadow: 0 8px 24px #2c27151a;
}
.hero-copy {
  position: relative;
  padding: clamp(1.8rem, 5.5vw, 4rem);
  align-self: center;
}
.welcome {
  display: flex;
  gap: .65rem;
  align-items: center;
  margin: 0 0 1.15rem;
  color: #f4bc83;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .055em;
}
.welcome::before { content: ""; width: 1.3rem; height: 2px; background: #e58a73; }
h1, h2, .potluck h3 { font-family: Georgia, serif; margin: 0; }
h1 {
  font-size: clamp(2.2rem, 5.6vw, 4.7rem);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .98;
}
h1 span {
  display: block;
  margin-top: .2em;
  color: #f3d7a9;
  font-size: .7em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.035em;
}
.date {
  display: inline-block;
  color: #fff7e8;
  background: var(--red);
  margin: 1.55rem 0 0;
  padding: .45rem .85rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 750;
  letter-spacing: .035em;
}
.hero-art { width: 100%; height: 100%; min-height: 0; aspect-ratio: 1.5; object-fit: cover; display: block; }
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  align-items: start;
}
.card {
  padding: clamp(1.15rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fffaf1;
  box-shadow: 0 4px 12px #46341e09;
}
.list-card { background: #f0f1e8; border-color: #d6dac9; }
h2 { font-size: clamp(1.48rem, 3vw, 1.95rem); letter-spacing: -.035em; line-height: 1.12; }
.intro { margin: .55rem 0 0; line-height: 1.45; color: var(--muted); }
form { margin-top: 1.35rem; }
label, legend { font-weight: 700; font-size: .93rem; }
input, button { font: inherit; }
input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: max(16px, 1rem);
  margin-top: .45rem;
  padding: .72rem .8rem;
  border-radius: .55rem;
  border: 1px solid #ac9b84;
  color: inherit;
  background: #fffffb;
}
input::placeholder { color: #766759; }
fieldset { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
legend { padding: 0; }
.item-row { display: flex; gap: .65rem; align-items: center; }
.item-row input { flex: 1; }
.item-row button { flex: none; }
button { cursor: pointer; }
form button, #refresh, .remove-dish { min-height: 44px; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 3px solid #447156; outline-offset: 3px; }
.secondary {
  background: transparent;
  color: var(--red);
  border: 0;
  padding: .5rem 0;
  font-size: .92rem;
  font-weight: 700;
}
.secondary:hover { text-decoration: underline; }
#add-item { margin-top: .2rem; }
.primary {
  width: 100%;
  padding: .8rem;
  border-radius: .55rem;
  border: 0;
  color: #fffaf1;
  font-weight: 750;
  background: var(--red);
}
.primary:hover:not(:disabled) { background: #842c23; }
.status { line-height: 1.45; color: var(--muted); margin: .75rem 0 0; }
.status:empty { display: none; }
.list-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem 1rem; }
#refresh { padding: .36rem .67rem; border: 1px solid #b2baaa; border-radius: .45rem; color: var(--forest); }
#list-status {
  padding: 1.1rem;
  margin-top: 1rem;
  border: 1px dashed #bdc3b1;
  border-radius: .65rem;
}
.potluck { list-style: none; padding: 0; margin: 0; }
.potluck:not(:empty) { margin-top: 1rem; }
.potluck > li {
  padding: .85rem 1rem;
  border: 1px solid #d6dac9;
  border-radius: .65rem;
  background: #fcfcf5;
  overflow-wrap: anywhere;
}
.potluck > li + li { margin-top: .65rem; }
.potluck h3 { font-size: 1.18rem; margin-bottom: .15rem; }
.dishes { list-style: none; padding: 0; }
.dishes li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem;
  align-items: center;
}
.dishes li + li { border-top: 1px solid #e9e8dd; }
.remove-dish {
  min-width: 44px;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: var(--red);
  font-size: 1.25rem;
  line-height: 1;
}
.remove-dish:hover { background: #f6e5de; }
@media (max-width: 50rem), (orientation: landscape) and (max-height: 32rem) {
  main {
    padding: max(.75rem, env(safe-area-inset-top))
      max(.75rem, env(safe-area-inset-right))
      max(1.5rem, env(safe-area-inset-bottom))
      max(.75rem, env(safe-area-inset-left));
  }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding: clamp(1rem, 5vw, 1.5rem); }
  .welcome { margin-bottom: .6rem; }
  h1 { font-size: clamp(2rem, 7.5vw, 3.2rem); overflow-wrap: anywhere; }
  .date { margin-top: .8rem; }
  .hero-art { height: clamp(7.5rem, 33vw, 11rem); aspect-ratio: auto; object-position: center 44%; }
  .board { grid-template-columns: minmax(0, 1fr); margin-top: .85rem; gap: .85rem; }
  .card { padding: clamp(.85rem, 4vw, 1.35rem); }
}
@media (orientation: landscape) and (min-width: 36rem) and (max-height: 32rem) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .hero-art { height: 100%; }
  h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
}
