/**
 * NeuroDiscuss — component & design-system styles (Phases 2–9).
 *
 * Loaded after custom.css. Covers: article-type chrome, structured article
 * sections, reactions/follow/bookmark, editorial timeline + status pills,
 * reviewer queue, feed, subspecialty hubs, redesigned comments, disclosures,
 * dark mode, reader mode, and print.
 *
 * @package NeuroDiscuss
 */

:root {
    --nd-navy: #0F2A44;
    --nd-teal: #137A7F;
    --nd-ink: #1f2933;
    --nd-muted: #5b6b7b;
    --nd-line: #e4e7ec;
    --nd-surface: #ffffff;
    --nd-surface-2: #faf8f3;
    --nd-radius: 12px;
    --nd-shadow: 0 1px 3px rgba(15, 42, 68, .08), 0 8px 24px rgba(15, 42, 68, .06);
    --nd-serif: Georgia, "Times New Roman", serif;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
    --nd-ink: #e7edf3;
    --nd-muted: #9fb0c0;
    --nd-line: #2a3947;
    --nd-surface: #16212e;
    --nd-surface-2: #1b2733;
    --nd-shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
[data-theme="dark"] body,
[data-theme="dark"] .site-content,
[data-theme="dark"] .content-area {
    background: #0e1620;
    color: var(--nd-ink);
}
[data-theme="dark"] .article,
[data-theme="dark"] .post-card,
[data-theme="dark"] .single-post,
[data-theme="dark"] .doctor-form-card,
[data-theme="dark"] .widget,
[data-theme="dark"] .nd-review-card,
[data-theme="dark"] .author-box,
[data-theme="dark"] .related-posts .post-card {
    background: var(--nd-surface);
    color: var(--nd-ink);
    border-color: var(--nd-line);
}
[data-theme="dark"] .post-title,
[data-theme="dark"] .article-title a,
[data-theme="dark"] .nd-section-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 { color: var(--nd-ink); }
[data-theme="dark"] .post-content,
[data-theme="dark"] .entry-content,
[data-theme="dark"] .article-content { color: var(--nd-ink); }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--nd-surface-2);
    color: var(--nd-ink);
    border-color: var(--nd-line);
}

/* Theme toggle button */
.nd-theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-actions { display: inline-flex; align-items: center; gap: 12px; }
.nd-theme-toggle .nd-icon-light { display: none; }
.nd-theme-toggle .nd-icon-dark { display: inline; }
[data-theme="dark"] .nd-theme-toggle .nd-icon-light { display: inline; }
[data-theme="dark"] .nd-theme-toggle .nd-icon-dark { display: none; }

/* ============================================================
   ARTICLE TYPE BADGE + CARD STRIPE
   ============================================================ */
.nd-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--nd-type-color, var(--nd-teal));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none;
    line-height: 1.8;
}
.nd-type-badge i { font-size: 11px; }
.nd-type-stripe { border-top: 4px solid var(--nd-type-color, var(--nd-teal)); }

/* ============================================================
   BLOG FILTER CHIPS
   ============================================================ */
.nd-blog-filters { margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.nd-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nd-filter-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--nd-muted); margin-right: 4px; }
.nd-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--nd-line); background: var(--nd-surface);
    color: var(--nd-ink); font-size: 13px; text-decoration: none;
    transition: all .15s ease;
}
.nd-chip:hover { border-color: var(--nd-teal); }
.nd-chip.is-active { background: var(--nd-navy); color: #fff; border-color: var(--nd-navy); }
.nd-chip-type.is-active { background: var(--nd-type-color, var(--nd-teal)); border-color: var(--nd-type-color, var(--nd-teal)); }
.nd-filter-clear .nd-clear-link { font-size: 13px; color: var(--nd-muted); text-decoration: none; }

/* ============================================================
   STRUCTURED ARTICLE SECTIONS
   ============================================================ */
.nd-article-section { margin: 28px 0; }
.nd-section-title {
    font-size: 15px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--nd-teal); margin: 0 0 10px; font-weight: 700;
}
.nd-abstract {
    background: var(--nd-surface-2);
    border-left: 4px solid var(--nd-teal);
    padding: 18px 22px; border-radius: 0 var(--nd-radius) var(--nd-radius) 0;
    font-family: var(--nd-serif);
}
.nd-keyword-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.nd-keyword { background: var(--nd-surface-2); border: 1px solid var(--nd-line); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--nd-muted); }
.nd-references .nd-ordered-list,
.nd-teaching-points .nd-ordered-list { padding-left: 22px; }
.nd-references .nd-ordered-list li { font-size: 14px; color: var(--nd-muted); margin-bottom: 8px; line-height: 1.55; }
.nd-references { border-top: 1px solid var(--nd-line); padding-top: 18px; }

/* ============================================================
   ARTICLE ACTIONS: REACTIONS / SAVE / FOLLOW
   ============================================================ */
