/* The Good Stuff — fresh-market design system
   Designed around iPhone 12 (390 × 844, notch + home indicator). */

:root {
  --cream: #FDF3E3;
  --card: #FFFDF8;
  --ink: #2B2118;
  --ink-soft: #6E6152;
  --green: #2E7D46;
  --green-deep: #1E5631;
  --green-tint: #E3F1E4;
  --tomato: #E2472B;
  --tomato-tint: #FCE7DF;
  --marigold: #F2A93B;
  --marigold-tint: #FBEFD7;
  --plum: #A0518F;
  --plum-tint: #F4E4F1;
  --line: #EDE0C8;
  --radius: 20px;
  --radius-sm: 14px;
  --display: 'Bricolage Grotesque', -apple-system, 'SF Pro Rounded', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pad: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ── Header ─────────────────────────────── */
.app-header {
  padding: calc(18px + env(safe-area-inset-top)) var(--pad) 6px;
}
.header-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.app-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.02em;
  color: var(--green-deep);
}
.season-chip {
  flex-shrink: 0;
  font-size: 13px; font-weight: 600;
  color: var(--green-deep);
  background: var(--green-tint);
  border-radius: 999px;
  padding: 5px 12px;
}
.week-label {
  margin-top: 4px;
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ── Views ──────────────────────────────── */
.view { padding: 10px var(--pad) 24px; }
.is-hidden { display: none !important; }

.intro {
  font-size: 15px; line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

/* ── Hero card ──────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--green);
  color: #FFFDF8;
  border-radius: var(--radius);
  padding: 22px 104px 20px 20px;
  margin-bottom: 26px;
  box-shadow: 0 8px 24px rgba(30, 86, 49, 0.22);
}
.hero.tint-fruit  { background: var(--tomato);  box-shadow: 0 8px 24px rgba(226, 71, 43, .25); }
.hero.tint-veg    { background: var(--green);   }
.hero.tint-flower { background: var(--plum);    box-shadow: 0 8px 24px rgba(160, 81, 143, .25); }
.hero-kicker {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.85; margin-bottom: 8px;
}
.hero-name {
  font-family: var(--display);
  font-weight: 800; font-size: 32px; letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 8px;
}
.hero-note { font-size: 15px; line-height: 1.45; opacity: 0.95; max-width: 30ch; }
.hero-emoji {
  position: absolute; right: -6px; bottom: -14px;
  font-size: 96px; transform: rotate(-8deg);
  opacity: 0.9;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.15));
}
.hero-cta {
  display: inline-block; margin-top: 14px;
  font-size: 14px; font-weight: 700;
  background: rgba(255, 253, 248, 0.22);
  border-radius: 999px; padding: 8px 14px;
}

/* ── Market run groups ──────────────────── */
.group { margin-bottom: 26px; }
.group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.group-title {
  font-family: var(--display);
  font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
}
.group-more { font-size: 14px; font-weight: 600; color: var(--green); }

.card-list { display: flex; flex-direction: column; gap: 10px; }

.item-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: transform 0.12s ease;
}
.item-card:active { transform: scale(0.98); }

.item-emoji {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 999px;
  background: var(--green-tint);
}
.tint-fruit  .item-emoji, .item-emoji.tint-fruit  { background: var(--marigold-tint); }
.tint-veg    .item-emoji, .item-emoji.tint-veg    { background: var(--green-tint); }
.tint-flower .item-emoji, .item-emoji.tint-flower { background: var(--plum-tint); }

.item-text { min-width: 0; flex: 1; }
.item-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.item-sub {
  font-size: 13px; color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}

/* status badges */
.badge {
  flex-shrink: 0;
  font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 4px 10px;
  white-space: nowrap;
}
.badge.peak { background: var(--green); color: #fff; }
.badge.in   { background: var(--green-tint); color: var(--green-deep); }
.badge.soon { background: var(--marigold-tint); color: #94631A; }
.badge.out  { background: #F1EADD; color: var(--ink-soft); }
.badge.year { background: var(--marigold-tint); color: #94631A; }

/* ── Browse ─────────────────────────────── */
.browse-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--cream);
  padding: 6px 0 12px;
}
.segmented {
  display: flex; gap: 4px;
  background: #F3E9D4;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 10px;
}
.seg-btn {
  flex: 1;
  font-size: 14px; font-weight: 650;
  color: var(--ink-soft);
  padding: 9px 0;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(43, 33, 24, 0.10);
}
.search-input {
  width: 100%;
  font: inherit; font-size: 16px; /* 16px stops iOS zoom-on-focus */
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  outline: none;
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--green); }
.search-input::placeholder { color: #B4A78F; }

.browse-section-label {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
  margin: 18px 0 8px;
}
.empty-msg { color: var(--ink-soft); font-size: 15px; padding: 24px 0; text-align: center; }

/* ── Detail sheet ───────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(43, 33, 24, 0.42);
  opacity: 1;
  transition: opacity 0.22s ease;
}
.sheet-backdrop.is-closing { opacity: 0; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(26px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(0);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -10px 40px rgba(43, 33, 24, 0.18);
}
.sheet.is-closing { transform: translateY(105%); }
@keyframes sheet-up { from { transform: translateY(105%); } to { transform: translateY(0); } }
.sheet:not(.is-hidden):not(.is-closing) { animation: sheet-up 0.28s cubic-bezier(0.32, 0.72, 0, 1); }

.sheet-handle {
  width: 40px; height: 5px;
  background: var(--line);
  border-radius: 999px;
  margin: 4px auto 16px;
}
.sheet-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sheet-emoji {
  width: 64px; height: 64px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 38px; border-radius: 999px;
}
.sheet-title {
  font-family: var(--display);
  font-weight: 800; font-size: 26px; letter-spacing: -0.02em;
  line-height: 1.1;
}
.sheet-status { margin-top: 6px; }

.month-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin: 18px 0 6px;
}
.month-cell { text-align: center; }
.month-dot {
  height: 26px;
  border-radius: 8px;
  background: #F1EADD;
}
.month-dot.in   { background: #A9D3B2; }
.month-dot.peak { background: var(--green); }
.month-cell.is-now .month-dot { outline: 2.5px solid var(--tomato); outline-offset: 1.5px; }
.month-name { font-size: 10px; font-weight: 600; color: var(--ink-soft); margin-top: 5px; display: block; }
.strip-legend {
  display: flex; gap: 14px; margin: 10px 0 18px;
  font-size: 12px; color: var(--ink-soft);
}
.strip-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.sheet-section { margin-bottom: 16px; }
.sheet-section h3 {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.sheet-section p { font-size: 15px; line-height: 1.5; }

/* ── Tab bar ────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  background: rgba(253, 243, 227, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-soft);
  padding: 4px 0;
}
.tab-btn.is-active { color: var(--green-deep); }
.tab-icon { font-size: 22px; filter: grayscale(1) opacity(0.55); }
.tab-btn.is-active .tab-icon { filter: none; }
.tab-label { font-size: 11px; font-weight: 650; }

.footnote {
  font-size: 12.5px; line-height: 1.5;
  color: var(--ink-soft);
  padding-top: 4px;
}

/* ── Months / calendar ──────────────────── */
.month-row {
  display: flex; gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 12px;
  margin: 0 calc(-1 * var(--pad));
  padding-left: var(--pad); padding-right: var(--pad);
  scrollbar-width: none;
}
.month-row::-webkit-scrollbar { display: none; }
.month-chip {
  flex-shrink: 0;
  font-size: 14px; font-weight: 650;
  color: var(--ink-soft);
  background: #F3E9D4;
  border-radius: 999px;
  padding: 9px 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.month-chip.is-active { background: var(--green); color: #FFFDF8; }

.months-heading {
  font-family: var(--display);
  font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
  margin: 6px 0 18px;
}
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  transition: transform 0.12s ease;
}
.chip:active { transform: scale(0.96); }
.also-line {
  font-size: 13px; line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ── Markets ────────────────────────────── */
.market-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.market-top { display: flex; align-items: center; gap: 14px; }
.market-meta {
  font-size: 13px; line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.market-link { color: var(--green); font-weight: 650; text-decoration: none; white-space: nowrap; }

.sheet-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
  color: var(--ink-soft);
  background: #F1EADD;
  border-radius: 999px;
}

.reviewed-stamp {
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.notify-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  font-size: 15px; font-weight: 700;
  color: #FFFDF8;
  background: var(--green);
  border-radius: 999px;
  padding: 13px 16px;
  transition: transform 0.12s ease;
}
.notify-btn:active { transform: scale(0.98); }
.notify-btn.is-off { background: #F1EADD; color: var(--ink-soft); }
.notify-status {
  font-size: 13px; line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ── About / info ───────────────────────── */
.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.info-p { font-size: 15px; line-height: 1.55; margin-top: 8px; }
.benefit-list { list-style: none; margin-top: 12px; }
.benefit-list li {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}
.benefit-list li:last-child { margin-bottom: 0; }
.benefit-emoji { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.benefit-list p { font-size: 15px; line-height: 1.5; }
.benefit-list strong { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
