/* ============================================================
   Basix Certificates — polish layer
   Loaded after the harvested Divi CSS on every page. Softens the
   flat-block look (radii, shadows, spacing, type rhythm) without
   changing the page structure, and styles the injected mega menu.
   Australian English. No em dashes.
   ============================================================ */

:root {
  --bx-green: #003f2e;
  --bx-green-ink: #0b2b1f;
  --bx-green-soft: #eaf3ee;
  --bx-lime: #8bc34a;
  --bx-lime-deep: #74a83c;
  --bx-amber: #f5b942;
  --bx-charcoal: #262a28;
  --bx-body: #3c4440;
  --bx-line: #e3e9e5;
  --bx-radius: 12px;
  --bx-radius-sm: 8px;
  --bx-shadow-sm: 0 1px 3px rgba(11, 43, 31, 0.08), 0 4px 14px rgba(11, 43, 31, 0.07);
  --bx-shadow-md: 0 6px 24px rgba(11, 43, 31, 0.12);
  --bx-shadow-lg: 0 18px 48px rgba(11, 43, 31, 0.18);
}

/* ---- 1. Rescue Divi scroll animations (waypoint JS never runs).
   Without polish.js the content is simply visible; with it, elements
   get .bx-reveal and fade up on first intersection. ---- */
.et_animated:not(.bx-reveal),
.et-waypoint:not(.bx-reveal) {
  opacity: 1 !important;
  animation: none !important;
}
.et_animated.bx-reveal,
.et-waypoint.bx-reveal {
  animation: none !important;
}
.bx-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.bx-reveal.bx-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .bx-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- 2. Type rhythm and alignment ---- */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.et_pb_text p {
  line-height: 1.75;
}
/* Justified body copy creates rivers at these column widths */
.et_pb_text_align_justified,
.et_pb_text_align_justified p,
.et_pb_text p[style*="text-align: justify"],
.et_pb_text[style*="justify"] p {
  text-align: left !important;
}
h1, h2, h3, h4 {
  letter-spacing: -0.015em;
}
.et_pb_module h2 {
  margin-bottom: 0.5em;
}

/* ---- 3. Buttons ---- */
.et_pb_button,
.et_pb_contact_submit,
.et_pb_newsletter_button,
.et_pb_more_button,
button[type="submit"],
input[type="submit"] {
  border-radius: 10px !important;
  box-shadow: var(--bx-shadow-sm) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease !important;
  letter-spacing: 0.04em;
}
.et_pb_button:hover,
.et_pb_contact_submit:hover,
.et_pb_newsletter_button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--bx-shadow-md) !important;
}
.et_pb_button:active,
button[type="submit"]:active,
input[type="submit"]:active {
  transform: translateY(0);
}

/* ---- 4. Forms ---- */
.et_pb_contact_form input[type="text"],
.et_pb_contact_form input[type="email"],
.et_pb_contact_form input[type="tel"],
.et_pb_contact_form textarea,
.et_pb_newsletter_form input,
.et_pb_contact_field input,
.et_pb_contact_field textarea,
input.input,
textarea.input {
  border-radius: var(--bx-radius-sm) !important;
  border: 1px solid var(--bx-line) !important;
  padding: 12px 14px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.et_pb_contact_form input:focus,
.et_pb_contact_form textarea:focus,
.et_pb_newsletter_form input:focus,
input.input:focus,
textarea.input:focus {
  border-color: var(--bx-lime-deep) !important;
  box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.25) !important;
  outline: none;
}

/* ---- 5. Cards: blurbs, testimonials ---- */
.et_pb_blurb.et_pb_module {
  background: #ffffff;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-radius);
  box-shadow: var(--bx-shadow-sm);
  padding: 26px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.et_pb_blurb.et_pb_module:hover {
  transform: translateY(-3px);
  box-shadow: var(--bx-shadow-md);
}
/* Dark sections keep their own card tint */
.et_pb_section.et_pb_with_background .et_pb_blurb.et_pb_module,
.et_pb_bg_layout_dark .et_pb_blurb.et_pb_module {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
/* Kill the staggered offsets in service card grids */
.et_pb_row:has(.et_pb_blurb) .et_pb_column {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.et_pb_blurb .et_pb_blurb_content {
  margin: 0 auto;
}
.et_pb_testimonial,
.et_pb_testimonial_description {
  border-radius: var(--bx-radius);
}

/* ---- 6. Content imagery ---- */
.et_pb_image img,
.et_pb_section img.wp-post-image,
.et_pb_post .entry-featured-image-url img {
  border-radius: var(--bx-radius);
  box-shadow: var(--bx-shadow-sm);
}
.et_pb_blurb_image img {
  border-radius: var(--bx-radius-sm);
  box-shadow: none;
}

/* ---- 7. Header and nav ---- */
#main-header {
  box-shadow: none;
  transition: box-shadow 0.25s ease;
}
#main-header.bx-scrolled {
  box-shadow: 0 2px 18px rgba(11, 43, 31, 0.12);
}
#top-menu > li > a {
  position: relative;
  padding-bottom: 8px;
  transition: color 0.15s ease;
}
#top-menu > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--bx-amber);
  transition: right 0.22s ease;
}
#top-menu > li:hover > a::after,
#top-menu > li.bx-open > a::after,
#top-menu > li.current-menu-item > a::after {
  right: 0;
}

