/* TipTap Editor Styles */

.editor-wrapper {
    border: 1px solid var(--gn-gray-light);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

/* ── Toolbar ──────────────────────────────── */

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    background: #f8f8f9;
    border-bottom: 1px solid var(--gn-gray-light);
    flex-wrap: wrap;
}

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

.toolbar-sep {
    width: 1px;
    height: 24px;
    background: var(--gn-gray-light);
    margin: 0 6px;
}

.toolbar-btn {
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    line-height: 1;
    transition: all 0.15s;
    font-family: inherit;
}

.toolbar-btn:hover {
    background: #e8e8e9;
    border-color: var(--gn-gray-light);
    color: #333;
}

.toolbar-btn.toolbar-active {
    background: var(--gn-burgundy);
    color: white;
    border-color: var(--gn-burgundy);
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* ── Editor Content Area ──────────────────── */

.tiptap-content {
    min-height: 450px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 24px 28px;
    font-size: 14.5px;
    line-height: 1.75;
    color: #333;
    outline: none;
}

.tiptap-content:focus {
    background: #fefefe;
}

/* Headings */
.tiptap-content h1 {
    font-size: 22px;
    margin: 24px 0 10px;
    color: var(--gn-burgundy);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--gn-burgundy);
}

.tiptap-content h2 {
    font-size: 19px;
    margin: 20px 0 8px;
    color: var(--gn-burgundy);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gn-gray-light);
}

.tiptap-content h3 {
    font-size: 16px;
    margin: 18px 0 6px;
    color: #444;
}

.tiptap-content h4 {
    font-size: 14px;
    margin: 14px 0 4px;
    color: #555;
    font-weight: 600;
}

/* Paragraphs */
.tiptap-content p {
    margin: 8px 0;
}

/* Lists */
.tiptap-content ul,
.tiptap-content ol {
    margin: 10px 0;
    padding-left: 28px;
}

.tiptap-content li {
    margin: 4px 0;
}

.tiptap-content li p {
    margin: 0;
}

/* Blockquote */
.tiptap-content blockquote {
    border-left: 4px solid var(--gn-burgundy);
    margin: 12px 0;
    padding: 8px 16px;
    background: #faf8f8;
    color: #555;
    font-style: italic;
}

/* Code */
.tiptap-content code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.tiptap-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 6px;
    margin: 12px 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

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

/* Tables */
.tiptap-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    border: 1px solid #dee2e6;
}

.tiptap-content th,
.tiptap-content td {
    border: 1px solid #dee2e6;
    padding: 10px 14px;
    font-size: 13px;
    vertical-align: top;
    min-width: 80px;
}

.tiptap-content th {
    background: var(--gn-bg);
    font-weight: 600;
}

.tiptap-content td {
    background: white;
}

.tiptap-content tr:nth-child(even) td {
    background: #fafafa;
}

/* Selected table cells */
.tiptap-content .selectedCell {
    background: rgba(152, 30, 50, 0.08) !important;
}

/* Horizontal rule */
.tiptap-content hr {
    border: none;
    border-top: 2px solid var(--gn-gray-light);
    margin: 20px 0;
}

/* Links */
.tiptap-content a {
    color: var(--gn-burgundy);
    text-decoration: underline;
}

/* Images */
.tiptap-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

/* Placeholder */
.tiptap-content p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: #adb5bd;
    pointer-events: none;
    height: 0;
}

/* Strong / Em */
.tiptap-content strong {
    color: #222;
}

/* Text alignment */
.tiptap-content .text-align-center {
    text-align: center;
}
.tiptap-content .text-align-right {
    text-align: right;
}
