/* Botão global para voltar ao início — identidade visual do Diário73. */

.d73dr-back-to-top {
  align-items: center !important;
  appearance: none;
  background: linear-gradient(145deg, #d0001b 0%, #b40016 56%, #79000f 100%) !important;
  border: 2px solid rgba(255, 255, 255, .88) !important;
  border-radius: 50% 50% 50% 16px !important;
  bottom: max(22px, env(safe-area-inset-bottom)) !important;
  box-shadow: 0 8px 22px rgba(121, 0, 15, .34), 0 2px 7px rgba(0, 0, 0, .2) !important;
  color: #fff !important;
  cursor: pointer;
  display: flex !important;
  height: 52px !important;
  justify-content: center !important;
  margin: 0 !important;
  min-height: 52px !important;
  min-width: 52px !important;
  opacity: 0;
  overflow: visible;
  padding: 0 !important;
  pointer-events: none;
  position: fixed !important;
  right: max(18px, env(safe-area-inset-right)) !important;
  transform: translateY(18px) scale(.88);
  transition: opacity .24s ease, transform .24s ease, visibility .24s ease, box-shadow .2s ease;
  visibility: hidden;
  width: 52px !important;
  z-index: 9998 !important;
}

.d73dr-back-to-top::before {
  border: 1px solid rgba(180, 0, 22, .22);
  border-radius: inherit;
  content: '';
  inset: -6px;
  opacity: 0;
  position: absolute;
  transform: scale(.84);
  transition: opacity .2s ease, transform .2s ease;
}

.d73dr-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.d73dr-back-to-top svg {
  display: block;
  fill: none;
  height: 25px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  transition: transform .2s ease;
  width: 25px;
}

.d73dr-back-to-top:hover,
.d73dr-back-to-top:focus-visible {
  background: linear-gradient(145deg, #e00020 0%, #b40016 55%, #68000d 100%) !important;
  box-shadow: 0 11px 28px rgba(121, 0, 15, .42), 0 3px 9px rgba(0, 0, 0, .24) !important;
  color: #fff !important;
  outline: none !important;
  transform: translateY(-3px) scale(1.04);
}

.d73dr-back-to-top:hover::before,
.d73dr-back-to-top:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.d73dr-back-to-top:hover svg,
.d73dr-back-to-top:focus-visible svg {
  transform: translateY(-2px);
}

.d73dr-back-to-top:active {
  transform: translateY(0) scale(.96);
}

@media (max-width: 620px) {
  .d73dr-back-to-top {
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    height: 48px !important;
    min-height: 48px !important;
    min-width: 48px !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    width: 48px !important;
  }

  .d73dr-back-to-top svg {
    height: 23px;
    width: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .d73dr-back-to-top,
  .d73dr-back-to-top::before,
  .d73dr-back-to-top svg {
    scroll-behavior: auto;
    transition-duration: .01ms !important;
  }
}
