/*
 * INNOVATE X — Stylesheet
 * A Modern Writing Platform
 */

/* ── Reset & Variables ──────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ink: #0d2137;
    --parchment: #fff;
    --cream: #f4f8fb;
    --warm: #e8f0f6;
    --accent: #00b4d8;
    --accent-dark: #0088a8;
    --accent-light: #00d4aa;
    --accent-glow: rgba(0, 180, 216, 0.1);
    --navy: #0d2137;
    --navy-light: #1a3a5c;
    --teal: #00b4d8;
    --teal-light: #00d4aa;
    --sage: #5a7a6a;
    --sage-light: #7a9a8a;
    --muted: #5a6d7a;
    --border: #dce6ed;
    --shadow: rgba(13, 33, 55, 0.08);
    --font-display: 'Libre Franklin', Helvetica, Arial, sans-serif;
    --font-article-title: 'Raleway', 'Libre Franklin', Helvetica, sans-serif;
    --font-body: 'Source Serif 4', Charter, Georgia, serif;
    --font-ui: 'Libre Franklin', Helvetica, Arial, sans-serif;
    --radius: 6px;
    --max-w: 1200px;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    box-shadow: 0 1px 8px var(--shadow);
}
.navbar-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
}
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-links a, .nav-links button {
    font-family: var(--font-ui);
    font-size: 0.88rem; font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
    border: none; background: none; cursor: pointer;
}
.nav-links a:hover, .nav-links button:hover {
    color: var(--navy);
    background: var(--accent-glow);
}
.btn-write {
    background: linear-gradient(135deg, var(--teal), var(--teal-light)) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 0.45rem 1.2rem !important;
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.25);
}
.btn-write:hover {
    background: linear-gradient(135deg, #009ab8, #00b892) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.35);
}
.nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* ── Flash Messages ─────────────────────────────────────────── */
.flash {
    max-width: var(--max-w); margin: 1rem auto; padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    font-family: var(--font-ui); font-size: 0.9rem;
}
.flash-error { background: #fde8e8; color: #c33; border: 1px solid #f5c6c6; }
.flash-success { background: #e8f5e8; color: #2a7a2a; border: 1px solid #c6e8c6; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 2rem; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 2rem; }
.container-wide { max-width: 900px; margin: 0 auto; padding: 2rem; }

/* ── Hero Banner ────────────────────────────────────────────── */
.hero {
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 0;
    overflow: hidden;
}
.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3.5rem 2rem 3rem;
}
.hero-logo {
    margin-bottom: 1.5rem;
}
.hero-logo img {
    width: 280px;
    height: auto;
}
.hero-content {
    max-width: 620px;
}
.hero-content h1 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.8rem;
}
.hero-content h1 em {
    font-style: normal;
    color: var(--teal);
}
.hero-content p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 1.8rem;
}
.hero-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.8rem;
}
.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border-radius: 6px;
}
.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--teal);
    background: var(--accent-glow);
    color: var(--navy);
}
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    color: var(--muted);
}
.hero-stat strong {
    color: var(--teal);
    font-weight: 700;
    margin-right: 0.25rem;
}
.hero-stat-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--border);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-ui); font-size: 0.9rem; font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 6px; border: none;
    cursor: pointer; text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-light)); color: #fff; box-shadow: 0 2px 8px rgba(0, 180, 216, 0.2); }
.btn-primary:hover { background: linear-gradient(135deg, #009ab8, #00b892); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3); }
.btn-secondary { background: var(--cream); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--warm); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--navy); background: var(--accent-glow); }
.btn-danger { background: #e85454; color: #fff; }
.btn-danger:hover { background: #d44; }
.btn-linkedin { background: #0a66c2; color: #fff; }
.btn-linkedin:hover { background: #004182; }
.btn-linkedin svg { vertical-align: -2px; }

/* ── Share Menu & Icons ────────────────────────────────────── */
.toolbar-right { position: relative; }
.share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 200px;
    padding: 0.4rem;
    z-index: 200;
    font-family: var(--font-ui);
}
.share-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.8rem;
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-ui);
    transition: background 0.12s;
}
.share-item:hover {
    background: var(--cream);
}
.share-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.share-sep {
    height: 1px;
    background: var(--border);
    margin: 0.3rem 0.6rem;
}
.share-bar-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: var(--muted);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.15s;
}
.share-icon:hover {
    background: var(--accent-glow);
    color: var(--teal);
}
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.88rem;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; }

