/* ================================================================
   Modern Refresh v2.0 - Home Inspector New Ulm
   Comprehensive CSS overlay for Colibri WP theme modernization
   ================================================================ */

/* ========== WEB FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
  --brand-primary: #667eea;
  --brand-secondary: #764ba2;
  --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --brand-gradient-subtle: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --bg-light: #f7f8fc;
  --bg-white: #ffffff;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== GLOBAL TYPOGRAPHY ========== */
body#colibri,
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6,
.h-global-transition-all h1,
.h-global-transition-all h2,
.h-global-transition-all h3,
.h-global-transition-all h4 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}

p, li, td, th, span, div {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ========== NAVIGATION - MODERN GLASS EFFECT ========== */
.h-navigation {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: all var(--transition-medium);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.h-navigation_sticky .h-navigation {
  box-shadow: 0 1px 20px rgba(0,0,0,0.06) !important;
  background: rgba(255,255,255,0.95) !important;
}

.h-navigation .menu-item a {
  font-weight: 500 !important;
  font-size: 14px !important;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast) !important;
  position: relative;
}

.h-navigation .menu-item a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--brand-gradient);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
  border-radius: 2px;
}

.h-navigation .menu-item a:hover::after {
  width: 80%;
}

.h-navigation .menu-item a:hover {
  color: var(--brand-primary) !important;
}

/* Logo area */
.h-navigation img {
  transition: transform var(--transition-fast);
}

.h-navigation img:hover {
  transform: scale(1.03);
}

/* ========== HERO / PAGE HEADER ========== */
.page-header {
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.02) 100%);
  pointer-events: none;
  z-index: 1;
}

.page-header .h-column__content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em;
}

.page-header .h-column__content h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem) !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  opacity: 0.9;
}

.page-header .h-column__content p {
  font-size: clamp(1rem, 2vw, 1.15rem) !important;
  opacity: 0.85;
  line-height: 1.7 !important;
}

/* ========== BUTTONS - MODERN WITH MICRO-INTERACTIONS ========== */
.h-button,
a.h-button,
.wp-block-button__link,
input[type="submit"],
button[type="submit"] {
  border-radius: var(--radius-md) !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  letter-spacing: 0.02em;
  padding: 13px 30px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: var(--shadow-sm) !important;
  text-transform: none !important;
  position: relative;
  overflow: hidden;
}

.h-button::before,
a.h-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.h-button:hover::before,
a.h-button:hover::before {
  left: 100%;
}

.h-button:hover,
a.h-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
}

.h-button:active,
a.h-button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm) !important;
}

/* ========== CONTENT SECTIONS ========== */
.h-section {
  overflow: hidden;
}

/* Content area styling */
.h-column__inner {
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

/* Modern card effect for content blocks with backgrounds */
.h-column__inner[style*="background"] {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}

/* Page content area - better readability */
.page-content h1,
.entry-content h1 {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  margin-bottom: 0.8em !important;
  color: var(--text-primary) !important;
}

.page-content h2,
.entry-content h2 {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  margin-top: 2em !important;
  margin-bottom: 0.6em !important;
  color: var(--text-primary) !important;
  position: relative;
  padding-bottom: 12px;
}

.page-content h2::after,
.entry-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--brand-gradient);
  border-radius: 2px;
}

.page-content h3,
.entry-content h3 {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin-top: 1.5em !important;
  margin-bottom: 0.5em !important;
  color: var(--text-primary) !important;
}

.page-content p,
.entry-content p {
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 1.2em !important;
}

.page-content ul,
.page-content ol,
.entry-content ul,
.entry-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.page-content li,
.entry-content li {
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 0.5em;
  position: relative;
}

/* Styled unordered lists */
.page-content ul li::marker,
.entry-content ul li::marker {
  color: var(--brand-primary);
}

/* ========== INLINE STYLED CONTENT (our added sections) ========== */

/* H1 with inline style (our service pages) */
h1[style*="margin-bottom"] {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
}

