/* NousRoyalistes V2.10.4 — back-to-top control and definitive top-edge correction. */
/* Safari may expose the root canvas during elastic scrolling or first paint.
   Paint that canvas like the header and neutralise any inherited top edge. */
html {
  margin: 0;
  padding: 0;
  border: 0;
  background: #071c2b;
}

body {
  margin-top: 0 !important;
  border-top: 0 !important;
}

body::before {
  content: none !important;
  display: none !important;
}

/* Remove every legacy viewport-edge track, including cached article markup. */
.reading-progress,
.nr17-site-progress {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.nr-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  z-index: 9995;
  display: inline-grid;
  grid-template-columns: 32px auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin: 0;
  padding: 7px 16px 7px 8px;
  border: 1px solid rgba(214, 182, 111, .42);
  border-radius: 16px 2px 16px 2px;
  background:
    linear-gradient(115deg, rgba(214, 182, 111, .08), transparent 42%),
    rgba(3, 21, 37, .91);
  color: #f5f0e6;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .035);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
  font: 620 10px/1 var(--sans, Inter, Arial, sans-serif);
  letter-spacing: .075em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 12px, 0);
  pointer-events: none;
  transition:
    opacity .28s ease,
    visibility 0s linear .28s,
    transform .36s var(--ease, cubic-bezier(.2, .75, .25, 1)),
    border-color .24s ease,
    background-color .24s ease,
    box-shadow .24s ease;
}

.nr-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  transition-delay: 0s;
}

.nr-to-top-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(214, 182, 111, .4);
  border-radius: 11px 2px 11px 2px;
  background: rgba(214, 182, 111, .055);
  color: #d4b66f;
  transition: transform .28s var(--ease, cubic-bezier(.2, .75, .25, 1));
}

.nr-to-top-icon::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(45deg);
}

@media (hover: hover) and (pointer: fine) {
  .nr-to-top:hover {
    border-color: rgba(214, 182, 111, .72);
    background:
      linear-gradient(115deg, rgba(214, 182, 111, .13), transparent 46%),
      rgba(3, 21, 37, .97);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
    transform: translate3d(0, -3px, 0);
  }

  .nr-to-top:hover .nr-to-top-icon {
    transform: translateY(-2px);
    border-color: rgba(214, 182, 111, .68);
  }
}

.nr-to-top:focus-visible {
  outline: 2px solid #d4b66f;
  outline-offset: 4px;
}

body.nav-open .nr-to-top,
body.dialog-open .nr-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 520px) {
  .nr-to-top {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    grid-template-columns: 32px;
    gap: 0;
    width: 48px;
    min-width: 48px;
    padding: 7px;
  }

  .nr-to-top > span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nr-to-top,
  .nr-to-top-icon {
    transition: none;
  }
}

@media print {
  .nr-to-top {
    display: none !important;
  }
}
