/*
Theme Name: SPARK-TS Child Theme
Theme URI: https://tveshaj.com/
Description: Custom enterprise child theme for SPARK featuring modular architecture, custom JS controllers, and performance enhancements.
Author: Tveshaj
Author URI: https://tveshaj.com/
Template: bricks
Version: 1.0.0
Text Domain: spark-child
*/

/**
 * =========================================================================
 * GLOBAL STYLING & LAYOUT OVERRIDES
 * =========================================================================
 */

/* Prevent Horizontal Scroll */
html, body {
  overflow-x: clip;
}

/* Superscript Sizing */
sup {
  font-size: 50%;
  top: -.8em;
}

/* External Tabs State Control (Display None for Inactive Items) */
.tab-external > :not(.brx-open) {
  display: none !important;
}

/* Active Tab Element Smooth Entrance */
.tab-external > *.brx-open {
  animation: tabFadeIn 0.3s ease-in-out forwards;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Anchor Link Offset */
:target {
  scroll-margin-top: 150px;
}

/* Keep header fixed at the top when the mobile menu is open */
body.no-scroll #brx-header,
body:has(.show-mobile-menu) #brx-header,
#brx-header:has(.show-mobile-menu) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999;
}

/* =========================================================================
 * SPARK LEAD FORM & MODAL POPUP STYLES (NEHANET CRM)
 * ========================================================================= */

/* Container & Card */
.spark-leadform { 
  padding: 0; 
}
.spark-leadform__card {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
}

/* Form Layout Grid */
.spark-leadform__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-300);
}
.spark-field--full { 
  grid-column: 1 / -1; 
}

/* Accessible Label Hiding (except checkboxes) */
.spark-field label:not(.spark-checkbox) {
  position: absolute;
  width: 1px; 
  height: 1px;
  padding: 0; 
  margin: -1px;
  overflow: hidden; 
  clip: rect(0,0,0,0);
  white-space: nowrap; 
  border: 0;
}

/* Form Controls (Inputs, Selects, Textareas) */
.spark-field input,
.spark-field select,
.spark-field textarea {
  width: 100%;
  background: var(--neutral-l-10);
  border: 1px solid transparent;
  border-radius: var(--space-200);
  padding: 18px 22px;
  font-size: var(--body);
  line-height: 1.2;
  color: var(--neutral);
  box-shadow: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spark-field textarea {
  min-height: 280px;
  padding-top: var(--space-300);
  resize: vertical;
}

.spark-field input::placeholder,
.spark-field textarea::placeholder {
  color: var(--neutral-l-4);
  opacity: 1;
  font-family: inherit;
}

/* Select Dropdown Styling */
.spark-field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--neutral-l-4) 50%),
    linear-gradient(135deg, var(--neutral-l-4) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 4px),
    calc(100% - 16px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Focus States */
.spark-field input:focus,
.spark-field select:focus,
.spark-field textarea:focus {
  outline: none;
  border-color: var(--neutral-t-4);
  box-shadow: 0 0 0 3px var(--neutral-t-2);
}

/* Validation Error Highlights (Red Border + Red Soft Glow) */
.spark-field.is-invalid input,
.spark-field.is-invalid select,
.spark-field.is-invalid textarea {
  border: 1px solid var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-t-3) !important;
}

/* Checkbox Row Styling */
.spark-field--checkbox { 
  margin-top: var(--space-50); 
}
.spark-checkbox {
  display: flex;
  gap: var(--space-200);
  align-items: center;
  font-size: var(--body);
  color: var(--neutral);
  opacity: .9;
  font-family: inherit;
  position: relative;
}
.spark-checkbox span { 
  display: inline-block; 
}

/* Force Checkbox Visibility Over Theme Resets */
.spark-checkbox input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  opacity: 1 !important;
  position: static !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin: 0 var(--space-200) 0 0 !important;
  visibility: visible !important;
  display: inline-block !important;
  pointer-events: auto !important;
  clip: auto !important;
  clip-path: none !important;
  transform: none !important;
}

