/*
  Comments styles (pure CSS)
  Keep selectors scoped to .acb-* to avoid leaking into theme styles
*/

.acb-comments,
.acb-comments *,
.acb-comments *::before,
.acb-comments *::after {
  box-sizing: border-box;
}

.acb-comments {
  margin-top: 32px;
  padding: 0;
  padding-top: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #111827;
}

.acb-comments__header {
  margin: 0 0 12px 0;
}

.acb-comments__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: #111827;
}

.acb-comments__count {
  color: #3871cc;
}

.acb-comments__notice {
  margin: 0 0 16px 0;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.acb-comments__list {
  border-top: 1px solid #e5e7eb;
}

.acb-comments__empty {
  margin-top: 16px;
  text-align: center;
  padding: 28px 0;
  color: #9ca3af;
  font-size: 14px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
}

.acb-comments__composer {
  margin-top: 18px;
}

.acb-comments__no-permission {
  margin-top: 18px;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #6b7280;
  font-size: 14px;
}

/* -------------------------------------------------------------------------- */
/* Single comment                                                              */
/* -------------------------------------------------------------------------- */

.acb-comment {
  padding: 24px 0;
  border-bottom: 1px solid #f3f4f6;
}

.acb-comment--depth-2 { margin-left: 18px; }
.acb-comment--depth-3 { margin-left: 36px; }

@media (max-width: 480px) {
  .acb-comment--depth-2 { margin-left: 12px; }
  .acb-comment--depth-3 { margin-left: 24px; }
}

.acb-comment--reply {
  position: relative;
  margin-top: 12px;
  padding: 18px 16px 18px 44px;
  background: rgba(249, 250, 251, 0.7);
  border: 1px solid #f3f4f6;
  border-bottom: none;
  border-radius: 12px;
}

.acb-comment__reply-indicator {
  position: absolute;
  left: 16px;
  top: 20px;
  color: #d1d5db;
}

.acb-comment__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.acb-comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acb-comment__author {
  font-weight: 800;
  color: #111827;
  font-size: 14px;
}

.acb-comment__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.acb-comment__badge--admin {
  background: #111827;
  color: #fff;
}

.acb-comment__date {
  font-size: 12px;
  color: #9ca3af;
}

.acb-comment__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

.acb-comment__separator {
  width: 1px;
  height: 12px;
  background: #e5e7eb;
  display: inline-block;
}

.acb-comment__action {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
  cursor: pointer;
  text-decoration: none;
}

.acb-comment__action:hover {
  color: #4b5563;
  text-decoration: underline;
}

.acb-comment__action--delete:hover {
  color: #bd1a03;
}

.acb-comment__action:focus-visible {
  outline: 2px solid rgba(56, 113, 204, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.acb-comment__content {
  font-size: 14px;
  color: #374151;
  line-height: 1.7;
  word-break: break-word;
}

.acb-comment__content p {
  margin: 0 0 0.75em;
}

.acb-comment__content p:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------------------- */
/* New comment form                                                            */
/* -------------------------------------------------------------------------- */

.acb-comment-form {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.acb-comment-form__form {
  margin: 0;
}

.acb-comment-form__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.acb-comment-form__title {
  margin: 0;
  font-weight: 800;
  font-size: 16px;
  color: #111827;
}

.acb-comment-form__badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
}

.acb-comment-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.acb-comment-form__input {
  flex: 1 1 160px;
  min-width: 160px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.acb-comment-form__input:focus {
  outline: none;
  border-color: #3871cc;
  box-shadow: 0 0 0 3px rgba(56, 113, 204, 0.15);
}

.acb-comment-form__textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.acb-comment-form__textarea:focus {
  outline: none;
  border-color: #3871cc;
  box-shadow: 0 0 0 3px rgba(56, 113, 204, 0.15);
}

.acb-comment-form__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.acb-comment-form__submit {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.acb-comment-form__submit:hover {
  background: #374151;
  border-color: #374151;
}

.acb-comment-form__submit:focus-visible {
  outline: 2px solid rgba(56, 113, 204, 0.35);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Reply form                                                                  */
/* -------------------------------------------------------------------------- */

.acb-reply-form {
  margin-top: 12px;
}

.acb-reply-form__layout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.acb-reply-form__indicator {
  width: 34px;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding-top: 6px;
  color: #9ca3af;
}

.acb-reply-form__card {
  flex: 1 1 auto;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 16px;
}

.acb-reply-form__card--admin {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.acb-reply-form__form {
  margin: 0;
}

.acb-reply-form__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.acb-reply-form__heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.acb-reply-form__badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  background: #111827;
  color: #fff;
}

.acb-reply-form__heading-text {
  font-size: 12px;
  color: #6b7280;
}

.acb-reply-form__heading-strong {
  font-weight: 800;
  color: #111827;
}

.acb-reply-form__close {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 4px;
  margin: 0;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 8px;
}

.acb-reply-form__close:hover {
  color: #4b5563;
  background: rgba(17, 24, 39, 0.06);
}

.acb-reply-form__close:focus-visible {
  outline: 2px solid rgba(56, 113, 204, 0.35);
  outline-offset: 2px;
}

.acb-reply-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.acb-reply-form__input {
  flex: 1 1 140px;
  min-width: 140px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
}

.acb-reply-form__input:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.acb-reply-form__textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.acb-reply-form__textarea:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.acb-reply-form__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.acb-reply-form__button {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.acb-reply-form__button:hover {
  background: #f3f4f6;
  border-color: #cbd5e1;
  color: #111827;
}

.acb-reply-form__button--submit {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.acb-reply-form__button--submit:hover {
  background: #374151;
  border-color: #374151;
  color: #fff;
}

/* -------------------------------------------------------------------------- */
/* Edit form                                                                   */
/* -------------------------------------------------------------------------- */

.acb-edit-form {
  margin-top: 12px;
}

.acb-edit-form__card {
  background: #fff;
  border: 2px solid #111827;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.acb-edit-form__form {
  margin: 0;
}

.acb-edit-form__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.acb-edit-form__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acb-edit-form__author {
  font-weight: 800;
  color: #111827;
  font-size: 14px;
}

.acb-edit-form__badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: #dbeafe;
  color: #1d4ed8;
}

.acb-edit-form__password {
  width: 150px;
  max-width: 45vw;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
}

.acb-edit-form__password:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.acb-edit-form__textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  color: #111827;
}

.acb-edit-form__textarea:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.acb-edit-form__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.acb-edit-form__button {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.acb-edit-form__button:hover {
  background: #f3f4f6;
  border-color: #cbd5e1;
  color: #111827;
}

.acb-edit-form__button--submit {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.acb-edit-form__button--submit:hover {
  background: #374151;
  border-color: #374151;
  color: #fff;
}

.acb-edit-form__button:focus-visible {
  outline: 2px solid rgba(56, 113, 204, 0.35);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Modal                                                                       */
/* -------------------------------------------------------------------------- */

.acb-modal,
.acb-modal *,
.acb-modal *::before,
.acb-modal *::after {
  box-sizing: border-box;
}

.acb-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.acb-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.acb-modal__dialog {
  position: relative;
  width: calc(100% - 32px);
  max-width: 420px;
  margin: 12vh auto 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.acb-modal__header {
  padding: 16px;
  font-weight: 800;
  font-size: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.acb-modal__body {
  padding: 16px;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

.acb-modal__footer {
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.acb-modal__button {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #111827;
  transition: background-color 0.2s, border-color 0.2s;
}

.acb-modal__button:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
}

.acb-modal__button--confirm {
  background: #bd1a03;
  border-color: #bd1a03;
  color: #fff;
}

.acb-modal__button--confirm:hover {
  background: #9c1502;
  border-color: #9c1502;
}

.acb-modal__button:focus-visible {
  outline: 2px solid rgba(56, 113, 204, 0.35);
  outline-offset: 2px;
}
