/* CMC Scholarly Publishing Suite — Frontend Styles */
.cmcs-portal-wrap { max-width: 980px; margin: 24px auto; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: #0f172a; }
.cmcs-alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-weight: 600; font-size: 14px; }
.cmcs-alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.cmcs-alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.cmcs-kicker { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: #1d4ed8; margin-bottom: 6px; }
.cmcs-auth-header { background: linear-gradient(135deg, #0b1d3a 0%, #153466 100%); color: #fff; padding: 30px 32px; border-radius: 16px 16px 0 0; }
.cmcs-auth-header h2 { margin: 0 0 8px; color: #fff; font-size: 26px; }
.cmcs-auth-header p { margin: 0 0 18px; color: rgba(255,255,255,0.82); font-size: 14.5px; }
.cmcs-portal-topbar { background: #0b1d3a; color: #fff; padding: 16px 24px; border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cmcs-role-pill { display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,0.16); font-size: 11.5px; font-weight: 600; }
.cmcs-tabs-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.cmcs-tab-link { padding: 8px 14px; border-radius: 8px; background: rgba(255,255,255,0.12); color: #fff !important; font-size: 13px; font-weight: 600; text-decoration: none; }
.cmcs-tab-link.is-active { background: #ffffff; color: #0b1d3a !important; }
.cmcs-tab-editor { background: #c89b3c; color: #0b1d3a !important; }
.cmcs-form-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 28px 32px; box-shadow: 0 8px 28px rgba(11,29,58,0.06); }
.cmcs-auth-shell .cmcs-form-card { border-radius: 0 0 16px 16px; border-top: none; }
.cmcs-form-card h3 { margin: 0 0 8px; font-size: 22px; color: #0b1d3a; }
.cmcs-sub-note { font-size: 13.5px; color: #64748b; margin: 0 0 18px; }
.cmcs-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cmcs-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cmcs-field { margin-bottom: 16px; }
.cmcs-field label { display: block; font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 6px; }
.cmcs-field input[type="text"], .cmcs-field input[type="email"], .cmcs-field input[type="password"], .cmcs-field select, .cmcs-field textarea {
  width: 100%; padding: 10px 13px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; color: #0f172a; box-sizing: border-box;
}
.cmcs-checkbox-line { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.cmcs-section-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; margin: 18px 0; }
.cmcs-section-box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.cmcs-section-box h4 { margin: 0; font-size: 15.5px; color: #0b1d3a; }
.cmcs-author-entry { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.cmcs-btn-primary { background: #1d4ed8; color: #fff; border: none; padding: 12px 24px; border-radius: 10px; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.cmcs-btn-primary:hover { background: #1e40af; }
.cmcs-btn-sm { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; background: #0b1d3a; color: #fff !important; font-size: 12.5px; font-weight: 600; border: 1px solid #0b1d3a; cursor: pointer; text-decoration: none; }
.cmcs-btn-outline { background: #fff; color: #0b1d3a !important; border-color: #cbd5e1; }
.cmcs-sub-row { border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; background: #f8fafc; }
.cmcs-sub-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cmcs-sub-meta { font-size: 13px; color: #64748b; margin-top: 4px; }
.cmcs-status-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-submitted { background: #fef3c7; color: #92400e; }
.status-under_review { background: #dbeafe; color: #1e40af; }
.status-revisions_requested { background: #ffedd5; color: #9a3412; }
.status-accepted, .status-published { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.cmcs-feedback-box { background: #fff; border-left: 4px solid #1d4ed8; padding: 12px 14px; margin: 12px 0; border-radius: 0 8px 8px 0; font-size: 13.5px; }
.cmcs-sub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Single Article Scholarly Enhancement */
.cmcs-scholarly-header-card, .cmcs-scholarly-footer-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 22px 24px; margin: 22px 0; }
.cmcs-meta-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; margin-bottom: 8px; }
.cmcs-authors-block { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.cmcs-author-item { display: flex; flex-direction: column; }
.cmcs-author-orcid-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: #0b1d3a; text-decoration: none; }
.cmcs-author-orcid-link:hover { color: #1d4ed8; text-decoration: underline; }
.cmcs-author-plain { font-weight: 700; color: #0b1d3a; }
.cmcs-corr-badge { color: #b91c1c; font-weight: 700; margin-left: 2px; }
.cmcs-author-affil { font-size: 12.5px; color: #64748b; }
.cmcs-badges-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cmcs-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #cbd5e1; color: #1e293b; text-decoration: none; }
.cmcs-chip-doi { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.cmcs-chip-oa { background: #ecfdf5; border-color: #86efac; color: #166534; }
.cmcs-timeline-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e2e8f0; font-size: 12.5px; color: #475569; }
.cmcs-detail-block { margin-bottom: 18px; }
.cmcs-detail-block h4, .cmcs-declarations-grid h4 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: #0b1d3a; }
.cmcs-keyword-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cmcs-kw { background: #e0e7ff; color: #1e3a8a; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.cmcs-declarations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.cmcs-cite-box { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 12px; padding: 18px 20px; margin-top: 16px; }
.cmcs-cite-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cmcs-cite-head h4 { margin: 0; font-size: 15px; color: #0b1d3a; }
.cmcs-cite-tabs { display: flex; gap: 6px; }
.cmcs-cite-tab { border: 1px solid #cbd5e1; background: #f8fafc; padding: 5px 11px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.cmcs-cite-tab.is-active { background: #0b1d3a; color: #fff; border-color: #0b1d3a; }
.cmcs-cite-text { font-size: 13.5px; line-height: 1.6; color: #1e293b; background: #f8fafc; padding: 12px 14px; border-radius: 8px; margin-bottom: 12px; }
.cmcs-cite-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .cmcs-grid-2, .cmcs-grid-3 { grid-template-columns: 1fr; }
  .cmcs-form-card, .cmcs-auth-header { padding: 20px; }
}

/* ==========================================================================
   CMC Journal Frontend Polish & Complete Dark Mode Fix (html[data-theme="dark"])
   Eliminates all white-on-white headings, hidden content, and low-contrast navs
   ========================================================================== */
@media (min-width: 1025px) {
  header nav a, .site-header nav a, .cmc-header a.btn, .cmc-header .submit-btn, a[href*="/submit"] {
    white-space: nowrap !important;
  }
  .mobile-menu-toggle, .menu-toggle, .hamburger-btn, button[aria-label*="Menu"], button[aria-label*="menu"] {
    display: none !important;
  }
}

.article-card, .cmc-article-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  border-radius: 14px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.article-card:hover, .cmc-article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1) !important;
}
.article-card .article-authors, .cmc-article-card .article-authors, .cmc-article-card__authors {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* Complete Dark Mode Theme Overrides */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #0b1120 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] main,
html[data-theme="dark"] section,
html[data-theme="dark"] .cmc-article-page,
html[data-theme="dark"] .cmc-articles-section,
html[data-theme="dark"] .latest-articles,
html[data-theme="dark"] .site-main {
  background-color: #0b1120 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] header,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .cmc-header {
  background-color: #0f172a !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] header a,
html[data-theme="dark"] .site-header a,
html[data-theme="dark"] nav a,
html[data-theme="dark"] #cmc-theme-toggle,
html[data-theme="dark"] .cmc-theme-toggle {
  color: #f1f5f9 !important;
}
html[data-theme="dark"] header a:hover,
html[data-theme="dark"] nav a:hover {
  color: #60a5fa !important;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .cmc-abstract-card__title,
html[data-theme="dark"] .section-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] .article-meta,
html[data-theme="dark"] .cmc-article-authors {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .cmc-article-card,
html[data-theme="dark"] .scope-card,
html[data-theme="dark"] .editorial-card,
html[data-theme="dark"] .cmc-abstract-card,
html[data-theme="dark"] .cmcs-scholarly-header-card,
html[data-theme="dark"] .cmcs-scholarly-footer-card,
html[data-theme="dark"] .cmcs-cite-box,
html[data-theme="dark"] .cmcs-form-card,
html[data-theme="dark"] .cmcs-section-box,
html[data-theme="dark"] .cmcs-author-entry,
html[data-theme="dark"] .cmcs-sub-row {
  background-color: #111c33 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .cmcs-cite-text,
html[data-theme="dark"] .cmcs-chip,
html[data-theme="dark"] .cmcs-cite-tab,
html[data-theme="dark"] .cmcs-btn-outline,
html[data-theme="dark"] .cmcs-feedback-box {
  background-color: #0b1120 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .cmcs-author-orcid-link,
html[data-theme="dark"] .cmcs-author-plain {
  color: #f8fafc !important;
}
html[data-theme="dark"] .cmcs-author-affil,
html[data-theme="dark"] .cmcs-meta-label,
html[data-theme="dark"] .cmcs-timeline-row {
  color: #94a3b8 !important;
}
html[data-theme="dark"] footer,
html[data-theme="dark"] .site-footer {
  background-color: #070d1a !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] footer a {
  color: #93c5fd !important;
}