.nd-article-actions {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 16px; margin: 30px 0; padding: 16px 0; border-top: 1px solid var(--nd-line); border-bottom: 1px solid var(--nd-line);
}
.nd-reactions { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-reactions.nd-needs-login { animation: nd-shake .4s; }
@keyframes nd-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.nd-reaction, .nd-bookmark-btn, .nd-follow-btn, .nd-comment-insightful {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--nd-line); background: var(--nd-surface);
    color: var(--nd-ink); font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all .15s ease;
}
.nd-reaction:hover, .nd-bookmark-btn:hover, .nd-follow-btn:hover, .nd-comment-insightful:hover { border-color: var(--nd-teal); color: var(--nd-teal); }
.nd-reaction.is-active { background: var(--nd-teal); border-color: var(--nd-teal); color: #fff; }
.nd-reaction-count, .nd-comment-insightful-count { font-variant-numeric: tabular-nums; opacity: .85; }
.nd-article-actions-secondary { display: flex; gap: 8px; }
.nd-bookmark-btn.is-bookmarked { background: var(--nd-navy); border-color: var(--nd-navy); color: #fff; }
.nd-follow-btn.is-following { background: var(--nd-navy); border-color: var(--nd-navy); color: #fff; }

/* ============================================================
   EDITORIAL TIMELINE + STATUS PILLS
   ============================================================ */
.nd-editorial-timeline {
    margin: 28px 0; border: 1px solid var(--nd-line); border-radius: var(--nd-radius);
    background: var(--nd-surface-2); padding: 4px 18px;
}
.nd-editorial-timeline > summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--nd-navy); }
[data-theme="dark"] .nd-editorial-timeline > summary { color: var(--nd-ink); }
.nd-timeline-list { list-style: none; margin: 0 0 12px; padding: 0; }
.nd-timeline-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--nd-line); }
.nd-timeline-icon { color: var(--nd-teal); width: 20px; text-align: center; flex: 0 0 20px; }
.nd-timeline-actor { font-weight: 700; }
.nd-timeline-time { display: block; font-size: 12px; color: var(--nd-muted); margin-top: 2px; }
.nd-timeline-note { color: var(--nd-muted); }

