/**
 * Apex Authors Signup Box Styles
 *
 * Kadence Theme Integration
 * - Uses Kadence global color palette for automatic light/dark mode support
 * - Automatically adapts to seasonal palette changes
 * - Respects user's color preferences
 *
 * @package Apex_Authors_Signup_Box
 * @version 0.0.2
 */

/* ================================================
   CSS Custom Properties - Kadence Integration
   ================================================ */

:root {
  /* Map to Kadence global palette for automatic theme integration */
  --asb-primary: var(--global-palette1, #41b5f9);
  --asb-primary-hover: var(--global-palette-btn-bg-hover, var(--global-palette2, #2a9ce0));
  --asb-text: var(--global-palette4, #454a4e);
  --asb-heading: var(--global-palette3, #181616);
  --asb-bg: var(--global-palette9, #ffffff);

  /* Static design values */
  --asb-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  --asb-border-radius: 4px;
  --asb-button-radius: 6px;
  --asb-spacing-small: 20px;
  --asb-spacing-medium: 30px;
  --asb-spacing-large: 36px;
}

/* Dark mode adjustments - automatically activated when user toggles Kadence dark mode */
.color-switch-dark {
  --asb-bg: var(--global-palette3, #1f2426);
  --asb-text: var(--global-palette8, #ffffff);
  --asb-heading: var(--global-palette9, #ffffff);
  --asb-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ================================================
   Main Signup Box Container
   ================================================ */

.apex-signup-box {
  background-color: var(--asb-bg);
  border-radius: var(--asb-border-radius);
  box-shadow: var(--asb-shadow);
  padding: var(--asb-spacing-medium);
  margin: 0 auto 40px;

  /* Flexbox layout - mobile first */
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: flex-start;
  text-align: center;

  /* Smooth transitions for theme changes */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Desktop layout - horizontal arrangement */
@media (min-width: 1200px) {
  .apex-signup-box {
    justify-content: flex-start;
    flex-wrap: nowrap;
    text-align: left;
  }
}

/* ================================================
   Photo/Avatar
   ================================================ */

.apex-signup-box__photo {
  max-width: 150px;
  height: auto;
  margin-right: 0;
  margin-bottom: var(--asb-spacing-medium);
  flex: 0 0 100%;
  border-radius: var(--asb-border-radius);

  /* Prevent image distortion */
  object-fit: cover;
}

/* Desktop - photo on left side */
@media (min-width: 992px) {
  .apex-signup-box__photo {
    margin-right: var(--asb-spacing-large);
    margin-top: 15px;
    margin-bottom: 0;
    flex: 0 0 auto;
  }
}

/* ================================================
   Content Wrapper
   ================================================ */

.apex-signup-box__content {
  padding-top: 0;
  width: 100%;
}

@media (min-width: 992px) {
  .apex-signup-box__content {
    flex: 1;
    width: auto;
  }
}

/* ================================================
   Heading
   ================================================ */

.apex-signup-box__heading {
  color: var(--asb-heading);
  margin-top: 0;
  margin-bottom: var(--asb-spacing-small);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.3;

  /* Smooth color transitions for theme changes */
  transition: color 0.3s ease;
}

/* Smaller heading on mobile */
@media (max-width: 575px) {
  .apex-signup-box__heading {
    font-size: 20px;
  }
}

/* ================================================
   Copy Text / Body Content
   ================================================ */

.apex-signup-box__copy {
  color: var(--asb-text);
  font-size: 16px;
  margin-top: var(--asb-spacing-small);
  font-weight: 600;
  line-height: 1.5;

  /* Smooth color transitions for theme changes */
  transition: color 0.3s ease;
}

/* Copy text paragraphs */
.apex-signup-box__copy p {
  margin-top: 0;
  margin-bottom: 1em;
}

.apex-signup-box__copy p:last-child {
  margin-bottom: 0;
}

/* Links within copy text use Kadence primary color */
.apex-signup-box__copy a {
  color: var(--asb-primary);
  font-weight: inherit;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.apex-signup-box__copy a:hover,
.apex-signup-box__copy a:focus {
  color: var(--asb-primary-hover);
}

/* Hide line breaks on smaller screens for better readability */
@media (max-width: 991px) {
  .apex-signup-box__copy br {
    display: none;
  }
}

/* ================================================
   Call-to-Action Button
   ================================================ */

.apex-signup-box__button {
  display: inline-block;

  /* Use Kadence button text color (typically white/light on primary) */
  color: var(--global-palette9, #ffffff);
  background-color: var(--asb-primary);

  border: none;
  border-radius: var(--asb-button-radius);
  padding: 10px 30px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  text-align: center;

  /* Smooth hover transitions */
  transition: background-color 0.2s ease, transform 0.1s ease;

  cursor: pointer;
}

.apex-signup-box__button:hover,
.apex-signup-box__button:focus {
  background-color: var(--asb-primary-hover);
  color: var(--global-palette8, #ffffff);
  text-decoration: none;

  /* Subtle lift effect on hover */
  transform: translateY(-1px);
}

.apex-signup-box__button:active {
  transform: translateY(0);
}

/* Smaller button on mobile for better fit */
@media (max-width: 575px) {
  .apex-signup-box__button {
    font-size: 18px;
    padding: 8px 20px;
  }
}

/* Dark mode: Ensure button text remains readable against bright button */
.color-switch-dark .apex-signup-box__button {
  color: var(--global-palette3, #181616);
}

.color-switch-dark .apex-signup-box__button:hover,
.color-switch-dark .apex-signup-box__button:focus {
  color: var(--global-palette3, #181616);
}

/* ================================================
   Fluent Forms Integration
   ================================================ */

/* Ensure embedded Fluent Forms inherit proper spacing and colors */
.apex-signup-box .fluentform,
.apex-signup-box .ff-el-form-control {
  margin-top: var(--asb-spacing-small);
}

/* Fluent Forms submit button should match primary color */
.apex-signup-box .fluentform .ff-btn-submit {
  background-color: var(--asb-primary) !important;
  border-color: var(--asb-primary) !important;
}

.apex-signup-box .fluentform .ff-btn-submit:hover {
  background-color: var(--asb-primary-hover) !important;
  border-color: var(--asb-primary-hover) !important;
}

/* ================================================
   Accessibility Enhancements
   ================================================ */

/* Focus visible for keyboard navigation */
.apex-signup-box__button:focus-visible,
.apex-signup-box__copy a:focus-visible {
  outline: 2px solid var(--asb-primary);
  outline-offset: 2px;
}

/* Ensure sufficient contrast for readability */
@media (prefers-contrast: high) {
  .apex-signup-box {
    border: 1px solid var(--asb-text);
  }
}

/* Respect user's reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

  .apex-signup-box,
  .apex-signup-box__heading,
  .apex-signup-box__copy,
  .apex-signup-box__copy a,
  .apex-signup-box__button {
    transition: none;
  }
}

/* ================================================
   Print Styles
   ================================================ */

@media print {
  .apex-signup-box {
    box-shadow: none;
    border: 1px solid #000;
    page-break-inside: avoid;
  }

  .apex-signup-box__button {
    border: 1px solid #000;
  }
}