/* BYLBY V3 — commentaires */

.by3-comments-modal[hidden] {
  display: none !important;
}

.by3-comments-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .65);
  font-family: Inter, Arial, sans-serif;
}

.by3-comments-panel {
  width: min(100%, 520px);
  max-height: min(720px, 88dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--by-border, #e7e7e9);
  background: var(--by-card, #fff);
  color: var(--by-text, #111);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}

.by3-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--by-border, #e7e7e9);
}

.by3-comments-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
}

.by3-comments-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--by-secondary, #f4f4f5);
  color: var(--by-text, #111);
  font-size: 23px;
  cursor: pointer;
}

.by3-comments-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 20px;
}

.by3-comment {
  margin-bottom: 20px;
}

.by3-comment-author {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 750;
}

.by3-comment-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.by3-comment-date {
  display: block;
  margin-top: 6px;
  color: var(--by-muted, #777782);
  font-size: 11px;
}

.by3-comment-reply {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--by-muted, #777782);
  font-size: 12px;
  cursor: pointer;
}

.by3-comment.is-reply {
  margin-left: 22px;
  padding-left: 14px;
  border-left: 2px solid var(--by-border, #e7e7e9);
}

.by3-comments-form {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--by-border, #e7e7e9);
}

.by3-comments-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 76px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--by-border, #e7e7e9);
  border-radius: 12px;
  background: var(--by-secondary, #f4f4f5);
  color: var(--by-text, #111);
  font: 14px Inter, Arial, sans-serif;
}

.by3-comments-form button[type="submit"] {
  display: block;
  margin: 10px 0 0 auto;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: #B5FF4D;
  color: #111;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.by3-comments-form button:disabled {
  opacity: .5;
  cursor: wait;
}

.by3-comments-feedback {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12px;
}

@media (max-width: 600px) {
  .by3-comments-modal {
    padding: 0;
    align-items: end;
  }

  .by3-comments-panel {
    width: 100%;
    max-height: 85dvh;
    border-radius: 20px 20px 0 0;
  }
}

/* Liens vers les profils des auteurs */
.by3-comment-author {
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.by3-comment-author:hover,
.by3-comment-author:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