/* ---- 8. FAQ toggles (accordion behaviour comes from polish.js) ---- */
.et_pb_toggle {
  border: 1px solid var(--bx-line) !important;
  border-radius: var(--bx-radius) !important;
  background: #ffffff !important;
  padding: 18px 22px !important;
  margin-bottom: 12px !important;
  overflow: hidden;
}
.et_pb_toggle_title {
  cursor: pointer;
  position: relative;
  padding-right: 34px !important;
}
.et_pb_toggle_title::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  line-height: 1;
  color: var(--bx-lime-deep);
  transition: transform 0.2s ease;
}
.et_pb_toggle.bx-toggle-open .et_pb_toggle_title::after {
  content: "\2212";
}
.et_pb_toggle .et_pb_toggle_content {
  display: none;
  padding-top: 12px !important;
}
.et_pb_toggle.bx-toggle-open .et_pb_toggle_content {
  display: block;
}

/* ---- 9. Focus visibility ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(245, 185, 66, 0.7);
  outline-offset: 2px;
}

/* ---- 10. Mobile menu (handler in polish.js) ---- */
@media (max-width: 980px) {
  .et_mobile_menu {
    display: none;
    border-radius: 0 0 var(--bx-radius) var(--bx-radius);
    box-shadow: var(--bx-shadow-md);
  }
  .bx-mobile-open .et_mobile_menu {
    display: block !important;
  }
}

/* ============================================================
   Mega menu (desktop only). Markup injected by polish.js.
   ============================================================ */
@media (min-width: 981px) {
  #main-header {
    position: relative;
  }
  /* Panels anchor to the header, not the menu item */
  #top-menu > li {
    position: static !important;
  }
  #top-menu > li > ul.sub-menu {
    display: none !important; /* replaced by mega panels */
  }
  .bx-mega-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 9999;
    background: #ffffff;
    border-top: 3px solid var(--bx-amber);
    border-radius: 0 0 16px 16px;
    box-shadow: var(--bx-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    pointer-events: none;
  }
  #top-menu > li.bx-open > .bx-mega-panel,
  #top-menu > li:focus-within > .bx-mega-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
  }
  .bx-mega-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 30px 40px 34px;
  }
  .bx-mega-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bx-lime-deep);
    margin: 0 0 18px;
  }
  .bx-mega-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px 22px;
  }
  .bx-mega-card {
    display: block;
    text-decoration: none;
    border-radius: var(--bx-radius);
    padding: 8px;
    margin: -8px;
    transition: background-color 0.15s ease;
  }
  .bx-mega-card:hover {
    background: var(--bx-green-soft);
  }
  .bx-mega-card .bx-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--bx-radius-sm);
    box-shadow: var(--bx-shadow-sm);
    margin-bottom: 10px;
    transition: transform 0.2s ease;
  }
  .bx-mega-card:hover .bx-thumb {
    transform: scale(1.025);
  }
  .bx-mega-card .bx-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--bx-green-ink);
    line-height: 1.35;
    margin-bottom: 3px;
  }
  .bx-mega-card .bx-helper {
    display: block;
    font-size: 12.5px;
    color: #6b746f;
    line-height: 1.45;
  }
  /* Single-feature panel (Section J, About, Contact, News) */
  .bx-mega-feature {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: center;
  }
  .bx-mega-feature .bx-thumb {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--bx-radius);
    box-shadow: var(--bx-shadow-md);
  }
  .bx-mega-feature .bx-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--bx-green-ink);
    margin: 0 0 8px;
  }
  .bx-mega-feature .bx-helper {
    font-size: 14.5px;
    color: var(--bx-body);
    line-height: 1.65;
    margin: 0 0 14px;
    max-width: 56ch;
  }
  .bx-mega-feature .bx-cta {
    display: inline-block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bx-green);
    text-decoration: none;
    border-bottom: 2px solid var(--bx-amber);
    padding-bottom: 2px;
  }
  .bx-mega-feature .bx-cta:hover {
    color: var(--bx-lime-deep);
  }
  .bx-mega-phone {
    display: inline-block;
    margin-left: 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bx-green);
  }
}
