/* ============================================
   CUSTOM OVERRIDES — Evans Well Drilling
   ============================================ */

/* --- Hero Section: 100vh, vertically centered --- */
/* Target the first min-height section inside page content, not inside the header */
/* Exclude blog single-post pages (handled by blog hero CSS) */
#content .elementor-section-height-min-height:first-of-type,
.elementor-location-header ~ .elementor-section-height-min-height:first-of-type,
[data-elementor-type="wp-page"] > .elementor-section-height-min-height:first-child,
[data-elementor-type="wp-post"] > .elementor-section-height-min-height:first-child {
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}
/* Disable 100vh hero on blog single posts — must override #content selector above */
body.single-post #content .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-featured-image) {
  min-height: 0 !important;
  display: none !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

#content .elementor-section-height-min-height:first-of-type > .elementor-container,
[data-elementor-type="wp-page"] > .elementor-section-height-min-height:first-child > .elementor-container,
[data-elementor-type="wp-post"] > .elementor-section-height-min-height:first-child > .elementor-container {
  align-items: center !important;
}

/* --- Fix 1: Sticky Header --- */
.elementor-location-header,
header[data-elementor-type="header"] {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.elementor-sticky__spacer { display: none !important; }

.elementor-sticky--active {
  left: 0 !important;
  width: 100% !important;
}

/* ===========================================
   NAV SYSTEM — Desktop, Tablet, Mobile
   (From fix_mobile_nav_dropdown.md)
   =========================================== */

/* --- Overflow visible on all header containers (all viewports) --- */
.elementor-location-header,
.elementor-location-header .elementor-section,
.elementor-location-header .elementor-container,
.elementor-location-header .elementor-column,
.elementor-location-header .elementor-widget-wrap,
.elementor-location-header .elementor-widget-container,
.elementor-location-header .elementor-widget-nav-menu {
  overflow: visible !important;
}

/* ---- DESKTOP (> 1024px) ---- */
@media (min-width: 1025px) {
  /* Hide mobile dropdown and hamburger on desktop */
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: none !important;
  }
  .elementor-menu-toggle {
    display: none !important;
  }

  /* Desktop hover dropdowns */
  .elementor-nav-menu--main .menu-item-has-children > .sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100%; left: 0;
    background: #fff !important;
    min-width: 220px; width: max-content; max-width: 320px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14) !important;
    border-radius: 0 0 4px 4px;
    z-index: 10000 !important;
    padding: 6px 0;
    list-style: none;
  }

  .elementor-nav-menu--main .menu-item-has-children:hover > .sub-menu {
    display: block !important;
  }

  /* Submenu links */
  .elementor-nav-menu--main .sub-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    white-space: normal;
    transition: background 0.15s, color 0.15s;
  }

  .elementor-nav-menu--main .sub-menu li a:hover {
    background: #247BA0;
    color: #fff;
  }

  /* Inline caret */
  .elementor-nav-menu--main .sub-menu .menu-item-has-children > a .sub-arrow {
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
  }

  .elementor-nav-menu--main .sub-menu .menu-item-has-children > a .sub-arrow i {
    transform: rotate(-90deg);
  }

  /* SmartMenus-style scroll arrows for long dropdowns */
  .sm-scroll-wrapper {
    overflow: hidden auto;
    scroll-behavior: smooth;
    position: static;
  }

  /* Flyout submenus inside scroll wrapper — positioned via JS inline styles */

  .sm-scroll-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    background: #fff;
    color: #247BA0;
    cursor: pointer;
    font-size: 14px;
    border: none;
    user-select: none;
    position: relative;
    z-index: 2;
  }

  .sm-scroll-arrow:hover {
    background: #f0f4f7;
  }

  .sm-scroll-arrow-up {
    border-bottom: 1px solid #eee;
    border-radius: 4px 4px 0 0;
  }

  .sm-scroll-arrow-down {
    border-top: 1px solid #eee;
    border-radius: 0 0 4px 4px;
  }

  /* Nested flyout (opens right) */
  .elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu {
    position: absolute !important;
    top: 0 !important; left: 100% !important;
    margin: 0 !important;
    background: #fff !important;
    border-radius: 0 4px 4px 0 !important;
    box-shadow: 4px 4px 16px rgba(0,0,0,0.12) !important;
    z-index: 10001 !important;
    min-width: 180px; width: max-content; max-width: 320px;
    padding: 6px 0;
  }
}

