/**
 * Newsletter AJAX Messages - COMPLETE PRODUCTION INLINE & MULTISITE MODAL STYLE
 */

/* Container wrapper styling - sits naturally below the input block */
#newsletter-ajax-messages {
  width: 100%;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  display: block !important;
  clear: both;
}

/* Clear core overrides to preserve natural inline text distribution */
#newsletter-ajax-messages .messages-list,
#newsletter-ajax-messages .messages__wrapper {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Custom Inline Messages Container */
.newsletter-inline-messages {
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Base style for individual text rows */
.newsletter-inline-messages p {
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: none !important;
  box-shadow: none !important;
}

/* Error Text Colors using a fallback Red */
.inline-msg--error {
  color: #e31b23 !important;
}

/**
 * Multi-Site Adaptive Success Popup Box
 */

/* Modal full-screen overlay backdrop layer */
#newsletter-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.4) !important; /* Soft dimming shadow */
  z-index: 999999 !important; /* Renders cleanly over headers & admin trays */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Base styles for the default popup (Applies globally across all multi-site instances) */
#newsletter-modal-card {
  background-color: #ffffff !important;
  border-top: 5px solid #007bff !important; /* Default blue border */
  border-radius: 8px !important;
  
  /* --- RESTORED MISSING STRUCTURAL PROPERTIES --- */
  padding: 35px 50px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
  position: relative !important;
  width: 90% !important;
  max-width: 480px !important;
  box-sizing: border-box !important;
  animation: newsletterModalPop 0.25s ease-out forwards;
}

/* =========================================================================
   SITE-SPECIFIC THEME OVERRIDES (Customize styles per multi-site instance)
   ========================================================================= */

/* 1. Theme override for the "ohio" host/machine name (Outputs as "site-ohio") */
#newsletter-modal-overlay.site-ohio #newsletter-modal-card {
  border-top: 5px solid #e31b23 !important; /* Pure Red for Ohio Diesel */
}
#newsletter-modal-overlay.site-ohio .newsletter-modal-content p {
  color: #1a1a1a !important; /* Dark text for readability */
}

/* 2. Theme override for an alternative host name (e.g., "site-texas-trucks") */
#newsletter-modal-overlay.site-texas-trucks #newsletter-modal-card {
  border-top: 5px solid #ffc107 !important; /* Yellow border for Texas site */
  background-color: #f8f9fa !important;
}

/* Success Message Text Box Formatter */
.newsletter-modal-content p {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  text-align: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Minimalist floating close (✕) action point button */
#newsletter-modal-close {
  position: absolute !important;
  top: 12px !important;
  right: 16px !important;
  background: none !important;
  border: none !important;
  font-size: 16px !important;
  color: #aaaaaa !important;
  cursor: pointer !important;
  padding: 5px !important;
  line-height: 1 !important;
  transition: color 0.2s ease !important;
}

#newsletter-modal-close:hover {
  color: #333333 !important;
}

/* Entry animation for the modal */
@keyframes newsletterModalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/**
 * Isolated Throbber Handling - Zero-Width Structural Footprint Fix
 */
#newsletter-form-wrapper .newsletter-submit-container {
  display: inline-block !important;
  position: relative !important;
  padding-right: 30px !important; /* Pre-allocated empty space for the spinner */
  margin-right: -30px !important; /* Counterbalance to maintain original theme flow */
  vertical-align: middle !important;
}

#newsletter-form-wrapper .newsletter-submit-container .Subscribe-btn {
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Lock the throbber using absolute positioning to prevent layout shifts */
#newsletter-form-wrapper .newsletter-submit-container .ajax-progress-throbber {
  display: inline-block !important;
  position: absolute !important;
  left: calc(100% - 20px) !important; 
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 16px !important;
  height: 16px !important;
  float: none !important;
}

/* Graphical loading spinner icon image adjustments */
#newsletter-form-wrapper .newsletter-submit-container .ajax-progress-throbber .throbber {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  background-position: center !important;
}

/* Completely suppress the hidden system core processing text string layout metrics */
#newsletter-form-wrapper .newsletter-submit-container .ajax-progress .message {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/**
 * Input Box Border Highlight on Error
 */
#newsletter-form-wrapper:has(.inline-msg--error) .newsletter-input input[type="email"] {
  border: 1px solid #e31b23 !important;
}

/* Ensure the italicized emphasis text inside our custom messages displays perfectly */
.newsletter-inline-messages p em {
  font-style: italic !important;
  font-weight: 600 !important;
  background: none !important;
  padding: 0 !important;
}