/**
 * Popup Modal Styles
 * Centered modal with max-width 847px
 */

/* Overlay */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* 70% black */
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

#popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

/* Popup Container */
.popup-container {
  position: relative;
  background: var(--floral-white);
  border-radius: var(--border-lg);
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

/* Close Button using SVG icon */
.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 10;
}

.popup-close-btn svg {
  width: 36px;
  height: 36px;
  display: block;
}

/* Style popups with Gutenberg columns */
.popup-content .wp-block-columns {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.popup-content .wp-block-column {
  flex: 1 1 auto;
}

/* Contact Form 7 */
.popup-content .wpcf7 {
  width: 100%;
}

.popup-content textarea,
.popup-content .wpcf7-textarea {
  max-height: 200px;
  resize: vertical;
}

/* Hide Title */
.popup-content .popup-title {
  display: none;
}

/* Popup Content */
.popup-content h1,
.popup-content h2,
.popup-content .big-header-inline {
  color: var(--nu-blue);
  text-transform: uppercase;
}

@keyframes popup-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Error State */
.popup-error {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: #d63638;
}

#popup-link-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

/* Popup Menu Styles (based on footer menu) */
#popup-menu {
  width: fit-content;
  display: inline-block;
}

#popup-menu .custom-menu {
  padding: 0;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

#popup-menu .custom-menu li {
  margin: 0;
  height: 27px;
  display: flex;
  align-items: center;
  padding: 8px 0;
}

#popup-menu .custom-menu li a {
  color: var(--nu-blue);
  font-size: 20px;
  line-height: 27px;
  padding: 0;
  transition: opacity 0.3s ease;
}

#popup-menu .custom-menu li a:hover {
  opacity: 0.8;
}

/* Popup Social Links Styles */
#popup-socials {
  width: fit-content;
  display: inline-block;
}

#popup-socials .social-links-container {
  display: flex;
  gap: 32px;
}

#popup-socials .social-link {
  display: block;
  line-height: 0;
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

#popup-socials .social-icon {
  width: 27px;
  height: 27px;
  filter: brightness(0) saturate(100%) invert(16%) sepia(89%) saturate(1547%)
    hue-rotate(188deg) brightness(95%) contrast(101%);
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

#popup-socials .social-link:hover .social-icon {
  transform: scale(1.1);
}

/* --- Media Queries --- */
/* Desktop Styles */
@media (min-width: 768px) {
  .popup-container {
    width: 65vw;
    min-width: 800px;
    max-width: 900px;
    padding: 48px 40px 30px;
  }

  .popup-content .border-right {
    border-right: 1px solid var(--timberwolf);
    padding-right: 33px;
  }

  .popup-content .wp-block-columns {
    gap: 5rem;
  }
}

/* Mobile Styles */
@media (max-width: 767px) {
  #popup-overlay {
    padding: 10px;
  }

  .popup-container {
    width: 95vw;
    padding: 30px 18px 18px;
  }

  .popup-close-btn {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }

  .popup-close-btn img {
    width: 36px;
    height: 36px;
  }

  .popup-content .wp-block-columns {
    flex-direction: column;
    gap: 2rem;
  }

  .popup-content p {
    font-size: var(--copyFontSmall);
    line-height: 1.3;
    padding-bottom: 10px;
  }

  .popup-content h2 {
    text-wrap: balance;
    line-height: 1.15em;
  }

  .popup-content figure {
    margin: 0;
  }

  .popup-content figure img {
    max-height: 125px;
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
  }

  .popup-content .wpcf7-acceptance .wpcf7-list-item {
    font-size: 14px;
    line-height: 1em;
  }
}

@media (max-width: 480px) {
  .popup-trigger-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}
