/* Peppers garden — static site */
:root {
  --bg: #f6f3ed;
  --bg-card: #fffef9;
  --ink: #1c2418;
  --muted: #5c6658;
  --accent: #2d5a27;
  --accent-soft: #e8f0e4;
  --bed-wood: #8b6914;
  --soil: #3d3229;
  --fence: #9aa0a6;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(28, 36, 24, 0.08);
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, #e3efe0 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(232, 240, 228, 0.5) 0%, transparent 45%);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #1e4019;
}

.wrap {
  width: min(1280px, 96vw);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid rgba(45, 90, 39, 0.12);
  margin-bottom: 2rem;
}

.site-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.site-header .tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.site-header .desc {
  margin: 0.75rem 0 0;
  max-width: 42em;
  color: var(--muted);
  font-size: 0.95rem;
}

.section {
  margin-bottom: 2.75rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--accent);
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 48em;
  margin-bottom: 1.25rem;
}

/* Index: two beds — side by side on wide screens, stacked on narrow */
.pepper-map-section {
  margin-top: 0.5rem;
}

.pepper-map-heading {
  margin-bottom: 0.75rem;
}

.edit-api-missing {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.pepper-map-beds {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0 1rem;
  align-items: stretch;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(45, 90, 39, 0.12);
  padding: 0.5rem 0.65rem 0.75rem;
}

@media (max-width: 719px) {
  .pepper-map-beds {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.5rem 0.5rem 0.65rem;
  }
}

.pepper-bed-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  padding: 0.45rem 0.25rem 0.5rem;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #eef3ea 100%);
  color: var(--accent);
  border-radius: 8px;
  margin-bottom: 0.4rem;
}

.pepper-bed-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.25rem 0.2rem;
}

.pepper-bed-divider {
  width: 2px;
  min-height: 120px;
  margin: 0 0.15rem;
  align-self: stretch;
  background: rgba(45, 90, 39, 0.22);
  border-radius: 1px;
}

@media (max-width: 719px) {
  .pepper-bed-divider {
    display: none;
  }

  .pepper-bed-right {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 2px solid rgba(45, 90, 39, 0.18);
  }
}

.pepper-map-cell {
  text-align: center;
  padding: 0.35rem 0.15rem 0.5rem;
  min-width: 0;
}

a.pepper-map-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.25rem;
  margin: -0.25rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

a.pepper-map-link:hover {
  background: rgba(45, 90, 39, 0.06);
  color: inherit;
}

a.pepper-map-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a.pepper-map-link:hover .pepper-map-name {
  color: var(--accent);
}

.pepper-map-thumb {
  display: block;
  width: 100%;
  max-width: 104px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #dfe5db;
  box-shadow: 0 2px 12px rgba(28, 36, 24, 0.12);
}

/* Whole image visible in the square (map uses small WebP thumbs when available). */
.pepper-map-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.pepper-map-pos {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.pepper-map-name {
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--ink);
  font-weight: 600;
  max-width: 7.5rem;
  hyphens: auto;
}

/* Latest notes (no duplicate thumbnails) */
.plant-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.plant-note-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(45, 90, 39, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.plant-note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(28, 36, 24, 0.1);
}

a.plant-note-link {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem 1.05rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

a.plant-note-link:hover .plant-note-title {
  color: var(--accent);
}

.plant-note-meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.plant-note-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  transition: color 0.15s;
}

.plant-note-preview {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plant-note-preview .label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.plant-note-cta {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.plant-note-actions {
  padding: 0 1.1rem 1rem;
  border-top: 1px solid rgba(45, 90, 39, 0.06);
}

.journal-quick-add {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(45, 90, 39, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  min-height: 44px;
}

.journal-quick-add:active {
  background: #dce8d6;
}

/* Buttons (garden editor) */
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  border: none;
}

.btn-small {
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  min-height: 40px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(45, 90, 39, 0.35);
}

.btn-danger {
  background: transparent;
  color: #9a2b2b;
  border: 1px solid rgba(154, 43, 43, 0.35);
}

.journal-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.journal-section-head h2 {
  margin: 0;
}

.journal-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Inline editor overlays */
#garden-edit-root {
  position: relative;
  z-index: 0;
}

.garden-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(28, 36, 24, 0.45);
  backdrop-filter: blur(2px);
}

.garden-dialog,
.garden-sheet {
  position: fixed;
  z-index: 310;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(26rem, calc(100vw - 1.5rem));
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 1.25rem 1.35rem 1.35rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(28, 36, 24, 0.2);
  border: 1px solid rgba(45, 90, 39, 0.12);
}

.garden-sheet {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
  max-height: 88vh;
  border-radius: var(--radius) var(--radius) 0 0;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

@media (min-width: 560px) {
  .garden-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(26rem, calc(100vw - 1.5rem));
    max-height: min(90vh, 640px);
    border-radius: var(--radius);
  }
}

.garden-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(45, 90, 39, 0.2);
  margin: -0.35rem auto 0.85rem;
}

.garden-dialog h2,
#garden-sheet-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.garden-dialog-lede {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.garden-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.garden-field span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.garden-field input,
.garden-field textarea,
.garden-field select {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(45, 90, 39, 0.25);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}

.garden-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: -0.35rem 0 0.85rem;
}

.garden-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.garden-dialog-actions .btn {
  flex: 1;
  min-width: 6rem;
  padding: 0.65rem 1rem;
}

.garden-error {
  color: #9a2b2b;
  font-size: 0.88rem;
  margin: 0.5rem 0 0;
}

.footer-edit-hint {
  color: var(--muted);
}

/* Care table (index) */
.care-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(45, 90, 39, 0.12);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

table.care {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

table.care th,
table.care td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(45, 90, 39, 0.08);
  vertical-align: top;
}

table.care th {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

table.care tr:last-child td {
  border-bottom: none;
}

/* Plant page */
.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.plant-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: start;
}

@media (max-width: 800px) {
  .plant-hero {
    grid-template-columns: 1fr;
  }
}

.plant-hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.plant-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.5rem;
}

.care-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(45, 90, 39, 0.1);
  box-shadow: var(--shadow);
}

.care-panel h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.care-panel dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.care-panel dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}

.care-panel dd {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
}

/* Journal timeline */
.journal h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
  color: var(--accent);
}

.journal-entry {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(45, 90, 39, 0.08);
  box-shadow: 0 4px 20px rgba(28, 36, 24, 0.05);
}

.journal-entry header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(45, 90, 39, 0.08);
}

.journal-entry .date {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

.journal-entry .id {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.journal-entry .body {
  font-size: 0.95rem;
  white-space: pre-wrap;
  margin: 0 0 0.75rem;
}

.journal-entry figure {
  margin: 0;
}

.journal-entry figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.journal-entry figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.no-entries {
  color: var(--muted);
  font-style: italic;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(45, 90, 39, 0.1);
  font-size: 0.85rem;
  color: var(--muted);
}
