/* Accessibility helpers shared by every page. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background-color: var(--ctp-mauve);
  color: var(--ctp-base);
  font-weight: 700;
  border-radius: 0 0 0.5rem 0.5rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

#main-content:focus {
  outline: none;
}

/* Some components remove the default outline for their own hover or focus
   style; keyboard users must always see where focus is. */
:focus-visible {
  outline: 2px solid var(--ctp-mauve) !important;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Links inside running text must not rely on color alone. */
p a,
li a,
.inventory-hint a,
.optimizer-hint a {
  text-decoration: underline;
}

/* Target size (WCAG 2.2 AA): standalone links and small controls are at least
   24px tall, and 44px on touch screens. Links inside running text are exempt. */
.footer-links a,
.view-all-btn,
.plan-actions a,
.inventory-data-links a,
.auth-links a,
.manual-back-link,
.legal-back a,
.edit-link,
.delete-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.auth-checkbox {
  width: 24px;
  height: 24px;
}

@media (pointer: coarse) {
  .footer-links a,
  .view-all-btn,
  .plan-actions a,
  .inventory-data-links a,
  .auth-links a,
  .manual-back-link,
  .legal-back a,
  .edit-link,
  .delete-link {
    min-height: 44px;
    padding-inline: 0.5rem;
  }

  .plan-move {
    width: 2.75rem;
    height: 2.75rem;
  }

  .inventory-data-links {
    gap: 0.25rem 0.75rem;
  }
}
