/*
Theme Name:     Access Electrical — Divi Child
Theme URI:      https://accesselectrician.com
Description:     Divi child theme for Access Electrical, LLC (Aurora / Denver Metro electrician). Brand palette, Inter Tight typography, LocalBusiness JSON-LD, and layout polish for the "Trusted Trade" homepage. Requires the Divi parent theme (Elegant Themes).
Author:         Access Electrical
Template:       Divi
Version:        1.1.0
License:        GNU General Public License v2 or later
License URI:    http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:    access-electrical-child
*/

/* =========================================================================
   Brand tokens (from DESIGN_SPEC.md). Also registered as Divi Global Colors
   in the layout import — these vars back the custom CSS below and let the
   accent be swapped in one place.
   ========================================================================= */
:root {
  /* Brand is BLACK + red (not navy). Variable names kept for back-compat;
     values are the near-blacks sampled from the approved mockup. */
  --ae-navy:        #17181c; /* primary ink — headings, dark sections, topbar */
  --ae-navy-deep:   #0d0e11; /* footer background */
  --ae-navy-2:      #262a30; /* secondary dark / hover */
  --ae-accent:      #d72b1f; /* brand red — CTAs, links, eyebrows, icons */
  --ae-accent-hover:#b3231a; /* red hover */
  --ae-paper:       #ffffff;
  --ae-cream:       #f5f1ea; /* alt section bg, form bg, icon chips */
  --ae-border:      #e3e1dc; /* hairlines, card borders */
  --ae-muted:       #5a6577; /* body / secondary text */
  --ae-gold:        #f5b400; /* review stars */
}

/* =========================================================================
   Typography — Inter Tight everywhere, JetBrains Mono for utility labels.
   Fonts are enqueued with font-display:swap in functions.php.
   ========================================================================= */