/* ── Article Cards ──────────────────────────────────────────── */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}
.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px var(--shadow);
}
.article-card-cover {
    width: 100%; height: 200px;
    object-fit: cover;
    background: var(--cream);
}
.article-card-body { padding: 1.3rem 1.5rem; }
.article-card-meta {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-family: var(--font-ui); font-size: 0.8rem; color: var(--muted);
}
.article-card-meta img {
    width: 26px; height: 26px;
    border-radius: 50%; object-fit: cover;
}
.article-card h3 {
    font-family: var(--font-article-title);
    font-size: 1.25rem; font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}
.article-card h3 a {
    color: var(--ink); text-decoration: none;
}
.article-card h3 a:hover { color: var(--teal); }
.article-card-excerpt {
    font-size: 0.92rem; color: var(--muted);
    line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 0.8rem; padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-ui); font-size: 0.78rem; color: var(--muted);
}
.article-card-footer .stat { display: flex; align-items: center; gap: 0.25rem; }
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}
.card-actions form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* ── Single Article (Medium-style) ──────────────────────────── */
.article-page {
    background: #fff;
    min-height: 100vh;
}
.article-header {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
}
.article-header h1 {
    font-family: var(--font-article-title);
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #242424;
    margin-bottom: 0.5rem;
    word-break: break-word;
}
.article-subtitle {
    font-family: var(--font-body);
    font-size: 1.3rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1.8rem;
    letter-spacing: -0.003em;
}
.article-author-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-ui);
}
.author-avatar-link { flex-shrink: 0; text-decoration: none; }
.author-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.author-avatar-placeholder {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--teal));
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem; font-weight: 700;
    color: #fff;
}
.author-info { display: flex; flex-direction: column; gap: 0.1rem; }
.author-name-row a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink);
    text-decoration: none;
}
.author-name-row a:hover { text-decoration: underline; }
.article-meta-row {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.meta-dot { opacity: 0.5; }

/* Article toolbar (under author, above content) */
.article-toolbar,
.article-footer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.article-footer-toolbar {
    margin-bottom: 2.5rem;
    margin-top: 0;
}
.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--muted);
    background: none;
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.toolbar-btn:hover {
    color: var(--ink);
    background: rgba(0, 0, 0, 0.04);
}

/* Cover image — full width break-out */
.article-cover {
    max-width: 100%;
    margin: 0 auto 2rem;
}
.article-cover img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Article content — Medium-style reading typography */
.article-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 1.82;
    color: #242424;
    word-break: break-word;
    letter-spacing: -0.003em;
}
.article-content h1 {
    font-family: var(--font-article-title);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 3.2rem 0 0.5rem;
    line-height: 1.2;
    color: #242424;
}
.article-content h2 {
    font-family: var(--font-article-title);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.018em;
    margin: 2.6rem 0 0.4rem;
    line-height: 1.25;
    color: #242424;
}
.article-content h3 {
    font-family: var(--font-article-title);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 2rem 0 0.35rem;
    line-height: 1.3;
    color: #242424;
}
.article-content h4 {
    font-family: var(--font-article-title);
    font-size: 1rem;
    font-weight: 700;
    margin: 1.6rem 0 0.3rem;
    line-height: 1.35;
    color: #242424;
}
.article-content p {
    margin-bottom: 1.4rem;
}
.article-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
}
.article-content figure {
    margin: 2rem 0;
}
.article-content figure img {
    margin: 0 auto;
}
.article-content figcaption {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.6rem;
    line-height: 1.4;
}
.article-content blockquote {
    border-left: 3px solid #242424;
    padding: 0 0 0 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #242424;
}
.article-content blockquote p { margin-bottom: 0.5rem; }
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content pre {
    background: #f2f2f2;
    color: #242424;
    padding: 1.3rem 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Source Code Pro', Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    margin: 2rem 0;
    border: 1px solid var(--border);
}
.article-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
    font-family: 'Fira Code', 'Source Code Pro', Menlo, monospace;
    font-size: 0.85em;
}
.article-content pre code {
    background: transparent;
    padding: 0;
    font-size: 1em;
    border-radius: 0;
}
.article-content a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}
.article-content a:hover {
    text-decoration-color: #242424;
}
.article-content hr {
    border: none;
    text-align: center;
    margin: 3rem 0;
}
.article-content hr::before {
    content: '∗ ∗ ∗';
    font-size: 1.2rem;
    letter-spacing: 0.5em;
    color: #bbb;
}
.article-content ul,
.article-content ol {
    margin: 0.8rem 0 1.4rem 1.8rem;
    padding-left: 0.5rem;
}
.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }
.article-content li {
    margin-bottom: 0.6rem;
    line-height: 1.75;
    padding-left: 0.3rem;
}
.article-content li ul,
.article-content li ol {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}
.article-content strong, .article-content b { font-weight: 700; }
.article-content em, .article-content i { font-style: italic; }
.article-content mark {
    background: #ffffb8;
    padding: 0.1em 0.2em;
}

