/**
 * Gravity Forms Paywall Modal Styles
 * 
 * Additional styles for the paywall modal (complementing Tailwind classes)
 * 
 * @package AutostraddleFeatures
 * @since 1.0.0
 */

/* Ensure modal is on top of everything */
#gf-paywall-modal {
  z-index: 999999;
}

/* Smooth transitions */
#gf-paywall-modal,
#gf-paywall-modal .fixed.inset-0.bg-black {
  transition: opacity 0.3s ease-in-out;
}

/* Prevent body scroll when modal is open */
body.overflow-hidden {
  overflow: hidden;
}

/* Close button styling */
.gf-paywall-close {
  cursor: pointer;
  flex-shrink: 0;
}

/* Button focus states */
#gf-paywall-modal a[href]:focus,
#gf-paywall-modal button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Ensure proper text rendering */
#gf-paywall-modal h2 {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#gf-paywall-modal p {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Button styling refinement */
#gf-paywall-modal .bg-black {
  letter-spacing: 0.05em;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  #gf-paywall-modal .max-w-\[547px\] {
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }

  #gf-paywall-modal .px-\[80px\] {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  #gf-paywall-modal .max-w-\[334px\] {
    max-width: 100%;
  }

  /* Adjust padding on mobile */
  #gf-paywall-modal .p-\[22px\] {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  #gf-paywall-modal .px-\[80px\] {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Adjust title size on very small screens */
  #gf-paywall-modal h2 {
    font-size: 1.75rem; /* 28px */
  }
}

/* Animation for modal appearance */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#gf-paywall-modal:not(.hidden) > .fixed.inset-0 {
  animation: modalFadeIn 0.3s ease-in-out;
}

#gf-paywall-modal:not(.hidden) .max-w-\[547px\] {
  animation: modalFadeIn 0.3s ease-in-out 0.1s backwards;
}

/* Ensure proper stacking context */
#gf-paywall-modal > .fixed.inset-0:first-child {
  z-index: 1;
}

#gf-paywall-modal > .fixed.inset-0.z-10 {
  z-index: 10;
}

/* Accessibility: reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  #gf-paywall-modal,
  #gf-paywall-modal .fixed.inset-0.bg-black,
  #gf-paywall-modal .max-w-\[547px\] {
    transition: none;
    animation: none;
  }
}

/* Print styles - hide modal when printing */
@media print {
  #gf-paywall-modal {
    display: none !important;
  }
}
