/**
 * Community Hub Styles
 */

.community-hub {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Main Layout - Content on left, tabs on right */
.community-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  margin-top: 2rem;
}

.community-hub__header {
  text-align: center;
  margin-bottom: 2rem;
}

.community-hub__title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary, #1a1a1a);
}

.community-hub__subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary, #666);
}

/* Vertical Tab Navigation (Right Sidebar) */
.community-tabs-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.community-tabs-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: white;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.community-tab-vertical {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--color-text-secondary, #666);
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
  font-weight: 500;
}

.community-tab-vertical i {
  font-size: 1.125rem;
  width: 20px;
  text-align: center;
  color: #9ca3af;
  transition: all 0.2s ease;
}

.community-tab-vertical span {
  flex: 1;
}

.community-tab-vertical:hover {
  background: #f9fafb;
  color: var(--color-primary, #10b981);
  transform: translateX(-2px);
}

.community-tab-vertical:hover i {
  color: var(--color-primary, #10b981);
}

.community-tab-vertical.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--color-primary, #10b981);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.community-tab-vertical.active i {
  color: var(--color-primary, #10b981);
}

.community-tab-vertical.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--color-primary, #10b981);
  border-radius: 0 2px 2px 0;
}

/* Legacy horizontal tabs (hidden but kept for compatibility) */
.community-tabs {
  display: none;
}

/* Tab Panels */
.community-panels {
  position: relative;
}

.community-panel {
  display: none;
}

.community-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Forums */
.forums-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

.forums-sidebar h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.forum-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.forum-category-item {
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.forum-category-item:hover {
  background: #f3f4f6;
  transform: translateX(4px);
}

.category-icon {
  font-size: 1.5rem;
}

.category-name {
  flex: 1;
  font-weight: 500;
}

.category-count {
  color: var(--color-text-secondary, #666);
  font-size: 0.875rem;
}

.forums-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.discussions-container {
  padding: 1rem 0;
}

.forum-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Shared masonry column width — Feed & Discussions cards render the same pixel width */
:root {
  --garden-card-masonry-width: 300px;
  --garden-card-masonry-gap: 1.5rem;
}

.feed-masonry,
.forum-posts-list.forum-posts-list--masonry {
  display: block;
  column-width: var(--garden-card-masonry-width);
  column-gap: var(--garden-card-masonry-gap);
  column-count: auto;
  column-fill: balance;
}

.forum-posts-list--masonry > .forum-post-card,
.forum-posts-list--masonry > article.forum-post-card,
#feed-masonry > .forum-post-card,
#feed-masonry > article.forum-post-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.forum-posts-list--masonry > .forum-posts-empty-state,
.forum-posts-list--masonry > .forum-posts-error-state {
  column-span: all;
  display: block;
  width: 100%;
}

/* Legacy simple forum cards (no garden-event-card / garden-discussion-card) */
.forum-post-card:not(.garden-event-card):not(.garden-discussion-card) {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.forum-post-card:not(.garden-event-card):not(.garden-discussion-card):hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

/* Discussion cards use garden-event-card layout: do not apply fixed event tile height or legacy padding */
.forum-post-card.garden-event-card {
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
}

.forum-post-card.garden-event-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.forum-post-card.garden-event-card .garden-event-card__meta {
  min-height: 0;
  padding: 0.6rem 0.75rem;
}

.forum-post-card.garden-event-card .garden-discussion-meta__author {
  margin-bottom: 0.35rem;
}

.forum-post-card.garden-event-card .garden-event-card__meta-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 360px) {
  .forum-post-card.garden-event-card .garden-event-card__meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.forum-post-card.garden-event-card .garden-event-card__actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  row-gap: 0.5rem;
}

.post-header h3 {
  margin-bottom: 0.5rem;
}

.post-header a {
  color: var(--color-text-primary, #1a1a1a);
  text-decoration: none;
}

.post-header a:hover {
  color: var(--color-primary, #10b981);
}

.post-author {
  color: var(--color-text-secondary, #666);
  font-size: 0.875rem;
}

.post-meta {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #666);
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: #e5e7eb;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--color-text-secondary, #666);
}

/* Events */
.events-container {
  padding: 1rem 0;
}

.events-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.event-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.event-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
}

.event-content {
  padding: 1.5rem;
}

.events-list > * {
  height: 100%;
  align-self: stretch;
}

/* Full-width rows inside grid lists (empty/error messages); avoids single column ~300px cell */
.events-list > .forum-posts-empty-state,
.events-list > .forum-posts-error-state {
  grid-column: 1 / -1;
  align-self: center;
}

.forum-posts-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: #9ca3af;
}

.forum-posts-error-state {
  text-align: center;
  padding: 2rem;
  color: #ef4444;
}

.garden-event-card {
  height: 520px;
  box-sizing: border-box;
  overflow: hidden;
}

.garden-event-card__cover {
  flex: 0 0 180px;
}

.garden-event-card__cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #047857;
  font-size: 2rem;
}

.garden-event-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.garden-event-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.garden-event-card__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.garden-event-card__meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #444;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  min-height: 128px;
}

.garden-event-card__meta-row {
  word-wrap: break-word;
  min-height: 18px;
}

.garden-event-card__meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
  align-items: start;
}

.garden-event-card__location {
  display: flex;
  align-items: flex-start;
  min-height: 38px;
  min-width: 0;
  grid-column: 1 / -1;
}

.garden-event-card__location-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
  max-height: calc(1.35em * 2);
  flex: 1;
  min-width: 0;
}

