/* TipTap Editor Styles */

.tiptap-wrapper {
  background: white;
}

/* Toolbar */
.tiptap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.tiptap-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tiptap-toolbar-divider {
  width: 1px;
  height: 24px;
  background: #d1d5db;
  margin: 0 6px;
}

.tiptap-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tiptap-toolbar-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.tiptap-toolbar-btn-active {
  background: #4f46e5 !important;
  color: white !important;
}

/* Editor Content Area */
.tiptap-editor-area {
  min-height: 350px;
  padding: 20px 24px;
}

.tiptap-editor-area .ProseMirror {
  min-height: 300px;
  outline: none;
}

.tiptap-editor-area .ProseMirror p.is-editor-empty:first-child::before {
  color: #9ca3af;
  content: "Start writing your article...";
  float: left;
  height: 0;
  pointer-events: none;
}

/* Editor content typography */
.tiptap-editor-content h2 {
  font-size: 1.5em;
  font-weight: 700;
  margin: 1.2em 0 0.6em;
  line-height: 1.3;
}

.tiptap-editor-content h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin: 1em 0 0.5em;
  line-height: 1.4;
}

.tiptap-editor-content p {
  margin: 0.75em 0;
  line-height: 1.75;
}

.tiptap-editor-content ul,
.tiptap-editor-content ol {
  padding-left: 1.5em;
  margin: 0.75em 0;
}

.tiptap-editor-content li {
  margin: 0.25em 0;
}

.tiptap-editor-content blockquote {
  border-left: 4px solid #6366f1;
  padding-left: 1em;
  margin: 1em 0;
  color: #4b5563;
  font-style: italic;
}

.tiptap-editor-content pre {
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin: 1em 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.9em;
}

.tiptap-editor-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.9em;
}

.tiptap-editor-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

.tiptap-editor-content a {
  color: #4f46e5;
  text-decoration: underline;
}

.tiptap-editor-content hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 1.5em 0;
}

/* Resizable image wrapper */
.resizable-image-wrapper {
  display: flex;
  margin: 1em 0;
  user-select: none;
}

.resizable-image-wrapper[data-alignment="left"] { justify-content: flex-start; }
.resizable-image-wrapper[data-alignment="center"] { justify-content: center; }
.resizable-image-wrapper[data-alignment="right"] { justify-content: flex-end; }

.resizable-image-container {
  position: relative;
  max-width: 100%;
}

.resizable-image-container .tiptap-image {
  border-radius: 8px;
  cursor: default;
}

.resizable-image-wrapper.ProseMirror-selectednode .resizable-image-container {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 8px;
}

/* Resize handle */
.resize-handle {
  display: none;
  position: absolute;
  width: 14px;
  height: 14px;
  background: #4f46e5;
  border: 2px solid white;
  border-radius: 3px;
  cursor: se-resize;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.resize-handle-br {
  bottom: 4px;
  right: 4px;
}

.resizable-image-wrapper.ProseMirror-selectednode .resize-handle {
  display: block;
}

/* Alignment bar */
.image-align-bar {
  display: none;
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 20;
}

.resizable-image-wrapper.ProseMirror-selectednode .image-align-bar {
  display: flex;
}

.image-align-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  color: #6b7280;
  transition: all 0.15s ease;
}

.image-align-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.image-align-btn-active {
  background: #4f46e5 !important;
  color: white !important;
}

/* Regular images (non-nodeView fallback) */
.tiptap-editor-content img:not(.tiptap-image) {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
}

/* Public-facing content styles */
.tiptap-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1em 0;
}

.tiptap-content img[data-alignment="left"] { margin-left: 0; margin-right: auto; }
.tiptap-content img[data-alignment="center"] { margin-left: auto; margin-right: auto; }
.tiptap-content img[data-alignment="right"] { margin-left: auto; margin-right: 0; }

.prose .tiptap-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1em 0;
}

.tiptap-content blockquote {
  border-left: 4px solid #6366f1;
  padding-left: 1em;
  font-style: italic;
}

.tiptap-content pre {
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.tiptap-content pre code {
  background: none;
  color: inherit;
}

/* Inherit text color on dark-themed public pages */
.prose .tiptap-content,
.prose .tiptap-content p,
.prose .tiptap-content li,
.prose .tiptap-content h2,
.prose .tiptap-content h3,
.prose .tiptap-content h4 {
  color: inherit;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Waitlist Modal Animations */
#waitlist-modal [data-waitlist-target="overlay"] {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

#waitlist-modal [data-waitlist-target="container"] {
  opacity: 0;
  transform: scale(0.95) translateY(-20px);
  transition: all 0.3s ease-out;
}

/* reCAPTCHA responsive styling */
.g-recaptcha {
  transform: scale(1);
  transform-origin: 0 0;
}

@media screen and (max-width: 400px) {
  .g-recaptcha {
    transform: scale(0.85);
  }
}
