.community-page {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  padding-top: clamp(1.8rem, 4vw, 3.1rem) !important;
  padding-bottom: clamp(2.5rem, 5vw, 4rem) !important;
}

.community-page svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.community-hero {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr);
  align-items: center;
  gap: 2.4rem;
  margin-bottom: 1.15rem;
}

.community-hero-copy { padding: .2rem 0 .5rem; }
.community-hero-copy .eyebrow { margin-bottom: .55rem; }
.community-hero h1 {
  margin: 0 0 .4rem;
  color: var(--pm-primary-deep);
  font-size: clamp(3.25rem, 6vw, 5.55rem);
  line-height: .96;
  letter-spacing: -.055em;
}
.community-hero p { max-width: 560px; margin: 0; color: var(--pm-text); font-size: clamp(1rem, 1.45vw, 1.18rem); }
.community-hero-link { display: inline-block; margin: .8rem 1rem 0 0; font-size: .82rem; font-weight: 800; }
.community-hero-art { width: 100%; min-width: 0; align-self: end; }
.community-hero-art svg { display: block; width: 100%; height: auto; overflow: visible; stroke-width: initial; }

.community-filters {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1.75fr) minmax(145px, .7fr) minmax(145px, .74fr) minmax(170px, .86fr) auto;
  gap: .7rem .8rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem 1.05rem;
  border-color: #d7e6e2;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 78, 72, .045);
}

.community-field { min-width: 0; margin: 0; }
.community-field > label,
.community-field-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .35rem;
  color: var(--pm-primary-deep);
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.25;
}
.community-field > label svg,
.community-field-label svg { width: 17px; height: 17px; color: var(--pm-primary); flex: 0 0 auto; }
.community-feed-field { display: block; }
.community-feed-field select { min-height: 44px; }

