:root {
  --paper:   #FBF8F2;
  --card:    #FFFFFF;
  --ink:     #1B2E22;
  --ink-soft:#5A6B60;
  --line:    #E4DED2;
  --green:   #2F5D45;
  --sage:    #8FA88C;
  --brass:   #A8823C;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gap: 1.75rem;
  --radius: 4px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--green); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 680px; }
.muted { color: var(--ink-soft); }

/* ---------------------------------------------------------- masthead */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--green);
  text-decoration: none;
}
.masthead nav { display: flex; gap: 1.5rem; }
.masthead nav a {
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.masthead nav a:hover { color: var(--green); }

/* ---------------------------------------------------------- hero */

.hero { padding: 4rem 0 3rem; }
.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 18ch;
}

/* ---------------------------------------------------------- tile grid */

.tiles {
  list-style: none;
  margin: 0 0 5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}
.tile-link { text-decoration: none; color: inherit; display: block; }
.tile-frame {
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color .2s ease, transform .2s ease;
}
.tile-frame img { width: 100%; height: 100%; object-fit: cover; }
.tile-link:hover .tile-frame { border-color: var(--sage); transform: translateY(-3px); }
.tile-empty { color: var(--sage); font-size: 0.85rem; }

.tile-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.06rem;
  margin: 1rem 0 0.15rem;
  line-height: 1.3;
}
.tile-botanical {
  margin: 0;
  font-style: italic;
  font-size: 0.86rem;
  color: var(--sage);
}
.tile-summary {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- detail */

.plant { padding: 2.5rem 0 5rem; }
.back {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.back:hover { color: var(--green); }

.plant-head { max-width: 62ch; margin-bottom: 2.5rem; }
.plant-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}
.botanical { font-style: italic; color: var(--sage); margin: 0 0 1.2rem; }
.lede { font-size: 1.12rem; color: var(--ink-soft); margin: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
  margin-bottom: 3rem;
}
.shot { margin: 0; }
.shot-lead { grid-column: 1 / -1; }
.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: zoom-in;
  overflow: hidden;
}
.shot-btn img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.shot-lead .shot-btn img { aspect-ratio: 16 / 9; }
.shot figcaption {
  margin-top: 0.5rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 0 0 3rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fact dt {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.3rem;
}
.fact dd { margin: 0; }

.notes { max-width: 66ch; }
.notes p { margin: 0 0 1.25rem; }

/* ---------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 34, 26, 0.94);
  display: grid;
  place-content: center;
  gap: 1rem;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 82vh; object-fit: contain; }
.lightbox p { color: #E9E3D6; text-align: center; margin: 0; font-size: 0.9rem; }
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  background: none; border: 0;
  color: #E9E3D6;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------------------------------------------------------- forms & admin */

.page-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.page-subtitle {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 3rem 0 1rem;
}
.narrow, .admin-head { padding-top: 2.5rem; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.form { display: grid; gap: 0.4rem; margin: 1.5rem 0 3rem; }
.form label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1rem;
}
.form .hint { text-transform: none; letter-spacing: 0; color: var(--sage); }
.form input[type="text"], .form input:not([type]), .form input[type="password"], .form textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  justify-self: start;
}
.btn:hover { background: #244836; }
.btn-quiet { background: none; color: var(--green); }
.btn-quiet:hover { background: rgba(47, 93, 69, 0.07); }

.link-quiet {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 0.86rem;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}
.link-quiet:hover { color: var(--green); }
.danger { color: #8C3B2E; }

.flash {
  margin: 1.25rem 0 0;
  padding: 0.7rem 1rem;
  background: #EDF1E9;
  border-left: 3px solid var(--sage);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.admin-table { width: 100%; border-collapse: collapse; margin: 2rem 0 4rem; }
.admin-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }

.photo-admin {
  list-style: none; padding: 0; margin: 0 0 3rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem;
}
.photo-admin img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.photo-admin-actions { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.badge {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brass);
}

.empty-state { padding: 4rem 0 6rem; max-width: 40ch; }
.empty-state h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 0 0 0.5rem; }

/* ---------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.foot-dot { margin: 0 0.5rem; color: var(--sage); }

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