/* EmbWin Comments — Pinterest-ish, teal / Fraunces tokens */

body.embwin-comments-ux .magpal-comments-wrapper,
body.embwin-comments-ux .comments-area {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

body.embwin-comments-ux .comments-area {
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.1rem 1.5rem;
  background: var(--emb-card, #fff);
  border: 1px solid var(--emb-line, rgba(31, 58, 95, 0.12));
  border-radius: calc(var(--emb-radius, 12px) + 4px);
  box-shadow: var(--emb-shadow, 0 12px 32px rgba(31, 58, 95, 0.08));
  font-family: var(--emb-font-body, "Source Sans 3", "Segoe UI", sans-serif);
  color: var(--emb-ink, #1a2332);
}

body.embwin-comments-ux .comments-title,
body.embwin-comments-ux .comment-reply-title {
  font-family: var(--emb-font-display, "Fraunces", Georgia, serif);
  font-weight: 650;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  letter-spacing: -0.02em;
  color: var(--emb-navy, #1f3a5f);
  margin: 0 0 0.85rem;
  border: 0;
  padding: 0;
}

body.embwin-comments-ux .comment-reply-title small {
  font-family: var(--emb-font-body, "Source Sans 3", sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
}

body.embwin-comments-ux .comment-notes,
body.embwin-comments-ux .required-field-message {
  display: none !important;
}

/* ——— Composer ——— */
body.embwin-comments-ux .embwin-comment-form,
body.embwin-comments-ux .comment-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

body.embwin-comments-ux .comment-form-comment {
  margin: 0;
}

body.embwin-comments-ux .comment-form-comment label:not(.screen-reader-text) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.embwin-comments-ux .comment-form-comment textarea:not([aria-hidden="true"]) {
  display: block;
  width: 100%;
  min-height: 6.5rem;
  padding: 0.95rem 1rem;
  border: 1.5px solid var(--emb-line, rgba(31, 58, 95, 0.16));
  border-radius: var(--emb-radius, 12px);
  background: var(--emb-paper, #f7fafc);
  color: var(--emb-ink, #1a2332);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.embwin-comments-ux .comment-form-comment textarea:not([aria-hidden="true"]):focus {
  outline: none;
  border-color: var(--emb-accent, #0e7490);
  background: #fff;
  box-shadow: 0 0 0 3px var(--emb-accent-soft, rgba(14, 116, 144, 0.18));
}

html[data-emb-theme="dark"] body.embwin-comments-ux .comment-form-comment textarea:not([aria-hidden="true"]):focus {
  background: var(--emb-card, #1e293b);
}

body.embwin-comments-ux .embwin-cf-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 560px) {
  body.embwin-comments-ux .embwin-cf-meta {
    grid-template-columns: 1fr;
  }
}

body.embwin-comments-ux .comment-form-author,
body.embwin-comments-ux .comment-form-email,
body.embwin-comments-ux .comment-form-url {
  margin: 0;
}

body.embwin-comments-ux .comment-form-url {
  display: none !important;
}

body.embwin-comments-ux .embwin-cf-field label:not(.screen-reader-text),
body.embwin-comments-ux .comment-form-author > label,
body.embwin-comments-ux .comment-form-email > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.embwin-comments-ux .embwin-cf-field input,
body.embwin-comments-ux .comment-form-author input,
body.embwin-comments-ux .comment-form-email input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--emb-line, rgba(31, 58, 95, 0.16));
  border-radius: 10px;
  background: var(--emb-paper, #f7fafc);
  color: var(--emb-ink, #1a2332);
  font-size: 1rem;
}

body.embwin-comments-ux .embwin-cf-field input:focus,
body.embwin-comments-ux .comment-form-author input:focus,
body.embwin-comments-ux .comment-form-email input:focus {
  outline: none;
  border-color: var(--emb-accent, #0e7490);
  box-shadow: 0 0 0 3px var(--emb-accent-soft, rgba(14, 116, 144, 0.18));
}

body.embwin-comments-ux .embwin-cf-cookies,
body.embwin-comments-ux .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--emb-muted, #5b6b7c);
  line-height: 1.35;
}

body.embwin-comments-ux .embwin-cf-cookies input,
body.embwin-comments-ux .comment-form-cookies-consent input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--emb-accent, #0e7490);
}

/* Progressive disclosure before interact (keep reCAPTCHA visible so it can render) */
body.embwin-comments-ux .embwin-comment-form:not(.is-open) .comment-form-author,
body.embwin-comments-ux .embwin-comment-form:not(.is-open) .comment-form-email,
body.embwin-comments-ux .embwin-comment-form:not(.is-open) .embwin-cf-meta,
body.embwin-comments-ux .embwin-comment-form:not(.is-open) .comment-form-cookies-consent {
  display: none;
}

body.embwin-comments-ux .form-submit {
  margin: 0.15rem 0 0;
  display: flex;
  justify-content: flex-end;
}

body.embwin-comments-ux .embwin-comment-submit,
body.embwin-comments-ux .comment-form .submit {
  appearance: none;
  min-height: 2.85rem;
  min-width: 6.5rem;
  padding: 0.65rem 1.35rem;
  border: 0;
  border-radius: 999px;
  background: #0e7490 !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.28);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

body.embwin-comments-ux .embwin-comment-submit:hover,
body.embwin-comments-ux .comment-form .submit:hover {
  background: #0b6178 !important;
  transform: translateY(-1px);
}

body.embwin-comments-ux .embwin-comment-submit:active,
body.embwin-comments-ux .comment-form .submit:active {
  transform: translateY(0);
}

body.embwin-comments-ux .g-recaptcha {
  transform-origin: left top;
  margin: 0.15rem 0;
}

/* Strip heavy extras (fallback if unhook misses) */
body.embwin-comments-ux .crfp-field,
body.embwin-comments-ux .comment-form-attachment,
body.embwin-comments-ux .comment-form-url {
  display: none !important;
}

/* ——— Thread / cards ——— */
body.embwin-comments-ux .comment-list {
  list-style: none;
  margin: 0 0 1.35rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.embwin-comments-ux .comment-list .children {
  list-style: none;
  margin: 0.65rem 0 0 0.85rem;
  padding: 0 0 0 0.85rem;
  border-left: 2px solid var(--emb-accent-soft, rgba(14, 116, 144, 0.35));
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

body.embwin-comments-ux .comment-body,
body.embwin-comments-ux .comment-list > .comment > .comment-body,
body.embwin-comments-ux article.comment-body {
  background: var(--emb-paper, #f7fafc);
  border: 1px solid var(--emb-line, rgba(31, 58, 95, 0.1));
  border-radius: var(--emb-radius, 12px);
  padding: 0.85rem 1rem;
}

body.embwin-comments-ux .comment-meta,
body.embwin-comments-ux .comment-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
}

body.embwin-comments-ux .comment-author .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

body.embwin-comments-ux .comment-author .fn {
  font-weight: 700;
  color: var(--emb-navy, #1f3a5f);
  font-style: normal;
}

body.embwin-comments-ux .comment-author .says {
  display: none;
}

body.embwin-comments-ux .comment-metadata,
body.embwin-comments-ux .comment-metadata a {
  font-size: 0.82rem;
  color: var(--emb-muted, #5b6b7c);
  text-decoration: none;
}

body.embwin-comments-ux .comment-content {
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--emb-ink, #1a2332);
}

body.embwin-comments-ux .comment-content p:last-child {
  margin-bottom: 0;
}

body.embwin-comments-ux .reply a,
body.embwin-comments-ux .comment-reply-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.25rem 0.7rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--emb-accent, #0e7490) !important;
  background: var(--emb-accent-soft, rgba(14, 116, 144, 0.12));
  text-decoration: none !important;
}

body.embwin-comments-ux .no-comments {
  color: var(--emb-muted, #5b6b7c);
  font-size: 0.95rem;
}

/* Chip near like / download */
.embwin-vote--single {
  position: relative;
}

.embwin-comment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0.65rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--emb-accent-soft, rgba(14, 116, 144, 0.12));
  color: var(--emb-accent, #0e7490) !important;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none !important;
  font-family: var(--emb-font-body, "Source Sans 3", sans-serif);
}

.embwin-comment-chip:hover {
  background: rgba(14, 116, 144, 0.2);
}

.embwin-comment-chip__ico {
  flex-shrink: 0;
}

html[data-emb-theme="dark"] body.embwin-comments-ux .comments-area {
  background: var(--emb-card, #1e293b);
}

html[data-emb-theme="dark"] body.embwin-comments-ux .comment-body,
html[data-emb-theme="dark"] body.embwin-comments-ux article.comment-body {
  background: rgba(15, 23, 42, 0.55);
}

html[data-emb-theme="dark"] body.embwin-comments-ux .comment-form-comment textarea:not([aria-hidden="true"]),
html[data-emb-theme="dark"] body.embwin-comments-ux .embwin-cf-field input,
html[data-emb-theme="dark"] body.embwin-comments-ux .comment-form-author input,
html[data-emb-theme="dark"] body.embwin-comments-ux .comment-form-email input {
  background: rgba(15, 23, 42, 0.65);
  color: var(--emb-ink, #f1f5f9);
}

@media (max-width: 640px) {
  body.embwin-comments-ux .comments-area {
    padding: 1rem 0.85rem 1.25rem;
    border-radius: 14px;
  }

  body.embwin-comments-ux .embwin-comment-submit,
  body.embwin-comments-ux .comment-form .submit {
    width: 100%;
  }

  body.embwin-comments-ux .form-submit {
    justify-content: stretch;
  }

  body.embwin-comments-ux .comment-list .children {
    margin-left: 0.35rem;
    padding-left: 0.55rem;
  }

  body.embwin-comments-ux .g-recaptcha {
    transform: scale(0.92);
  }
}
