/* text-view.css — typography for rendered editor HTML inside `.text-view`
   blocks. Keep the existing baseline in main.css; this file handles every
   inline/block text tag CKEditor 4 + 5 can emit. Media (images, figures,
   iframes, responsive + dark + print) live in text-view-media.css. */

.text-view {
    float: left;
    display: block;
    width: 100%;
    margin: 24px 0 32px;
    padding: 0;
    color: #1d1929;
    font-family: "Lato", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(15px, 1.05vw + 13px, 17px);
    line-height: 1.72;
    letter-spacing: 0.005em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.text-view > *,
.text-view p,
.text-view ul, .text-view ol,
.text-view blockquote, .text-view pre,
.text-view figure, .text-view table,
.text-view h1, .text-view h2, .text-view h3,
.text-view h4, .text-view h5, .text-view h6 {
    float: none;
    clear: both;
    width: auto;
    max-width: 100%;
}

/* Headings */
.text-view h1, .text-view h2, .text-view h3,
.text-view h4, .text-view h5, .text-view h6 {
    font-family: "Montserrat", "Lato", "Helvetica Neue", Arial, sans-serif;
    color: #141321;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 1.6em 0 0.55em;
}
.text-view h1 { font-size: clamp(24px, 2.2vw + 14px, 32px); }
.text-view h2 { font-size: clamp(22px, 1.8vw + 14px, 28px); }
.text-view h3 { font-size: clamp(19px, 1.2vw + 14px, 22px); }
.text-view h4 { font-size: clamp(17px, 0.8vw + 14px, 19px); }
.text-view h5 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; }
.text-view h6 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: #555366; }
.text-view h1:first-child,
.text-view h2:first-child,
.text-view h3:first-child { margin-top: 0; }

/* Paragraphs + alignment */
.text-view p { margin: 0 0 1em; font-size: inherit; line-height: inherit; color: inherit; }
.text-view p + p { margin-top: 0; }
.text-view .text-align-left,   .text-view p[style*="text-align: left"]   { text-align: left; }
.text-view .text-align-center, .text-view p[style*="text-align: center"] { text-align: center; }
.text-view .text-align-right,  .text-view p[style*="text-align: right"]  { text-align: right; }
.text-view .text-align-justify,.text-view p[style*="text-align: justify"]{ text-align: justify; hyphens: auto; }

/* Inline */
.text-view strong, .text-view b { font-weight: 700; color: #0e0d1a; }
.text-view em, .text-view i     { font-style: italic; }
.text-view u                    { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.text-view s, .text-view strike, .text-view del { text-decoration: line-through; color: #8a8898; }
.text-view ins   { text-decoration: none; background: #fff8c8; padding: 0 2px; border-radius: 2px; }
.text-view mark  { background: linear-gradient(180deg, transparent 55%, #ffe680 55%); color: inherit; padding: 0 1px; }
.text-view sub   { font-size: 0.75em; vertical-align: sub; }
.text-view sup   { font-size: 0.75em; vertical-align: super; }
.text-view small { font-size: 0.88em; color: #555366; }
.text-view abbr[title] { text-decoration: underline dotted; cursor: help; }
.text-view kbd {
    font-family: Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f4f4f6;
    border: 1px solid #d7d7de;
    border-bottom-width: 2px;
    color: #1d1929;
}

/* Links */
.text-view a {
    color: #c81e1e;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    padding-bottom: 1px;
    transition: color .15s ease, background-size .15s ease;
}
.text-view a:hover { color: #8a0f0f; background-size: 100% 2px; }
.text-view a:focus { outline: 2px solid rgba(200, 30, 30, 0.35); outline-offset: 2px; border-radius: 2px; }

/* Blockquote */
.text-view blockquote {
    position: relative;
    margin: 1.6em 0;
    padding: 14px 22px 14px 28px;
    border-left: 3px solid #c81e1e;
    background: #faf7f4;
    border-radius: 0 8px 8px 0;
    color: #2a2635;
    font-family: "Source Serif 4", Georgia, serif;
    font-style: italic;
    font-size: 1.05em;
}
.text-view blockquote p { margin: 0.4em 0; }
.text-view blockquote cite,
.text-view blockquote footer {
    display: block;
    margin-top: 8px;
    font-size: 0.88em;
    font-style: normal;
    color: #6b6878;
}
.text-view blockquote cite::before,
.text-view blockquote footer::before { content: "— "; }

/* Code */
.text-view code {
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    padding: 2px 6px;
    background: #f4f4f6;
    border-radius: 4px;
    color: #7a1212;
    border: 1px solid #eaeaee;
}
.text-view pre {
    margin: 1.4em 0;
    padding: 14px 16px;
    background: #1f1c2c;
    color: #f5f5f7;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.55;
    font-size: 0.9em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.text-view pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: inherit;
}

/* Horizontal rule + page break */
.text-view hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d7d7de 20%, #d7d7de 80%, transparent);
    margin: 2em 0;
}
.text-view .page-break {
    display: block;
    height: 1px;
    background: #e5e5ec;
    margin: 2em 0;
}

/* Lists */
.text-view ul, .text-view ol { margin: 0.9em 0; padding-left: 1.6em; }
.text-view ul { list-style: disc outside; }
.text-view ol { list-style: decimal outside; }
.text-view ul ul, .text-view ol ul { list-style: circle outside; }
.text-view ul ul ul, .text-view ol ol ol { list-style: square outside; }
.text-view li { margin: 0.35em 0; padding-left: 0.15em; }
.text-view li::marker { color: #c81e1e; }

.text-view ul.todo-list { list-style: none; padding-left: 0.2em; }
.text-view ul.todo-list li { position: relative; padding-left: 1.8em; }
.text-view ul.todo-list li input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0.3em;
    accent-color: #c81e1e;
}

/* Tables */
.text-view table,
.text-view .ck-table {
    width: 100%;
    margin: 1.6em 0;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95em;
    background: #fff;
    border: 1px solid #e5e5ec;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    overflow-x: auto;
    white-space: normal;
}
.text-view table thead { background: #faf7f4; }
.text-view table th,
.text-view table td {
    padding: 10px 14px;
    border: 1px solid #ececf2;
    text-align: left;
    vertical-align: top;
}
.text-view table th { font-weight: 700; color: #141321; }
.text-view table tbody tr:nth-child(even) { background: #fafafb; }
.text-view table tbody tr:hover            { background: #f4f0eb; }
.text-view table caption {
    caption-side: top;
    text-align: left;
    padding: 6px 2px 10px;
    font-size: 0.9em;
    color: #6b6878;
    font-style: italic;
}