/* ---- TABLET + MOBILE (≤ 1024px) ---- */
@media (max-width: 1024px) {
  /* Hide desktop nav, show hamburger */
  .elementor-nav-menu--main { display: none !important; }

  .elementor-menu-toggle {
    z-index: 99999 !important;
    cursor: pointer;
  }

  /* Mobile dropdown — hidden by default */
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: none;
  }

  /* Shown when hamburger is active (via JS adding .elementor-active) */
  .elementor-menu-toggle.elementor-active + .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: block !important;
    max-height: 100vh !important;
    transform: scaleY(1) !important;
    overflow-y: auto !important;
  }

  /* Fixed positioning to escape narrow column */
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    width: 100vw !important;
    max-height: calc(100vh - 80px) !important;
    height: auto !important;
    z-index: 99998 !important;
    background: #fff !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
  }

  /* Also handle stretch mode */
  .elementor-nav-menu--stretch .elementor-nav-menu__container.elementor-nav-menu--dropdown {
    position: fixed !important;
    width: 100vw !important;
    left: 0 !important;
  }

  /* Sub-menus — hidden until toggled open by JS */
  .elementor-nav-menu--dropdown .menu-item-has-children > .sub-menu {
    display: none !important;
    position: static !important;
    box-shadow: none !important;
    background: transparent !important;
    padding-left: 15px !important;
  }

  .elementor-nav-menu--dropdown .menu-item-has-children.sub-menu-open > .sub-menu {
    display: block !important;
  }

  /* Link styling */
  .elementor-nav-menu--dropdown li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    color: #222;
    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    text-decoration: none;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
  }

  .elementor-nav-menu--dropdown .elementor-nav-menu > li > a {
    font-weight: 600;
  }

  .elementor-nav-menu--dropdown .sub-menu li a {
    font-size: 14px;
    color: #444;
    font-weight: 400;
  }

  .elementor-nav-menu--dropdown .sub-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 6px;
    transition: transform 0.25s;
  }

  .elementor-nav-menu--dropdown .menu-item-has-children.sub-menu-open > a > .sub-arrow {
    transform: rotate(180deg);
  }

  /* Hamburger icon toggle (open/close swap) */
  .elementor-menu-toggle {
    font-size: 22px;
    color: #333;
    padding: 8px;
  }

  .elementor-menu-toggle .elementor-menu-toggle__icon--close {
    display: none;
  }
  .elementor-menu-toggle.elementor-active .elementor-menu-toggle__icon--open {
    display: none;
  }
  .elementor-menu-toggle.elementor-active .elementor-menu-toggle__icon--close {
    display: inline-block;
  }

  /* Active/focus state for mobile links */
  .elementor-nav-menu--dropdown li a:active,
  .elementor-nav-menu--dropdown li a:focus {
    background: #f0f0f0;
    color: #247BA0;
  }
}

/* --- Blog Cards --- */
.blog-grid-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.blog-card {
  background: #fff;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s;
}

.blog-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
}

.blog-card__image {
  display: block;
  overflow: hidden;
}

.blog-card__image img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.03);
}

.blog-card__body {
  padding: 22px 24px 24px;
}

.blog-card__title {
  font-family: "Source Serif Pro", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 16px;
}

.blog-card__title a {
  color: #247BA0;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card__title a:hover {
  color: #206E90;
}

.blog-card__divider {
  height: 1px;
  background: #ddd;
  margin-bottom: 14px;
}

.blog-card__date {
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  color: #7a7a7a;
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-card__image img {
    height: 200px;
  }
}

/* --- Blog Post Hero: two-column (text left, image right) --- */
/* Remove gap between header and hero on blog posts */
body.single-post .site-content {
  padding-top: 0 !important;
}
body.single-post .elementor-location-single {
  margin-top: 0 !important;
}
/* Kill the sticky spacer ghost gap */
body.single-post .elementor-sticky__spacer {
  display: none !important;
}
/* Merge the featured-image section + title section into one visual hero row */

/* The title section becomes the hero */
.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  min-height: 55vh !important;
  background: #f5f7fa !important;
  padding: 0 !important;
}

.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) > .elementor-container {
  display: flex !important;
  flex-direction: row !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 55vh;
}

/* Left column: text content — vertically centered */
.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:last-child {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  display: flex !important;
  align-items: center !important;
  padding: 60px 60px 60px 80px !important;
  background: #f5f7fa !important;
}

/* Right column: featured image injected via JS */
.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:first-child {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  padding: 0 !important;
  overflow: hidden;
}

.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:first-child .elementor-widget-wrap {
  height: 100%;
}

.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:first-child img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  min-height: 55vh;
}

/* Title styling */
.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-heading-title {
  font-size: 38px;
  line-height: 1.25;
  color: #222;
}