/* H2 headers in content */
h2:not([style]) {
  position: relative;
  padding-bottom: 12px;
}

/* Paragraph content in our sections */
div[style*="max-width: 900px"] {
  background: var(--bg-white);
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-sm);
  padding: 35px 40px !important;
  margin: 35px auto !important;
}

div[style*="max-width: 900px"] h2 {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700 !important;
  font-size: 26px !important;
  color: var(--text-primary) !important;
  margin-bottom: 24px !important;
}

div[style*="max-width: 900px"] h3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 17px !important;
  color: var(--text-primary) !important;
}

div[style*="max-width: 900px"] p {
  color: var(--text-secondary) !important;
  line-height: 1.8 !important;
  font-size: 15px !important;
}

/* FAQ items - modern accordion look */
div[style*="max-width: 900px"] div[style*="border-bottom"] {
  border-bottom: 1px solid var(--border-light) !important;
  padding: 18px 0 !important;
  transition: background var(--transition-fast);
}

div[style*="max-width: 900px"] div[style*="border-bottom"]:hover {
  background: rgba(102,126,234,0.03);
  padding-left: 12px !important;
  border-radius: var(--radius-sm);
}

/* ========== SERVICE AREAS FOOTER ========== */
div[style*="border-top: 1px solid #eee"] {
  background: var(--brand-gradient-subtle) !important;
  border-top: none !important;
  border-radius: var(--radius-xl) !important;
  padding: 35px 30px !important;
  margin: 40px auto !important;
  position: relative;
  overflow: hidden;
}

div[style*="border-top: 1px solid #eee"]::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(102,126,234,0.06) 0%, transparent 70%);
  pointer-events: none;
}

div[style*="border-top: 1px solid #eee"] h3 {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  font-size: 20px !important;
}

div[style*="border-top: 1px solid #eee"] a {
  transition: all var(--transition-fast);
  border-radius: 4px;
  padding: 2px 4px;
}

div[style*="border-top: 1px solid #eee"] a:hover {
  color: var(--brand-primary) !important;
  background: rgba(102,126,234,0.08);
  text-decoration: none !important;
}

/* ========== IFRAME / CALCULATOR SECTION ========== */
div[style*="max-width: 800px"] {
  background: var(--bg-white);
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-md);
  padding: 35px 30px !important;
  margin: 40px auto !important;
  position: relative;
  overflow: hidden;
}

div[style*="max-width: 800px"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
}

div[style*="max-width: 800px"] h2 {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700 !important;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 26px !important;
  margin-bottom: 20px !important;
}

/* ========== IMAGES ========== */
.h-column__content img,
.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

/* ========== IFRAMES ========== */
iframe {
  max-width: 100%;
}

.h-column__content img:hover,
.page-content img:hover {
  box-shadow: var(--shadow-md);
}

/* Trust badges */
.page-content img[alt*="certified"],
.page-content img[alt*="Certified"],
.page-content img[alt*="InterNACHI"],
.page-content img[alt*="internachi"],
.page-content img[alt*="badge"],
.page-content img[alt*="logo"] {
  border-radius: var(--radius-sm);
  transition: transform var(--transition-medium);
}

.page-content img[alt*="certified"]:hover,
.page-content img[alt*="Certified"]:hover,
.page-content img[alt*="InterNACHI"]:hover {
  transform: scale(1.05);
}

/* ========== FOOTER ========== */
footer,
.footer-main,
#footer,
.h-footer {
  font-size: 14px;
  position: relative;
}

footer a,
.footer-main a,
.h-footer a {
  transition: all var(--transition-fast);
}

footer a:hover,
.footer-main a:hover,
.h-footer a:hover {
  color: var(--brand-primary) !important;
  opacity: 1;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-secondary);
}

/* ========== SMOOTH SCROLL ========== */
html {
  scroll-behavior: smooth;
}