/* Article footer */
.article-footer {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}
.article-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.tag-chip {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.05);
    color: #555;
    padding: 0.4rem 0.9rem;
    border-radius: 100px;
    cursor: default;
    transition: background 0.15s;
}
.tag-chip:hover { background: var(--accent-glow); color: var(--navy); }

/* Author card at bottom */
.article-author-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}
.author-card-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
}
.author-card-avatar-placeholder {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--teal));
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 700;
    color: #fff;
}
.author-card-right { flex: 1; }
.author-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
}
.author-card-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
}
.author-card-header h3 a {
    color: var(--ink);
    text-decoration: none;
}
.author-card-header h3 a:hover { text-decoration: underline; }
.author-card-bio {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ── Forms ──────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 80vh;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
}
.auth-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%; max-width: 440px;
    box-shadow: 0 8px 30px var(--shadow);
}
.auth-card h2 {
    font-family: var(--font-display);
    font-size: 1.8rem; font-weight: 700;
    margin-bottom: 0.3rem;
}
.auth-card .subtitle {
    color: var(--muted); font-size: 0.95rem;
    margin-bottom: 1.5rem;
}
.form-group { margin-bottom: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-group label {
    display: block;
    font-family: var(--font-ui); font-size: 0.85rem; font-weight: 500;
    color: var(--ink);
    margin-bottom: 0.35rem;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    font-family: var(--font-ui); font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--parchment);
    color: var(--ink);
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-link {
    font-family: var(--font-ui); font-size: 0.88rem;
    text-align: center; margin-top: 1rem;
    color: var(--muted);
}
.form-link a { color: var(--teal); text-decoration: none; font-weight: 600; }

/* ── Profile ────────────────────────────────────────────────── */
.profile-header {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--parchment) 100%);
    border-bottom: 1px solid var(--border);
}
.profile-avatar {
    width: 100px; height: 100px;
    border-radius: 50%; object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px var(--shadow);
    margin-bottom: 1rem;
}
.profile-avatar-placeholder {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 2.2rem; font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}
.profile-header h1 {
    font-family: var(--font-display);
    font-size: 2rem; font-weight: 700;
}
.profile-header .tagline {
    color: var(--muted); font-style: italic;
    font-size: 1.05rem; margin-top: 0.3rem;
}
.profile-header .bio {
    max-width: 560px; margin: 1rem auto 0;
    color: var(--ink); line-height: 1.7;
}
.profile-meta {
    display: flex; justify-content: center; gap: 1.5rem;
    margin-top: 1rem;
    font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted);
}
.profile-meta a { color: var(--teal); text-decoration: none; }

