/* ---------- Comments: Modern card style ---------- */
:root{
  --comment-bg: #ffffff;
  --panel-bg: #fbfcfd;
  --border: #e6e9ee;
  --muted: #6b7280;
  --accent:#7c3aed;
  --accent-hover:#7c3aed;
  --radius: 12px;
  --shadow: 0 6px 18px rgba(16,24,40,0.06);
  --max-width: 1024px;
  --gap: 14px;
  --avatar-size: 48px;
}

/* container */
.comments{
  max-width: var(--max-width);
  margin: 22px auto;
  padding: 18px;
  background: linear-gradient(180deg, var(--panel-bg), #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #111827;
}

/* heading */
.comments > h3{
  margin: 0 0 14px 0;
  font-size: 1.125rem;
  letter-spacing: -0.2px;
  color: #0f172a;
}

/* comment list reset */
.comment-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

/* each comment card */
.comment-list li{
  background: var(--comment-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: block;
}

/* article layout */
.comment-body{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

/* avatar + author block */
.comment-author.vcard{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: var(--avatar-size);
  min-width: var(--avatar-size);
}

.comment-author .avatar{
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 999px;
  border: 2px solid var(--border);
  box-shadow: 0 2px 6px rgba(2,6,23,0.06);
  object-fit: cover;
  display: block;
}

/* author name and timestamp */
.comment-meta{
  grid-column: 2 / -1;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 8px;
}

.comment-author .fn{
  font-weight: 600;
  color: #0f172a;
  display: inline-block;
  margin-right: 6px;
}

.comment-author .says{
  color: var(--muted);
  font-size: 0.95rem;
}

/* metadata (time + edit link) */
.comment-metadata{
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.comment-metadata a{
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed rgba(107,114,128,0.12);
}
.comment-metadata a:hover{
  color: var(--accent);
  border-bottom-style: solid;
}

/* comment content */
.comment-content{
  grid-column: 2 / -1;
  background: linear-gradient(180deg, rgba(14,165,164,0.03), transparent);
  padding: 10px 12px;
  border-radius: 8px;
  color: #0b1220;
  line-height: 1.5;
  margin-bottom: 8px;
  font-size: 0.98rem;
}

/* reply link as button */
.reply{
  grid-column: 2 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-reply-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(14,165,164,0.12);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 160ms ease;
}
.comment-reply-link:hover,
.comment-reply-link:focus{
  background: rgba(14,165,164,0.08);
  color: #064847;
  transform: translateY(-1px);
  border-color: rgba(14,165,164,0.22);
}

/* the respond form */
#respond{
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.comment-respond-title{
  margin: 0 0 12px 0;
}

/* logged-in-as text */
.logged-in-as{
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}

/* textarea and inputs */
.comment-form-comment label{
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
#comment{
  width: 100%;
  min-height: 120px;
  max-height: 320px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  resize: vertical;
  font-size: 0.95rem;
  line-height: 1.4;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(16,24,40,0.02);
}

/* submit button */
.form-submit .submit{
  padding: 10px 16px;
  background: linear-gradient(180deg,var(--secondary-color));
  color: var(--accent-4);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(14,165,164,0.12);
}
.form-submit .submit:hover,
.form-submit .submit:focus{
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(14,165,164,0.14);
}

/* small screens: stack nicely */
@media (max-width:640px){
  .comment-body{
    grid-template-columns: auto 1fr;
  }
  .comment-author.vcard{
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: auto;
    min-width: auto;
  }
  .comment-metadata{
    font-size: 0.82rem;
  }
}

/* accessibility: focus outlines */
a:focus, button:focus, textarea:focus, input:focus{
  outline: 3px solid rgba(14,165,164,0.12);
  outline-offset: 2px;
  border-radius: 8px;
}



/* ---------- Comment form fields (Name, Email, Website) ---------- */
.comment-form-author,
.comment-form-email,
.comment-form-url {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

/* Label styling */
.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
}

/* Input box styling */
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
  padding: 10px 12px;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus effect */
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
  border-color: #0ea5a4;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15);
  outline: none;
}

/* Placeholder style */
.comment-form-author input::placeholder,
.comment-form-email input::placeholder,
.comment-form-url input::placeholder {
  color: #9ca3af;
}

/* Make 3 fields in one row on desktop */
@media (min-width: 640px) {
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    flex: 1;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    display: flex;
    flex-direction: column;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-bottom: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-right: 10px;
  }
  /* Wrap in one row */
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    min-width: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    display: inline-flex;
    flex-direction: column;
  }
  /* Group all 3 fields in one line */
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    width: 100%;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    display: flex;
    flex: 1;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-right: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-bottom: 12px;
  }
}

/* Add wrapper row for better control */
.comment-form-author,
.comment-form-email,
.comment-form-url {
  margin-bottom: 12px;
}

/* If you want them perfectly side-by-side in a row */
@media (min-width: 640px) {
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    display: flex;
    flex-direction: column;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-bottom: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    min-width: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-right: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    width: 100%;
  }
}

/* Align them in one row */
@media (min-width: 768px) {
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    flex: 1;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-right: 10px;
  }
  .comment-form-url {
    margin-right: 0;
  }
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    display: inline-flex;
    flex-direction: column;
  }
}