.nd-status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e8eef4; color: var(--nd-navy); }
.nd-status-nd_in_review { background: #fef3c7; color: #92400e; }
.nd-status-pending { background: #e0e7ff; color: #3730a3; }
.nd-status-publish { background: #d1fae5; color: #065f46; }
.post-status-badge.status-review { background: #fef3c7; color: #92400e; }

/* ============================================================
   EDITOR: TYPE CHOOSER + TYPE FIELDS
   ============================================================ */
.nd-type-chooser { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.nd-type-option {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 10px 16px; border-radius: var(--nd-radius); border: 2px solid var(--nd-line);
    background: var(--nd-surface); font-weight: 600; font-size: 14px;
}
.nd-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.nd-type-option i { color: var(--nd-type-color, var(--nd-teal)); }
.nd-type-option.is-selected { border-color: var(--nd-type-color, var(--nd-teal)); background: color-mix(in srgb, var(--nd-type-color, var(--nd-teal)) 8%, transparent); }
.nd-type-fields { padding: 16px; border: 1px dashed var(--nd-line); border-radius: var(--nd-radius); margin-bottom: 20px; background: var(--nd-surface-2); }

/* ============================================================
   REVIEWER QUEUE
   ============================================================ */
.nd-queue-intro { color: var(--nd-muted); margin-bottom: 20px; }
.nd-review-card { background: var(--nd-surface); border: 1px solid var(--nd-line); border-radius: var(--nd-radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--nd-shadow); }
.nd-review-title { margin: 10px 0 4px; font-size: 22px; }
.nd-review-byline { color: var(--nd-muted); font-size: 13px; margin: 0 0 14px; }
.nd-review-abstract { background: var(--nd-surface-2); padding: 14px 18px; border-radius: var(--nd-radius); font-family: var(--nd-serif); }
.nd-review-fulltext > summary { cursor: pointer; font-weight: 600; color: var(--nd-teal); margin: 14px 0; }
.nd-review-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--nd-line); }
.nd-review-unassigned { color: var(--nd-muted); font-style: italic; }

/* ============================================================
   FEED + NAV BADGE + SUBSPECIALTY HUB
   ============================================================ */
.doctor-nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.nd-feed-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.nd-feed-grid { margin-top: 8px; }
.nd-saved-section { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--nd-line); }
.nd-section-heading { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 16px; color: var(--nd-navy); }
[data-theme="dark"] .nd-section-heading { color: var(--nd-ink); }

.nd-hub-header { background: linear-gradient(135deg, var(--nd-navy) 0%, var(--nd-teal) 100%); color: #fff; padding: 48px 0; }
.nd-hub-header .page-title { color: #fff; }
.nd-hub-kicker { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; opacity: .85; margin: 0 0 6px; }
.nd-hub-description { max-width: 720px; opacity: .92; }
.nd-hub-actions { margin-top: 16px; }
.nd-hub-header .nd-follow-btn { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; }
.nd-hub-section { margin: 36px 0; }
.nd-hub-doctors { display: flex; flex-wrap: wrap; gap: 18px; }
.nd-hub-doctor-card { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 110px; text-align: center; text-decoration: none; color: var(--nd-ink); }
.nd-hub-doctor-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.nd-hub-doctor-avatar--placeholder { display: flex; align-items: center; justify-content: center; background: var(--nd-surface-2); color: var(--nd-muted); font-size: 26px; }
.nd-hub-doctor-name { font-size: 13px; font-weight: 600; }

/* ============================================================
   COMMENT REDESIGN
   ============================================================ */
.nd-comment-sort { display: flex; align-items: center; gap: 12px; margin: 12px 0 20px; font-size: 14px; }
.nd-comment-sort-label { color: var(--nd-muted); font-weight: 600; }
.nd-comment-sort-link { text-decoration: none; color: var(--nd-muted); padding-bottom: 2px; }
.nd-comment-sort-link.is-active { color: var(--nd-teal); border-bottom: 2px solid var(--nd-teal); font-weight: 600; }
.nd-comment-list { list-style: none; padding: 0; }
.nd-comment-list .children { list-style: none; margin-left: 28px; padding-left: 18px; border-left: 2px solid var(--nd-line); }
.nd-comment-body { padding: 16px 0; }
.nd-comment-head { display: flex; align-items: center; gap: 12px; }
.nd-comment-avatar { border-radius: 50%; }
.nd-comment-author { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.nd-comment-permalink { font-size: 12px; color: var(--nd-muted); text-decoration: none; }
.nd-comment-content { margin: 10px 0; line-height: 1.6; }
.nd-comment-actions { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.nd-comment-insightful { padding: 4px 12px; font-size: 12px; }
.nd-comment-insightful.is-active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.nd-comment-awaiting { font-size: 13px; color: #92400e; background: #fef3c7; padding: 6px 10px; border-radius: 6px; display: inline-block; }
.nd-mention { color: var(--nd-teal); font-weight: 600; text-decoration: none; }

.nd-comment-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; color: #fff; }
.nd-comment-badge--author { background: var(--nd-teal); }
.nd-comment-badge--editor { background: #5b21b6; }
.nd-comment-badge--reviewer { background: #b45309; }
.nd-comment-badge--verified { background: var(--nd-navy); }

/* ============================================================
   DISCLOSURES + AUTO DISCLAIMER (Phase 9)
   ============================================================ */
.nd-disclosures { background: var(--nd-surface-2); border: 1px solid var(--nd-line); border-radius: var(--nd-radius); padding: 16px 20px; }
.nd-disclaimer {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 24px 0; padding: 14px 18px;
    border-radius: var(--nd-radius); border-left: 4px solid var(--nd-teal);
    background: var(--nd-surface-2); font-size: 14px; color: var(--nd-muted);
}
.nd-disclaimer i { color: var(--nd-teal); margin-top: 3px; }
.nd-disclaimer--clinical { border-left-color: #b45309; }
.nd-disclaimer--clinical i { color: #b45309; }
.nd-disclaimer--opinion { border-left-color: #be185d; }
.nd-disclaimer--opinion i { color: #be185d; }

/* ============================================================
   READER MODE
   ============================================================ */
.nd-reader-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--nd-line);
    border-radius: 999px; padding: 4px 12px; cursor: pointer;
    font-size: 13px; color: var(--nd-muted);
}
body.nd-reader .sidebar,
body.nd-reader .site-header,
body.nd-reader .site-footer,
body.nd-reader .related-posts,
body.nd-reader .nd-article-actions,
body.nd-reader .social-share,
body.nd-reader .preloader { display: none !important; }
body.nd-reader .blog-layout { display: block; }
body.nd-reader .main-content { max-width: 720px; margin: 0 auto; }
body.nd-reader .post-content,
body.nd-reader .entry-content { font-family: var(--nd-serif); font-size: 20px; line-height: 1.8; }
body.nd-reader .nd-reader-toggle { position: fixed; top: 16px; right: 16px; z-index: 50; background: var(--nd-surface); box-shadow: var(--nd-shadow); }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .site-header, .site-footer, .sidebar, .mobile-menu, .preloader,
    .nd-article-actions, .social-share, .related-posts, .post-navigation,
    .comments-area, .nd-blog-filters, .back-to-top, .nd-reader-toggle,
    .header-actions, .breadcrumbs, .doctor-portal-sidebar {
        display: none !important;
    }
    body { background: #fff !important; color: #000 !important; font-size: 12pt; }
    .main-content, .blog-layout, .container { width: 100% !important; max-width: 100% !important; margin: 0 !important; }
    .nd-abstract, .nd-disclaimer, .nd-references { border: 1px solid #ccc; }
    .post-title { font-size: 22pt; }
    a[href]:after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
    .nd-type-badge { border: 1px solid #000; color: #000 !important; background: #fff !important; }
}