/* Date styling */
.elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-post-info {
  margin-bottom: 12px;
}

/* Mobile: stack vertically, image on top */
@media (max-width: 1024px) {
  .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) > .elementor-container {
    flex-direction: column-reverse !important;
  }

  .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:last-child,
  .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:first-child {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:last-child {
    padding: 30px 20px !important;
  }

  .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-col-50:first-child img {
    min-height: 250px;
    max-height: 350px;
  }

  .elementor-location-single .elementor-section:has(.elementor-widget-theme-post-title) .elementor-heading-title {
    font-size: 28px;
  }
}

/* --- Testimonial Carousel Arrows --- */
.elementor-widget-testimonial-carousel .elementor-swiper-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  color: #333;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.elementor-widget-testimonial-carousel .elementor-swiper-button:hover {
  background: rgba(0,0,0,0.15);
}

.elementor-widget-testimonial-carousel .elementor-swiper-button-prev {
  left: -10px;
}

.elementor-widget-testimonial-carousel .elementor-swiper-button-next {
  right: -10px;
}

.elementor-widget-testimonial-carousel .elementor-swiper {
  position: relative;
}

/* --- BrandAssets Media Room: fix article images --- */
.wa-intcode-image-pr-max-size {
  min-height: 150px;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-radius: 4px;
  cursor: pointer;
}

/* --- Hide Elementor popup modals and dialog artifacts (frozen from WP capture) --- */
.elementor-popup-modal,
.elementor-popup-modal.dialog-type-lightbox,
.dialog-widget.dialog-lightbox-widget {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

/* Remove dialog classes side-effects on body */
body.dialog-lightbox-container,
body.dialog-body {
  overflow: visible !important;
  height: auto !important;
}

/* --- Fix 7: Smooth Scroll --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* ============================================
   ADAPT FORM — Evans Well Drilling
   Brand primary: #247BA0  Hover: #206E90
   ============================================ */

.adapt-form-wrapper {
  width: 100%;
  max-width: 100%;
}

.adapt-form {
  display: block;
  width: 100%;
  background: transparent;
  font-family: inherit;
  color: inherit;
}

.adapt-form-field {
  display: block;
  margin: 0 0 14px;
}

.adapt-form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  margin: 0 0 6px;
  color: inherit;
}

.adapt-form-field label .required {
  color: #d93025;
  font-weight: 700;
  margin-left: 2px;
}

.adapt-form-field input[type="text"],
.adapt-form-field input[type="tel"],
.adapt-form-field input[type="email"],
.adapt-form-field textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.adapt-form-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}

.adapt-form-field input::placeholder,
.adapt-form-field textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.adapt-form-field input:focus,
.adapt-form-field textarea:focus {
  outline: none;
  border-color: #247BA0;
  box-shadow: 0 0 0 3px rgba(36, 123, 160, 0.18);
}

.adapt-form-honey {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.adapt-form-submit {
  margin-top: 8px;
}

.adapt-form-submit input[type="submit"],
.adapt-form-submit .gform_button {
  display: inline-block;
  width: 100%;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0.3px;
  color: #ffffff;
  background: #247BA0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.1s ease;
  -webkit-appearance: none;
  appearance: none;
}

.adapt-form-submit input[type="submit"]:hover,
.adapt-form-submit input[type="submit"]:focus,
.adapt-form-submit .gform_button:hover,
.adapt-form-submit .gform_button:focus {
  background: #206E90;
  color: #ffffff;
  outline: none;
}

.adapt-form-submit input[type="submit"]:active,
.adapt-form-submit .gform_button:active {
  transform: translateY(1px);
}

.adapt-form-submit input[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Form messages (errors / network failures from form-handler.js) */
.form-message {
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Forms placed in dark hero sections inherit white labels */
.elementor-widget-wrap[data-elementor-overlay] .adapt-form-field label,
.elementor-section[data-settings*="background_background"] .adapt-form-field label {
  /* No-op selector intentionally left; dark hero overrides handled by inline color where present */
}

/* Tablet/mobile tightening */
@media (max-width: 768px) {
  .adapt-form-field input[type="text"],
  .adapt-form-field input[type="tel"],
  .adapt-form-field input[type="email"],
  .adapt-form-field textarea {
    font-size: 16px; /* prevent iOS zoom-on-focus */
  }
}

/* Hero "Request a Callback" form sits on a dark photo background — labels need white. */
#adapt_form_wrapper_3 .adapt-form-field label,
#adapt_form_wrapper_3 .adapt-form-field label .required {
  color: #ffffff;
}
