/* PDF Preview Embed — front-end viewer.
   Override the accent colour from your theme with, e.g.:
   .starttrain-pdf-embed { --rpe-accent: #2563eb; --rpe-accent-dark: #1d4ed8; } */
.starttrain-pdf-embed {
  --rpe-accent: #0b7a3e;
  --rpe-accent-dark: #09642f;
  margin: 2rem 0;
  padding: 0;
}

.starttrain-pdf-embed__title {
  display: block;
  margin: 0 0 0.75rem;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.starttrain-pdf-embed__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #dfe4e2;
  border-radius: 0.75rem;
  background: #f4f6f5;
}

.starttrain-pdf-embed__scroll {
  height: var(--starttrain-pdf-height, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.starttrain-pdf-embed__iframe {
  display: block;
  width: 100%;
  height: var(--starttrain-pdf-height, 560px);
  border: 0;
  background: #fff;
}

.starttrain-pdf-embed__scroll:focus-visible {
  outline: 3px solid rgb(37 99 235 / 0.35);
  outline-offset: -3px;
}

.starttrain-pdf-embed__pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 0.75rem 4.5rem;
}

.starttrain-pdf-embed__page {
  width: 100%;
  max-width: 46rem;
  border: 1px solid #e2e6e4;
  border-radius: 0.25rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 40 30 / 0.08);
}

.starttrain-pdf-embed__page canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.starttrain-pdf-embed__more {
  display: inline-flex !important;
  margin-top: 0.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid #dfe4e2;
  border-radius: 999px;
  background: #fff;
  color: var(--rpe-accent, #0b7a3e) !important;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none !important;
}

.starttrain-pdf-embed__status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: #526c60;
  font-size: 0.8125rem;
  text-align: center;
  background: #f4f6f5;
}

.starttrain-pdf-embed__status--error {
  color: #8a1f11;
}

.starttrain-pdf-embed__spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 3px solid #cfe0d7;
  border-top-color: var(--rpe-accent, #0b7a3e);
  border-radius: 50%;
  animation: starttrain-pdf-spin 0.7s linear infinite;
}

@keyframes starttrain-pdf-spin {
  to { transform: rotate(360deg); }
}

.starttrain-pdf-embed__expand {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  display: inline-flex !important;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe4e2;
  border-radius: 0.5rem;
  color: #46524d !important;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(4px);
  text-decoration: none !important;
  transition: background-color 160ms ease, color 160ms ease;
}

.starttrain-pdf-embed__expand:hover {
  color: var(--rpe-accent, #0b7a3e) !important;
  background: #fff;
}

.starttrain-pdf-embed__expand svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.starttrain-pdf-embed__toolbar {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 999px;
  color: #f4f7f5;
  background: rgb(28 38 33 / 0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px -4px rgb(15 40 30 / 0.35);
  transform: translateX(-50%);
  font-size: 0.8125rem;
}

.starttrain-pdf-embed__pager {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.5rem 0 0.65rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.starttrain-pdf-embed__page-current {
  min-width: 1.5rem;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  background: rgb(255 255 255 / 0.16);
  text-align: center;
  font-weight: 700;
}

.starttrain-pdf-embed__zoom {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding-left: 0.4rem;
  border-left: 1px solid rgb(255 255 255 / 0.18);
}

.starttrain-pdf-embed__zoom-btn {
  display: inline-flex;
  width: 1.9rem;
  height: 1.9rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.starttrain-pdf-embed__zoom-btn:hover {
  background: rgb(255 255 255 / 0.16);
}

.starttrain-pdf-embed__zoom-btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.starttrain-pdf-embed__zoom-level {
  min-width: 2.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.starttrain-pdf-embed__noscript,
.starttrain-pdf-embed__notice {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid #e8c56c;
  border-radius: 0.5rem;
  color: #6f5312;
  background: #fff8df;
  font-size: 0.8125rem;
}

.starttrain-pdf-embed__actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.starttrain-pdf-embed__download {
  display: inline-flex !important;
  min-height: 2.875rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  color: #fff !important;
  background: var(--rpe-accent, #0b7a3e) !important;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  transition: background-color 160ms ease;
}

.starttrain-pdf-embed__download:hover {
  color: #fff !important;
  background: var(--rpe-accent-dark, #09642f) !important;
  text-decoration: none !important;
}

.starttrain-pdf-embed__download:focus-visible {
  outline: 3px solid rgb(37 99 235 / 0.3);
  outline-offset: 3px;
}

.starttrain-pdf-embed--link-only {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin: 1.5rem 0;
}

.starttrain-pdf-embed__title--inline {
  font-weight: 600;
  color: #1f2933;
  font-size: 0.9375rem;
}

.starttrain-pdf-embed__download svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 47.9375rem) {
  .starttrain-pdf-embed__pages {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .starttrain-pdf-embed__download {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .starttrain-pdf-embed__scroll {
    scroll-behavior: auto;
  }

  .starttrain-pdf-embed__spinner {
    animation-duration: 1.4s;
  }

  .starttrain-pdf-embed__expand,
  .starttrain-pdf-embed__download {
    transition: none;
  }
}