/* Action Actions Row */
.spark-leadform__actions { 
  margin-top: var(--space-300); 
}
.spark-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-200);
  background: var(--neutral);
  color: var(--pure-white);
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-family: inherit;
  font-size: var(--body);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}
.spark-btn i {
  font-size: 14px;
  line-height: 1;
}
.spark-btn:hover { 
  background: var(--primary);
  opacity: 1; 
}
.spark-btn:active { 
  transform: translateY(1px); 
}

/* Notice Banners */
.spark-leadform__notice {
  border: 0;
  border-radius: var(--space-200);
  padding: 16px 20px;
  margin-top: var(--space-300);
  font-size: var(--body);
  font-family: inherit;
}

.spark-leadform__notice--success {
  background-color: var(--success-l-3);
  color: var(--success-d-3);
}

.spark-leadform__notice--error {
  background-color: var(--danger-l-3);
  color: var(--danger-d-3);
}

/* Off-screen Anti-Spam Honeypot */
.spark-leadform__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mobile Responsiveness */
@media (max-width: 720px) {
  .spark-leadform__grid { 
    grid-template-columns: 1fr; 
  }
}

/* =========================================================================
 * SPARK FOOTER NEWSLETTER FORM STYLES (.spark-newsletterform)
 * ========================================================================= */

.spark-newsletterform {
  padding: 0;
  width: 100%;
}

.spark-newsletterform__card {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
}

.spark-newsletterform__row {
  display: flex;
  gap: var(--space-200);
  align-items: center;
  width: 100%;
}

.spark-newsletterform__field {
  flex: 1 1 auto;
}

.spark-newsletterform__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.spark-newsletterform__field input[type="email"] {
  width: 100%;
  background: var(--pure-white);
  border: 1px solid transparent;
  border-radius: var(--space-200);
  padding: 14px 20px;
  font-size: var(--body);
  line-height: 1.2;
  color: var(--neutral);
  box-shadow: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spark-newsletterform__field.is-invalid input[type="email"] {
  border: 1px solid var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-t-3) !important;
}

.spark-newsletterform__field input[type="email"]::placeholder {
  color: var(--neutral-l-4);
  opacity: 1;
}

.spark-newsletterform__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral);
  color: var(--pure-white);
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-family: inherit;
  font-size: var(--body);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.spark-newsletterform__btn:hover {
  background: var(--primary);
  opacity: 1;
}

.spark-newsletterform__notice {
  border: 0;
  border-radius: var(--space-200);
  padding: var(--space-200) var(--space-300);
  margin-top: var(--space-200);
  font-size: var(--body-small);
  font-family: inherit;
}

.spark-newsletterform__notice--success {
  background-color: var(--success-l-3);
  color: var(--success-d-3);
}

.spark-newsletterform__notice--error {
  background-color: var(--danger-l-3);
  color: var(--danger-d-3);
}

@media (max-width: 720px) {
  .spark-newsletterform__row {
    flex-direction: column;
    align-items: stretch;
  }
  .spark-newsletterform__btn {
    width: 100%;
  }
}

/* =========================================================================
 * GLOBAL NAVIGATION LOADER & WAIT CURSOR STYLES
 * =========================================================================
 */

/* Force wait cursor across all interactive elements during page load */
html.is-navigating,
html.is-navigating * {
  cursor: wait !important;
}

/* Top Progress Bar (2px height, var(--primary) brand token) */
#spark-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--primary, #C22423);
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.35s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.2s ease;
  box-shadow: 0 0 8px var(--primary-l-2, rgba(194, 36, 35, 0.5));
}

/* Downloadable Asset Button Loading State */
.spark-asset-loading {
  cursor: wait !important;
  pointer-events: none !important;
  opacity: 0.7;
}