/* ========== LINKS ========== */
.page-content a:not(.h-button):not([style]),
.entry-content a:not(.h-button):not([style]) {
  color: var(--brand-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--transition-fast);
}

.page-content a:not(.h-button):not([style]):hover,
.entry-content a:not(.h-button):not([style]):hover {
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-secondary);
}

/* Phone number links */
a[href^="tel:"] {
  font-weight: 600;
  color: var(--brand-primary) !important;
  white-space: nowrap;
}

a[href^="tel:"]:hover {
  color: var(--brand-secondary) !important;
}

/* Phone button in nav bar - ensure visibility */
.h-navigation a.h-button[href^="tel:"],
.h-navigation a.h-button[href^="tel:"] span {
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}

.h-navigation a.h-button[href^="tel:"]:hover,
.h-navigation a.h-button[href^="tel:"]:hover span {
  color: #fff !important;
}

/* ========== SELECTION ========== */
::selection {
  background: var(--brand-primary);
  color: white;
}

::-moz-selection {
  background: var(--brand-primary);
  color: white;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.page-content .h-section {
  animation: fadeInUp 0.6s ease-out;
}

/* Staggered animations for FAQ items */
div[style*="max-width: 900px"] div[style*="border-bottom"]:nth-child(2) { animation: fadeInUp 0.4s ease-out 0.1s both; }
div[style*="max-width: 900px"] div[style*="border-bottom"]:nth-child(3) { animation: fadeInUp 0.4s ease-out 0.2s both; }
div[style*="max-width: 900px"] div[style*="border-bottom"]:nth-child(4) { animation: fadeInUp 0.4s ease-out 0.3s both; }
div[style*="max-width: 900px"] div[style*="border-bottom"]:nth-child(5) { animation: fadeInUp 0.4s ease-out 0.4s both; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .page-content h1 { font-size: 1.8rem !important; }
  .page-content h2 { font-size: 1.4rem !important; }

  div[style*="max-width: 900px"],
  div[style*="max-width: 800px"] {
    margin-left: 15px !important;
    margin-right: 15px !important;
  }
}

@media (max-width: 768px) {
  .page-header .h-column__content h1 {
    font-size: 1.7rem !important;
  }

  /* Override any inline hero font-size for mobile */
  .page-header h1[style*="font-size"],
  .page-header .h-column__content h1[style*="font-size"] {
    font-size: 1.7rem !important;
  }

  .page-content h2,
  .entry-content h2 {
    font-size: 1.3rem !important;
  }

  .h-button:not(.h-navigation .h-button),
  a.h-button:not(.h-navigation a.h-button) {
    padding: 11px 24px !important;
    font-size: 14px !important;
    width: 100%;
    text-align: center;
  }

  div[style*="max-width: 900px"],
  div[style*="max-width: 800px"] {
    padding: 20px 18px !important;
    border-radius: var(--radius-lg) !important;
  }

  /* Scale iframe height for tablets/mobile */
  div[style*="max-width: 800px"] iframe {
    height: 500px;
  }

  .page-content h2::after,
  .entry-content h2::after {
    width: 40px;
    height: 2px;
  }

  /* Scale service areas padding on mobile */
  div[style*="border-top: 1px solid #eee"] {
    padding: 24px 18px !important;
  }

  /* Service area links - better touch targets */
  div[style*="border-top: 1px solid #eee"] a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 6px;
  }

  /* Stack service area links better on mobile */
  div[style*="border-top: 1px solid #eee"] p {
    line-height: 2.5 !important;
  }

  /* Trust badges bar responsive */
  .trust-badges-bar div {
    gap: 16px !important;
    padding: 12px 16px !important;
  }

  .trust-badges-bar span {
    font-size: 12px !important;
  }

  /* Prevent trust bar from covering content below hero */
  .trust-badges-bar + .h-section,
  .trust-badges-bar + div {
    margin-top: 0 !important;
  }
}