.garden-event-card__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Discussion cards — same compact layout as Feed tab (not tall event tiles) */
.forum-post-card.garden-discussion-card {
  display: inline-block;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
}

.forum-post-card.garden-discussion-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
  transform: translateY(-2px);
}

.garden-discussion-card__media {
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.garden-discussion-card__media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.garden-discussion-card__body {
  padding: 1rem 1.25rem 1.15rem;
}

.garden-discussion-card__type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: #ede9fe;
  color: #5b21b6;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid #ddd6fe;
  flex-shrink: 0;
}

.garden-discussion-card__type-pill i {
  font-size: 0.68rem;
}

.garden-discussion-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
}

.garden-discussion-card__excerpt {
  margin: 0 0 0.75rem;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
}

.garden-discussion-card__tags {
  margin-bottom: 0.75rem;
}

.garden-discussion-card__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.garden-discussion-card__avatar--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.garden-discussion-card__author-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
}

.garden-discussion-card__time {
  color: #4b5563;
  font-size: 0.75rem;
}

/* Discussion cards (Feed-style) — action buttons */
.forum-post-card .garden-discussion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.forum-post-card .garden-discussion-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.875rem;
  margin-top: 0.25rem;
}

.forum-post-card .garden-discussion-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.forum-post-card .g-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.forum-post-card .g-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.forum-post-card .g-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.forum-post-card .g-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.forum-post-card .g-action-btn--vote {
  background: #f8fafc;
}

.forum-post-card .g-action-btn--vote.is-voted-up {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.forum-post-card .g-action-btn--vote.is-voted-down {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.forum-post-card .g-action-btn--replies {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
  color: #047857;
}

.forum-post-card .g-action-btn--replies:hover:not(:disabled) {
  background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #34d399;
  color: #065f46;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.forum-post-card .g-action-btn.primary,
.forum-post-card .g-action-btn--primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #fff;
  padding: 0.55rem 1.1rem;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.28);
}

.forum-post-card .g-action-btn.primary:hover:not(:disabled),
.forum-post-card .g-action-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  color: #fff;
}

.forum-post-card .g-action-btn--replies .g-action-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 700;
}

.event-content h3 {
  margin-bottom: 0.75rem;
}

