/* Preview JATS — gaya diselaraskan dengan Vitaliy-1/JATSParserPlugin (tanpa cover) */

:root {
  --jp-border: #ddd;
  --jp-text: #222;
  --jp-muted: #5c5c5c;
  --jp-active: #80bfff;
  --jp-accent: #927b24;
  --jp-link: #bd9f31;
  --jp-link-hover: #927b24;
  --jp-bg: #fff;
}

* {
  box-sizing: border-box;
}

body,
body.jp-galley-body {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--jp-text);
  background: #f7f7f7;
}

/* Upload bar */
.jp-topbar {
  background: #fff;
  border-bottom: 1px solid var(--jp-border);
  padding: 0.85rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.jp-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.jp-brand {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--jp-accent);
}

.jp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.jp-actions input[type="file"] {
  max-width: 16rem;
}

.jp-btn {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px;
  padding: 0.45rem 0.9rem;
  border-radius: 3px;
  border: 1px solid var(--jp-accent);
  background: var(--jp-accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.jp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.jp-btn.secondary {
  background: #fff;
  color: var(--jp-accent);
}

#status {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.8rem;
  color: var(--jp-muted);
  width: 100%;
}

#status.is-error {
  color: #b00020;
}

/* Upload panel */
#upload-panel {
  max-width: 720px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

#drop-zone {
  border: 2px dashed #bbb;
  border-radius: 8px;
  background: #fff;
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--jp-muted);
  transition: border-color 0.15s, background 0.15s;
}

#drop-zone.is-drag {
  border-color: var(--jp-accent);
  background: #faf6ee;
}

#drop-zone strong {
  color: var(--jp-text);
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

#file-label {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.upload-hints {
  margin-top: 1.25rem;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.85rem;
  color: var(--jp-muted);
  line-height: 1.5;
}

/* Preview layout — jatsParser__articleView */
.jatsParser__container {
  width: 100%;
  max-width: none;
  margin: 1.5rem 0 4rem;
  padding: 0;
  background: transparent;
  box-sizing: border-box;
}

