/* ==================================================
   1. SHARED BUTTON FOUNDATION
   Navbar links + explicitly marked homepage links
   ================================================== */

:is(#quarto-header .navbar-nav .nav-link, .home .action-link) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  box-sizing: border-box;
  min-height: 46px;
  padding: 0.8rem 1.25rem;
  margin: 0;

  border: 1px solid transparent;
  border-radius: 0;
  background-color: transparent;
  color: var(--uf-dark-blue);

  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;

  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}


/* ==================================================
   2. HOMEPAGE BUTTONS
   Slightly raised at rest
   ================================================== */

.home .action-link {
  border-color: rgba(0, 38, 87, 0.25);
  background-color: #FFFDF8;

  box-shadow:
    0 2px 4px rgba(0, 38, 87, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}


/* ==================================================
   3. HOVER, FOCUS, AND CURRENT PAGE
   ================================================== */

:is(#quarto-header .navbar-nav .nav-link, .home .action-link):is(
  :hover,
  :focus-visible,
  .active,
  [aria-current="page"]
) {
  background-color: var(--uf-blue);
  border-color: transparent;
  color: var(--uf-white);
  text-decoration: none;
}

.home .action-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 38, 87, 0.18);
}

/* Pressed appearance */
.home .action-link:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.25);
}


/* ==================================================
   4. CORNER BRACKETS
   Overrides the earlier content: none rule
   ================================================== */

:is(#quarto-header .navbar-nav .nav-link, .home .action-link)::before,
:is(#quarto-header .navbar-nav .nav-link, .home .action-link)::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;

  border: 0;
  opacity: 0;
  transform: scale(0.75);
  pointer-events: none;

  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

/* Top-right */
:is(#quarto-header .navbar-nav .nav-link, .home .action-link)::before {
  top: 4px;
  right: 4px;
  border-top: 2px solid white;
  border-right: 2px solid white;
  transform-origin: top right;
}

/* Bottom-left */
:is(#quarto-header .navbar-nav .nav-link, .home .action-link)::after {
  bottom: 4px;
  left: 4px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  transform-origin: bottom left;
}

:is(#quarto-header .navbar-nav .nav-link, .home .action-link):is(
  :hover,
  :focus-visible,
  .active,
  [aria-current="page"]
)::before,
:is(#quarto-header .navbar-nav .nav-link, .home .action-link):is(
  :hover,
  :focus-visible,
  .active,
  [aria-current="page"]
)::after {
  opacity: 1;
  transform: scale(1);
}


/* ==================================================
   5. KEYBOARD AND REDUCED MOTION
   ================================================== */

:is(#quarto-header .navbar-nav .nav-link, .home .action-link):focus-visible {
  outline: 3px solid var(--uf-blue);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  :is(#quarto-header .navbar-nav .nav-link, .home .action-link),
  :is(#quarto-header .navbar-nav .nav-link, .home .action-link)::before,
  :is(#quarto-header .navbar-nav .nav-link, .home .action-link)::after {
    transition: none;
    transform: none;
  }
}