/* ── Editor ─────────────────────────────────────────────────── */
.editor-page { background: #fff; min-height: 100vh; }
.editor-toolbar {
    position: sticky; top: 64px; z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem;
}
.editor-toolbar button, .editor-toolbar select, .editor-toolbar input[type="color"] {
    font-family: var(--font-ui); font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 5px; background: var(--parchment);
    cursor: pointer; color: var(--ink);
    transition: all 0.15s;
}
.editor-toolbar select {
    min-width: 100px;
    padding-right: 1.4rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6b6b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.editor-toolbar select#headingSelect { min-width: 110px; }
.editor-toolbar select#fontSelect { min-width: 155px; }
.editor-toolbar select option {
    padding: 0.4rem 0.6rem;
    font-size: 0.88rem;
}
.editor-toolbar button:hover { background: var(--warm); }
.editor-toolbar input[type="color"] {
    width: 32px; height: 30px; padding: 2px;
}
.editor-toolbar .sep {
    width: 1px; height: 24px;
    background: var(--border); margin: 0 0.3rem;
}
.editor-area {
    max-width: 800px; margin: 0 auto;
    padding: 2rem;
}
.editor-title-input {
    width: 100%;
    font-family: var(--font-article-title);
    font-size: 2.4rem; font-weight: 800;
    border: none; outline: none;
    background: transparent;
    color: #242424;
    padding: 0.5rem 0;
    letter-spacing: -0.03em;
}
.editor-title-input::placeholder { color: #bbb; }
.editor-excerpt-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1.15rem;
    border: none; outline: none;
    background: transparent;
    color: var(--muted);
    padding: 0.3rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    resize: none;
    overflow: hidden;
    line-height: 1.6;
    min-height: 2.5em;
}
.editor-excerpt-input::placeholder { color: #bbb; }
#editor-content {
    min-height: 400px;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 1.82;
    color: #242424;
    letter-spacing: -0.003em;
}
#editor-content:empty::before {
    content: attr(data-placeholder);
    color: #bbb;
}

/* ── Editor: Headings ──────────────────────────────────── */
#editor-content h2 {
    font-family: var(--font-article-title);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.018em;
    margin: 2rem 0 0.4rem;
    line-height: 1.25;
    color: #242424;
}
#editor-content h3 {
    font-family: var(--font-article-title);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 1.6rem 0 0.35rem;
    line-height: 1.3;
    color: #242424;
}
#editor-content h4 {
    font-family: var(--font-article-title);
    font-size: 1rem;
    font-weight: 700;
    margin: 1.2rem 0 0.3rem;
    line-height: 1.35;
    color: #242424;
}

/* ── Editor: Inline formatting ─────────────────────────── */
#editor-content b,
#editor-content strong,
#editor-content [style*="font-family"] b,
#editor-content [style*="font-family"] strong,
#editor-content b [style*="font-family"],
#editor-content strong [style*="font-family"] {
    font-weight: 700 !important;
}
#editor-content i,
#editor-content em,
#editor-content [style*="font-family"] i,
#editor-content [style*="font-family"] em,
#editor-content i [style*="font-family"],
#editor-content em [style*="font-family"] {
    font-style: italic !important;
}
#editor-content u {
    text-decoration: underline;
    text-underline-offset: 3px;
}
#editor-content s,
#editor-content strike,
#editor-content del {
    text-decoration: line-through;
}

/* ── Editor: Blockquote ────────────────────────────────── */
#editor-content blockquote {
    border-left: 3px solid #242424;
    padding: 0.2rem 0 0.2rem 1.4rem;
    margin: 1.5rem 0;
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #555;
}

/* ── Editor: Code ──────────────────────────────────────── */
#editor-content pre {
    background: #f2f2f2;
    color: #242424;
    padding: 1rem 1.2rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Source Code Pro', Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}
#editor-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Fira Code', 'Source Code Pro', Menlo, monospace;
    font-size: 0.85em;
}

/* ── Editor: Links ─────────────────────────────────────── */
#editor-content a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Editor: Horizontal rule ───────────────────────────── */
#editor-content hr {
    border: none;
    text-align: center;
    margin: 2rem 0;
}
#editor-content hr::before {
    content: '∗ ∗ ∗';
    font-size: 1.2rem;
    letter-spacing: 0.5em;
    color: #bbb;
}

/* ── Editor: Paragraphs ────────────────────────────────── */
#editor-content p {
    margin-bottom: 1.2rem;
}

/* ── Editor: Images ────────────────────────────────────── */
#editor-content img {
    max-width: 100%; height: auto;
    border-radius: 8px; margin: 1rem 0;
    cursor: pointer;
}

/* ── Editor: Lists ─────────────────────────────────────── */
#editor-content ul,
#editor-content ol {
    margin: 0.8rem 0 1.2rem 1.8rem;
    padding-left: 0.5rem;
}
#editor-content ul { list-style-type: disc; }
#editor-content ol { list-style-type: decimal; }
#editor-content li {
    margin-bottom: 0.4rem;
    line-height: 1.75;
}
#editor-content li ul,
#editor-content li ol {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}
.editor-bottom-bar {
    max-width: 800px; margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex; align-items: center; gap: 0.8rem;
    border-top: 1px solid var(--border);
}
.cover-preview {
    max-width: 300px; margin: 1rem 0 0;
    border-radius: 8px;
}
.cover-preview-wrap {
    margin-top: 0.5rem;
}
.cover-remove-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: #e85454;
    cursor: pointer;
    margin-top: 0.5rem;
}
.cover-remove-label input[type="checkbox"] {
    width: auto;
    accent-color: #e85454;
}

