:root {
  --color-bg: #fafaf7;
  --color-text: #2c2c2c;
  --color-accent: #3d7a4f;
  --color-accent-dark: #2d5c3b;
  --color-card-bg: #ffffff;
  --color-border: #e0e0d8;
  --color-muted: #6b7c6b;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --card-radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: var(--color-accent);
  color: white;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: normal;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 1rem;
  opacity: 0.85;
  margin-top: 0.4rem;
}

.month-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.6rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Month slider ── */
.month-slider {
  max-width: 360px;
  margin: 1rem auto 0;
}

.month-slider input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.month-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--color-accent-dark);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.month-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--color-accent-dark);
  cursor: pointer;
}

.month-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  opacity: 0.7;
  letter-spacing: 0.03em;
}

/* ── Main / Grid ── */
main {
  flex: 1;
}

.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Card ── */
.plant-card {
  background: var(--color-card-bg);
  border-radius: var(--card-radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.plant-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.plant-photo-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e8ede8;
  flex-shrink: 0;
}

.plant-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.plant-card:hover .plant-photo-wrap img {
  transform: scale(1.05);
}

.photo-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

/* ── Card body ── */
.plant-info {
  padding: 1.1rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.common-name {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--color-text);
  line-height: 1.3;
}

.scientific-name {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.plant-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.plant-links a {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-accent);
  text-decoration: none;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.plant-links a:hover {
  background: var(--color-accent);
  color: white;
}

.photo-credit {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--color-muted);
  margin-top: auto;
  padding-top: 0.6rem;
  line-height: 1.4;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.8rem 1rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-muted);
}

footer a {
  color: var(--color-accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── States ── */
.no-results {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 1rem;
}

.error {
  text-align: center;
  padding: 4rem 2rem;
  color: #a04040;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
