:root {
  --green: #355c3b;
  --green-dark: #2c4a31;
  --pale: #f4f4ef;
  --card: #ffffff;
  --muted: #666;
  --soft: #dce8da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--pale);
  color: #222;
}

header {
  background: var(--green);
  color: white;
  padding: 1rem;
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.7rem;
}

nav a {
  color: white;
  text-decoration: none;
  margin-right: 1rem;
  font-size: 1rem;
}

main {
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card h2 {
  margin-top: 0;
}

.category-section {
  margin-bottom: 0.8rem;
}

.category-header {
  width: 100%;
  text-align: left;
  background: var(--soft);
  border: none;
  border-radius: 10px;
  padding: 0.9rem;
  font-size: 1rem;
  cursor: pointer;
}

.category-content {
  display: none;
  padding-top: 0.5rem;
}

.plant-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #fafafa;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.plant-card:hover {
  background: #f0f0f0;
}

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: #cfcfcf;
  flex-shrink: 0;
}

.plant-info {
  min-width: 0;
}

.plant-name {
  font-weight: bold;
  font-size: 1rem;
}

.scientific-name {
  font-style: italic;
  color: var(--muted);
  margin-top: 0.15rem;
}

.tag-line {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--green);
}

@media (max-width: 640px) {
  header h1 {
    font-size: 1.4rem;
  }

  nav a {
    display: inline-block;
    margin-bottom: 0.4rem;
  }

  .thumb {
    width: 64px;
    height: 64px;
  }

  .plant-name {
    font-size: 0.95rem;
  }
}
.large-scientific-name {
  margin-top: 0.4rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.section-image-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(120px, 1fr));

  gap: 0.75rem;

  margin-top: 1rem;
}

.section-image {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  object-fit: cover;
}

.lightbox-overlay {
  position: fixed;

  inset: 0;

  background: rgba(0,0,0,0.88);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

.lightbox-image {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 12px;
}

.comment-card {
  background: #fafafa;

  border-radius: 12px;

  padding: 0.85rem;

  margin-top: 0.85rem;
}

.comment-header {
  display: flex;

  justify-content: space-between;

  gap: 1rem;
}

.comment-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.comment-flags {
  margin-top: 0.4rem;

  color: var(--green);

  font-size: 0.9rem;

  font-weight: bold;
}
.placeholder-thumb {
  background: #cfcfcf;
}

.thumb {
  width: 72px;
  height: 72px;

  border-radius: 10px;

  object-fit: cover;

  flex-shrink: 0;
}
.text-input,
.text-area {
  width: 100%;

  margin-top: 0.6rem;

  padding: 0.7rem;

  border-radius: 10px;

  border: 1px solid #ccc;

  font-size: 1rem;
}

.text-area {
  min-height: 110px;

  resize: vertical;
}

.flag-row {
  margin-top: 0.8rem;

  display: flex;

  flex-direction: column;

  gap: 0.4rem;
}

.submit-button {
  margin-top: 1rem;

  background: var(--green);

  color: white;

  border: none;

  border-radius: 10px;

  padding: 0.8rem 1rem;

  cursor: pointer;

  font-size: 1rem;
}
.file-input {
  margin-top: 0.8rem;
}
.comment-card img.section-image {
  margin-top: 0.8rem;

  max-height: 220px;

  object-fit: cover;

  display: block;
}
.file-field {
  margin-top: 0.9rem;
}

.file-label {
  display: block;

  margin-bottom: 0.35rem;

  font-weight: bold;
}

.section-image-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(140px, 1fr));

  gap: 0.75rem;

  margin-top: 1rem;
}

.section-image {
  width: 100%;

  max-height: 220px;

  border-radius: 10px;

  cursor: pointer;

  object-fit: contain;

  background: #f1f1f1;

  display: block;
}

.comment-card img.section-image {
  margin-top: 0;

  max-height: 220px;

  object-fit: contain;

  display: block;
}
.feed-card {
  margin-bottom: 1rem;
}

.feed-meta {
  display: flex;

  justify-content: space-between;

  gap: 1rem;

  color: var(--muted);

  font-size: 0.9rem;
}

.feed-title {
  margin-top: 0.45rem;

  font-weight: bold;
}

.feed-title a {
  color: var(--green);

  text-decoration: none;
}
.post-form-header-row {
  display: flex;

  gap: 1rem;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 1rem;
}

.post-form-header-row h2 {
  margin: 0;
}

.compact-name-input {
  max-width: 320px;
}

.post-options-row {
  margin-top: 1rem;
}

.post-flags-row {
  display: flex;

  gap: 0.75rem;

  flex-wrap: wrap;
}

.flag-pill {
  display: flex;

  align-items: center;

  gap: 0.4rem;

  padding: 0.45rem 0.8rem;

  border-radius: 999px;

  background: #edf3ec;

  font-size: 0.95rem;
}

