/* =============================================================
   Newsletter Compose View — card-based newsletter editing
   Activated via [data-view="newsletter"] on <html>
   ============================================================= */

/* --- Reset canvas effects in newsletter mode --- */
[data-view="newsletter"] .tiptap {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  min-height: auto !important;
}

[data-view="newsletter"] .editor-container {
  background: transparent !important;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Newsletter placeholder */
[data-view="newsletter"] .ProseMirror p.is-editor-empty:first-child::before {
  content: "Start writing your newsletter..." !important;
  color: var(--ink-muted, #adb5bd) !important;
  font-size: inherit !important;
}

/* =============================================================
   Wrapper / Card
   ============================================================= */

.nl-compose-wrapper {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  border: 1px solid var(--border-light, #ebebeb);
  border-radius: 12px;
  overflow: hidden;
}

.nl-compose-content {
  padding: 24px 32px 16px;
}

.nl-compose-body {
  min-height: 200px;
}

/* --- Newsletter editor typography --- */
.nl-compose-wrapper .ProseMirror {
  max-width: 100% !important;
  padding: 0 !important;
  color: var(--editor-color, #242424) !important;
}

.nl-compose-wrapper .ProseMirror h1 {
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin-top: 1.4em !important;
  margin-bottom: 0.5em !important;
}

.nl-compose-wrapper .ProseMirror h2 {
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  margin-top: 1.3em !important;
  margin-bottom: 0.4em !important;
}

.nl-compose-wrapper .ProseMirror h3 {
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-top: 1.2em !important;
  margin-bottom: 0.4em !important;
}

.nl-compose-wrapper .ProseMirror h1:first-child {
  margin-top: 0 !important;
}

.nl-compose-wrapper .ProseMirror blockquote {
  border-left: 3px solid var(--blockquote-border) !important;
  padding-left: 1em !important;
  margin-left: 0 !important;
  color: var(--blockquote-color) !important;
  font-style: normal !important;
}

.nl-compose-wrapper .ProseMirror img {
  max-width: 100% !important;
  border-radius: 8px !important;
  margin: 1em 0 !important;
}

/* =============================================================
   Subject Line
   ============================================================= */

.nl-subject-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-dark, #1a1a1a);
  padding: 0;
  margin-bottom: 10px;
}
.nl-subject-input::placeholder { color: var(--ink-muted, #888); opacity: 0.6; }

/* =============================================================
   Preview Text
   ============================================================= */

.nl-preview-wrap {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light, #ebebeb);
}

.nl-preview-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-dark, #1a1a1a);
  padding: 0;
  resize: none;
  opacity: 0.65;
}
.nl-preview-input::placeholder { color: var(--ink-muted, #888); opacity: 0.6; }
.nl-preview-input.over-limit { color: var(--red, #dc2626); }

.nl-preview-count {
  position: absolute;
  right: 0;
  bottom: -16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  color: var(--ink-muted, #888);
  opacity: 0.6;
}
.nl-preview-count.full { color: var(--green, #16a34a); opacity: 1; }
.nl-preview-count.over-limit { color: var(--red, #dc2626); opacity: 1; }

/* =============================================================
   Sent Status
   ============================================================= */

.nl-sent-status {
  position: absolute;
  top: 8px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--green, #16a34a);
}

/* =============================================================
   Footer — Action Buttons
   ============================================================= */

.nl-compose-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
}

.nl-compose-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--border-light, #ebebeb);
}

.nl-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-light, #ebebeb);
  background: transparent;
  color: var(--ink-muted, #666);
  cursor: pointer;
  transition: all 0.15s;
}

.nl-footer-btn:hover {
  background: var(--bg-secondary, rgba(0, 0, 0, 0.03));
  color: var(--ink-dark, #1a1a1a);
  border-color: var(--ink-muted, #888);
}

.nl-footer-btn--primary {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: var(--accent, #2563eb);
}

.nl-footer-btn--primary:hover {
  background: var(--accent-hover, #1d4ed8);
  border-color: var(--accent-hover, #1d4ed8);
  color: #fff;
}
