/* ============================================================
   zenodo-read.css  —  Zenodo-style dataset view sidebar
   ============================================================ */

/* ── Sidebar container ── */
.zenodo-read-sidebar {
  background: #fff;
  border: 1px solid #dce0e5;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  margin-bottom: 20px;
  overflow: hidden;
}

/* ── Badges row (top area) ── */
.zrs-badges {
  padding: 12px 14px;
  background: #f6f8fa;
  border-bottom: 1px solid #dce0e5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── Resource type badges ── */
.zrs-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
}
.zrs-type-badge.type-dataset       { background: #1a7abf; }
.zrs-type-badge.type-publication   { background: #3e3e8f; }
.zrs-type-badge.type-software      { background: #2a7a2a; }
.zrs-type-badge.type-image         { background: #8a6a1a; }
.zrs-type-badge.type-video         { background: #6a1a8a; }
.zrs-type-badge.type-presentation  { background: #1a6a8a; }
.zrs-type-badge.type-poster        { background: #8a3a1a; }
.zrs-type-badge.type-model         { background: #4a6a2a; }
.zrs-type-badge.type-workflow      { background: #1a4a8a; }
.zrs-type-badge.type-lesson        { background: #6a4a2a; }
.zrs-type-badge.type-physicalobject{ background: #4a4a6a; }
.zrs-type-badge.type-other         { background: #666;    }

/* ── Subtype badge ── */
.zrs-subtype-badge {
  display: inline-block;
  padding: 3px 8px;
  background: #e5e8ec;
  border-radius: 3px;
  font-size: 11px;
  color: #555;
  font-weight: 500;
}

/* ── Open Access badge ── */
.zrs-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}
.zrs-access-badge.open {
  background: #1d8348;
  color: #fff;
}

/* ── Individual section ── */
.zrs-section {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f4;
}
.zrs-section:last-child {
  border-bottom: none;
}

/* ── Section label (uppercase, gray) ── */
.zrs-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8a9099;
  margin-bottom: 5px;
}

/* ── Section value ── */
.zrs-value {
  color: #222;
  line-height: 1.5;
}
.zrs-muted {
  color: #9aa0a8;
  font-style: italic;
}

/* ── DOI box ── */
.zrs-doi-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f4f6f8;
  border: 1px solid #dce0e5;
  border-radius: 4px;
  padding: 8px 10px;
}
.zrs-doi-link {
  flex: 1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: #1a7abf;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.4;
}
.zrs-doi-link:hover { text-decoration: underline; }
.zrs-doi-prefix {
  color: #8a9099;
  font-size: 11px;
}
.zrs-copy-btn {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #cdd3da;
  border-radius: 3px;
  color: #555;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}
.zrs-copy-btn:hover {
  background: #e8edf2;
  border-color: #8a9099;
  color: #222;
}
.zrs-copy-btn.copied {
  color: #1d8348;
  border-color: #1d8348;
  background: #eafaf1;
}

/* ── License badge ── */
.zrs-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.zrs-license-badge.cc-open       { background: #d4edda; color: #155724; border: 1px solid #b9dfbe; }
.zrs-license-badge.cc-restricted { background: #fff3cd; color: #7a5800; border: 1px solid #ffe9a0; }
.zrs-license-badge.oss           { background: #cce5ff; color: #00366e; border: 1px solid #9ecfff; }
.zrs-license-badge.closed        { background: #f8d7da; color: #6b1018; border: 1px solid #f5b8bc; }
.zrs-license-badge.other         { background: #e8edf2; color: #444; border: 1px solid #cdd3da; }
.zrs-license-badge:hover         { opacity: 0.82; text-decoration: none; }
a.zrs-license-badge:hover        { text-decoration: none; }

/* ── Version badge ── */
.zrs-version-badge {
  display: inline-block;
  padding: 2px 9px;
  background: #e8f0fe;
  border: 1px solid #a8c4fb;
  border-radius: 3px;
  color: #1a56b0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

/* ── Person rows ── */
.zrs-person {
  color: #222;
  font-weight: 500;
  font-size: 13px;
}
.zrs-person-role {
  font-size: 11px;
  color: #8a9099;
  font-style: italic;
}
.zrs-person-affiliation {
  font-size: 11px;
  color: #666;
}
.zrs-person-email {
  font-size: 12px;
  margin-top: 2px;
}
.zrs-person-email a {
  color: #1a7abf;
}

/* ── Contributors list ── */
.zrs-contributors-list {
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
}
.zrs-contributors-list li {
  padding: 5px 0;
  border-top: 1px solid #f0f2f4;
}

/* ── Related works list ── */
.zrs-works-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zrs-works-list li {
  padding: 5px 0;
  border-bottom: 1px solid #f0f2f4;
  font-size: 12px;
  line-height: 1.4;
}
.zrs-works-list li:last-child { border-bottom: none; }

.zrs-relation-label {
  display: inline-block;
  padding: 1px 5px;
  background: #e8edf2;
  border-radius: 2px;
  font-size: 10px;
  color: #555;
  margin-right: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Funding list ── */
.zrs-funding-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zrs-funding-list li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f4;
}
.zrs-funding-list li:last-child { border-bottom: none; }
.zrs-funder-name {
  font-weight: 600;
  font-size: 13px;
  color: #222;
}
.zrs-award-info {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

/* ── Additional dates list ── */
.zrs-dates-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zrs-dates-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f2f4;
  font-size: 12px;
  line-height: 1.4;
}
.zrs-dates-list li:last-child { border-bottom: none; }
.zrs-date-type {
  flex-shrink: 0;
  padding: 1px 6px;
  background: #e8f0fe;
  border-radius: 2px;
  font-size: 10px;
  color: #1a56b0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Copyright ── */
.zrs-copyright {
  font-size: 12px;
  color: #555;
  font-style: italic;
  line-height: 1.5;
}

/* ── Link ── */
.zrs-link {
  color: #1a7abf;
  text-decoration: none;
  word-break: break-all;
}
.zrs-link:hover { text-decoration: underline; }

/* ── Footer dates (Uploaded / Last Modified) ── */
.zrs-dates-footer {
  background: #f6f8fa;
  border-top: 1px solid #dce0e5 !important;
  border-bottom: none !important;
  border-radius: 0 0 4px 4px;
}
.zrs-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}
.zrs-label-inline {
  font-weight: 600;
  color: #8a9099;
  font-size: 11px;
}
.zrs-value-inline {
  color: #555;
  font-size: 12px;
}

/* ── Make CKAN's default info_block invisible (replaced by our panel) ── */
.module-info {
  display: none !important;
}

/* ============================================================
   PRIMARY CONTENT CONTEXT  (.zenodo-info-primary wrapper)
   The panel sits inside the wide main content column, so we
   use a 2-column flex grid instead of a single stacked list.
   ============================================================ */

.zenodo-info-primary {
  margin-top: 24px;
}

/* Heading above the panel */
.zenodo-info-primary-heading {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a9099;
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid #dce0e5;
}

/* Make the sidebar a flex container so sections tile side-by-side */
.zenodo-info-primary .zenodo-read-sidebar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Badges row always spans full width */
.zenodo-info-primary .zrs-badges {
  flex: 0 0 100%;
  order: -1;
}

/* Default: each section takes 50% (2 columns) */
.zenodo-info-primary .zrs-section {
  flex: 0 0 50%;
  box-sizing: border-box;
  border-bottom: 1px solid #f0f2f4;
  border-right: 1px solid #f0f2f4;
  min-width: 180px;
}

/* Even sections (right column) lose the right border */
.zenodo-info-primary .zrs-section:nth-of-type(even) {
  border-right: none;
}

/* Full-width sections (DOI, creators list, related works, etc.) */
.zenodo-info-primary .zrs-section.zrs-full {
  flex: 0 0 100%;
  border-right: none;
}

/* Footer always full width */
.zenodo-info-primary .zrs-dates-footer {
  flex: 0 0 100%;
  border-right: none;
  border-bottom: none;
}

/* Responsive: stack to 1 column on small screens */
@media (max-width: 600px) {
  .zenodo-info-primary .zrs-section {
    flex: 0 0 100%;
    border-right: none;
  }
}

/* ── Responsive: stack on small screens (sidebar context) ── */
@media (max-width: 767px) {
  .zenodo-read-sidebar {
    margin-top: 20px;
  }
}
