/* ============================================
   editor-content.css
   Master stylesheet for all TipTap-generated content
   Used by: pages, news, recruitment, announcements
   
   IMPORTANT:
   - Does NOT modify TipPad output
   - Does NOT store inline CSS in DB
   - Only CSS selectors with .editor-content prefix
   ============================================ */

/* ---- Base Typography ---- */
.editor-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #334155;
}

.editor-content > *:first-child {
    margin-top: 0;
}

.editor-content > *:last-child {
    margin-bottom: 0;
}

/* ---- Headings ---- */
.editor-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 2.5rem 0 1rem;
    line-height: 1.25;
}

.editor-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2rem 0 1rem;
    line-height: 1.3;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.editor-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 1.5rem 0 0.75rem;
    line-height: 1.3;
}

.editor-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 1.25rem 0 0.5rem;
    line-height: 1.3;
}

/* ---- Paragraph ---- */
.editor-content p {
    margin-bottom: 1.25rem;
}

/* ---- Links ---- */
.editor-content a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.editor-content a:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* ---- Images ---- */
.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: block;
}

.editor-content video {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.editor-content [style*="text-align: center"] img {
    margin-left: auto;
    margin-right: auto;
}

.editor-content [style*="text-align: right"] img {
    margin-left: auto;
    margin-right: 0;
}

.editor-content [style*="text-align: left"] img {
    margin-left: 0;
    margin-right: auto;
}

/* ---- Figure & Figcaption ---- */
.editor-content figure {
    margin: 1.5rem 0;
    text-align: center;
}

.editor-content figure img {
    margin: 0 auto;
}

.editor-content figcaption {
    margin-top: 0.75rem;
    font-size: 0.92rem;
    text-align: center;
    color: #64748b;
}

/* ---- Lists ---- */
.editor-content ul,
.editor-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.editor-content li {
    margin-bottom: 0.5rem;
}

.editor-content li > ul,
.editor-content li > ol {
    margin-bottom: 0;
    margin-top: 0.25rem;
}

/* ---- Task List ---- */
.editor-content ul[data-type="taskList"] {
    list-style: none;
    padding-left: 0;
}

.editor-content ul[data-type="taskList"] li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.editor-content ul[data-type="taskList"] li label {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---- Blockquote ---- */
.editor-content blockquote {
    margin: 1.75rem 0;
    padding: 1.2rem 1.3rem;
    border-left: 4px solid #7c3aed;
    border-radius: 0 16px 16px 0;
    background: linear-gradient(135deg, #eff6ff, #f8fbff);
    color: #1e3a5f;
}

.editor-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ---- Code ---- */
.editor-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #7c3aed;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.editor-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 1.5rem 0;
}

.editor-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

/* ---- Horizontal Rule ---- */
.editor-content hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2rem 0;
}

/* ---- Iframe / Embedded Content ---- */
.editor-content iframe {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* ---- Tables ----------
   Full grid with horizontal AND vertical borders.
   Responsive: scrollable on mobile.
   ------------------------------------------------ */
.editor-content table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #dbe7f5;
}

.editor-content th,
.editor-content td {
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.editor-content th {
    background: #eff6ff;
    color: #0f172a;
    font-weight: 700;
}

.editor-content th p:first-child,
.editor-content td p:first-child {
    margin-top: 0;
}

.editor-content th p:last-child,
.editor-content td p:last-child {
    margin-bottom: 0;
}

/* Table responsive: horizontal scroll on mobile */
@media (max-width: 767px) {
    .editor-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: normal;
    }

    .editor-content th,
    .editor-content td {
        min-width: 140px;
        white-space: normal;
    }
}