.event-date,
.event-organizer,
.event-attendees {
  margin: 0.5rem 0;
  color: var(--color-text-secondary, #666);
  font-size: 0.875rem;
}

/* Challenges */
.challenges-container {
  padding: 1rem 0;
}

.challenges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.challenge-filters {
  display: flex;
  gap: 1rem;
}

.challenge-filters select {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
}

.challenges-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.challenge-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.challenge-card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  transform: translateY(-4px);
}

.challenge-banner {
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
  will-change: auto;
}

.challenge-banner::before {
  content: '';
  display: block;
  padding-top: 0;
}

.challenge-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.challenge-content h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2937;
}

.challenge-difficulty {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.difficulty-easy {
  background: #d1fae5;
  color: #065f46;
}

.difficulty-medium {
  background: #fef3c7;
  color: #92400e;
}

.difficulty-hard {
  background: #fee2e2;
  color: #991b1b;
}

.challenge-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.challenge-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(16, 185, 129, 0.95);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.challenge-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.challenge-card:hover .challenge-banner {
  transform: scale(1);
  background-size: cover;
}

.challenge-banner {
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.challenge-content {
  padding: 1.5rem;
}

/* Challenge cards use the uploaded image without the global animated stripe overlay. */
.challenge-card .challenge-banner::before {
  content: none !important;
  display: none !important;
  animation: none !important;
}

.challenge-related-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: .2rem .15rem .85rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #86b99a transparent;
}

.challenge-related-showcase {
  width: 100%;
  margin: 2rem 0 1rem;
  padding: clamp(1.1rem, 2.5vw, 2rem);
  border: 1px solid #d9e7de;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(167, 243, 208, .35), transparent 34%),
    linear-gradient(180deg, #fbfefc 0%, #f2f8f4 100%);
  box-shadow: 0 18px 40px rgba(22, 76, 47, .08);
  box-sizing: border-box;
}

.challenge-related-showcase__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid #dfeae3;
}

.challenge-related-showcase__eyebrow {
  display: block;
  margin-bottom: .2rem;
  color: #16814c;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.challenge-related-showcase__header h3 {
  margin: 0;
  color: #123b28;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.challenge-related-showcase__header p {
  max-width: 430px;
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.challenge-carousel-block {
  padding: .9rem 0 .35rem;
}

.challenge-carousel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .65rem;
}

.challenge-carousel-heading h4 {
  margin: 0;
  color: #173c2a;
  font-size: 1rem;
}

.challenge-carousel-actions {
  display: flex;
  gap: .45rem;
}

.challenge-carousel-actions button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cde1d4;
  border-radius: 50%;
  background: #fff;
  color: #176d43;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.challenge-carousel-actions button:hover {
  transform: translateY(-2px);
  background: #ecfdf3;
  border-color: #74b991;
}

.challenge-related-card {
  flex: 0 0 clamp(250px, 31vw, 330px);
  display: block;
  min-height: 240px;
  padding: 0;
  border: 1px solid #dfe8e2;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: 0 8px 20px rgba(25, 70, 46, .07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.challenge-related-card:hover {
  transform: translateY(-4px);
  border-color: #72bd93;
  box-shadow: 0 15px 30px rgba(22, 92, 57, .13);
}

