﻿/* ========================================
                     HERO BUTTON COMPONENT STYLES
                     ======================================== */

.hero-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  transition: all 0.2s ease-in-out;
  border-top: 1px solid var(--mystic-shadow-medium);
  text-decoration: none;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-public-sans);
  /* Ensure proper focus behavior */
  outline: none;
}

.hero-button:hover {
  padding: 20px 24px;
  background-color: var(--brand-blue);
}

.hero-button-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
}

.hero-button-caption {
  font-family: var(--font-public-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 150%;
  margin: 0 !important;
  color: var(--brand-brown);
}

.hero-button-text {
  font-family: var(--font-public-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 150%;
  text-decoration: underline;
  margin: 0 !important;
  color: var(--brand-blue);
}

.hero-button-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: color 0.2s ease-in-out;
  color: var(--brand-blue);
}

.hero-button:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.hero-button:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  padding: 20px 24px;
}

.hero-button:focus-visible .hero-button-arrow {
  color: white;
}

.hero-button:focus-visible .hero-button-caption {
  color: rgba(255, 255, 255, 0.5);
}

.hero-button:focus-visible .hero-button-text {
  color: white;
}

/* Mobile-specific focus handling with improved hover animations - FIXED VERSION */
@media (max-width: 768px) {
  .hero-button {
    padding: 16px 0;
    /* Prevent hover on touch devices by default */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    /* CRITICAL FIX: Ensure content is always visible */
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* CRITICAL FIX: Ensure button content is ALWAYS visible on mobile */
  .hero-button .hero-button-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .hero-button .hero-button-caption {
    color: var(--brand-brown) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }

  .hero-button .hero-button-text {
    color: var(--brand-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }

  .hero-button .hero-button-arrow {
    color: var(--brand-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }

  /* Disable default hover effects on touch devices */
  .hero-button:hover {
    padding: 16px 0;
    background-color: transparent;
  }

  .hero-button:hover .hero-button-arrow {
    color: var(--brand-blue) !important;
  }

  .hero-button:hover .hero-button-caption {
    color: var(--brand-brown) !important;
  }

  .hero-button:hover .hero-button-text {
    color: var(--brand-blue) !important;
  }

  /* Touch hover animation - only applied via JavaScript */
  .hero-button.hero-button-touch-hover {
    padding: 16px 20px;
    background-color: var(--brand-blue);
    transition: all 0.2s ease-in-out;
    /* Ensure content remains visible during animation */
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button.hero-button-touch-hover .hero-button-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .hero-button.hero-button-touch-hover .hero-button-arrow {
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button.hero-button-touch-hover .hero-button-caption {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button.hero-button-touch-hover .hero-button-text {
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Keyboard focus-visible for accessibility - should show hover animation */
  .hero-button:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
    padding: 16px 20px;
    background-color: var(--brand-blue);
    /* Ensure content remains visible during focus */
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:focus-visible .hero-button-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .hero-button:focus-visible .hero-button-arrow {
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:focus-visible .hero-button-caption {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:focus-visible .hero-button-text {
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* CRITICAL FIX: Ensure proper focus removal for non-keyboard focus but keep content visible */
  .hero-button:focus:not(:focus-visible) {
    outline: none;
    background-color: transparent;
    padding: 16px 0;
    /* NEVER hide content */
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:focus:not(:focus-visible) .hero-button-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .hero-button:focus:not(:focus-visible) .hero-button-caption {
    color: var(--brand-brown) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:focus:not(:focus-visible) .hero-button-text {
    color: var(--brand-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:focus:not(:focus-visible) .hero-button-arrow {
    color: var(--brand-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* CRITICAL FIX: Ensure button content remains visible after click/active state */
  .hero-button:active {
    background-color: transparent;
    padding: 16px 0;
    /* NEVER hide content */
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:active .hero-button-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .hero-button:active .hero-button-arrow {
    color: var(--brand-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:active .hero-button-caption {
    color: var(--brand-brown) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button:active .hero-button-text {
    color: var(--brand-blue) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* CRITICAL FIX: Force content visibility in all states */
  .hero-button,
  .hero-button:hover,
  .hero-button:focus,
  .hero-button:focus-visible,
  .hero-button:active,
  .hero-button.hero-button-touch-hover {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-button .hero-button-content,
  .hero-button:hover .hero-button-content,
  .hero-button:focus .hero-button-content,
  .hero-button:focus-visible .hero-button-content,
  .hero-button:active .hero-button-content,
  .hero-button.hero-button-touch-hover .hero-button-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }

  .hero-button .hero-button-caption,
  .hero-button .hero-button-text,
  .hero-button .hero-button-arrow,
  .hero-button:hover .hero-button-caption,
  .hero-button:hover .hero-button-text,
  .hero-button:hover .hero-button-arrow,
  .hero-button:focus .hero-button-caption,
  .hero-button:focus .hero-button-text,
  .hero-button:focus .hero-button-arrow,
  .hero-button:active .hero-button-caption,
  .hero-button:active .hero-button-text,
  .hero-button:active .hero-button-arrow {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
}

.hero-button:hover .hero-button-arrow {
  color: white;
}

.hero-button:hover .hero-button-caption {
  color: rgba(255, 255, 255, 0.5);
}

.hero-button:hover .hero-button-text {
  color: white;
}