/* ── Tables (editor + article) ─────────────────────────────── */
.editor-table,
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    line-height: 1.5;
}
.editor-table th,
.article-content table th {
    background: #f7f7f7;
    font-weight: 600;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ddd;
    font-size: 0.88rem;
    color: #242424;
}
.editor-table td,
.article-content table td {
    padding: 0.6rem 0.85rem;
    border: 1px solid #ddd;
    vertical-align: top;
}
.editor-table tr:nth-child(even) td,
.article-content table tr:nth-child(even) td {
    background: #fafafa;
}
#editor-content .editor-table td,
#editor-content .editor-table th {
    min-width: 60px;
    outline: none;
}
#editor-content .editor-table td:focus,
#editor-content .editor-table th:focus {
    background: #eef6ff;
    box-shadow: inset 0 0 0 2px #4a9eff;
}

/* Table insert popup */
.table-popup {
    position: fixed;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    min-width: 200px;
}
.table-popup label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: #242424;
    font-weight: 500;
}
.table-popup input[type="number"] {
    width: 60px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-ui);
    text-align: center;
}
.table-popup-check {
    font-weight: 400 !important;
    font-size: 0.82rem;
    color: var(--muted) !important;
    gap: 0.3rem !important;
    justify-content: flex-start !important;
}
.table-popup-check input[type="checkbox"] {
    width: auto;
    margin-right: 0.3rem;
}
.table-popup button {
    padding: 0.45rem 0.8rem;
    border: none;
    border-radius: 5px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    transition: background 0.15s;
}
.table-popup button:hover {
    background: var(--accent-light);
}
.table-popup .table-popup-cancel {
    background: transparent;
    color: var(--muted);
    font-weight: 400;
}
.table-popup .table-popup-cancel:hover {
    background: var(--warm);
    color: var(--ink);
}

/* Table right-click context menu */
.table-ctx-menu {
    position: fixed;
    z-index: 300;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    padding: 0.3rem;
    min-width: 170px;
    font-family: var(--font-ui);
}
.table-ctx-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    font-family: var(--font-ui);
    font-size: 0.84rem;
    color: #242424;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.1s;
}
.table-ctx-menu button:hover {
    background: #f0f0f0;
}
.table-ctx-sep {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0.5rem;
}

/* ── Writers Grid ───────────────────────────────────────────── */
.writers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}
.writer-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}
.writer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}
.writer-card img {
    width: 64px; height: 64px;
    border-radius: 50%; object-fit: cover;
    margin-bottom: 0.8rem;
}
.writer-card .initials {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--teal));
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem; font-weight: 700;
    color: #fff;
    margin-bottom: 0.8rem;
}
.writer-card h3 { font-family: var(--font-display); font-size: 1.1rem; }
.writer-card h3 a { color: var(--ink); text-decoration: none; }
.writer-card h3 a:hover { color: var(--teal); }
.writer-card .count { font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); }

/* ── Status Badge ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}
.badge-published { background: #e0f0e0; color: #2a7a2a; }
.badge-draft { background: #f0e8d8; color: #8a6a3a; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 4rem 2rem;
    color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); margin-bottom: 0.5rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--navy);
    padding: 3rem 2rem;
    margin-top: 3rem;
}
.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    text-align: center;
}
.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}
.site-footer p {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
}
.footer-links a {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--teal-light); }
.footer-copy {
    font-size: 0.78rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
    margin-bottom: 0 !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-inner { padding: 2.5rem 1.5rem 2rem; }
    .hero-logo img { width: 220px; }
    .hero-content h1 { font-size: 2rem; }
    .logo-img { height: 48px; }
}
@media (max-width: 640px) {
    .hero-content h1 { font-size: 1.7rem; }
    .hero-logo img { width: 180px; }
    .hero-content p { font-size: 1rem; }
    .articles-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.8rem; }
    .article-subtitle { font-size: 1.05rem; }
    .article-content { font-size: 1.05rem; line-height: 1.8; }
    .article-content h1 { font-size: 1.5rem; }
    .article-content h2 { font-size: 1.3rem; }
    .article-content blockquote { font-size: 1.05rem; }
    .article-author-card { flex-direction: column; align-items: flex-start; }
    .editor-title-input { font-size: 1.6rem; }
    .nav-links .hide-mobile { display: none; }
    .btn-lg { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
    .logo-img { height: 42px; }
}