/* Meta block (JATSParser-like + field grid) */
.jatsParser__meta {
  background: #fff;
  border: 1px solid var(--jp-border);
  border-radius: 4px;
  padding: 1.5rem 1.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.jp-journal-line {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.9rem;
  color: var(--jp-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.jp-muted {
  color: #9a9a9a;
  text-transform: none;
  letter-spacing: 0;
}

h1.jatsParser__meta-title {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  text-align: center;
  color: #111;
}

.jp-subtitle {
  text-align: center;
  color: var(--jp-muted);
  margin: 0 0 1rem;
}

.jatsParser__meta-authors {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  margin: 1rem 0 0.75rem;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.jatsParser__meta-authors li:not(:last-child):after {
  content: ", ";
}

.jatsParser__meta-author {
  font-weight: 700;
  font-size: 1.05rem;
}

.jp-corresp {
  color: #b00020;
}

.jatsParser__meta-orcidImage {
  font-size: 0.75rem;
  margin-left: 0.2rem;
  text-decoration: none;
  color: #a6ce39;
  font-weight: 650;
}

.jp-aff-list {
  margin: 0.5rem auto 1.25rem;
  max-width: 52rem;
  text-align: center;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.88rem;
  color: var(--jp-muted);
}

.jatsParser__details-author {
  margin-bottom: 0.65rem;
}

.jatsParser__details-author strong {
  color: #333;
}

.jatsParser__details-author-affiliation {
  color: #808287;
}

.jp-email a {
  color: #1a5f7a;
}

.jp-meta-grid {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.45rem 1rem;
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--jp-border);
  border-bottom: 1px solid var(--jp-border);
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.9rem;
}

.jp-meta-row {
  display: contents;
}

.jp-meta-grid dt {
  margin: 0;
  color: #808287;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  padding-top: 0.15rem;
}

.jp-meta-grid dd {
  margin: 0;
  color: #222;
  word-break: break-word;
}

.jatsParser__keywords-wrapper {
  margin: 1.25rem 0 0.5rem;
  background: #ddd;
  height: 2px;
  display: flow-root;
}

.jatsParser__keywords-row {
  display: flex;
  margin: -11px auto 0;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  background: #fff;
  width: fit-content;
  border: 2px solid #ddd;
  padding: 0.15rem 0.35rem;
}

.jatsParser__keyword {
  color: #808287;
  font-size: 0.78rem;
  text-transform: uppercase;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.jatsParser__keywords-row span:not(:last-child):after {
  content: "\25CF";
  padding: 0 0.35rem;
  color: #bbb;
}

.jp-abstract {
  margin-top: 1.5rem;
  scroll-margin-top: 5rem;
}

.jp-abstract h2 {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 1.25rem;
  margin: 0 0 0.65rem;
}

/* Debug panel */
.jp-debug {
  margin-top: 2.5rem;
  scroll-margin-top: 5rem;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.jp-debug details {
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fbfbfb;
}

.jp-debug summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 650;
  color: var(--jp-accent);
  list-style: none;
}

.jp-debug summary::-webkit-details-marker {
  display: none;
}

.jp-debug-body {
  padding: 0 1rem 1.25rem;
}

.jp-debug h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
}

.jp-debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.jp-debug-table th,
.jp-debug-table td {
  border: 1px solid #e2e2e2;
  padding: 0.35rem 0.5rem;
  vertical-align: top;
  text-align: left;
}

.jp-debug-table th {
  background: #eee;
}

.jp-debug-table code {
  font-size: 0.78rem;
}

.jatsParser__articleView {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  background: #fff;
  border: 1px solid var(--jp-border);
  border-radius: 4px;
  overflow: visible;
}

.jatsParser__left-article-block {
  flex: 0 0 25%;
  max-width: 25%;
  padding: 1.25rem 1rem;
  text-align: left;
}

.jatsParser__center-article-block {
  flex: 0 0 75%;
  max-width: 75%;
  padding: 1.5rem 2rem 2.5rem;
  min-width: 0;
}

@media (max-width: 991px) {
  .jatsParser__left-article-block,
  .jatsParser__center-article-block {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* TOC sticky — jatsParser__intraarticle-menu */
.jatsParser__intraarticle-menu {
  position: sticky;
  top: 4.5rem;
  border: 1px solid var(--jp-border);
  padding: 1rem 1.1rem;
  background: #fafafa;
  max-height: calc(100vh - 5.5rem);
  overflow-y: auto;
}

.jatsParser__intraarticle-menu > h3 {
  margin: 0 0 0.75rem;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 1rem;
  font-weight: 650;
  color: var(--jp-accent);
}

.jatsParser__navbar-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jatsParser__navbar-items li {
  margin: 0;
}

.jatsParser__navbar-items a {
  display: block;
  border-bottom: 0;
  text-decoration: none;
  color: #474747;
  padding: 5px 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.9rem;
  line-height: 1.35;
}

.jatsParser__navbar-items a:before {
  content: " ";
  height: 12px;
  width: 12px;
  display: inline-block;
  margin-right: 6px;
  border: 1px solid #5c5c5c;
  border-radius: 50%;
  vertical-align: middle;
}

.jatsParser__navbar-items a.active:before {
  background-color: var(--jp-active);
  border-color: var(--jp-active);
}

.jatsParser__navbar-items a:hover,
.jatsParser__navbar-items a.active {
  color: #111;
}

.jatsParser__subnavbar-items > a {
  padding-left: 1rem;
  font-size: 0.82rem;
}

/* Fulltext — pakai px/em (hindari rem root theme OJS ~10px) */
.jatsParser__article-fulltext {
  font-size: calc(17px * var(--jats-font-scale, 1));
}

.jatsParser__sec {
  margin: 0 0 1.5em;
  scroll-margin-top: 5em;
}

.article-section-title {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 700;
  font-size: 1.35em;
  color: #222;
  margin: 0 0 0.75em;
}

h3.article-section-title {
  font-size: 1.15em;
}

h4.article-section-title {
  font-size: 1.05em;
}

.jats-p {
  margin: 0 0 0.85rem;
  text-align: justify;
}

.jats-p.jats-align-left {
  text-align: left;
}
.jats-p.jats-align-center {
  text-align: center;
}
.jats-p.jats-align-right {
  text-align: right;
}

a.jats-xref,
.jatsParser__article-fulltext a {
  color: var(--jp-link);
  text-decoration: underline;
  cursor: pointer;
}

a.jats-xref:hover,
.jatsParser__article-fulltext a:hover {
  color: var(--jp-link-hover);
}

.jatsParser__table-wrap table {
  width: 100%;
}

.jp-brand {
  max-width: min(48rem, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#jp-status.is-error {
  color: #b00020;
}

/* Figures & tables — box-shadow ala plugin */
.jatsParser__fig,
.jatsParser__table-wrap {
  margin: 2rem 0;
  padding: 1.25rem 1.25rem 1rem;
  display: block;
  overflow: auto;
  box-shadow: 0 0 5px #ddd;
  background: #fff;
  scroll-margin-top: 5rem;
}

.jatsParser__fig img {
  display: block;
  width: 100%;
  height: auto;
}

.jatsParser__fig-placeholder {
  padding: 2rem;
  text-align: center;
  background: #f0f0f0;
  color: #666;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.caption,
.jatsParser__table-wrap .caption {
  padding-top: 0.75rem;
  padding-bottom: 0.35rem;
  color: #6c757d;
  text-align: left;
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.caption .label {
  font-weight: 700;
  color: #444;
}

.jatsParser__table-wrap table {
  border-collapse: collapse;
  font-size: 0.9rem;
  width: 100%;
  margin-top: 0.5rem;
}

.jatsParser__table-wrap tr {
  border-top: 1px solid #e7e7e7;
}

.jatsParser__table-wrap tbody,
.jatsParser__table-wrap thead {
  border: 1px solid #e7e7e7;
}

.jatsParser__table-wrap td,
.jatsParser__table-wrap th {
  padding: 4px 6px;
  border-right: 1px solid #e7e7e7;
  vertical-align: top;
}

.jatsParser__table-wrap th {
  background: #f5f5f5;
  font-weight: 650;
}

.jats-list {
  margin: 0 0 1rem 1.25rem;
}

.jatsParser__ref-list {
  padding-left: 1.25rem;
}

.jatsParser__ref-list li {
  margin-bottom: 0.65rem;
  scroll-margin-top: 5rem;
  font-size: 0.95rem;
}

.jatsParser__ref-list a {
  word-break: break-all;
}

sup,
sub {
  font-size: 0.75em;
  line-height: 0;
}

u {
  text-decoration: underline;
}

/* Reader font scale */
:root {
  --jats-font-scale: 1;
}

.jatsParser__article-fulltext,
.jp-abstract {
  font-size: calc(17px * var(--jats-font-scale, 1));
}

.jatsParser__fig img {
  cursor: zoom-in;
}

/* Collapsible article details */
.jp-meta-details {
  margin: 1rem 0 1.25rem;
  border-top: 1px solid var(--jp-border);
  border-bottom: 1px solid var(--jp-border);
}

.jp-meta-details__summary {
  cursor: pointer;
  list-style: none;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--jp-accent);
  padding: 0.7rem 0;
}

.jp-meta-details__summary::-webkit-details-marker {
  display: none;
}

.jp-meta-details[open] .jp-meta-details__summary {
  border-bottom: 1px solid #eee;
  margin-bottom: 0.35rem;
}

.jp-meta-details .jp-meta-grid {
  border: 0;
  margin: 0.35rem 0 0.75rem;
  padding: 0.35rem 0 0.75rem;
}

/* ---------- Xref hover preview (Figure / Table / Citation) ---------- */
.jats-xref--fig,
.jats-xref--table,
.jats-xref--bibr,
a.jats-xref.fig,
a.jats-xref.table,
a.jats-xref.bibr {
  cursor: pointer;
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
}

.jats-xref-preview {
  position: fixed;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  padding: 0.55rem;
  pointer-events: auto;
}

.jats-xref-preview.is-table {
  max-width: min(640px, calc(100vw - 24px));
}

.jats-xref-preview.is-cite {
  max-width: min(480px, calc(100vw - 24px));
}

.jats-xref-preview__media img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.jats-xref-preview__caption {
  margin-top: 0.4rem;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #555;
}

.jats-xref-preview__table {
  overflow: auto;
  max-width: 100%;
}

.jats-xref-preview__table .jatsParser__table-wrap,
.jats-xref-preview__table table {
  margin: 0;
  width: 100%;
  font-size: 0.72rem;
}

.jats-xref-preview__table img {
  max-width: 100%;
  height: auto;
}

.jats-xref-preview__cite {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #222;
}

/* Reference backlinks */
.jatsParser__ref-item {
  position: relative;
}

.jatsParser__ref-backlinks {
  margin-top: 0.35rem;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.72rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  align-items: center;
}

.jatsParser__ref-backlinks-label {
  color: #888;
}

.jatsParser__ref-backlink {
  color: #1a5f7a;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.jatsParser__ref-backlink:hover {
  color: #0d3a4a;
}

/* Search hits */
mark.jats-search-hit {
  background: #ffe08a;
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
}

mark.jats-search-hit.is-current {
  background: #ffb020;
  outline: 1px solid #c27b00;
}

/* Lightbox */
.jats-lightbox {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(10, 14, 22, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.jats-lightbox[hidden] {
  display: none !important;
}

.jats-lightbox__inner {
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: auto;
  text-align: center;
}

.jats-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  background: #fff;
  border-radius: 4px;
}

.jats-lightbox__caption {
  margin-top: 0.75rem;
  color: #e8eef7;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.85rem;
  line-height: 1.4;
}

.jats-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

body.jats-lightbox-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .jats-xref-preview {
    max-width: calc(100vw - 16px);
    max-height: 55vh;
    padding: 0.4rem;
  }

  .jatsParser__article-fulltext,
  .jp-abstract {
    font-size: calc(15px * var(--jats-font-scale, 1));
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  body,
  body.jp-galley-body {
    font-size: 15px;
    line-height: 1.55;
  }

  .jatsParser__meta {
    padding: 1rem 0.9rem 0.85rem;
    margin-bottom: 0.85rem;
  }

  h1.jatsParser__meta-title {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .jatsParser__meta-authors {
    font-size: 0.9rem;
  }

  .jatsParser__meta-author {
    font-size: 0.92rem;
  }

  .jp-aff-list {
    max-width: none;
    font-size: 0.78rem;
    text-align: left;
  }

  /* Meta grid: stack label di atas value (hindari 2 kolom sempit) */
  .jp-meta-grid {
    display: block;
    font-size: 0.78rem;
    margin: 0.65rem 0 0.85rem;
    padding: 0.35rem 0;
  }

  .jp-meta-row {
    display: block;
    padding: 0.4rem 0;
    border-bottom: 1px solid #ececec;
  }

  .jp-meta-row:last-child {
    border-bottom: 0;
  }

  .jp-meta-grid dt {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    padding: 0;
    margin: 0 0 0.12rem;
    line-height: 1.3;
  }

  .jp-meta-grid dd {
    display: block;
    font-size: 0.78rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .jp-meta-grid dd a {
    word-break: break-all;
  }

  .jatsParser__keyword {
    font-size: 0.68rem;
  }

  .jp-abstract h2 {
    font-size: 1.05rem;
  }

  .jatsParser__center-article-block {
    padding: 1rem 0.9rem 1.75rem;
  }

  .jatsParser__left-article-block {
    padding: 0.75rem 0.9rem;
  }

  .jatsParser__intraarticle-menu {
    position: static;
    max-height: none;
    padding: 0.75rem 0.85rem;
  }

  .jatsParser__intraarticle-menu > h3 {
    font-size: 0.88rem;
  }

  .jatsParser__navbar-items a {
    font-size: 0.8rem;
    padding: 4px 0;
  }

  .jatsParser__subnavbar-items > a {
    font-size: 0.74rem;
  }

  .jatsParser__article-fulltext,
  .jp-abstract {
    font-size: calc(15px * var(--jats-font-scale, 1));
  }

  .article-section-title {
    font-size: 1.15em;
  }

  h3.article-section-title {
    font-size: 1.05em;
  }

  h4.article-section-title {
    font-size: 1em;
  }

  .jats-p {
    text-align: left;
    margin-bottom: 0.7rem;
  }

  .jatsParser__ref-list {
    padding-left: 1rem;
  }

  .jatsParser__ref-list li {
    font-size: 0.82rem;
  }

  /* Tabel full-bleed scroll horizontal */
  .jatsParser__table-wrap,
  .table-wrap,
  .jats-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 0.78rem;
  }

  figure img,
  .jatsParser__fig img,
  .fig img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  body,
  body.jp-galley-body {
    font-size: 14px;
  }

  .jatsParser__article-fulltext,
  .jp-abstract {
    font-size: calc(14px * var(--jats-font-scale, 1));
  }

  h1.jatsParser__meta-title {
    font-size: 1.08rem;
  }

  .jp-meta-grid dd {
    font-size: 0.74rem;
  }

  .jp-meta-grid dt {
    font-size: 0.58rem;
  }
}
