/* ====================================
   CUSTOM ANIMATED BUTTON
   functions.php --> function render_custom_button
   ==================================== */

a:hover {
  color: inherit;
  text-decoration: none;
}

.custom-btn {
  display: inline-flex;
  font-size: 1rem;
  user-select: none;
  appearance: none;
  border: none;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: none;
  background: none;
  position: relative;
  transition: all 0.3s ease;
}

.custom-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Content */
.custom-btn__content {
  position: relative;
  display: flex;
  padding: 0 3.5rem;
  line-height: 1.2;
  border-radius: 1.875rem;
  align-items: center;
  justify-content: center;
  height: 2.8125rem;
  white-space: nowrap;
  transition: all 0.4s ease-in-out;
}

/* Text Container */
.custom-btn__text {
  position: relative;
  overflow: hidden;
  display: block;
  height: 1.2em;
}

/* Text Animation */
.custom-btn__text-inner {
  display: block;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-btn__text-inner::after {
  content: attr(data-title);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effect - Text slides up */
.custom-btn:hover .custom-btn__text-inner {
  transform: translateY(-100%);
}

/* Icon */
.custom-btn__icon {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.8125rem;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  transition: all 0.4s ease-in-out;
  font-style: normal;
}

.custom-btn__icon svg {
  fill: currentColor;
  width: 0.8125rem;
  height: 0.8125rem;
  transition: transform 0.2s ease-in-out;
  transform: rotate(135deg);
}

/* Icon rotation on hover */
.custom-btn:hover .custom-btn__icon svg {
  transform: rotate(180deg);
}

/* Focus state for accessibility */
.custom-btn:focus {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.custom-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Active/pressed state */
.custom-btn:active:not(.custom-btn--disabled) .custom-btn__content {
  transform: scale(0.98);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .custom-btn__content {
    padding: 0 2rem;
    height: 2.5rem;
    font-size: 0.9rem;
  }

  .custom-btn__icon {
    font-size: 2.5rem;
  }
}
