/* Wiley Online Library – article page styles */
:root {
  --wiley-blue: #00205b;
  --wiley-link: #0066a1;
  --wiley-link-hover: #004d7a;
  --journal-green: #1a6b5c;
  --journal-green-dark: #0f4a40;
  --text: #1a1a1a;
  --muted: #555;
  --border: #d9d9d9;
  --toolbar-bg: #f5f5f5;
  --sidebar-width: 280px;
  --content-max: 720px;
  --page-max: 1180px;
  --accent-cite: #0066a1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
}

a {
  color: var(--wiley-link);
  text-decoration: none;
}

a:hover {
  color: var(--wiley-link-hover);
  text-decoration: underline;
}

/* ========== Top header ========== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.wiley-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  color: var(--wiley-blue);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wiley-logo:hover {
  text-decoration: none;
  color: var(--wiley-blue);
}

.wiley-logo .brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.wiley-logo .sub {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  letter-spacing: 0.01em;
}

.search-box {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.search-box input {
  width: 100%;
  height: 38px;
  border: 1px solid #bbb;
  border-radius: 2px;
  padding: 0 40px 0 14px;
  font-size: 14px;
  font-family: inherit;
}

.search-box input:focus {
  outline: 2px solid var(--wiley-link);
  outline-offset: -1px;
}

.search-box button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px 10px;
  color: #444;
}

.header-actions {
  flex-shrink: 0;
  font-size: 14px;
}

.header-actions a {
  color: var(--wiley-link);
  font-weight: 500;
}

/* ========== Journal banner ========== */
.journal-banner {
  background: linear-gradient(90deg, var(--journal-green-dark) 0%, var(--journal-green) 55%, #2a8a76 100%);
  color: #fff;
}

.journal-banner-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.journal-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.journal-title-block .journal-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}

.journal-title-block .journal-name a {
  color: #fff;
  text-decoration: none;
}

.journal-title-block .journal-name a:hover {
  text-decoration: underline;
}

/* ========== Page layout ========== */
.page-wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: 40px;
  align-items: start;
}

.article-main {
  min-width: 0;
  max-width: 760px;
}

/* Article type badges */
.article-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #222;
}

.oa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c45c26;
}

.oa-badge .oa-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e87722;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.cc-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cc-badge span {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.article-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px;
  color: #111;
  letter-spacing: -0.01em;
}

.authors {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.authors a {
  font-weight: 500;
}

.authors .sep {
  color: #999;
  margin: 0 2px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.meta-row .doi a {
  word-break: break-all;
}

.btn-metrics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #333;
  cursor: pointer;
  border-radius: 2px;
  font-family: inherit;
}

.btn-metrics:hover {
  background: #f7f7f7;
}

.authorship-note {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 20px;
}

.affiliations {
  font-size: 13px;
  color: #444;
  margin: 0 0 12px;
  line-height: 1.55;
}

.affiliations p {
  margin: 0 0 4px;
}

.keywords {
  font-size: 14px;
  margin: 0 0 20px;
}

.keywords strong {
  font-weight: 700;
}

.keywords a {
  margin-right: 4px;
}

/* ========== Sticky toolbar ========== */
.article-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 62px;
  z-index: 90;
  margin-bottom: 28px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #333;
  cursor: pointer;
  font-family: inherit;
  border-radius: 2px;
}

.toolbar-btn:hover {
  background: var(--toolbar-bg);
}

.toolbar-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toolbar-btn.pdf-btn svg {
  color: #c62828;
}

.toolbar-spacer {
  flex: 1;
}

/* Sections dropdown */
.sections-menu {
  position: relative;
}

.sections-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 120;
  padding: 8px 0;
}

.sections-menu.open .sections-dropdown {
  display: block;
}

.sections-dropdown a {
  display: block;
  padding: 8px 16px;
  color: #222;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.sections-dropdown a:hover {
  background: #f0f7fa;
  text-decoration: none;
}

.sections-dropdown a.sub {
  padding-left: 28px;
  font-size: 13px;
  color: #444;
}

/* ========== Abstract & body ========== */
.section-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
}

.abstract p {
  margin: 0 0 1em;
  text-align: justify;
}

.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 2em 0 0.75em;
  line-height: 1.3;
  color: #111;
}

.article-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 1.6em 0 0.6em;
  line-height: 1.35;
  color: #111;
}

.article-body p {
  margin: 0 0 1em;
  text-align: justify;
}

.cite {
  color: var(--accent-cite);
  font-weight: 500;
  white-space: nowrap;
}

.cite:hover {
  text-decoration: underline;
}

/* Figure */
.figure-block {
  margin: 2em 0;
  text-align: center;
}

.figure-block .figure-frame {
  display: inline-block;
  max-width: 100%;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  padding: 16px;
}

