/**
 * Comments Component
 * Based on Figma node: 1654-107370
 */

/* ===========================================
 * COMMENTS AREA
 * =========================================== */

.comments-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===========================================
 * COMMENTS HEADER
 * =========================================== */

.comments-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.comments-header__meta {
  display: flex;
  align-items: center;
}

/* Title: "1 Comment" as block heading */
.comments-count {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 32px;
  color: #303030;
}

/* ===========================================
 * COMMENTS ACTIONS BAR
 * =========================================== */

.comments-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #E2E4E9;
}

.comments-actions__left,
.comments-actions__right {
  display: flex;
  align-items: center;
  gap: 48px;
}

.comments-actions__right {
  gap: 16px;
}

.comments-action-btn {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #B8B8B8;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.comments-action-btn:hover {
  color: #6E4F95;
}

/* ===========================================
 * COMMENT LIST
 * =========================================== */

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-item {
  padding: 0;
  margin: 0;
}

/* Nested comments (replies) */
.comment-item .children {
  list-style: none;
  padding: 0 0 0 32px;
  margin: 0;
  border-left: 2px solid #E2E4E9;
}

/* ===========================================
 * COMMENT BODY
 * =========================================== */

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #E2E4E9;
}

.comment-item:last-child > .comment-body {
  border-bottom: none;
}

/* User Info */
.comment-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.comment-avatar__img,
.comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
  color: #303030;
}

.comment-author a {
  color: inherit;
  text-decoration: none;
}

.comment-author a:hover {
  color: #6E4F95;
}

.comment-author-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background-color: #E8E1F3;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: #6E4F95;
}

.comment-date {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #888888;
}

/* Comment Content */
.comment-content {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: #4D4D4D;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* ===========================================
 * COMMENT ACTION BAR
 * =========================================== */

.comment-action-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-engagement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
}

.comment-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-reactions__emoji {
  font-size: 16px;
  line-height: 1;
}

.comment-reactions__count {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #B8B8B8;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.comment-actions__left,
.comment-actions__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.comment-action-link {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #B8B8B8;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.comment-action-link:hover {
  color: #6E4F95;
}

/* Reply link from WordPress */
.comment-reply-link {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #B8B8B8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.comment-reply-link:hover {
  color: #6E4F95;
}

/* ===========================================
 * COMMENT FORM
 * =========================================== */

.comment-respond {
  margin-top: 24px;
}

.comment-form-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-form__user-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.comment-form__user-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-form__content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .comment-form-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-form__content {
    width: 100%;
  }
}

/* Form Styles */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form__field {
  position: relative;
}

.comment-form__field textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #E2E4E9;
  border-radius: 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #303030;
  background-color: #ffffff;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.comment-form__field textarea::placeholder {
  color: #868C98;
}

.comment-form__field textarea:focus {
  outline: none;
  border-color: #6E4F95;
}

.comment-form__counter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 0;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 12px;
  color: #868C98;
  text-transform: uppercase;
  letter-spacing: 0.22px;
}

.comment-form__submit-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.comment-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  height: 48px;
  width: 100%; /* Mobile: full width */
  background-color: #8FB56C;
  border: none;
  border-radius: 10px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
  .comment-form__submit-wrapper {
    width: auto;
  }

  .comment-form__submit {
    width: auto;
  }
}

.comment-form__submit:hover {
  background-color: #7DA35A;
}

/* Cancel Reply Link */
#cancel-comment-reply-link {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #B8B8B8;
  text-decoration: none;
  transition: color 0.2s ease;
}

#cancel-comment-reply-link:hover {
  color: #6E4F95;
}

/* ===========================================
 * LOGIN PROMPT
 * =========================================== */

.comment-login-prompt {
  padding: 24px;
  background-color: #F6F6F6;
  border-radius: 12px;
  text-align: center;
}

.comment-login-prompt p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #4D4D4D;
  margin: 0;
}

.comment-login-prompt a {
  color: #6E4F95;
  text-decoration: none;
  font-weight: 500;
}

.comment-login-prompt a:hover {
  text-decoration: underline;
}

/* ===========================================
 * COMMENTS CLOSED
 * =========================================== */

.comments-closed {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #888888;
  text-align: center;
  padding: 16px;
}

/* ===========================================
 * RESPONSIVE
 * =========================================== */

@media (max-width: 767px) {
  .comments-actions {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .comments-actions__left,
  .comments-actions__right {
    gap: 24px;
  }
  
  .comment-item .children {
    padding-left: 16px;
  }
  
  .comment-form-wrapper {
    flex-direction: column;
  }
  
  .comment-form__user-avatar {
    display: none;
  }
}
