/* ==========================================================================
   Article Detail View Stylesheet — FJMRI Journal
   Refined to Modern Scholarly Capsule Design System
   ========================================================================== */

/* ── Scholarly Hero Banner ── */
.article-hero {
  position: relative;
  background: linear-gradient(135deg, #091e2f 0%, #0f354c 45%, #164e63 100%);
  background-image:
    radial-gradient(circle at 85% 15%, rgba(68, 161, 164, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 15% 85%, rgba(15, 118, 110, 0.2) 0%, transparent 45%),
    linear-gradient(135deg, #091e2f 0%, #0f354c 45%, #164e63 100%);
  color: #ffffff;
  padding: 44px 0 38px 0;
  border-bottom: 1.5px solid rgba(94, 234, 212, 0.2);
  box-shadow: 0 4px 24px rgba(9, 30, 47, 0.25);
}

/* Scholarly Breadcrumb Bar */
.article-breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.article-breadcrumb-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-breadcrumb-nav a:hover {
  color: #5eead4;
  transform: translateY(-1px);
}

.article-breadcrumb-sep {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.95rem;
  user-select: none;
}

.article-breadcrumb-current {
  color: #5eead4;
  font-weight: 600;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Article Hero Badges */
.article-hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge-category-glow {
  background: rgba(68, 161, 164, 0.25);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.45);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}

.badge-oa-gold {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.4);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-peer-reviewed {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
}

.article-issue-location {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
  margin-left: auto;
  font-weight: 500;
}

/* Article Title */
.article-title-h1 {
  font-size: clamp(1.85rem, 3.3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.28;
  color: #ffffff;
  margin: 0 0 20px 0;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* Authors Wrap */
.article-authors-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.author-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(94, 234, 212, 0.5);
  transform: translateY(-1px);
}

.author-orcid-link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.author-orcid-link:hover {
  opacity: 0.8;
}

.affiliations-list {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
  margin-bottom: 24px;
}

/* Hero Quick Actions Bar */
.hero-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-hero-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  border: 1.5px solid rgba(110, 231, 183, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-hero-download:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

.btn-hero-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(68, 161, 164, 0.25);
  color: #5eead4 !important;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none !important;
  border: 1.5px solid rgba(94, 234, 212, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-hero-preview:hover {
  background: rgba(68, 161, 164, 0.4);
  color: #ffffff !important;
  border-color: #5eead4;
  transform: translateY(-2px);
}

.btn-hero-xml {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc !important;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none !important;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-hero-xml:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff !important;
  transform: translateY(-2px);
}

.btn-hero-doi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 132, 199, 0.2);
  color: #7dd3fc !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none !important;
  border: 1.5px solid rgba(125, 211, 252, 0.35);
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-hero-doi:hover {
  background: rgba(2, 132, 199, 0.35);
  color: #ffffff !important;
  border-color: #7dd3fc;
}

/* ── Interactive PDF Viewer Section ── */
.pdf-viewer-section {
  background: #ffffff;
  border: 1.5px solid rgba(68, 161, 164, 0.25);
  border-radius: 16px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(34, 66, 72, 0.06);
  overflow: hidden;
}

.pdf-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  background: #f8fafc;
  border-bottom: 1.5px solid var(--line);
}

.pdf-viewer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--deep);
  margin: 0;
}

.pdf-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-frame-container {
  width: 100%;
  height: 780px;
  position: relative;
  background: #525659;
}

.pdf-frame-container iframe,
.pdf-frame-container object {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .pdf-frame-container {
    height: 520px;
  }
}

/* Two-Panel Layout */
.article-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: flex-start;
  padding: 40px 0 72px 0;
}

.article-main-stream {
  min-width: 0;
}

.article-section-card {
  background: var(--panel, #ffffff);
  border: 1.5px solid rgba(68, 161, 164, 0.25);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(34, 66, 72, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.article-section-card:hover {
  border-color: var(--teal);
  box-shadow: 0 8px 24px rgba(68, 161, 164, 0.1);
}

.article-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--deep);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2.5px solid var(--teal);
  padding-bottom: 8px;
}

.article-abstract-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  text-align: justify;
  margin: 0;
}

.article-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.keyword-tag {
  background: var(--teal-soft);
  color: var(--deep);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(68, 161, 164, 0.28);
  transition: all 0.15s ease;
}

.keyword-tag:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* Citation Box UI */
.citation-container {
  margin-top: 8px;
}

.citation-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.citation-tab-btn {
  background: #ffffff;
  border: 1.5px solid var(--line);
  padding: 6px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 9999px;
  transition: all 0.18s ease;
}

.citation-tab-btn:hover {
  color: var(--teal);
  border-color: var(--teal);
}

.citation-tab-btn.active {
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(68, 161, 164, 0.32);
}

.citation-pane {
  display: none;
  position: relative;
  background: #f8fafc;
  border: 1.5px solid rgba(68, 161, 164, 0.25);
  border-radius: 12px;
  padding: 18px;
}

.citation-pane.active {
  display: block;
}

.citation-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 14px 0;
}

.citation-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  border-radius: 9999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.citation-copy-btn:hover {
  background: var(--teal);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(68, 161, 164, 0.25);
}

/* Sidebar Styles */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 90px;
}

.sidebar-card {
  background: var(--panel, #ffffff);
  border: 1.5px solid rgba(68, 161, 164, 0.25);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(34, 66, 72, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.sidebar-card:hover {
  border-color: var(--teal);
  box-shadow: 0 8px 24px rgba(68, 161, 164, 0.1);
}

.sidebar-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--deep);
  margin: 0 0 14px 0;
  border-bottom: 2px solid var(--teal-soft);
  padding-bottom: 8px;
}

.sidebar-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(68, 161, 164, 0.18);
}

.sidebar-info-row:last-child {
  border-bottom: none;
}

.sidebar-info-label {
  color: var(--muted);
  font-weight: 500;
}

.sidebar-info-val {
  color: var(--deep);
  font-weight: 600;
  text-align: right;
}

.pdf-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 9999px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(255, 154, 0, 0.28);
}

.pdf-download-btn:hover {
  background: var(--accent-deep);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 154, 0, 0.38);
}

.pdf-gated-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #bbf7d0;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 9999px;
  text-decoration: none;
  text-align: center;
  transition: all 0.18s ease;
}

.pdf-gated-btn:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

/* Mobile promotion of download card */
.mobile-download-prompt {
  display: none;
}

@media (max-width: 1024px) {
  .article-detail-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .article-sidebar {
    position: static;
  }
  .mobile-download-prompt {
    display: block;
    margin-bottom: 24px;
  }
  .desktop-download-card {
    display: none;
  }
  .article-title-h1 {
    font-size: 1.7rem;
  }
}
