.community {
  --community-gold: var(--gold, var(--hub-gold, #d6b06a));
  --community-gold-soft: var(--gold-light, var(--hub-gold-soft, #ecd39e));
  --community-ink: var(--reader-text, var(--hub-ink, #eee8dd));
  --community-muted: var(--reader-muted, var(--hub-muted, #9c978d));
  --community-line: color-mix(in srgb, var(--community-ink) 15%, transparent);
  --community-panel: color-mix(in srgb, var(--community-ink) 3%, transparent);
  position: relative;
  width: 100%;
  margin: clamp(5rem, 11vw, 9rem) auto;
  color: var(--community-ink);
  font-family: "Manrope", Arial, sans-serif;
}

.community--reader {
  margin-top: clamp(6rem, 12vw, 10rem);
}

.community--poem {
  width: min(100%, 76rem);
  padding-inline: clamp(0px, 3vw, 2rem);
}

.community--static {
  width: min(100%, 52rem);
}

.community__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem 4rem;
  align-items: end;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--community-line);
}

.community__heading > div {
  max-width: 48rem;
}

.community__kicker {
  margin: 0;
  color: var(--community-gold);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.community__heading h2 {
  margin: .85rem 0 1.25rem;
  color: var(--community-ink);
  font-family: "Prata", Georgia, serif;
  font-size: clamp(2.45rem, 6vw, 5.7rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.02;
}

.community__heading h2 em {
  color: var(--community-gold);
  font-weight: 400;
}

.community__heading > div > p:last-child {
  max-width: 36rem;
  margin: 0;
  color: var(--community-muted);
  font-size: .78rem;
  line-height: 1.8;
}

.community__work-like {
  min-width: 10.5rem;
  padding: 1.35rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: .2rem .75rem;
  align-items: center;
  border: 1px solid var(--community-line);
  color: var(--community-ink);
  background: var(--community-panel);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.community__work-like:hover,
.community__work-like:focus-visible {
  border-color: var(--community-gold);
  transform: translateY(-2px);
}

.community__work-like > span {
  grid-row: 1 / 3;
  color: var(--community-gold);
  font-size: 2rem;
  line-height: 1;
}

.community__work-like strong {
  align-self: end;
  font-family: "Prata", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
}

.community__work-like small {
  align-self: start;
  color: var(--community-muted);
  font-size: .53rem;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.community__work-like.is-liked {
  border-color: var(--community-gold);
  color: #17130d;
  background: var(--community-gold);
}

.community__work-like.is-liked > span,
.community__work-like.is-liked small { color: #17130d; }

.community__work-like.is-error { animation: community-shake .36s ease; }

@keyframes community-shake {
  33% { transform: translateX(-5px); }
  66% { transform: translateX(5px); }
}

.community__comments-head {
  margin-top: clamp(3rem, 7vw, 5rem);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.community__comments-head > div:first-child {
  display: grid;
  gap: .35rem;
}

.community__comments-head span {
  font-family: "Prata", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.community__comments-head small,
.community__carousel-meta,
.community-form__footer p {
  color: var(--community-muted);
  font-size: .58rem;
  letter-spacing: .07em;
}

.community__arrows {
  display: flex;
  gap: .55rem;
}

.community__arrows button {
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--community-line);
  color: var(--community-ink);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color .2s, color .2s, background .2s;
}

.community__arrows button:not(:disabled):hover,
.community__arrows button:not(:disabled):focus-visible {
  border-color: var(--community-gold);
  color: #17130d;
  background: var(--community-gold);
}

.community__arrows button:disabled { opacity: .28; cursor: default; }

.community__carousel {
  margin-top: 1.25rem;
}

.community__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(min(82vw, 21rem), 30rem);
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 1px 0 1.1rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--community-gold) transparent;
  scrollbar-width: thin;
}

.community__track::-webkit-scrollbar { height: 4px; }
.community__track::-webkit-scrollbar-track { background: transparent; }
.community__track::-webkit-scrollbar-thumb { background: var(--community-gold); }

.community-card {
  min-height: 18rem;
  padding: clamp(1.35rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--community-line);
  background:
    radial-gradient(circle at 94% 5%, color-mix(in srgb, var(--community-gold) 12%, transparent), transparent 14rem),
    var(--community-panel);
  scroll-snap-align: start;
}

.community-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
}

.community-card > header > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .85rem;
}

.community-card__avatar {
  width: 2.65rem;
  height: 2.65rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--community-gold) 48%, transparent);
  border-radius: 50%;
  color: var(--community-gold);
  font-family: "Prata", Georgia, serif;
  font-size: 1rem;
}

.community-card > header > div:first-child > div {
  min-width: 0;
  display: grid;
  gap: .28rem;
}

.community-card > header strong {
  overflow: hidden;
  color: var(--community-ink);
  font-size: .72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-card time,
.community-card__number {
  color: var(--community-muted);
  font-size: .52rem;
  font-weight: 400;
  letter-spacing: .07em;
}

.community-card__number {
  padding-top: .3rem;
  color: var(--community-gold);
}

.community-card__text {
  margin: 2rem 0;
  color: var(--community-ink);
  font-family: "Prata", Georgia, serif;
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.community-card.is-collapsed .community-card__text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.community-card__expand {
  align-self: flex-start;
  margin: -1rem 0 1.35rem;
  padding: .35rem 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--community-gold) 52%, transparent);
  color: var(--community-gold);
  background: transparent;
  cursor: pointer;
  font: 500 .62rem/1.4 "Manrope", Arial, sans-serif;
  letter-spacing: .06em;
}

.community-card__expand:hover,
.community-card__expand:focus-visible { border-bottom-color: var(--community-gold); }

.community-card > footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--community-line);
}

.community-card__like {
  min-width: 4.4rem;
  padding: .62rem .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid var(--community-line);
  color: var(--community-muted);
  background: transparent;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}

.community-card__like span { color: var(--community-gold); font-size: 1.1rem; }
.community-card__like b { font-size: .66rem; font-weight: 500; }
.community-card__like:not(:disabled):hover { border-color: var(--community-gold); transform: translateY(-1px); }
.community-card__like.is-liked { border-color: var(--community-gold); color: #17130d; background: var(--community-gold); }
.community-card__like.is-liked span { color: #17130d; }
.community-card__like.is-error { animation: community-shake .36s ease; }

.community-card--empty {
  justify-content: center;
}

.community-card--empty > span {
  height: 4rem;
  color: var(--community-gold);
  font-family: "Prata", Georgia, serif;
  font-size: 5rem;
  line-height: 1;
}

.community-card--empty > strong {
  margin-top: 1rem;
  font-family: "Prata", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
}

.community-card--empty > p {
  max-width: 23rem;
  margin: 1rem 0 0;
  color: var(--community-muted);
  font-size: .72rem;
  line-height: 1.75;
}

.community-card--loading { gap: 1rem; }
.community-card--loading i {
  height: .8rem;
  display: block;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--community-ink) 10%, transparent), transparent);
  background-size: 220% 100%;
  animation: community-loading 1.2s linear infinite;
}
.community-card--loading i:nth-child(1) { width: 55%; }
.community-card--loading i:nth-child(2) { width: 92%; margin-top: 2rem; }
.community-card--loading i:nth-child(3) { width: 72%; }

@keyframes community-loading { to { background-position: -220% 0; } }

.community__carousel-meta {
  min-height: 2.7rem;
  padding-top: .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.community__carousel-meta > button {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--community-gold) 48%, transparent);
  color: var(--community-gold);
  background: transparent;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.community-form {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(14rem, .65fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  border: 1px solid var(--community-line);
  background: var(--community-panel);
}

.community-form__intro {
  grid-row: 1 / 3;
  padding-right: clamp(0px, 3vw, 2rem);
}

.community-form__intro h3 {
  margin: .8rem 0 1rem;
  font-family: "Prata", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -.035em;
}

.community-form__intro > p:last-child {
  margin: 0;
  color: var(--community-muted);
  font-size: .7rem;
  line-height: 1.75;
}

.community-field {
  min-width: 0;
  display: grid;
  gap: .65rem;
}

.community-field > span {
  color: var(--community-ink);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .07em;
}

.community-field > span small {
  margin-left: .35rem;
  color: var(--community-muted);
  font-size: .52rem;
  font-weight: 400;
}

.community-field input,
.community-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--community-line);
  border-radius: 0;
  color: var(--community-ink);
  background: transparent;
  font: 400 .82rem/1.7 "Manrope", Arial, sans-serif;
  outline: 0;
  transition: border-color .2s;
}

.community-field input { min-height: 3.35rem; padding: .7rem 0; }
.community-field textarea { min-height: 9.4rem; padding: .9rem 0; resize: vertical; }
.community-field input::placeholder,
.community-field textarea::placeholder { color: color-mix(in srgb, var(--community-muted) 65%, transparent); }
.community-field input:focus,
.community-field textarea:focus { border-color: var(--community-gold); }

.community-honeypot {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.community-turnstile {
  min-height: 2px;
  overflow: hidden;
}

.community-turnstile:not([hidden]) {
  margin-top: 4px;
}

.community-form__footer {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.community-submit {
  min-height: 3.45rem;
  padding: .85rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  border: 1px solid var(--community-gold);
  color: #17130d;
  background: var(--community-gold);
  cursor: pointer;
  font: 600 .64rem/1.2 "Manrope", Arial, sans-serif;
  letter-spacing: .06em;
  transition: background .2s, border-color .2s, transform .2s;
}

.community-submit:not(:disabled):hover,
.community-submit:not(:disabled):focus-visible {
  border-color: var(--community-gold-soft);
  background: var(--community-gold-soft);
  transform: translateY(-2px);
}

.community-submit:disabled { opacity: .55; cursor: wait; }
.community-form__footer p { max-width: 18rem; margin: 0; line-height: 1.55; text-align: right; }
.community-form__footer p.is-success { color: var(--community-gold); }
.community-form__footer p.is-error { color: #df927f; }

.community--loading :is(.community__work-like, .community__arrows button) { pointer-events: none; opacity: .5; }

html[data-ux-theme="warm"] .community {
  --community-panel: rgba(255, 244, 221, .035);
}

html[data-ux-theme="contrast"] .community {
  --community-line: rgba(255, 255, 255, .35);
  --community-panel: rgba(255, 255, 255, .045);
}

@media (max-width: 760px) {
  .community { margin-block: 5rem; }
  .community--reader { margin-top: 6rem; }
  .community__heading { grid-template-columns: 1fr; align-items: stretch; }
  .community__work-like { width: 100%; min-width: 0; grid-template-columns: auto auto 1fr; grid-template-rows: 1fr; justify-content: start; }
  .community__work-like > span { grid-row: 1; }
  .community__work-like strong,
  .community__work-like small { align-self: center; }
  .community__comments-head { align-items: center; }
  .community__track { grid-auto-columns: min(86vw, 25rem); }
  .community-form { grid-template-columns: 1fr; padding: 1.4rem; }
  .community-form__intro { grid-row: auto; padding: 0 0 .8rem; }
  .community-form__footer { grid-column: 1; align-items: stretch; flex-direction: column; }
  .community-submit { width: 100%; }
  .community-form__footer p { max-width: none; text-align: left; }
  .community__kicker,
  .community__work-like small,
  .community__comments-head small,
  .community__carousel-meta,
  .community-field > span,
  .community-field > span small,
  .community-form__footer p,
  .community-card time,
  .community-card__number,
  .community-card__expand { font-size: .7rem; }
  .community__heading > div > p:last-child,
  .community-form__intro > p:last-child,
  .community-card--empty > p { font-size: .78rem; }
}

@media (max-width: 480px) {
  .community__heading h2 { font-size: clamp(2.25rem, 12vw, 3.6rem); }
  .community__comments-head { align-items: flex-end; }
  .community__arrows button { width: 2.75rem; height: 2.75rem; }
  .community__track { margin-right: -1.25rem; padding-right: 1.25rem; }
  .community-card { min-height: 20rem; }
}

@media (prefers-reduced-motion: reduce) {
  .community *, .community *::before, .community *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Compact empty state: the invitation stays visible; errors remain separate. */
.community--empty .community__carousel,
.community--empty .community__arrows { display: none; }
.community--empty .community-form { margin-top: 1.5rem; }
@media (max-width: 760px) {
  .community-field input, .community-field textarea { font-size: 16px; }
  .community-field > span, .community-field > span small,
  .community-form__footer p, .community-form__intro > p:last-child,
  .community__comments-head small { font-size: 0.875rem; line-height: 1.6; }
}
