/* Password-protected publication PDFs (paper-pdfs.js) */

/* The number badge becomes a button that fills the existing pill
   (now ~0.77x the original 14px badge: 1.5x, then two 20% cuts). */
.middle .job p.year-row rightdate.paper-badge {
  padding: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 13.44px;
}

.paper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5.76px;
  min-width: 62px;           /* same width with or without the lock, so rows stay aligned */
  padding: 5.76px 9.6px;
  border: 0;
  border-radius: inherit;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.paper-num .fa {
  font-size: 11.5px;
}

/* Numbers with a PDF: black gradient + lock (the lock is what marks them). */
.middle .job p.year-row rightdate.paper-badge--pdf {
  border-color: rgba(255, 255, 255, .3);
  background: linear-gradient(135deg, #3d3d3d 0%, #161616 50%, #000000 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .30),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}

.middle .job p.year-row:hover rightdate.paper-badge--pdf {
  box-shadow:
    0 14px 30px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .32);
}

/* Open-access numbers: dark green (sits well next to the black ones) + unlock icon. */
.middle .job p.year-row rightdate.paper-badge--open {
  border-color: rgba(255, 255, 255, .3);
  background: linear-gradient(135deg, #2f7d4f 0%, #14532d 50%, #04210f 100%);
  box-shadow:
    0 10px 24px rgba(4, 33, 15, .30),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}

.middle .job p.year-row:hover rightdate.paper-badge--open {
  box-shadow:
    0 14px 30px rgba(4, 33, 15, .42),
    inset 0 1px 0 rgba(255, 255, 255, .32);
}

.paper-num {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.paper-num--pdf:hover,
.paper-num--pdf:focus-visible,
.paper-num--open:hover,
.paper-num--open:focus-visible {
  background: rgba(255, 255, 255, .16);
}

.paper-num:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.paper-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin: 0 0 16px;
  color: #333;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
}

.paper-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.paper-legend__swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
}

.paper-legend__swatch--pdf {
  background: linear-gradient(135deg, #3d3d3d 0%, #161616 50%, #000000 100%);
}

.paper-legend__swatch--open {
  background: linear-gradient(135deg, #2f7d4f 0%, #14532d 50%, #04210f 100%);
}

/* Narrow windows: a bit smaller still, so the badge does not widen the page. */
@media (max-width: 800px) {
  .middle .job p.year-row rightdate.paper-badge {
    font-size: 10.9px;
  }
  .paper-num {
    gap: 4.5px;
    min-width: 49px;
    padding: 4.5px 7px;
  }
  .paper-num .fa {
    font-size: 9.6px;
  }
}

/* Dialog: same look as the QR-code dialog. */
body.paper-modal-open {
  overflow: hidden;
}

.paper-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 15, 34, .7);
}

.paper-modal[hidden],
.paper-modal [hidden] {
  display: none !important;
}

.paper-modal__panel {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 420px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 14px;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  background: #fff;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .35);
}

.paper-modal__panel h3 {
  margin: 0 34px 6px;
  font-size: 20px;
  color: #2a1e5c;
}

.paper-modal__panel p {
  margin: 0 0 16px;
  color: #555;
  font-size: 14px;
  line-height: 1.45;
}

.paper-modal__panel .paper-modal__paper {
  font-style: italic;
  color: #333;
}

.paper-modal__form label {
  display: block;
  margin-bottom: 10px;
  color: #555;
  font-size: 14px;
}

.paper-modal__form input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9c4dc;
  border-radius: 7px;
  font: inherit;
  font-size: 16px;           /* 16px stops iOS from zooming in */
}

.paper-modal__form input:focus {
  outline: 2px solid #5f4bb6;
  outline-offset: 1px;
}

.paper-modal__panel .paper-modal__error {
  min-height: 1.4em;
  margin: 8px 0 12px;
  color: #b3261e;
  font-size: 13px;
}

.paper-modal__primary {
  display: inline-block;
  padding: 9px 18px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  background: #5f4bb6;
  cursor: pointer;
}

.paper-modal__primary:disabled {
  opacity: .65;
  cursor: progress;
}

.paper-modal__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.paper-modal__download {
  color: #5f4bb6;
  font-weight: 600;
}

.paper-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  padding: 2px 9px;
  color: #2a1e5c;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  background: transparent;
}
