/* public/styles/trees.css — owned by views/trees.js (Tree List, SPEC §5.1).
   Phone-first: single-column rows with 72px posters. From 641px up: a responsive card grid with big square posters.
   Every selector is prefixed .trees- so nothing leaks into other views. Shared tokens/components come from base.css. */

/* ---------- header: title, result count, "+ New tree" ---------- */
.trees-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.trees-head-text { min-width: 0; }
.trees-count { font-size: 0.9rem; margin-top: 2px; }
.trees-link { color: var(--accent); font: inherit; min-height: 28px; padding: 0 2px; border-radius: 4px; }
.trees-link:hover { text-decoration: underline; }

/* ---------- toolbar: search, sort, filters ---------- */
.trees-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.trees-search { position: relative; }
.trees-search-input { -webkit-appearance: none; appearance: none; padding-right: 44px; border-radius: var(--radius-pill); }
.trees-search-input::-webkit-search-cancel-button,
.trees-search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.trees-search-clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.trees-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trees-filters-btn.is-open { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.trees-filters-btn .pill-count { margin-left: 2px; }

.trees-filters {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.trees-filter-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 6px 12px; }
.trees-filter-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.trees-filters .chip-radio { min-height: 40px; padding: 4px 14px; }   /* touch targets ≥ 40px (SPEC §6) */
.trees-filters-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.trees-filters-hint { font-size: 0.75rem; color: var(--muted); }

/* ---------- the list: phone rows ---------- */
.trees-list { display: flex; flex-direction: column; gap: 8px; }
.trees-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 8px; min-height: 88px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.trees-item:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(31,42,34,0.06), 0 10px 24px rgba(31,42,34,0.10); }
.trees-item:active { transform: none; background: var(--bg); }
.trees-item-poster { width: 72px; flex: 0 0 72px; }
.trees-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trees-item-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.08rem; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.trees-item-name .nickname { font-weight: 400; color: var(--muted); }
.trees-item-sci { font-size: 0.84rem; color: var(--muted); line-height: 1.3; }
.trees-unsure {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font-size: 0.66rem; font-style: normal; font-weight: 600; line-height: 1; vertical-align: 1px; cursor: help;
}
.trees-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 6px; margin-top: 3px; font-size: 0.82rem; color: var(--muted); }
.trees-item-age { font-weight: 500; color: var(--ink); }
.trees-item-updated { font-size: 0.76rem; }
.trees-item-chevron { color: var(--placeholder); flex: 0 0 auto; }

/* dead trees: muted, greyscale poster, 🪦 chip (rendered by the view) */
.trees-item.is-dead { opacity: 0.78; background: var(--bg); }
.trees-item.is-dead .photo-tile-img { filter: grayscale(1); }
.trees-item.is-dead .trees-item-name { color: var(--muted); }

/* ---------- "+ New tree" modal ---------- */
.trees-new-form { display: flex; flex-direction: column; gap: 12px; }
.trees-required { color: var(--warn); }
.trees-form-error { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); }

/* ---------- wider screens (tablet + MacBook): card grid with large posters ---------- */
@media (min-width: 641px) {
  .trees-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .trees-search { flex: 1 1 280px; max-width: 480px; }
  .trees-filters { flex-basis: 100%; }
  .trees-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
  .trees-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; min-height: 0; }
  .trees-item-poster { width: 100%; flex: none; }
  .trees-item-body { gap: 3px; }
  .trees-item-name { font-size: 1.05rem; }
  .trees-item-chevron { display: none; }
}

/* ---------- phone tweaks ---------- */
@media (max-width: 640px) {
  .trees-head { margin-bottom: 10px; }
  .trees-filter-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (hover: none) {
  .trees-item:hover { transform: none; box-shadow: var(--shadow); }
}
