/* ============================================================
   COMPONENTS.CSS — Header, Buttons, Links, Volume, Timeline,
                    Paper View, Author, Contact, Back-to-Top
   Passberg.org Research Domain System
   ============================================================ */

/* ============================
   HEADER
   ============================ */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
}


#logo {
  height: 38px;
  width: auto;
  display: flex;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  color: var(--text);
}

nav a:hover {
  color: var(--accent);
}

nav a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ============================
   THEME TOGGLE
   ============================ */

#theme-toggle {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  line-height: 1.6;
}

#theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

#theme-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ============================
   PRIMARY BUTTON (Landing CTA)
   ============================ */

.primary-button {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.55rem 1.5rem;
  margin-top: 0.5rem;
}

.primary-button:hover {
  background-color: var(--accent);
  color: var(--bg);
}

.primary-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ============================
   ACTION LINKS (View / Download)
   ============================ */

.action-link {
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.action-link:hover {
  text-decoration: underline;
}

.action-link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ============================
   EXTERNAL LINKS (Author / Contact)
   ============================ */

.external-link {
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--accent);
}

.external-link:hover {
  text-decoration: underline;
}

/* ============================
   VOLUME BLOCK (Research page)
   ============================ */

.volume {
  border-top: 1px solid var(--border);
  padding-top: 2.25rem;
  padding-bottom: 2.25rem;
}

.volume:last-child {
  border-bottom: 1px solid var(--border);
}

.volume h2 {
  margin-bottom: 0.55rem;
}

.volume h3 {
  margin-bottom: 0.4rem;
}

.volume>p {
  margin-bottom: 1.1rem;
}

.volume-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ============================
   TIMELINE ENTRY
   ============================ */

.timeline-entry {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}

.timeline-entry:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline-entry .timeline-year {
  display: block;
  margin-bottom: 0.2rem;
}

.timeline-entry p {
  font-size: 0.82rem;
}

/* Terminal entry: PSTA */
.timeline-entry.terminal .timeline-year {
  color: var(--accent);
}

.timeline-entry.terminal p {
  color: var(--text-secondary);
}

/* ============================
   PAPER VIEW
   ============================ */

.paper-meta {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.paper-meta h1 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.paper-meta .abstract {
  margin-bottom: 0.75rem;
}

.paper-meta .doi {
  display: block;
}

.pdf-embed {
  display: block;
  width: 100%;
  height: 76vh;
  border: 1px solid var(--border);
  background-color: var(--bg);
  margin-bottom: 1.75rem;
}

/* Inline PDF.js canvas renderer */
.pdf-container {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 76vh;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  background-color: var(--bg);
  margin-top: 0.25rem;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

/* Zoom target — transform is applied here only, rendering never repeats */
.pdf-zoom-layer {
  display: block;
  transform-origin: top center;
}

.pdf-page {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
  line-height: 0;
  /* prevent inline gap below canvas */
}

.pdf-page+.pdf-page {
  border-top: 1px solid var(--border);
}

.pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.pdf-loading {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-primary);
}

/* ============================
   PDF ACTIONS ROW (zoom + download)
   ============================ */

.pdf-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.pdf-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pdf-zoom-btn {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}

.pdf-zoom-btn:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

.pdf-zoom-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.download-button {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.45rem 1.25rem;
}

.download-button:hover {
  background-color: var(--accent);
  color: var(--bg);
}

.download-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ============================
   AUTHOR BLOCK
   ============================ */

.author-block {
  max-width: 560px;
}

.author-block p {
  line-height: 1.85;
}

.author-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

/* ============================
   CONTACT BLOCK
   ============================ */

.contact-block {
  display: inline-block;
  width: fit-content;
  align-self: flex-start;
}

/* ============================
   BACK BUTTON
   ============================ */

.back-button {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.back-button:hover {
  text-decoration: underline;
  color: var(--text);
}

.back-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ============================
   BACK TO TOP
   ============================ */

#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  margin-left: 370px;
  width: 34px;
  height: 34px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: var(--font-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
}

#back-to-top.visible {
  opacity: 0.55;
  visibility: visible;
}

#back-to-top:hover {
  opacity: 1;
  color: var(--text);
  border-color: var(--text-secondary);
}

#back-to-top:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ============================
   RESPONSIVE ADJUSTMENTS
   ============================ */

@media (max-width: 820px) {
  #back-to-top {
    left: auto;
    right: 1.75rem;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  nav {
    gap: 1.25rem;
  }

  nav a {
    font-size: 0.65rem;
  }

  .pdf-embed {
    height: 60vh;
  }
}


.home-button {
  display: none;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

@media (max-width: 768px) and (orientation: portrait) {

  .home-button {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.6;
    letter-spacing: 0.05em;
  }
}

.doi a {
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
}

.doi a:hover {
  opacity: 1;
}

.footer {
  margin-top: 4rem;
  padding-top: 4rem;
  padding-bottom: 3rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
}

.footer-title {
  font-size: 0.7rem;
  color: var(--text);
  opacity: 0.55;
}

.footer-subtitle {
  font-size: 0.6rem;
  color: var(--text);
  opacity: 0.35;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .pdf-container {
    max-height: 50vh;
    overflow-x: hidden;
  }
}