/* ======================================================
   Plantology - Plant Guides Overview Page Styles
   All classes prefixed with "pi-" to avoid collisions.
   ====================================================== */

/* Page Hero */
.pi-page {
  padding-bottom: 3rem;
}

.pi-hero {
  text-align: center;
  padding: 3.5rem 0 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.pi-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 0.8rem;
}

.pi-hero-lead {
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  color: #5f6b66;
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 auto 1rem;
}

/* Search & Filter */
.pi-filter-bar {
  width: 100%;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.pi-search-wrap {
  position: relative;
  max-width: 540px;
  width: 100%;
}

.pi-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.6;
}

.pi-search-input {
  width: 100%;
  height: 54px;
  padding: 0 1rem 0 3rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.15);
  background: white;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--color-text-main);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.05);
  transition: all 0.25s ease;
}

.pi-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.12);
}

.pi-search-input::placeholder {
  color: #9aaa9a;
}

.pi-filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.pi-chip {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.12);
  background: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: #5f6b66;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.pi-chip:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.08);
}

.pi-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.2);
}

/* Plant Card Grid */
.pi-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  margin-bottom: 2.5rem;
}

.pi-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(46, 125, 50, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(46, 125, 50, 0.14);
}

.pi-card-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f2e4, #d4e8cc);
  position: relative;
}

.pi-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.4s ease;
}

.pi-card:hover .pi-card-image img {
  transform: scale(1.04);
}

.pi-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 8vw, 3.5rem);
  background: linear-gradient(135deg, #f0f7ee, #dceedd);
}

.pi-card-body {
  padding: 1rem 1.1rem 0.65rem;
  flex: 1;
}

.pi-card-name {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.25;
  margin-bottom: 0.15rem;
}

.pi-card-sci {
  font-style: italic;
  font-size: 0.78rem;
  color: #8a9a94;
  margin-bottom: 0.55rem;
}

.pi-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.pi-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.pi-badge-green {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.2);
}

.pi-badge-amber {
  background: rgba(255, 193, 7, 0.12);
  color: #9a6700;
  border-color: rgba(255, 193, 7, 0.25);
}

.pi-badge-blue {
  background: rgba(63, 81, 181, 0.1);
  color: #2643c4;
  border-color: rgba(63, 81, 181, 0.22);
}

.pi-badge-red {
  background: rgba(211, 47, 47, 0.08);
  color: #c62828;
  border-color: rgba(211, 47, 47, 0.18);
}

.pi-badge-neutral {
  background: rgba(90, 90, 90, 0.07);
  color: #4a4a4a;
  border-color: rgba(90, 90, 90, 0.14);
}

.pi-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.pi-card-fact {
  font-size: 0.75rem;
  color: #7a8a84;
}

.pi-card-footer {
  padding: 0.8rem 1.1rem 1rem;
  border-top: 1px solid rgba(46, 125, 50, 0.07);
  margin-top: auto;
}

.pi-card-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
}

.pi-pagination {
  width: 100%;
  margin: 0 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.pi-page-btn {
  min-width: 92px;
  padding: 0.46rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 50, 0.2);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pi-page-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: rgba(46, 125, 50, 0.08);
}

.pi-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pi-page-indicator {
  font-size: 0.88rem;
  font-weight: 700;
  color: #5f6b66;
}

/* Empty state */
.pi-empty {
  width: 100%;
  text-align: center;
  padding: 3rem 1rem;
}

.pi-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.pi-empty-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

/* Bottom CTA */
.pi-cta-section {
  width: 100%;
  margin-top: 1rem;
}

/* Responsive */
@media (min-width: 480px) {
  .pi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pi-card-name {
    font-size: 1rem;
  }
}

@media (min-width: 700px) {
  .pi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
  }
}

@media (max-width: 520px) {
  .pi-pagination {
    gap: 0.55rem;
  }

  .pi-page-btn {
    min-width: 78px;
    padding: 0.42rem 0.75rem;
    font-size: 0.8rem;
  }

  .pi-page-indicator {
    font-size: 0.8rem;
  }
}

@media (min-width: 900px) {
  .pi-filter-bar {
    max-width: none;
    margin-bottom: 2rem;
  }

  .pi-search-wrap {
    max-width: 600px;
    margin: 0 auto 0.5rem;
  }

  .pi-filter-chips {
    justify-content: center;
  }

  .pi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .pi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Standardized heading top spacing */
.pi-page h2 {
  margin-top: var(--heading-h2-top, 1.35rem) !important;
}

.pi-page h3 {
  margin-top: var(--heading-h3-top, 1rem) !important;
}

.pi-page h2:first-child,
.pi-page h3:first-child {
  margin-top: 0 !important;
}