body,
.et_pb_row,
.et_pb_text,
h1, h2, h3, h4, h5, h6,
input, textarea, button, select {
  font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.ae-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* =========================================================================
   Buttons — 2px radius, uppercase, tight tracking. Divi button base is
   restyled so both the module Buttons and inline links read as the brand.
   ========================================================================= */
.et_pb_button,
.ae-btn a,
.ae-btn .et_pb_button {
  border-radius: 2px !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600 !important;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
/* Primary red button */
.ae-btn-primary .et_pb_button,
.et_pb_button.ae-btn-primary {
  background-color: var(--ae-accent) !important;
  border-color: var(--ae-accent) !important;
  color: #ffffff !important;
}
.ae-btn-primary .et_pb_button:hover,
.et_pb_button.ae-btn-primary:hover {
  background-color: var(--ae-accent-hover) !important;
  border-color: var(--ae-accent-hover) !important;
}
/* Secondary outline (navy) button */
.ae-btn-outline .et_pb_button,
.et_pb_button.ae-btn-outline {
  background-color: transparent !important;
  border: 1.5px solid var(--ae-navy) !important;
  color: var(--ae-navy) !important;
}
.ae-btn-outline .et_pb_button:hover,
.et_pb_button.ae-btn-outline:hover {
  background-color: var(--ae-navy) !important;
  color: #ffffff !important;
}
/* Navy submit (CTA form) */
.ae-btn-navy .et_pb_button,
.et_pb_button.ae-btn-navy {
  background-color: var(--ae-navy) !important;
  border-color: var(--ae-navy) !important;
  color: #ffffff !important;
}
.ae-btn-navy .et_pb_button:hover,
.et_pb_button.ae-btn-navy:hover {
  background-color: var(--ae-navy-2) !important;
}
/* Hide Divi's default button icon slot where we don't want it */
.ae-btn .et_pb_button:after { margin-left: .4em; }

/* =========================================================================
   Eyebrows / labels
   ========================================================================= */
.ae-eyebrow, .ae-eyebrow p {
  color: var(--ae-accent) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  margin: 0 0 12px !important;
}

/* =========================================================================
   Service grid — 1px hairline dividers over the border colour (DESIGN_SPEC).
   The Services row uses .ae-service-grid; blurbs sit on a bordered grid.
   ========================================================================= */
.ae-service-grid { background: var(--ae-border); }
.ae-service-grid .et_pb_column {
  background: var(--ae-paper);
  margin: 0 !important;
}
.ae-service-blurb {
  padding: 32px 28px !important;
}
.ae-service-blurb .et_pb_main_blurb_image {
  width: 44px; height: 44px; border-radius: 4px;
  background: var(--ae-cream);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px !important;
}
.ae-service-blurb .et_pb_main_blurb_image .et-pb-icon { color: var(--ae-accent) !important; }
.ae-service-blurb .et_pb_module_header,
.ae-service-blurb h4 { font-size: 19px !important; font-weight: 700 !important; color: var(--ae-navy) !important; }
.ae-service-blurb .et_pb_blurb_description { color: var(--ae-muted); font-size: 14px; line-height: 1.55; }

/* Icon chip used by "Why Us" checklist + other blurbs */
.ae-check-blurb .et_pb_main_blurb_image {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ae-accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.ae-check-blurb .et_pb_main_blurb_image .et-pb-icon { color: #ffffff !important; }

/* =========================================================================
   Hero credentials chip (floating card overlaying the hero photo)
   ========================================================================= */
.ae-hero-chip {
  box-shadow: 0 12px 32px rgba(10,12,16,0.15);
  border-radius: 4px;
}

/* =========================================================================
   Contact / estimate forms — cream card, 2px inputs, brand focus rings.
   ========================================================================= */
.ae-form .et_pb_contact_field,
.ae-form .et_pb_contact_field input,
.ae-form .et_pb_contact_field textarea {
  border-radius: 2px !important;
}
.ae-form .et_pb_contact_field input,
.ae-form .et_pb_contact_field textarea {
  background: #ffffff !important;
  border: 1px solid var(--ae-border) !important;
  color: var(--ae-navy) !important;
  font-size: 14px !important;
  padding: 12px 14px !important;
}
.ae-form input:focus,
.ae-form textarea:focus {
  outline: 2px solid var(--ae-accent) !important;
  outline-offset: 1px;
  border-color: var(--ae-accent) !important;
}
.ae-form .et_pb_contact_field { padding: 5px !important; }

/* =========================================================================
   Stats bar — left hairline dividers between the four columns
   ========================================================================= */
.ae-stats .et_pb_column + .et_pb_column {
  border-left: 1px solid rgba(255,255,255,0.12);
}
.ae-stats .et_pb_number_counter .percent p,
.ae-stats .et_pb_number_counter .percent-value {
  color: var(--ae-accent) !important;
  font-size: 44px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

/* =========================================================================
   Accessibility — visible keyboard focus + ≥44px hit targets
   ========================================================================= */
a:focus-visible,
button:focus-visible,
.et_pb_button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.et_pb_menu a:focus-visible {
  outline: 2px solid var(--ae-accent);
  outline-offset: 2px;
}
.et_pb_button { min-height: 44px; display: inline-flex; align-items: center; }

/* =========================================================================
   Sticky mobile action bar (Call | Free Estimate) — CRO. Phone only.
   Markup is injected by functions.php.
   ========================================================================= */
#ae-mobile-bar { display: none; }
@media (max-width: 780px) {
  #ae-mobile-bar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
    box-shadow: 0 -4px 18px rgba(10,12,16,0.18);
  }
  #ae-mobile-bar a {
    flex: 1 1 50%;
    min-height: 56px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 700; font-size: 15px; letter-spacing: 0.03em;
    text-transform: uppercase; text-decoration: none;
  }
  #ae-mobile-bar .ae-bar-call    { background: var(--ae-accent); color: #fff; }
  #ae-mobile-bar .ae-bar-quote   { background: var(--ae-navy);   color: #fff; }
  /* keep content clear of the fixed bar */
  body { padding-bottom: 56px; }
}

/* =========================================================================
   Hero / About photos — the site's real photos (banner-1.jpg, cta-1.jpg)
   are wide; crop them to the design's tall aspect with object-fit.
   ========================================================================= */
.ae-hero-photo img {
  width: 100%; height: 620px; object-fit: cover; border-radius: 4px;
}
.ae-about-photo img {
  width: 100%; height: 520px; object-fit: cover; border-radius: 4px;
}
@media (max-width: 980px) {
  .ae-hero-photo img  { height: 380px; }
  .ae-about-photo img { height: 320px; }
}

/* =========================================================================
   FIX — Divi Overlays popup CSS bleeding onto the hero row.
   The site's "Free Estimate" overlay (Divi Overlays plugin, Gravity Form)
   has a first row styled background #030507 + 30px padding. Divi emits that
   rule with the UNSCOPED ordinal class `.et_pb_row_0` and bundles it into the
   page's unified stylesheet, where it collides with the homepage hero row
   (also row 0) and — loading later — paints the hero near-black, hiding the
   navy H1 and the kitchen photo.
   We re-assert the hero row's intended white background. The popup is injected
   OUTSIDE `#main-content`, so scoping to `#main-content` targets only the hero
   row and leaves the popup's dark background intact (verified live on staging).
   The `.ae-hero-row` selector covers the layout if it is re-imported with that
   module class; the `#main-content` positional selector fixes the current
   import with no re-import needed.
   ========================================================================= */
body.home #main-content .et_pb_section_0 .et_pb_row_0,
.ae-hero-row.et_pb_row {
  background-color: #ffffff !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* =========================================================================
   Safety net — headings on the dark sections must be white. Divi's
   `header_text_color` only styles H1; our headings are H2, so on the dark
   closing-CTA (#contact) and stats bar they must not fall back to the dark
   theme heading colour (which would be black-on-black).
   ========================================================================= */
#contact h1, #contact h2, #contact h3, #contact h4,
.ae-stats h1, .ae-stats h2, .ae-stats h3, .ae-stats h4 {
  color: #ffffff !important;
}

/* =========================================================================
   Inner pages — the site's original pages (services, city pages, etc.) have
   the OLD footer baked into their content as a section with the class
   `.foot-bottom`. Now that the new footer is a global Theme Builder template,
   that baked one is a duplicate. Hide it on every page that carries the TB
   footer (i.e. all of them) so only the single new footer remains. Scoped to
   `.et-tb-has-footer` so no page is ever left without a footer.
   ========================================================================= */
body.et-tb-has-footer .foot-bottom { display: none !important; }

/* =========================================================================
   Header wordmark logo sizing (existing logo-1.png)
   ========================================================================= */
.et_pb_menu .et_pb_menu__logo img,
#ae-logo img { max-height: 44px; width: auto; }
