/* ============================================
   MODERN MENU LINK ANIMATIONS
   ============================================ */

/* Modern underline animation */
.page-wrapper nav ul li > a,
.page-wrapper nav ul li > button {
  position: relative;
  overflow: hidden;
}

/* Simple underline effect on hover */
.page-wrapper nav ul li > a::after,
.page-wrapper nav ul li > button::after {
  content: '';
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  background-color: var(--r-br, var(--r-br-b));
  transition: width 0.3s ease;
}

/* Activate underline on hover */
.page-wrapper nav ul li > a:hover::after,
.page-wrapper nav ul li > button:hover::after {
  width: 100%;
}

/* Disable animation for mega menu nested items (2nd, 3rd, 4th levels) */
.page-wrapper nav .navigation__megamenu ul li > a,
.page-wrapper nav .navigation__megamenu ul li > button {
  overflow: visible;
}

.page-wrapper nav .navigation__megamenu ul li > a::after,
.page-wrapper nav .navigation__megamenu ul li > button::after {
  display: none;
}

/* Disable for other excluded areas */
.page-wrapper .header ul li > a::after,
.page-wrapper .header ul li > button::after,
.page-wrapper .solo-ul li > a::after,
.page-wrapper .solo-ul li > button::after,
.page-wrapper .field ul li > a::after,
.page-wrapper .field ul li > button::after,
.page-wrapper .pager ul li > a::after,
.page-wrapper .pager ul li > button::after {
  display: none;
}

/* ============================================
   GLOBAL TRANSITIONS
   ============================================ */
a,
button,
input.button {
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, border 0.3s ease, transform 0.3s ease;
}

/* ============================================
   MODERN BUTTON HOVER - SUBTLE LIFT
   ============================================ */

.page-wrapper form input.button.form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(var(--s-b, var(--s-w)), 0.1);
}

/* ============================================
   EXISTING ANIMATIONS - PRESERVED
   ============================================ */
.solo__fade-in,
.solo-animate-opacity {
  animation: opac 0.8s;
  animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes opac {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.solo-animate-top {
  position: relative;
  animation: animatetop 0.6s;
  animation-timing-function: var(--solo-ease-in-out);
}

@keyframes animatetop {
  from {
    inset-block-start: -300px;
    opacity: 0;
  }
  to {
    inset-block-start: 0;
    opacity: 1;
  }
}

.solo-animate-left {
  position: relative;
  animation: animateleft 0.6s;
  animation-timing-function: var(--solo-ease-in-out);
}

@keyframes animateleft {
  from {
    inset-inline-start: -300px;
    opacity: 0;
  }
  to {
    inset-inline-start: 0;
    opacity: 1;
  }
}

.solo-animate-right {
  position: relative;
  animation: animateright 0.6s;
  animation-timing-function: var(--solo-ease-in-out);
}

@keyframes animateright {
  from {
    inset-inline-end: -300px;
    opacity: 0;
  }
  to {
    inset-inline-end: 0;
    opacity: 1;
  }
}

.solo-animate-bottom {
  position: relative;
  animation: animatebottom 0.6s;
  animation-timing-function: var(--solo-ease-in-out);
}

@keyframes animatebottom {
  from {
    inset-block-end: -300px;
    opacity: 0;
  }
  to {
    inset-block-end: 0;
    opacity: 1;
  }
}

.solo-animate-zoom {
  animation: animatezoom 0.6s;
  animation-timing-function: var(--solo-ease-in-out);
}

@keyframes animatezoom {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.solo-animate-input {
  transition: width 0.4s ease-in-out;
}

.solo-animate-input:focus {
  width: 100% !important;
}

/* ============================================
   DISABLE CLASSES - USER CONTROL
   ============================================ */

/* Disable menu link animations */
.dis-anim-link nav ul li > a::after,
.dis-anim-link nav ul li > button::after {
  display: none !important;
}

.dis-anim-link nav ul li > a:hover::after,
.dis-anim-link nav ul li > button:hover::after {
  animation: none !important;
  width: 0 !important;
}

/* Disable submit button animations */
.dis-anim-submit form input.button.form-submit:hover {
  animation: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Disable ALL animations - accessibility option */
.dis-all-animations *,
.dis-all-animations *::before,
.dis-all-animations *::after {
  animation: none !important;
  transition: none !important;
}

/* ============================================
   LEGACY ANIMATIONS - OPT-IN WITH CLASS
   Use .enable-legacy-animations on body/wrapper
   ============================================ */

/* Old border sweep animation */
@keyframes btnBorderAnimation {
  0% {
    width: 0;
    height: 0;
    border-bottom-color: var(--r-br, var(--r-br-b));
  }
  99.9999% {
    width: 100%;
    height: 100%;
    border-bottom-color: var(--r-br, var(--r-br-b));
  }
  100% {
    width: 0;
    height: 0;
    border-bottom-color: transparent;
  }
}

/* Old wiggle animation */
@keyframes wiggle {
  0%, 100% {
    transform: rotateZ(0deg) scale(1);
  }
  15% {
    transform: rotateZ(-2.5deg) scale(1.01);
  }
  30% {
    transform: rotateZ(2deg) scale(0.99);
  }
  45% {
    transform: rotateZ(-1.5deg) scale(1.005);
  }
  60% {
    transform: rotateZ(1deg) scale(0.995);
  }
  75% {
    transform: rotateZ(-0.5deg) scale(1.0025);
  }
  90% {
    transform: rotateZ(0.25deg) scale(1);
  }
}

/* Enable legacy border animation */
.enable-legacy-animations nav ul li > a::before,
.enable-legacy-animations nav ul li > button::before {
  content: '';
  position: absolute;
  inset-block-end: 0;
  width: 0;
  height: 0;
  inset-inline-start: 0;
  background-color: transparent;
  border-block-end: 5px solid transparent;
}

.enable-legacy-animations nav ul li > a::after,
.enable-legacy-animations nav ul li > button::after {
  inset-inline-end: 0;
  width: 0;
  height: 0;
  background-color: transparent;
  border-block-end: 5px solid transparent;
  transition: none;
}

.enable-legacy-animations nav ul li > a:hover::after,
.enable-legacy-animations nav ul li > a:hover::before,
.enable-legacy-animations nav ul li > button:hover::after,
.enable-legacy-animations nav ul li > button:hover::before {
  animation: btnBorderAnimation 0.5s ease-out forwards;
  width: auto;
}

/* Enable legacy wiggle animation */
.enable-legacy-animations form input.button.form-submit:hover {
  animation: wiggle 0.6s ease-out both;
  transform: none;
  box-shadow: none;
}

/* Disable legacy animations in mega menu nested items */
.enable-legacy-animations nav .navigation__megamenu ul li > a::before,
.enable-legacy-animations nav .navigation__megamenu ul li > button::before {
  display: none;
}
