/* seed-timeline.css — #561
 *
 * The plant timeline as a three-column grid per entry: the date on the left,
 * the icon on a continuous vertical line, then the entry itself (title, quiet
 * detail, photo or note) on the right. Every entry shows its own date.
 * Approved mockup: .tmp/plant-timeline-561-mockup.html, variant A.
 *
 * Markup comes from _renderModalEvent / _renderModalCommentEvent in
 * public/js/seeds.js. Folds in the #551/#552 comment entry (notes, bottom heat):
 * the text is the main line, the author sits below it, the date is on the left.
 */

.seed-tl {
  --seed-tl-date-w: 52px;
  --seed-tl-rail-w: 28px;
  --seed-tl-gap: 10px;
  --seed-tl-row-gap: 20px;
  --seed-tl-dot: 28px;
  display: flex;
  flex-direction: column;
}

/* One entry. A <button> when it can be tapped (or was one before), a <div> for
   comment entries. Reset the button so both look the same. */
.seed-tl-ev {
  display: grid;
  grid-template-columns: var(--seed-tl-date-w) var(--seed-tl-rail-w) minmax(0, 1fr);
  column-gap: var(--seed-tl-gap);
  min-height: 44px;
  width: 100%;
  margin: 0;
  padding: 0 0 var(--seed-tl-row-gap);
  border: 0;
  background: none;
  text-align: left;
  font: var(--v2-type-body);
  color: var(--v2-text-primary);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.seed-tl-ev:last-child { padding-bottom: 0; }

.seed-tl-ev--tap { cursor: pointer; }
.seed-tl-ev--tap:active .seed-tl-body { opacity: 0.72; }
.seed-tl-ev--tap:active .seed-tl-photo { transform: scale(0.985); }
.seed-tl-ev:focus-visible {
  outline: 2px solid var(--v2-accent-botanical);
  outline-offset: 4px;
  border-radius: var(--v2-radius-sm);
}

/* Date column: "Oct 18" over the weekday, right-aligned against the line. */
.seed-tl-date {
  display: block;
  padding-top: 3px;
  text-align: right;
  font-feature-settings: "tnum";
}
.seed-tl-day {
  display: block;
  font: 700 15px/1.1 var(--v2-font-display);
  color: var(--v2-text-primary);
  white-space: nowrap;
}
.seed-tl-weekday {
  display: block;
  margin-top: 2px;
  font: 600 11px/1.2 var(--v2-font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v2-text-secondary);
}

/* Rail column: the icon dot on a line that runs from entry to entry. Each rail
   draws its own segment down through the gap to the next entry's dot; the first
   starts at its dot's centre and the last draws none. */
.seed-tl-rail {
  position: relative;
  display: block;
}
.seed-tl-rail::before {
  content: "";
  position: absolute;
  left: calc(50% - 0.75px);
  top: 0;
  bottom: calc(-1 * var(--seed-tl-row-gap));
  width: 1.5px;
  background: var(--v2-edge);
}
.seed-tl-ev:first-child .seed-tl-rail::before { top: calc(var(--seed-tl-dot) / 2); }
.seed-tl-ev:last-child .seed-tl-rail::before { display: none; }

.seed-tl-dot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--seed-tl-dot);
  height: var(--seed-tl-dot);
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid var(--v2-edge);
  background: var(--v2-bg-card);
  color: var(--v2-accent-botanical);
}
.seed-tl-dot--heat { color: var(--v2-heat-warmth); }
.seed-tl-dot--done { color: var(--v2-pop-sage); }

/* Content column. */
.seed-tl-body {
  display: block;
  min-width: 0;
  padding-top: 4px;
  transition: opacity 120ms ease;
}
.seed-tl-title {
  display: block;
  font: 600 15px/1.3 var(--v2-font-display);
  color: var(--v2-text-primary);
  overflow-wrap: anywhere;
}
.seed-tl-title--done { color: var(--v2-pop-sage); }
.seed-tl-quiet {
  display: block;
  margin-top: 4px;
  font: 400 13px/1.5 var(--v2-font-body);
  color: var(--v2-text-secondary);
  overflow-wrap: anywhere;
}

/* Comment entries (#551 notes, #552 bottom heat). */
.seed-tl-text {
  display: block;
  font: 400 14px/1.5 var(--v2-font-body);
  color: var(--v2-text-primary);
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.seed-tl-meta {
  display: block;
  margin-top: 4px;
  font: 500 12px/1.4 var(--v2-font-body);
  color: var(--v2-text-secondary);
}

/* Check-in photo: fills the content column at 4:3. The bytes are painted as a
   background by the authed hydrator (data-photo-bytes), never a plain src. */
.seed-tl-photo {
  position: relative;
  display: block;
  margin-top: 10px;
  aspect-ratio: 4 / 3;
  border-radius: var(--v2-radius-md);
  overflow: hidden;
  background-color: var(--v2-bg-secondary);
  background-size: cover;
  background-position: center;
  transition: transform 120ms ease;
}
.seed-tl-score {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font: 700 12px/1 var(--v2-font-body);
  font-feature-settings: "tnum";
  color: var(--v2-text-on-accent);
  background: var(--v2-pop-ochre);
}
.seed-tl-score.excellent { background: var(--v2-accent-botanical); }
.seed-tl-score.good { background: var(--v2-pop-ochre); }
.seed-tl-score.concern { background: var(--v2-pop-coral); }
.seed-tl-score-num { font-weight: 600; opacity: 0.85; }

/* Loading skeleton: the same grid with placeholder blocks. */
.seed-tl--skeleton .seed-tl-ev { cursor: default; }
.seed-tl-bone {
  display: block;
  border-radius: 6px;
  background: var(--v2-bg-secondary);
  animation: seed-tl-shimmer 1.4s ease-in-out infinite;
}
.seed-tl-date .seed-tl-bone { width: 40px; height: 14px; margin-left: auto; }
.seed-tl-dot.seed-tl-bone { border-radius: 50%; border: 0; }
.seed-tl-body .seed-tl-bone { width: 70%; height: 14px; }
.seed-tl-body .seed-tl-bone + .seed-tl-bone { width: 45%; height: 12px; margin-top: 8px; }
@keyframes seed-tl-shimmer {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .seed-tl-bone { animation: none; }
  .seed-tl-body, .seed-tl-photo { transition: none; }
}
