/* WIA Journal shared page styles (2026-10-12).
   Loaded after each page's inline <style>: shared header fixes + content-page components (wj-*). */

/* ---------- shared header: one-line logo on phones (all pages) ---------- */
header .logo { white-space: nowrap; min-width: 0; flex-shrink: 1; }
header .logo span { overflow: hidden; text-overflow: ellipsis; }
header .logo-icon { flex-shrink: 0; }
@media (max-width: 768px) {
  header .header-content { padding: 0 15px; }
  header nav:not(.mobile-nav) ul { display: none; }
  header .language-btn { display: none; }
  header .mobile-menu-btn { display: block; }
}
@media (max-width: 480px) {
  header .logo { font-size: 1.3rem; gap: 10px; }
}
@media (max-width: 400px) {
  header .logo { font-size: 1.15rem; gap: 8px; }
  header .logo-icon { width: 34px; height: 34px; font-size: 1.25rem; }
}

/* ---------- content pages ---------- */
.wj-main { background: #f8f9fb; }
.wj-wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.wj-page-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; text-align: center; padding: 130px 0 60px;
}
.wj-page-hero h1 { font-size: 2.4rem; line-height: 1.2; margin-bottom: .75rem; overflow-wrap: anywhere; }
.wj-page-hero .lead { font-size: 1.15rem; opacity: .95; max-width: 720px; margin: 0 auto; }
.wj-section { padding: 56px 0; }
.wj-section.alt { background: #fff; }
.wj-section h2 { font-size: 1.7rem; color: #2c3e50; margin-bottom: 1rem; line-height: 1.3; }
.wj-section h3 { font-size: 1.2rem; color: #2c3e50; margin: 1.4rem 0 .5rem; }
.wj-section p, .wj-section li { color: #444; font-size: 1.02rem; }
.wj-section p { margin-bottom: .9rem; }
.wj-section ul, .wj-section ol { margin: .4rem 0 1rem; padding-inline-start: 1.4rem; }
.wj-section li { margin-bottom: .35rem; }
.wj-section a { color: #5a4bd1; }
.wj-section code { background: #eef0f7; padding: 1px 6px; border-radius: 4px; font-size: .92em; overflow-wrap: anywhere; }

.wj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 1.2rem; }
.wj-card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 4px 18px rgba(30, 30, 60, .07); border: 1px solid #eceef5; }
.wj-section.alt .wj-card { background: #fafbfe; }
.wj-card h3 { margin-top: 0; font-size: 1.1rem; }
.wj-card p:last-child { margin-bottom: 0; }
.wj-card .wj-icon { font-size: 1.6rem; line-height: 1; margin-bottom: .6rem; display: block; }

.wj-steps { counter-reset: wjstep; list-style: none; padding: 0 !important; margin: 1.2rem 0; }
.wj-steps > li { counter-increment: wjstep; position: relative; background: #fff; border: 1px solid #eceef5; border-radius: 12px; padding: 16px 18px 16px 62px; margin-bottom: 12px; }
.wj-steps > li::before { content: counter(wjstep); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
[dir="rtl"] .wj-steps > li { padding: 16px 62px 16px 18px; }
[dir="rtl"] .wj-steps > li::before { left: auto; right: 16px; }
.wj-steps > li strong { display: block; color: #2c3e50; margin-bottom: 2px; }

.wj-note { background: #f3f1ff; border-inline-start: 4px solid #764ba2; border-radius: 8px; padding: 14px 18px; margin: 1.2rem 0; color: #3b3360; }
.wj-note.warn { background: #fff7e6; border-color: #d9a441; color: #5c4400; }
.wj-note p:last-child { margin-bottom: 0; }

.wj-btn { display: inline-block; padding: 12px 22px; border-radius: 10px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff !important; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; }
.wj-btn.secondary { background: #fff; color: #5a4bd1 !important; border: 2px solid #c9c3f3; }
.wj-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.2rem; }
.wj-page-hero .wj-actions { justify-content: center; }

.wj-table-wrap { overflow-x: auto; margin: 1rem 0; -webkit-overflow-scrolling: touch; }
.wj-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .97rem; }
.wj-table th, .wj-table td { padding: 10px 12px; border-bottom: 1px solid #eceef5; text-align: start; vertical-align: top; }
.wj-table th { background: #f3f4fa; color: #2c3e50; }

.wj-cite { background: #fff; border: 1px solid #e3e5f0; border-radius: 10px; padding: 14px 16px; margin: .6rem 0 1.2rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; color: #333; overflow-wrap: anywhere; }
.wj-cite .wj-label { display: block; font-family: 'Inter', sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: #7a6fc6; text-transform: uppercase; margin-bottom: 4px; }

.wj-faq details { background: #fff; border: 1px solid #eceef5; border-radius: 12px; padding: 0 18px; margin-bottom: 12px; }
.wj-faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; color: #2c3e50; list-style: none; position: relative; padding-inline-end: 28px; }
.wj-faq summary::-webkit-details-marker { display: none; }
.wj-faq summary::after { content: '+'; position: absolute; inset-inline-end: 0; top: 14px; font-size: 1.3rem; color: #764ba2; }
.wj-faq details[open] summary::after { content: '−'; }
.wj-faq details > div { padding: 0 0 16px; }

/* papers list (real data from /api/papers) */
.wj-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1.2rem; }
.wj-toolbar input, .wj-toolbar select { flex: 1 1 220px; min-width: 0; padding: 11px 14px; border: 2px solid #e3e5f0; border-radius: 10px; font-size: 1rem; background: #fff; }
.wj-paper { background: #fff; border: 1px solid #eceef5; border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; box-shadow: 0 3px 12px rgba(30, 30, 60, .05); }
.wj-paper h3 { margin: 0 0 .4rem; font-size: 1.15rem; overflow-wrap: anywhere; }
.wj-paper h3 a { color: #2c3e50; text-decoration: none; }
.wj-paper h3 a:hover { color: #5a4bd1; }
.wj-paper .wj-meta { font-size: .9rem; color: #6b6f85; margin-bottom: .5rem; overflow-wrap: anywhere; }
.wj-paper .wj-abstract { color: #444; margin: 0; overflow-wrap: anywhere; }
.wj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .6rem; }
.wj-tag { background: #f0eefc; color: #5a4bd1; border-radius: 999px; padding: 2px 10px; font-size: .82rem; }
.wj-badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; background: #e8f5ec; color: #1d6b36; vertical-align: middle; }
.wj-empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed #d5d8e8; border-radius: 14px; color: #6b6f85; }
.wj-empty strong { display: block; font-size: 1.15rem; color: #2c3e50; margin-bottom: .3rem; }

@media (max-width: 768px) {
  .wj-page-hero { padding: 110px 0 44px; }
  .wj-page-hero h1 { font-size: 1.9rem; }
  .wj-page-hero .lead { font-size: 1.02rem; }
  .wj-section { padding: 40px 0; }
  .wj-section h2 { font-size: 1.45rem; }
}

/* off-canvas mobile menu: no shadow strip at the left edge while closed */
.mobile-nav:not(.active) { box-shadow: none; visibility: hidden; }
.mobile-nav.active { visibility: visible; }

/* long words (German compounds etc.) must not push the page wider than the screen */
main h1, main h2, main h3, main p, main li, footer h3, footer p, footer a { overflow-wrap: break-word; hyphens: auto; }

/* header fit for long translated labels (class set by wj-site.js when the header row overflows) */
header nav ul a { white-space: nowrap; }
#loginBtn { white-space: nowrap; }
header .logo { flex-shrink: 0; }
header .logo span { overflow: visible; text-overflow: clip; }
body.wj-compact header nav:not(.mobile-nav) ul { display: none; }
body.wj-compact header .language-btn { display: none; }
body.wj-compact header .mobile-menu-btn { display: block; }
body.wj-compact .mobile-nav { display: block; }
body.wj-tight #loginBtn { padding: 6px 9px !important; font-size: 12px !important; }
body.wj-tight #authContainer { margin-left: 6px !important; margin-right: 6px; }
body.wj-tighter header .logo span { display: none; }
body.wj-compact header nav:not(.mobile-nav) { margin-inline-start: auto; margin-inline-end: 8px; }

/* ---------- app pages (auth, my papers/reviews, editor) ---------- */
.wj-page-hero.wj-hero-sm { padding: 120px 0 44px; }
.wj-actions-end { justify-content: flex-end; margin: 0 0 1rem; }
.wj-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.wj-row > div { min-width: 0; flex: 1 1 260px; }
.wj-status { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; background: #eef0f7; color: #3b3f5c; white-space: nowrap; }
.wj-status.st-submitted, .wj-status.st-assigned { background: #e3edff; color: #1d3f8f; }
.wj-status.st-under_review, .wj-status.st-in_progress { background: #fff4d6; color: #7a5a00; }
.wj-status.st-revision { background: #fde8e8; color: #8a1f1f; }
.wj-status.st-accepted, .wj-status.st-completed { background: #e3f5e8; color: #1d6b36; }
.wj-status.st-published { background: #5a4bd1; color: #fff; }
.wj-status.st-rejected, .wj-status.st-declined { background: #eee; color: #555; }
.wj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 2rem; }
.wj-stat { background: #fff; border: 1px solid #eceef5; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.wj-stat-label { color: #6b6f85; font-size: .9rem; }
.wj-stat-value { font-size: 1.8rem; font-weight: 700; color: #2c3e50; }
.wj-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: .6rem 0 1.2rem; }
.wj-tab { border: 1px solid #d9dcef; background: #fff; color: #4a4f6a; border-radius: 999px; padding: 8px 16px; font-size: .95rem; cursor: pointer; font-family: inherit; }
.wj-tab.active { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }
.wj-auth { max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid #eceef5; border-radius: 16px; padding: 24px; box-shadow: 0 6px 24px rgba(30, 30, 60, .07); }
.wj-auth .wj-tabs { margin-top: 0; }
.wj-form { display: none; }
.wj-form.active { display: block; }
.wj-form h2 { font-size: 1.25rem; margin-bottom: .4rem; }
.wj-field { display: block; margin-bottom: 14px; }
.wj-field > span { display: block; font-weight: 600; color: #2c3e50; margin-bottom: 6px; font-size: .95rem; }
.wj-field input, .wj-field select, .wj-field textarea { width: 100%; padding: 11px 14px; border: 2px solid #e3e5f0; border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff; }
.wj-field input:focus, .wj-field select:focus, .wj-field textarea:focus { outline: none; border-color: #667eea; }
.wj-btn-block { width: 100%; text-align: center; }
.wj-btn:disabled { opacity: .65; cursor: not-allowed; }
.wj-form-links { margin-top: 12px; text-align: center; }
.wj-msg { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.wj-msg.ok { background: #e9f7ee; color: #1d6b36; border: 1px solid #c8ebd4; }
.wj-msg.err { background: #fdecec; color: #8a1f1f; border: 1px solid #f6caca; }
.wj-msg.info { background: #f3f1ff; color: #3b3360; border: 1px solid #e0dcfb; }
.wj-inline { margin-top: 12px; padding: 14px; background: #fafbfe; border: 1px dashed #d5d8e8; border-radius: 12px; }
.wj-app-list .wj-paper h3 a { color: #2c3e50; }

/* ---------- header order (2026-10-13): [logo] … [scan][lang][login][☰] ----------
   The WIA scan button (wiacode.com/assets/wia-scan-float.js, not ours) docks before the language button in the desktop
   menu, or before the ☰ button when that is visible. Flex order puts it first in the right-hand group either way. */
header .header-content { gap: 10px; }
header .header-content > .logo { margin-inline-end: auto; }
header .header-content > wia-scan-btn { order: 1; flex-shrink: 0; }
header .header-content > nav:not(.mobile-nav) { order: 2; display: flex; align-items: center; gap: 10px; margin: 0 !important; flex-shrink: 0; }
header .header-content > .logo { flex-shrink: 0; }
/* the page CSS reversed the header for RTL; dir=rtl already mirrors flex rows */
[dir="rtl"] header .header-content, [dir="rtl"] header nav ul { flex-direction: row; }
header .header-content > .mobile-menu-btn { order: 3; flex-shrink: 0; }
header nav:not(.mobile-nav) .language-btn { display: inline-flex !important; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }
header nav:not(.mobile-nav) #authContainer { margin: 0 !important; flex-shrink: 0; }
header nav:not(.mobile-nav) wia-scan-btn { flex-shrink: 0; }
@media (max-width: 520px) {
  header nav:not(.mobile-nav) .language-btn { padding: 6px 9px; font-size: .85rem; gap: 4px; }
  header nav:not(.mobile-nav) .language-btn span:last-child { display: none; }
  header .header-content { gap: 8px; }
}
body.wj-tight header nav:not(.mobile-nav) .language-btn { padding: 5px 7px; }
body.wj-tighter #loginBtn { font-size: 11.5px !important; padding: 6px 8px !important; letter-spacing: -.1px; }
body.wj-tighter header .logo { font-size: 1rem; }
body.wj-tightest header .logo span { display: none; }
body.wj-tight header .header-content { gap: 6px; }
body.wj-tight header .header-content > nav:not(.mobile-nav) { gap: 6px; }
body.wj-tight header .mobile-menu-btn { padding: 6px; }
body.wj-tight header nav:not(.mobile-nav) .language-btn span:first-child { display: none; }
body.wj-tight header .logo { gap: 8px; font-size: 1.1rem; }

/* RTL: mirror the few physical-margin utilities used by the submission form */
[dir="rtl"] .mr-2 { margin-right: 0; margin-left: .5rem; }
[dir="rtl"] .mr-3 { margin-right: 0; margin-left: .75rem; }
[dir="rtl"] .ml-2 { margin-left: 0; margin-right: .5rem; }

/* submit hero: the 4 process steps must fit long translated labels */
.gradient-bg .flex.space-x-8 { gap: 1rem; }
.gradient-bg .flex.space-x-8 > * { margin-left: 0 !important; margin-right: 0 !important; flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

/* ---------- review workflow (2026-10-13) ---------- */
.wj-files { list-style: none; padding: 0 !important; margin: .4rem 0 1rem; }
.wj-files li { padding: 6px 0; border-bottom: 1px solid #f0f1f6; overflow-wrap: anywhere; }
.wj-link { background: none; border: 0; padding: 0; color: #5a4bd1; text-decoration: underline; cursor: pointer; font: inherit; text-align: start; overflow-wrap: anywhere; }
.wj-link.wj-err { color: #8a1f1f; }
.wj-pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #fafbfe; border: 1px solid #eceef5; border-radius: 10px; padding: 10px 12px; }
.wj-review { border-top: 1px solid #eceef5; padding-top: 10px; margin-top: 10px; }
.wj-inline h4, .wj-paper h4 { margin: 12px 0 6px; font-size: 1rem; color: #2c3e50; }
.wj-radios { border: 0; padding: 0; margin: 0 0 14px; }
.wj-radios legend { font-weight: 600; color: #2c3e50; margin-bottom: 6px; font-size: .95rem; }
.wj-radios label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e3e5f0; border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.wj-radios input { width: auto; }
.wj-hint { font-size: .88rem; color: #6b6f85; margin: -6px 0 14px; }
.wj-card.wj-form { margin-top: 18px; }
.wj-roles { margin-top: 2rem; }
.wj-roles .wj-toolbar input { min-width: 0; }

/* the hidden attribute must win over .wj-btn / .wj-msg display rules */
[hidden] { display: none !important; }
/* long e-mail addresses inside cards */
.wj-row > div, .wj-paper strong, .wj-paper .wj-meta, #wj-inv-who { overflow-wrap: anywhere; word-break: break-word; }