.community-input-wrap { position: relative; }
.community-input-wrap > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: .82rem;
  width: 18px;
  height: 18px;
  color: #64827e;
  transform: translateY(-50%);
  pointer-events: none;
}
.community-input-wrap input { min-height: 44px; padding-left: 2.55rem; }
.community-filters input,
.community-filters select {
  border-color: #d5e3e0;
  background-color: #fff;
  font-size: .9rem;
}
.community-filters input::placeholder { color: #6c7f7c; opacity: 1; }

.community-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .63rem .95rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.community-button:hover { transform: translateY(-1px); }
.community-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.community-button-primary { color: #fff; background: linear-gradient(135deg, var(--pm-primary), var(--pm-primary-dark)); border-color: var(--pm-primary); box-shadow: 0 7px 16px rgba(0, 91, 82, .12); }
.community-button-primary:hover { color: #fff; background: var(--pm-primary-deep); border-color: var(--pm-primary-deep); box-shadow: 0 9px 20px rgba(0, 78, 72, .16); }
.community-button-secondary { color: var(--pm-primary-deep); background: #f5faf9; border-color: #bed8d3; }
.community-button-secondary:hover { color: var(--pm-primary-deep); background: var(--pm-primary-soft); border-color: var(--pm-primary); }
.community-button:disabled { opacity: .58; cursor: not-allowed; transform: none; }

.community-clear-location {
  align-self: center;
  justify-self: end;
  margin-bottom: .05rem;
  color: var(--pm-primary-deep);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.community-location-note,
.community-location-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--pm-text-muted);
  font-size: .76rem;
  line-height: 1.45;
}
.community-location-status:empty { display: none; }
.community-location-status:not(:empty) { color: var(--pm-primary-dark); font-weight: 700; }

.community-tabs {
  display: grid;
  grid-template-columns: 1.08fr 1fr .95fr .95fr .9fr 1.35fr;
  gap: .55rem;
  margin: .95rem 0 .7rem;
}
.community-tab {
  min-height: 46px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: .62rem .72rem;
  color: var(--pm-primary-deep);
  background: #f6f9f8;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.community-tab:hover { color: var(--pm-primary-deep); background: var(--pm-primary-soft); border-color: var(--pm-primary-border); transform: translateY(-1px); }
.community-tab.is-active { color: #fff; background: linear-gradient(135deg, var(--pm-primary), var(--pm-primary-dark)); border-color: var(--pm-primary); box-shadow: 0 7px 18px rgba(0, 91, 82, .14); }
.community-tab.is-active:hover { color: #fff; background: var(--pm-primary-deep); }
.community-tab-icon { width: 21px; height: 21px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.community-tab-icon svg { width: 20px; height: 20px; }

.community-summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.community-summary span { padding-inline: .18rem; }

.community-card {
  padding: 1.5rem;
  overflow-wrap: anywhere;
  scroll-margin-top: 6rem;
  border-color: #d9e7e4;
  box-shadow: 0 6px 20px rgba(0, 78, 72, .04);
}
.community-card-heading { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.community-card-heading p { margin: 0 0 .35rem; }
.community-card h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.community-avatar { object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.community-card input,
.community-card textarea { max-width: 100%; }
.community-card .community-share { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--pm-border); }
.community-freshness { color: #607572; font-size: .8rem; }
.community-post-image { display: block; width: 100%; height: auto; max-height: 440px; object-fit: contain; aspect-ratio: 16/9; background: #f5f7f9; border-radius: 12px; margin: 1rem 0; }
.community-share { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.community-pagination { display: flex; justify-content: center; gap: 1rem; margin: 1.5rem 0; }

.community-empty {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: .5rem 0 1rem;
  padding: 1.65rem 2rem 1.8rem;
  text-align: center;
  border-color: #d9e7e4;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 78, 72, .035);
}
.community-empty-art { width: 165px; max-width: 44vw; margin: -.25rem auto .3rem; color: var(--pm-primary); }
.community-empty-art svg { display: block; width: 100%; height: auto; stroke-width: initial; }
.community-empty-art-error { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 1rem; border-radius: 50%; color: #fff; background: var(--pm-danger); font-size: 2rem; font-weight: 900; }
.community-empty h2 { margin: 0 0 .35rem; color: var(--pm-primary-deep); font-size: 1.22rem; letter-spacing: -.02em; }
.community-empty > p { max-width: 650px; margin: 0 auto 1rem; color: var(--pm-text-muted); font-size: .88rem; }
.community-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }
.community-actions .community-button { min-width: 190px; }

.community-owner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: .9rem 1rem;
  border-color: #cfe3df;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0f8f6, #f8fbfa);
}
.community-owner-copy { min-width: 0; display: flex; align-items: center; gap: .85rem; }
.community-owner-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border-radius: 50%; color: var(--pm-primary); background: #dcefeb; }
.community-owner-icon svg { width: 23px; height: 23px; }
.community-owner h2 { margin: 0 0 .16rem; color: var(--pm-primary-deep); font-size: 1.02rem; letter-spacing: -.02em; }
.community-owner p { margin: 0; color: var(--pm-text-muted); font-size: .8rem; }
.community-owner > .community-button { flex: 0 0 auto; min-width: 230px; }

.community-loading[hidden] { display: none; }
.community-loading div { height: 160px; border-radius: 14px; background: linear-gradient(110deg,#eef1f4,#f8fafc,#eef1f4); margin: 1rem 0; animation: community-pulse 1.2s ease-in-out infinite alternate; }
@keyframes community-pulse { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .community-loading div { animation: none; }
  .community-button,
  .community-tab { transition: none; }
}

@media (max-width: 1060px) {
  .community-hero { grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr); gap: 1.2rem; min-height: 195px; }
  .community-filters { grid-template-columns: minmax(240px, 1.5fr) minmax(135px, .65fr) minmax(145px, .75fr) minmax(165px, .8fr); }
  .community-clear-location { grid-column: 1 / -1; justify-self: end; margin-top: -.15rem; }
  .community-tabs { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .community-page { width: min(100% - 1.5rem, 760px); padding-top: 1.55rem !important; }
  .community-hero { grid-template-columns: 1fr 270px; min-height: 165px; gap: .8rem; }
  .community-hero h1 { font-size: clamp(2.7rem, 8vw, 4rem); }
  .community-hero p { font-size: .94rem; }
  .community-filters { grid-template-columns: 1fr 1fr; padding: .95rem; }
  .community-location { grid-column: 1 / -1; }
  .community-filters > .community-button { width: 100%; }
  .community-clear-location { grid-column: 1 / -1; justify-self: center; margin: 0; }
  .community-location-note { display: none; }
  .community-location-status { text-align: center; }
  .community-empty { min-height: 250px; }
  .community-owner { align-items: stretch; flex-direction: column; }
  .community-owner > .community-button { width: 100%; min-width: 0; }
}

@media (max-width: 600px) {
  .community-page { width: min(100% - 1rem, 560px); padding-top: 1rem !important; padding-bottom: 2rem !important; }
  .community-hero { grid-template-columns: minmax(0, 1fr) 128px; align-items: end; min-height: 132px; gap: .3rem; margin-bottom: .7rem; }
  .community-hero-copy { padding: 0 0 .2rem; }
  .community-hero-copy .eyebrow { margin-bottom: .3rem; font-size: .62rem; }
  .community-hero h1 { margin-bottom: .24rem; font-size: clamp(2.05rem, 11vw, 2.8rem); line-height: .98; }
  .community-hero p { font-size: .76rem; line-height: 1.4; }
  .community-hero-link { margin: .45rem .5rem 0 0; font-size: .68rem; }
  .community-hero-art { align-self: end; margin-bottom: .05rem; }

  .community-filters { grid-template-columns: 1fr; gap: .58rem; margin-bottom: .7rem; padding: .75rem; border-radius: 10px; }
  .community-location,
  .community-feed-field,
  .community-filters > .community-button,
  .community-clear-location,
  .community-location-note,
  .community-location-status { grid-column: 1; }
  .community-field > label,
  .community-field-label { margin-bottom: .28rem; font-size: .72rem; }
  .community-field > label svg,
  .community-field-label svg { width: 15px; height: 15px; }
  .community-filters input,
  .community-filters select,
  .community-button { min-height: 40px; font-size: .74rem; }
  .community-input-wrap > svg { width: 16px; height: 16px; left: .7rem; }
  .community-input-wrap input { padding-left: 2.25rem; }
  .community-clear-location { justify-self: center; font-size: .67rem; }
  .community-location-status { font-size: .66rem; }

  .community-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin: .68rem 0 .5rem; }
  .community-tab { min-height: 49px; flex-direction: column; gap: .18rem; padding: .42rem .24rem; border-color: #edf2f0; font-size: .62rem; line-height: 1.05; }
  .community-tab-icon { width: 17px; height: 17px; }
  .community-tab-icon svg { width: 16px; height: 16px; }
  .community-summary { margin: .45rem 0 .6rem; font-size: .67rem; }

  .community-card { padding: 1rem; }
  .community-card-heading { align-items: start; }
  .community-avatar { width: 40px; height: 40px; }

  .community-empty { min-height: 245px; margin-top: .25rem; padding: 1rem .75rem 1.1rem; border-radius: 10px; }
  .community-empty-art { width: 120px; margin-bottom: .2rem; }
  .community-empty h2 { font-size: 1rem; }
  .community-empty > p { max-width: 330px; margin-bottom: .8rem; font-size: .72rem; line-height: 1.4; }
  .community-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: .4rem; }
  .community-actions .community-button { width: 100%; min-width: 0; }

  .community-owner { gap: .75rem; padding: .75rem; }
  .community-owner-copy { align-items: flex-start; gap: .6rem; }
  .community-owner-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .community-owner-icon svg { width: 19px; height: 19px; }
  .community-owner h2 { font-size: .9rem; }
  .community-owner p { font-size: .7rem; line-height: 1.4; }
}