@media (max-width: 480px) {
  .page-header .h-column__content h1 {
    font-size: 1.5rem !important;
  }

  /* Override any inline hero font-size for small mobile */
  .page-header h1[style*="font-size"],
  .page-header .h-column__content h1[style*="font-size"] {
    font-size: 1.5rem !important;
  }

  div[style*="max-width: 900px"],
  div[style*="max-width: 800px"] {
    padding: 16px 14px !important;
  }

  div[style*="max-width: 900px"] h2,
  div[style*="max-width: 800px"] h2 {
    font-size: 20px !important;
  }

  /* Smaller iframe on small screens */
  div[style*="max-width: 800px"] iframe {
    height: 450px;
  }

  /* Trust badges - stack vertically on very small screens */
  .trust-badges-bar div {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }

  .trust-badges-bar span {
    font-size: 11px !important;
  }

  /* Service areas footer compact */
  div[style*="border-top: 1px solid #eee"] {
    padding: 18px 14px !important;
  }

  div[style*="border-top: 1px solid #eee"] h3 {
    font-size: 17px !important;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .h-navigation,
  .h-footer,
  footer,
  #footer,
  #mobile-cta-bar,
  #back-to-top,
  .trust-badges-bar,
  div[style*="border-top: 1px solid #eee"],
  div[style*="max-width: 800px"],
  iframe {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    padding-bottom: 0 !important;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p, li, blockquote {
    orphans: 3;
    widows: 3;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Forced colors / Windows High Contrast */
@media (forced-colors: active) {
  .h-button,
  a.h-button {
    border: 2px solid ButtonText !important;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 2px solid Highlight;
  }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000;
    --text-secondary: #333;
    --border-light: #666;
  }

  .h-button,
  a.h-button {
    border: 2px solid currentColor !important;
  }
}

/* ========== TRUST BADGES BAR ========== */
.trust-badges-bar {
  position: relative;
  z-index: 10;
  clear: both;
  margin-bottom: 0;
}

/* Ensure content below trust bar is not covered */
.page-header + .trust-badges-bar + .h-section,
.page-header + .trust-badges-bar + div[data-colibri-id] {
  position: relative;
  z-index: 1;
}

/* Fix overlapping cards section (teal #0090b7 "Certified Inspectors" cards) */
/* The Colibri theme uses margin-top: -80px to overlap the hero, but trust badges bar sits between */
/* Trust bar is between .page-header and .page-content, cards are inside .page-content */
.trust-badges-bar ~ .page-content .style-338 > .h-section-grid-container {
  margin-top: 0 !important;
}

/* White text on teal card section */
.style-338 .h-heading h5,
.style-338 .h-heading a,
.style-338 .h-text p,
.style-338 .h-text div {
  color: #ffffff !important;
}

/* Card icons white on teal */
.style-338 .h-icon svg path {
  fill: #ffffff !important;
}

/* ========== COLIBRI THEME OVERRIDES ========== */

/* Fix the overly-compressed Colibri grid */
.h-section-grid-container {
  max-width: 1200px;
}

/* Better spacing between sections */
.h-section + .h-section {
  margin-top: 0;
}

/* Fix Colibri's aggressive text transforms */
[class*="style-local"] {
  text-transform: none !important;
}

/* Soften Colibri's hard background transitions */
[data-colibri-id] {
  transition: background var(--transition-medium);
}

/* Remove Colibri's default box shadows that look dated */
.h-column__inner[style*="box-shadow: 0 0 0"] {
  box-shadow: var(--shadow-sm) !important;
}

/* Better Colibri icon styling */
.h-icon svg,
.h-icon i {
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.h-icon:hover svg,
.h-icon:hover i {
  transform: scale(1.1);
  color: var(--brand-primary);
}

/* Fix Colibri mega menu / dropdown */
.h-navigation .sub-menu {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-light) !important;
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}

.h-navigation .sub-menu .menu-item a {
  padding: 10px 20px !important;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast) !important;
}

.h-navigation .sub-menu .menu-item a:hover {
  background: var(--bg-light) !important;
}