.figure-block img,
.figure-block svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.figure-caption {
  text-align: left;
  font-size: 14px;
  margin-top: 12px;
  color: #222;
  line-height: 1.5;
}

.figure-caption strong {
  margin-right: 6px;
}

/* Mind map (Figure 1) */
.mindmap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  font-family: inherit;
}

.mindmap .node {
  stroke: #333;
  stroke-width: 1.2;
}

.mindmap .label {
  font-size: 11px;
  fill: #222;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Tables */
.table-wrap {
  margin: 2em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  min-width: 520px;
}

.article-table caption {
  caption-side: top;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  padding: 0 0 10px;
  color: #111;
}

.article-table th {
  background: #ececec;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #bbb;
  vertical-align: bottom;
}

.article-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: top;
}

.article-table tbody tr:last-child td {
  border-bottom: none;
}

.article-table tbody tr:hover {
  background: #f9fbfd;
}

.table-note {
  font-size: 13px;
  color: #555;
  margin: 8px 0 0;
}

/* Data availability */
.data-availability {
  margin: 2.5em 0 1.5em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
}

.data-availability h2 {
  font-size: 18px;
  margin: 0 0 0.5em;
}

.data-availability p {
  margin: 0;
  font-size: 15px;
}

/* References accordion */
.refs-panel {
  margin: 2em 0 0;
  border: 1px solid var(--border);
}

.refs-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--wiley-blue);
  color: #fff;
  border: none;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.refs-toggle .chevron {
  transition: transform 0.2s;
}

.refs-panel.open .refs-toggle .chevron {
  transform: rotate(180deg);
}

.refs-list {
  display: none;
  padding: 16px 20px 24px;
  background: #fff;
}

.refs-panel.open .refs-list {
  display: block;
}

.refs-list ol {
  margin: 0;
  padding-left: 1.5em;
}

.refs-list li {
  margin-bottom: 0.85em;
  font-size: 14px;
  line-height: 1.5;
  scroll-margin-top: 140px;
}

.refs-list li:target {
  background: #fff8e1;
  outline: 2px solid #ffe082;
  outline-offset: 4px;
}

/* ========== Sidebar ========== */
.sidebar {
  position: sticky;
  top: 80px;
  font-size: 13px;
}

.issue-card {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.cover-thumb {
  width: 72px;
  height: 96px;
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--journal-green-dark), var(--journal-green));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.issue-meta {
  font-size: 13px;
  line-height: 1.45;
  color: #333;
}

.issue-meta .vol {
  font-weight: 700;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.sidebar-tab svg {
  width: 20px;
  height: 20px;
}

.sidebar-tab.active {
  color: var(--wiley-link);
  border-bottom-color: var(--wiley-link);
  font-weight: 600;
}

.sidebar-tab:hover {
  color: var(--wiley-link);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.sidebar h3 {
  font-size: 15px;
  margin: 0 0 12px;
  font-weight: 700;
}

.related-item {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}

.related-item:last-child {
  border-bottom: none;
}

.related-item .rtitle {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  display: block;
  margin-bottom: 4px;
}

.related-item .rauthors {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.related-item .rjournal {
  font-size: 12px;
  color: #444;
  font-style: italic;
}

.author-list-side {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.author-list-side li {
  margin-bottom: 6px;
}

.author-list-side a {
  font-size: 14px;
}

.side-journal {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.figure-list-side a,
.ref-jump-side a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

.info-list {
  font-size: 13px;
  line-height: 1.55;
  color: #444;
}

.info-list dt {
  font-weight: 700;
  margin-top: 10px;
  color: #222;
}

.info-list dd {
  margin: 2px 0 0;
}

/* Modals / toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #222;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.25s;
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 150;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #fff;
  max-width: 480px;
  width: 100%;
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.modal h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.modal textarea {
  width: 100%;
  min-height: 100px;
  font-family: inherit;
  font-size: 13px;
  padding: 10px;
  border: 1px solid var(--border);
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-actions button {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  border-radius: 2px;
}

.modal-actions .primary {
  background: var(--wiley-blue);
  color: #fff;
  border-color: var(--wiley-blue);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  transition: opacity 0.3s;
}

.loading-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ddd;
  border-top-color: var(--wiley-link);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #f7f7f7;
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: #666;
}

/* Responsive */
@media (max-width: 960px) {
  .page-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sidebar {
    position: static;
    order: -1;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
  }

  .article-title {
    font-size: 24px;
  }

  .search-box {
    display: none;
  }
}

@media (max-width: 600px) {
  .site-header-inner,
  .journal-banner-inner,
  .page-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-toolbar {
    top: 56px;
  }

  .toolbar-btn span {
    display: none;
  }

  .article-title {
    font-size: 20px;
  }
}