.challenge-related-card__image {
  width: 100%;
  height: 150px;
  border-radius: 0;
  object-fit: cover;
  background: linear-gradient(135deg, #dff6e8, #bce8ce);
}

.challenge-related-card h5 {
  margin: .85rem .9rem .35rem;
  color: #153e2b;
  font-size: 1rem;
}

.challenge-related-card p {
  margin: 0 .9rem .95rem;
  color: #64748b;
  font-size: .82rem;
  line-height: 1.4;
}

.challenge-related-empty {
  flex: 0 0 100%;
  padding: .9rem;
  border: 1px dashed #cad9d0;
  border-radius: 11px;
  color: #64748b;
  font-size: .84rem;
}

.challenge-topic-card {
  padding: 1rem;
  border: 1px solid #dfe8e2;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.challenge-topic-card:hover {
  border-color: #72bd93;
  background: #fbfdfb;
}

.challenge-topic-card h4 {
  margin: 0 0 .35rem;
  color: #173c2a;
  font-size: 1rem;
}

.challenge-topic-card p {
  margin: 0 0 .55rem;
  color: #59685f;
  line-height: 1.5;
}

.challenge-topic-card small {
  color: #718078;
}

@media (max-width: 760px) {
  .challenge-related-showcase__header {
    align-items: flex-start;
    flex-direction: column;
  }
  .challenge-related-card {
    flex-basis: min(82vw, 300px);
  }
}

.challenge-difficulty {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.difficulty-easy {
  background: #d1fae5;
  color: #065f46;
}

.difficulty-medium {
  background: #fef3c7;
  color: #92400e;
}

.difficulty-hard {
  background: #fee2e2;
  color: #991b1b;
}

/* Groups */
.groups-container,
.resources-container,
.photos-container {
  padding: 1rem 0;
}

.groups-header,
.resources-header,
.photos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.groups-list,
.resources-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--color-primary, #10b981);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark, #059669);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Modal Positioning Fix */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding-top: 80px; /* Add top padding to move away from navbar */
  padding-bottom: 20px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal[style*="display: flex"] {
  display: flex !important;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: calc(100vh - 100px); /* Account for padding */
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.5rem;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 1.5rem;
}

.feed-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.feed-item-author {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: #666;
}

.feed-item-title {
  color: #1a1a1a;
  text-decoration: none;
}

.feed-item-title:hover {
  color: var(--color-primary, #10b981);
}

.feed-item-content {
  color: #666;
  line-height: 1.6;
}

.garden-search-input:focus {
  outline: none;
  border-color: var(--color-primary, #10b981);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.garden-search-input:hover {
  border-color: #cbd5e1;
}

/* Group feed post voting (Garden groups) */
.g-feed-card-footer .g-feed-card-stat-btn.is-voted[data-vote-direction="up"] {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.g-feed-card-footer .g-feed-card-stat-btn.is-voted[data-vote-direction="down"] {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Responsive Layout */
@media (max-width: 1200px) {
  .community-layout {
    grid-template-columns: 1fr 200px;
    gap: 1.5rem;
  }
  
  :root {
    --garden-card-masonry-width: 280px;
  }
  
  .community-tabs-vertical {
    padding: 0.75rem;
  }
  
  .community-tab-vertical {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  .community-tab-vertical i {
    font-size: 1rem;
    width: 18px;
  }
}

@media (max-width: 968px) {
  .community-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .community-tabs-sidebar {
    order: -1;
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 0.25rem;
  }
  
  .community-tabs-vertical {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .community-tab-vertical {
    white-space: nowrap;
    min-width: fit-content;
  }
  
  .community-tab-vertical.active::before {
    display: none;
  }
  
  .community-tab-vertical.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--color-primary, #10b981);
    border-radius: 2px 2px 0 0;
  }
  
  :root {
    --garden-card-masonry-width: 260px;
  }
  
  .feed-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
  
  .feed-filters {
    width: 100%;
  }
  
  .feed-filter-select {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .feed-masonry,
  .forum-posts-list--masonry {
    column-count: 1;
    column-width: auto;
  }
  
  .community-tabs-vertical {
    padding: 0.5rem;
  }
  
  .community-tab-vertical span {
    display: none;
  }
  
  .community-tab-vertical {
    padding: 0.75rem;
    justify-content: center;
  }
  
  .community-tab-vertical i {
    margin: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .forums-container {
    grid-template-columns: 1fr;
  }

  .forums-sidebar {
    order: 2;
  }

  .forums-main {
    order: 1;
  }

  .community-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .events-list,
  .challenges-list {
    grid-template-columns: 1fr;
  }
}
