/**
 * public/css/components/garden-grid.css
 * Canopy v2 component — Garden tab photo-led grid (Mockup B, Frame 1).
 * Consumes ONLY --v2-* tokens. Never raw hex.
 *
 * Depends on: canopy-v2.css (loaded before this file in index.html)
 */

/* ───────── Garden header ───────── */

.garden-header {
  padding: 12px 24px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.garden-title {
  font-family: var(--v2-font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--v2-text-primary);
}

.garden-sub {
  font-family: var(--v2-font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--v2-text-tertiary);
  margin-top: 4px;
}

/* ───────── Stats row ───────── */

.garden-meta {
  padding: 0 24px 16px;
  display: flex;
  gap: 16px;
  font-family: var(--v2-font-body);
  font-size: 12px;
  color: var(--v2-text-secondary);
}

.garden-meta .stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.garden-meta .n {
  font-family: var(--v2-font-display);
  font-size: 20px;
  color: var(--v2-text-primary);
}

.garden-meta .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--v2-text-tertiary);
}

/* ───────── Zone grid ───────── */

.zone-grid {
  padding: 0 16px 80px; /* bottom padding clears nav bar */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ───────── Zone card (shared) ───────── */

.zone-card {
  position: relative;
  border-radius: var(--v2-radius-lg);
  overflow: hidden;
  background: var(--v2-bg-card);
  box-shadow: var(--v2-elev-2);
  cursor: pointer;
  /* Reset any inherited styles from legacy .zone-card */
  border: none;
  animation: none;
}

.zone-card .photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--v2-accent-botanical); /* fallback if no cover photo */
}

/* V1 legibility — stronger bottom gradient anchors the overlay; reaches
   65% up the card so the name has dark cover even when the photo's lower
   half is light/busy. Matches mockup .tmp/garden-grid-name-legibility-mockup.html. */
.zone-card .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    oklch(12% 0.03 150 / 0.88) 0%,
    oklch(12% 0.03 150 / 0.62) 30%,
    oklch(12% 0.03 150 / 0.20) 65%,
    transparent 100%
  );
}

.zone-card .overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* V1: 12px bottom flush to card edge — legacy 48px footer slot removed in chrome-strip. */
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--v2-text-on-dark);
}

.zone-card .name {
  font-family: var(--v2-font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  /* Force white over the global h1-h6 color rule in style.css which would
     otherwise tint the name with the sand text-primary (legibility bug). */
  color: var(--v2-text-on-dark);
  /* Drop-shadow catches stray light areas so the silhouette always reads. */
  text-shadow: 0 1px 6px oklch(0% 0 0 / 0.65), 0 1px 2px oklch(0% 0 0 / 0.5);
}

.zone-card .chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}

/* ───────── Hero card (first zone, full-width) ───────── */

.zone-card.hero {
  grid-column: span 2;
  aspect-ratio: 358 / 240;
}

.zone-card.hero .name {
  font-size: 32px;
}

/* ───────── Small cards (2-column) ───────── */

.zone-card.sm {
  aspect-ratio: 174 / 200;
}

.zone-card.sm .name {
  font-size: 19px;
}

/* ───────── Chip variants (on zone cards) ───────── */

.zone-card .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--v2-radius-xs);
  font-family: var(--v2-font-body);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

.zone-card.sm .chip {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-card .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.zone-card .chip--health-good {
  background: var(--v2-pop-sage-bg);
  /* semi-transparent over photo */
  background: oklch(93% 0.025 162 / 0.92);
  color: var(--v2-pop-sage);
}

.zone-card .chip--health-okay {
  background: oklch(93% 0.035 60 / 0.92);
  color: var(--v2-pop-ochre);
}

.zone-card .chip--health-warn {
  background: oklch(93% 0.025 25 / 0.92);
  color: var(--v2-pop-coral);
}

.zone-card .chip--sun {
  background: oklch(98% 0.006 85 / 0.85);
  color: var(--v2-pop-ochre);
}

.zone-card .chip--shade {
  background: oklch(98% 0.006 85 / 0.85);
  color: var(--v2-raw-ink-700);
}

/* ───────── + New Zone tile ───────── */

.zone-card-add {
  grid-column: span 2;
  height: 48px;
  border-radius: var(--v2-radius-lg);
  background: var(--v2-bg-secondary);
  border: 1px dashed var(--v2-border-strong);
  color: var(--v2-text-secondary);
  font-family: var(--v2-font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-card-add:active {
  background: var(--v2-bg-card);
}

/* ───────── Empty state ───────── */

.zone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 8px;
}

.zone-empty h3 {
  font-family: var(--v2-font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 20px;
  color: var(--v2-text-primary);
}

.zone-empty p {
  font-family: var(--v2-font-body);
  font-size: 13px;
  color: var(--v2-text-tertiary);
}