.post-bottom-row {
  margin-top: 1rem;

  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 1rem;

  flex-wrap: wrap;
}

.photo-upload-row {
  display: flex;

  align-items: center;

  gap: 0.75rem;

  flex-wrap: wrap;
}

.photo-label {
  font-weight: bold;
}

.feed-post-card {
  margin-top: 1rem;
}

.feed-post-layout {
  display: flex;

  gap: 1rem;

  align-items: flex-start;
}

.feed-post-text-column {
  flex: 1;
}

.feed-post-image-column {
  width: 260px;

  flex-shrink: 0;
}

.feed-post-image {
  width: 100%;

  height: auto;

  border-radius: 12px;

  cursor: pointer;

  display: block;
}

.feed-post-top-row {
  display: flex;

  justify-content: space-between;

  gap: 1rem;

  flex-wrap: wrap;
}

.feed-post-author {
  font-weight: bold;

  font-size: 1.05rem;
}

.feed-post-date {
  color: #666;

  font-size: 0.92rem;
}

.feed-post-title {
  margin-top: 0.35rem;

  font-weight: bold;
}

.feed-post-title a {
  color: #2f6333;

  text-decoration: none;
}

.feed-post-flags {
  margin-top: 0.5rem;

  color: #2f6333;

  font-size: 0.95rem;

  font-weight: bold;
}

.feed-post-text {
  margin-top: 0.7rem;

  line-height: 1.5;
}

@media (max-width: 720px) {

  .feed-post-layout {
    flex-direction: column;
  }

  .feed-post-image-column {
    width: 100%;
  }

  .compact-name-input {
    max-width: none;
  }

  .post-form-header-row {
    flex-direction: column;

    align-items: stretch;
  }

  .post-bottom-row {
    flex-direction: column;

    align-items: stretch;
  }

  .submit-button {
    width: 100%;
  }
}
.admin-section-block {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  background: #fafafa;
}

.admin-section-block label {
  display: block;
  margin-top: 0.8rem;
  font-weight: bold;
}

.admin-image-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.admin-thumb {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 10px;
  background: #eee;
}

.remove-image-button {
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.active-nav-link {
  text-decoration: underline;
  text-underline-offset: 0.35rem;
}
.inline-login-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d5b85a;
  border-radius: 12px;
  background: #fff8d7;
}
.plant-hero-card {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.plant-hero-card h1 {
  margin-bottom: 0.25rem;
}

.other-names-line {
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 0.2rem;
}

.plant-hero-card .large-scientific-name {
  margin-top: 0;
  font-size: 0.95rem;
}

.plant-hero-summary {
  margin-top: 0.75rem;
  margin-bottom: 0;
}
.plant-hero-card {
  padding: 0.75rem 1.6rem !important;
}

.plant-hero-card h1 {
  margin-top: 0;
  margin-bottom: 0.1rem;
}

.other-names-line {
  margin-top: 0;
  margin-bottom: 0.05rem;
  line-height: 1.2;
}

.plant-hero-card .large-scientific-name {
  margin: 0;
  line-height: 1.2;
}

.plant-hero-summary {
  margin-top: 0.5rem;
}
.collapsible-post-card {
  padding: 0;
  overflow: hidden;
}

.collapsible-post-toggle-row {
  display: flex;
  align-items: center;
}

.post-form-toggle-button {
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.collapsible-post-body {
  padding: 0 16px 16px 16px;
}

.collapsible-post-card.collapsed .collapsible-post-body {
  display: none;
}
.collapsible-post-card {
  padding: 0;
  overflow: hidden;
}

.collapsible-post-toggle-row {
  display: block;
}

.post-form-toggle-button {
  display: block;
  width: 100%;
  padding: 20px 24px;
  border: 1px solid #d9ddd6;
  border-radius: 12px;
  background: #bfe3b8;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.post-form-toggle-button:hover {
  background: #bfe3b8;
}
.collapsible-post-body {
  padding: 0 22px 22px 22px;
}

.collapsible-post-card.collapsed .collapsible-post-body {
  display: none !important;
}
.admin-section-upload-row {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.admin-section-upload-controls {
  flex: 1;
  min-width: 220px;
}
.section-drop-zone {
  border: 2px dashed #8fa38a;
  border-radius: 12px;
  background: #f3f7f1;
  padding: 18px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #40513b;
  font-weight: 700;
}

.section-drop-zone.drag-active {
  background: #bfe3b8;
  border-color: #40513b;
}
.plant-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plant-title-row h1 {
  margin: 0;
}

.plant-edit-link {
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: #40513b;
  background: #bfe3b8;
  border: 1px solid #8fa38a;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.plant-edit-link:hover {
  background: #a9d79f;
}