/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* =================================================
   Unbound Studio - Image Hotspot Modal Styles
   ================================================= */

.hotspot-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
}

.hotspot-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.hotspot-marker {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 10;
  border: 2px solid #fff;
  padding: 0;
  margin: 0;
}

.hotspot-marker:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.has-pulse .hotspot-marker::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: inherit;
  z-index: -1;
  opacity: 0.75;
  animation: unboundPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes unboundPulse {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(2.8); opacity: 0; }
}

.hotspot-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(3px);
}

.hotspot-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Bruteforce Editor Lock Class */
.hotspot-wrapper.is-locked-open .hotspot-modal-backdrop {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.hotspot-wrapper.is-locked-open .hotspot-modal-content {
  transform: scale(1) !important;
}

.hotspot-modal-content {
  position: relative;
  background: #1a1a1a;
  color: #fff;
  width: max-content;                 /* Shrinks width strictly to fit content */
  max-width: min(90vw, 30ch);     /* Prevents it from overflowing small screens */  
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  text-align: left;
}

.hotspot-modal-backdrop.is-active .hotspot-modal-content {
  transform: scale(1);
}

.hotspot-modal-body h4 {
  margin: 0 0 8px 0;
}

.hotspot-modal-body p {
  margin: 0;
  line-height: 1.5;
}

.hotspot-modal-body .hotspot-action-btn {
  margin-top: 14px;
}

.hotspot-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.hotspot-modal-close:hover,
.hotspot-modal-close:focus-visible {
  opacity: 0.8;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hotspot-action-btn {
  display: inline-block;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.hotspot-action-btn:hover,
.hotspot-action-btn:focus-visible {
  filter: brightness(1.15);
  transform: translateY(-1px);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* =================================================
   ACCESSIBILITY: Prefers Reduced Motion
   ================================================= */
@media (prefers-reduced-motion: reduce) {
  .has-pulse .hotspot-marker::after {
    animation: none !important;
    display: none !important;
  }
  
  .hotspot-modal-backdrop,
  .hotspot-modal-content {
    transition: none !important;
  }
  
  .hotspot-action-btn,
  .hotspot-modal-close {
    transition: filter 0.1s ease !important;
    transform: none !important;
  }
}

/* Bricks Builder Interactions & Overrides */
body.bricks-is-builder .hotspot-marker {
  pointer-events: auto !important;
  z-index: 9999 !important;
}
body.bricks-is-builder .hotspot-modal-backdrop,
body.bricks-is-builder .hotspot-modal-close,
body.bricks-is-builder .hotspot-action-btn {
  pointer-events: auto !important;
}