/* remark42 custom theme matching Hextra */

/* ===== Light mode (default) ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-danger: #ef4444;
  --color-success: #22c55e;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ===== Dark mode ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-border: #334155;
    --color-border-hover: #475569;
    --color-primary: #60a5fa;
    --color-primary-hover: #93bbfd;
    --color-danger: #f87171;
    --color-success: #4ade80;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

/* Remark42 dark theme override */
.remark42 .root-498a3,
.remark42[data-theme="dark"] {
  --color-bg: #0f172a !important;
  --color-bg-secondary: #1e293b !important;
  --color-text: #e2e8f0 !important;
  --color-text-secondary: #94a3b8 !important;
  --color-border: #334155 !important;
}

body {
  font-family: var(--font-family) !important;
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
}

/* Comment container */
.remark42 #root {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Comment thread */
.remark42 .comment {
  border-radius: var(--radius) !important;
  border: 1px solid var(--color-border) !important;
  background: var(--color-bg) !important;
  padding: 16px !important;
  margin-bottom: 12px !important;
  box-shadow: var(--shadow) !important;
  transition: border-color 0.2s ease !important;
}

.remark42 .comment:hover {
  border-color: var(--color-border-hover) !important;
}

/* Comment header / user info */
.remark42 .comment__author {
  color: var(--color-text) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

.remark42 .comment__time {
  color: var(--color-text-secondary) !important;
  font-size: 12px !important;
}

/* Comment body text */
.remark42 .comment__text {
  color: var(--color-text) !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
}

.remark42 .comment__text p {
  margin: 0 0 8px 0 !important;
}

.remark42 .comment__text p:last-child {
  margin-bottom: 0 !important;
}

/* Links inside comments */
.remark42 .comment__text a {
  color: var(--color-primary) !important;
  text-decoration: none !important;
}

.remark42 .comment__text a:hover {
  text-decoration: underline !important;
  color: var(--color-primary-hover) !important;
}

/* Code blocks inside comments */
.remark42 .comment__text code {
  background: var(--color-bg-secondary) !important;
  color: var(--color-text) !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  border: 1px solid var(--color-border) !important;
}

.remark42 .comment__text pre {
  background: var(--color-bg-secondary) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 8px !important;
  padding: 12px !important;
  overflow-x: auto !important;
}

.remark42 .comment__text pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* Vote buttons */
.remark42 .vote {
  color: var(--color-text-secondary) !important;
}

.remark42 .vote__value {
  color: var(--color-text) !important;
  font-weight: 500 !important;
}

.remark42 .vote__button {
  color: var(--color-text-secondary) !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.remark42 .vote__button:hover {
  color: var(--color-primary) !important;
  background: var(--color-bg-secondary) !important;
}

/* Reply button */
.remark42 .comment__reply {
  color: var(--color-text-secondary) !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: color 0.15s ease !important;
}

.remark42 .comment__reply:hover {
  color: var(--color-primary) !important;
}

/* Comment input / textarea */
.remark42 .input {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius) !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  font-family: var(--font-family) !important;
  line-height: 1.6 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.remark42 .input:focus {
  outline: none !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.remark42 textarea.input {
  min-height: 100px !important;
  resize: vertical !important;
}

/* Submit button */
.remark42 .button_submit {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: background 0.15s ease, transform 0.1s ease !important;
}

.remark42 .button_submit:hover {
  background: var(--color-primary-hover) !important;
}

.remark42 .button_submit:active {
  transform: scale(0.97) !important;
}

/* Toolbar buttons (bold, italic, etc.) */
.remark42 .button {
  color: var(--color-text-secondary) !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
}

.remark42 .button:hover {
  color: var(--color-text) !important;
  background: var(--color-bg-secondary) !important;
}

/* Tabs (Comments / Profile) */
.remark42 .tabs {
  border-bottom: 1px solid var(--color-border) !important;
  margin-bottom: 16px !important;
}

.remark42 .tabs__tab {
  color: var(--color-text-secondary) !important;
  font-weight: 500 !important;
  padding: 8px 16px !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.15s ease !important;
}

.remark42 .tabs__tab:hover {
  color: var(--color-text) !important;
}

.remark42 .tabs__tab_active {
  color: var(--color-primary) !important;
  border-bottom-color: var(--color-primary) !important;
}

/* Separator / horizontal rule */
.remark42 hr {
  border: none !important;
  border-top: 1px solid var(--color-border) !important;
  margin: 12px 0 !important;
}

/* Scrollbar styling */
.remark42 ::-webkit-scrollbar {
  width: 6px !important;
}

.remark42 ::-webkit-scrollbar-track {
  background: transparent !important;
}

.remark42 ::-webkit-scrollbar-thumb {
  background: var(--color-border) !important;
  border-radius: 3px !important;
}

.remark42 ::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-hover) !important;
}

/* "Show more" / pagination */
.remark42 .more-button {
  color: var(--color-primary) !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.remark42 .more-button:hover {
  background: var(--color-bg-secondary) !important;
}

/* Hide "Powered by Remark42" branding */
.remark42 .powered-by,
.remark42 .footer,
.remark42 [class*="branding"] {
  display: none !important;
}

.remark42 a[href*="remark42"] {
  display: none !important;
}
