/* LONGWAVE episode comments.
   The familiar, always-open comment surface stays separate from episode extras. */

.lw-community-shell {
  max-width: none;
  color: var(--bone, #e8ddd7);
  border: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
  border-top: 3px solid var(--gold, #e8c875);
  background: rgba(10, 7, 16, 0.5);
}

.lw-community-shell[hidden] {
  display: none !important;
}

.lw-community-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
}

.lw-community button:focus-visible,
.lw-community textarea:focus-visible,
.lw-community input:focus-visible,
.lw-community select:focus-visible,
.lw-community-received:focus-visible {
  outline: 2px solid var(--gold, #e8c875);
  outline-offset: 3px;
}

.lw-community-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 5px;
}

.lw-community-heading h2 {
  margin: 0;
  color: var(--bone, #e8ddd7);
  font-family: var(--serif, "Playfair Display", Georgia, serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.05;
}

.lw-community-new {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gold-soft, rgba(232, 200, 117, 0.35));
  background: rgba(232, 200, 117, 0.08);
  color: var(--gold, #e8c875);
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.15em;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
}

.lw-community-new[hidden] {
  display: none !important;
}

.lw-community-heading p {
  margin: 0;
  color: var(--bone-2, rgba(232, 221, 215, 0.78));
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
}

.lw-community-received-host {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 8px;
}

.lw-community-received-host[hidden] {
  display: none !important;
}

.lw-community-meta,
.lw-community-note,
.lw-community-badge,
.lw-community-count {
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
}

.lw-community {
  padding: 22px 24px 30px;
}

.lw-community-received {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
  background: transparent;
  color: var(--bone-2, rgba(232, 221, 215, 0.78));
  cursor: pointer;
  padding: 10px 13px;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.lw-community-received:hover,
.lw-community-received[aria-pressed="true"] {
  border-color: var(--gold, #e8c875);
  color: var(--gold, #e8c875);
  background: rgba(232, 200, 117, 0.06);
}

.lw-community-received:disabled,
.lw-community-action:disabled,
.lw-community-submit:disabled {
  cursor: default;
  opacity: 0.55;
}

.lw-community-heart {
  font-size: 17px;
  line-height: 1;
}

.lw-community-count {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lw-community-received-total {
  min-width: 1.5ch;
  color: var(--bone, #e8ddd7);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 10px;
}

.lw-community-heart-feedback {
  color: var(--rose, #d4889c);
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.4;
  max-width: 28ch;
}

.lw-community-status {
  min-height: 20px;
  color: var(--gold, #e8c875);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
}

.lw-community-status[data-kind="error"],
.lw-community-error {
  color: #e5868a;
}

.lw-community-error {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
}

.lw-community-loading {
  color: var(--bone-3, rgba(232, 221, 215, 0.5));
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.2em;
  padding: 28px 0 8px;
  text-transform: uppercase;
}

.lw-community-composer,
.lw-community-inline-form {
  border: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
  background: rgba(34, 26, 46, 0.56);
  padding: 18px;
}

.lw-community-composer {
  margin-bottom: 26px;
}

.lw-community-composer h3 {
  font-family: var(--serif, "Playfair Display", Georgia, serif);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 14px;
}

.lw-community-identity {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  align-items: end;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.lw-community-identity label {
  grid-column: 1;
}

.lw-community-identity input {
  grid-column: 1;
}

.lw-community-identity .lw-community-note {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.lw-community-identity[data-saved="true"] input {
  opacity: 0.72;
}

.lw-community label {
  display: block;
  color: var(--bone-3, rgba(232, 221, 215, 0.5));
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 9px;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.lw-community input,
.lw-community textarea,
.lw-community select {
  width: 100%;
  border: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
  border-radius: 0;
  background: var(--void, #0a0710);
  color: var(--bone, #e8ddd7);
  font: 14px/1.55 var(--sans, "Inter", sans-serif);
  padding: 11px 12px;
}

.lw-community textarea {
  min-height: 96px;
  resize: vertical;
}

.lw-community-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
}

.lw-community-controls {
  display: flex;
  gap: 10px;
}

.lw-community-note {
  color: rgba(232, 221, 215, 0.64);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.lw-community-submit,
.lw-community-secondary {
  appearance: none;
  border: 1px solid var(--gold, #e8c875);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 10px 14px;
  min-height: 40px;
  text-transform: uppercase;
}

.lw-community-submit {
  background: var(--gold, #e8c875);
  color: var(--void, #0a0710);
}

.lw-community-submit:hover {
  background: #f1d287;
}

.lw-community-secondary {
  background: transparent;
  color: var(--gold, #e8c875);
}

.lw-community-comments {
  margin-top: 8px;
}

.lw-community-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lw-community-item {
  border-top: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
  padding: 22px 0;
}

.lw-community-item[data-reply="true"] {
  border-top-color: rgba(232, 221, 215, 0.11);
  margin-left: clamp(20px, 5vw, 58px);
  padding: 18px 0;
}

.lw-community-comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 9px;
}

.lw-community-author {
  color: var(--bone, #e8ddd7);
  font-size: 13px;
  font-weight: 500;
}

.lw-community-badge {
  border: 1px solid var(--gold-soft, rgba(232, 200, 117, 0.35));
  color: var(--gold, #e8c875);
  font-size: 8px;
  letter-spacing: 0.12em;
  padding: 3px 6px;
  text-transform: uppercase;
}

.lw-community-badge[data-kind="creator-heart"] {
  border-color: rgba(212, 136, 156, 0.45);
  color: var(--rose, #d4889c);
}

.lw-community-meta {
  color: var(--bone-3, rgba(232, 221, 215, 0.5));
  font-size: 9px;
  letter-spacing: 0.08em;
  margin-left: auto;
  text-transform: uppercase;
}

.lw-community-body {
  color: var(--bone-2, rgba(232, 221, 215, 0.78));
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lw-community-body[data-removed="true"] {
  color: var(--bone-3, rgba(232, 221, 215, 0.5));
  font-style: italic;
}

.lw-community-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 12px;
}

.lw-community-action {
  appearance: none;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--bone-3, rgba(232, 221, 215, 0.5));
  cursor: pointer;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.1em;
  min-height: 36px;
  padding: 8px 2px;
  text-transform: uppercase;
}

.lw-community-action:hover,
.lw-community-action[aria-pressed="true"] {
  border-bottom-color: var(--gold, #e8c875);
  color: var(--gold, #e8c875);
}

.lw-community-action[data-danger="true"]:hover {
  border-bottom-color: #e5868a;
  color: #e5868a;
}

.lw-community-inline-form {
  margin-top: 15px;
}

.lw-community-inline-form .lw-community-form-foot {
  justify-content: flex-end;
}

.lw-community-inline-form select {
  margin-bottom: 10px;
}

.lw-community-empty {
  border-top: 1px solid var(--bone-4, rgba(232, 221, 215, 0.18));
  margin: 8px 0 0;
  padding: 24px 12px 2px;
  color: var(--bone, #e8ddd7);
  font-family: var(--serif, "Playfair Display", Georgia, serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 680px) {
  .lw-community-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px;
  }

  .lw-community {
    padding: 18px 16px 24px;
  }

  .lw-community-identity {
    grid-template-columns: minmax(0, 1fr);
  }

  .lw-community-identity label,
  .lw-community-identity input,
  .lw-community-identity .lw-community-note {
    grid-column: 1;
    grid-row: auto;
  }

  .lw-community-form-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .lw-community-controls {
    flex-direction: column;
    width: 100%;
  }

  .lw-community-submit,
  .lw-community-secondary {
    min-height: 44px;
    width: 100%;
  }

  .lw-community-action {
    min-height: 44px;
    padding: 11px 3px;
  }

  .lw-community-meta {
    flex-basis: 100%;
    margin-left: 0;
  }

  .lw-community-item[data-reply="true"] {
    margin-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lw-community * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
