/* --------------------------------------------------------------------------
Links & Typography Refinements (Phase 3)
-------------------------------------------------------------------------- */

/* Base link styling */
a {
  position: relative;
}

/* Content links with elegant underline */
.entry-content a,
.page-content a,
.comment-content a {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Prevent underline on links with no text content (images, buttons) */
a:has(> img) {
  text-decoration: none;
}

a:has(> .button),
a.button {
  text-decoration: none;
}

/* Navigation links (breadcrumbs, menus) */
.breadcrumbs a,
.main-navigation a,
.footer-menu a {
  text-decoration: none;
}

.breadcrumbs a:hover,
.main-navigation a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Subtle focus-visible outline */
a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-button-text);
  padding: 0.75rem 1rem;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 6px 0;
}

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

/* Transitions for all interactive elements */
button,
a:not(.no-transition),
input[type="button"],
input[type="submit"],
input[type="reset"],
.button {
  transition: all 0.2s ease;
}

/* Focus states for form controls */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Disabled state */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading state animation */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.loading,
[aria-busy="true"] {
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Tooltip styling (if using title attribute) */
[title]:not([title=""]) {
  position: relative;
  cursor: help;
  text-decoration: underline dotted;
  text-decoration-color: var(--color-text-muted);
  text-underline-offset: 4px;
}

/* External links indicator */
a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
}

/* Document links indicator */
a[href$=".pdf"]::after {
  content: " PDF";
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: 0.25em;
}

/* Mobile-friendly link tap targets */
@media (hover: none) and (pointer: coarse) {
  button,
  .button,
  a[role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="reset"] {
    min-height: 44px;
    min-width: 44px;
    padding: 0.875rem 1rem;
  }
}
