/*
 Theme Name:   Divi Child Theme
 Theme URI:    https://www.ampcocontracting.com/
 Description:  AMPCO Divi child. Layout and styling live in Divi modules and the Customizer; this file holds only what Divi cannot express natively.
 Author:       AMPCO
 Template:     Divi
 Version:      5.0.0
*/

/* ---- Service card bullets: 15x5 orange bar. Divi has no list-marker control. ---- */
.ampco-svc ul.ampco-svc-list{padding-left:0;margin:0;}
.ampco-svc ul.ampco-svc-list li{position:relative;padding-left:26px;list-style:none;}
.ampco-svc ul.ampco-svc-list li::before{content:"";position:absolute;left:0;top:.62em;width:15px;height:5px;background:#F96302;}

/* ---- Service cards: EXPLORE pinned to the bottom so it aligns across cards. ---- */
.ampco-svc-col{display:flex !important;flex-direction:column;}
.ampco-svc-col > .ampco-explore{margin-top:auto !important;}
.ampco-explore p{margin:0;}
.ampco-explore a{display:inline-flex;align-items:center;gap:10px;color:#F96302;text-decoration:none;}
.ampco-explore a:hover{opacity:.8;}
.ampco-explore img{width:24px;height:24px;display:block;flex:0 0 auto;}

/* ---- SVG blurb icons have no intrinsic size, so Divi renders them at 0. ---- */
.et_pb_blurb .et_pb_main_blurb_image img[src$=".svg"]{width:50px;height:50px;display:block;}
.et_pb_blurb .et_pb_main_blurb_image{margin-bottom:14px;}

/* ---- Partners marquee. Divi has no continuous-scroll module. ---- */
.ampco-mq-wrap{overflow:hidden;}
.ampco-mq-wrap .ampco-mq-track{display:flex !important;align-items:center;width:max-content !important;float:none !important;animation:ampco-marquee 45s linear infinite;}
.ampco-mq-wrap .ampco-mq-track:hover{animation-play-state:paused;}
.ampco-mq-wrap .ampco-mq-item{flex:0 0 auto;width:auto !important;margin:0 55px 0 0 !important;}
.ampco-mq-wrap .ampco-mq-item img{max-height:46px;width:auto;}
@keyframes ampco-marquee{from{transform:translateX(0);}to{transform:translateX(-50%);}}
@media (prefers-reduced-motion:reduce){.ampco-mq-wrap .ampco-mq-track{animation:none;}}

/* ---- Footer: edge-to-edge; Divi specialty rows are fixed-width. ---- */
.ampco-footer-sec > .et_pb_row{width:100% !important;max-width:100% !important;padding:0 !important;}
#main-footer{display:none;}

/* ---- Header (desktop only; below 981px Divi swaps to its mobile menu). ---- */
@media (min-width:981px){
  #main-header .logo_container,
  #main-header #et-top-navigation{height:80px;}
  #main-header .logo_container{display:flex;align-items:center;}
  #main-header .logo_container a{display:flex !important;align-items:center;height:auto !important;}
  #main-header #logo{max-height:52px !important;height:auto !important;width:auto !important;}
  #main-header #et-top-navigation{padding-top:0 !important;display:flex;align-items:center;justify-content:flex-end;}
  #main-header #top-menu-nav,
  #main-header #top-menu{display:flex;align-items:center;}
  #main-header #top-menu > li{display:flex;align-items:center;height:80px;}
  #main-header #top-menu > li > a{display:flex;align-items:center;height:100%;position:relative;padding-bottom:0;}
  #main-header #top-menu li.ampco-cta{margin-left:20px;}
  #main-header #top-menu > li.ampco-cta > a{height:46px;padding:0 26px !important;background:#F96302;color:#FFFFFF !important;line-height:1;}
  #main-header #top-menu > li.ampco-cta > a:hover{background:#E95C01;opacity:1;}
  #main-header #top-menu > li.current-menu-item:not(.ampco-cta) > a:before{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:#F96302;}
}

/* CTA inside the mobile menu reads as a button too. */
@media (max-width:980px){
  #mobile_menu li.ampco-cta > a{background:#F96302;color:#FFFFFF !important;text-align:center;margin:10px 6%;width:88%;}
  #main-header #logo{max-height:44px !important;height:auto !important;width:auto !important;}
}

/* Bar is translucent by design; without blur the page reads through it. */
#main-header{backdrop-filter:blur(7.5px);-webkit-backdrop-filter:blur(7.5px);}

/* ---------------------------------------------------------------
   TEMPORARY SHIM - delete this whole block once these three lines in
   Divi-child/functions.php are commented out:
     add_filter('body_class', 'ampco_home_body_class', 99);
     add_action('wp_head', 'ampco_home_critical_css', 1);
     add_action('wp_footer', 'ampco_topbar_nav_script', 50);
   That legacy code hides Divi's native header and strips et_fixed_nav, so
   Divi's "Fixed Navigation Bar" option (already on) has no effect. WordPress
   refuses PHP edits here because its loopback check cannot reach
   localhost:8080 from inside the container.
--------------------------------------------------------------- */
body.ampco-home-layout #main-header,
body.ampco-home-layout header#main-header{
  display:block !important;visibility:visible !important;height:auto !important;
  min-height:0 !important;overflow:visible !important;pointer-events:auto !important;
}
body.ampco-home-layout #main-header{position:fixed;top:0;left:0;right:0;width:100%;z-index:99999;box-shadow:0 1px 3px rgba(0,0,0,.08);}
body.admin-bar.ampco-home-layout #main-header{top:32px;}
body.ampco-home-layout #page-container{padding-top:80px !important;}
@media screen and (max-width:782px){body.admin-bar.ampco-home-layout #main-header{top:46px;}}


/* Vertically center homepage statistics icons beside their text. */
.et_pb_section_2 .et_pb_blurb_content{display:flex;align-items:center;column-gap:22px;}
.et_pb_section_2 .et_pb_main_blurb_image{display:block;margin:0;flex:0 0 50px;}
.et_pb_section_2 .et_pb_blurb_container{display:block;padding-left:0;}

/* Anchor desktop dropdowns below the flex-aligned header and center their arrows. */
@media (min-width:981px){
  #main-header #top-menu > li > .sub-menu{top:calc(100% - 20px);bottom:auto;left:0;width:190px;padding:6px 0;}
  #main-header #top-menu > li > .sub-menu > li{display:block;padding:0;width:100%;}
  #main-header #top-menu > li > .sub-menu > li > a{width:100%;padding:10px 16px;line-height:1.5;text-align:left;}
  #main-header #top-menu > li.menu-item-has-children > a:first-child::after{
    top:50%;bottom:auto;transform:translateY(-50%);
  }
  #main-header #top-menu > li:focus-within > .sub-menu{visibility:visible;opacity:1;}
}


/* ---- Markets We Serve: unify the Federal Government agency list. ---- */
body.page-id-258 .et_pb_section_4{background-color:#FFFFFF !important;background-image:none !important;}
body.page-id-258 .et_pb_section_4 .et_pb_module_header,
body.page-id-258 .et_pb_section_4 .et_pb_text_inner{color:#444444 !important;}
body.page-id-258 .et_pb_section_4 .et-pb-icon{color:#F96302 !important;}


/* ---- Markets We Serve: align section content to one vertical grid. ---- */
body.page-id-258 .et_pb_section_1 > .et_pb_row{width:90% !important;max-width:1290px !important;}

/* Upcoming Events: animated orange/gold text in the primary navigation. */
#main-header #top-menu > li.ampco-events-cta > a,
#main-header #mobile_menu li.ampco-events-cta > a {
  color: #b94700 !important;
  background-color: transparent !important;
  font-weight: 700 !important;
  font-size: 17px;
  white-space: nowrap;
  opacity: 1;
  position: relative;
  isolation: isolate;
  z-index: 0;
  border: 1.5px solid #F96302 !important;
  border-radius: 999px;
  box-shadow: 0 5px 18px rgba(249, 99, 2, .22), inset 0 0 0 1px rgba(249, 99, 2, .05);
  transition: transform .2s ease, filter .2s ease;
}
#main-header #top-menu > li.ampco-events-cta > a::before,
#main-header #mobile_menu li.ampco-events-cta > a::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F96302' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (min-width: 981px) {
  #main-header #top-menu > li.ampco-events-cta > a {
    height: 48px;
    padding: 0 24px 0 54px !important;
  }
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  #main-header #top-menu > li.ampco-events-cta > a,
  #main-header #mobile_menu li.ampco-events-cta > a {
    background-image: linear-gradient(90deg, #b94700 0%, #d95b00 22%, #a96100 42%, #df7700 50%, #a96100 58%, #d95b00 78%, #b94700 100%) !important;
    background-size: 300% 100% !important;
    background-repeat: repeat !important;
    background-position: 0% 50%;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent;
    animation: ampco-events-shimmer 4s linear infinite;
  }
}
#main-header #top-menu > li.ampco-events-cta > a:hover,
#main-header #mobile_menu li.ampco-events-cta > a:hover {
  animation-duration: 2s;
  filter: brightness(1.08);
  transform: translateY(-1px);
  opacity: 1;
}
#main-header li.ampco-events-cta > a:focus-visible {
  outline: 2px solid #b94700;
  outline-offset: 4px;
}
@keyframes ampco-events-shimmer {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 50%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 50%; }
  100% { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  #main-header #top-menu > li.ampco-events-cta > a,
  #main-header #mobile_menu li.ampco-events-cta > a {
    animation: none;
  }
}
@media (max-width: 980px) {
  #main-header #mobile_menu li.ampco-events-cta > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 24px) !important;
    min-height: 48px;
    margin: 10px 12px !important;
    padding: 0 22px 0 54px !important;
    text-align: center;
  }
}

/* Catalina staging fixes (match production).
   Scoped to pages that use the Catalina Theme Builder header — those
   rules target et_pb_column_0_tb_footer, which the global AMPCO footer
   also uses, so they must not run on other pages. */
@font-face {
  font-family: dorris;
  font-display: swap;
  src: url("/wp-content/uploads/et-fonts/Dorris-Regular.ttf") format("truetype");
}

body.et-tb-has-header .et-l--footer .et_pb_column_0_tb_footer {
  padding: 0 !important;
}
body.et-tb-has-header .et-l--footer .footr-row,
body.et-tb-has-header .et-l--footer .et_pb_row_0_tb_footer {
  min-height: 0 !important;
  align-items: center;
}
body.et-tb-has-header .et-l--footer .et_pb_section_0_tb_footer {
  min-height: 0 !important;
}

.et_pb_menu_0_tb_header ul li.current-menu-item > a::before,
.et_pb_menu_0_tb_header ul li.current-menu-item > a::after {
  display: none !important;
  content: none !important;
}
body.et-tb-has-header #page-container .et-l--footer .et_pb_section_0_tb_footer.et_pb_section,
body.et-tb-has-header.et_pb_pagebuilder_layout #page-container .et-l--footer .et_pb_section_0_tb_footer {
  padding-top: 20px !important;
  padding-bottom: 20px !important;
}
body.et-tb-has-header #page-container .et-l--footer .et_pb_row_0_tb_footer.et_pb_row,
body.et-tb-has-header #page-container .et-l--footer .footr-row {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  min-height: 0 !important;
}
body.et-tb-has-header #page-container .et-l--footer .et_pb_column_0_tb_footer,
body.et-tb-has-header #page-container .et-db #et-boc .et-l--footer .et_pb_column_0_tb_footer {
  padding: 0 !important;
}

/* Global AMPCO footer: match Visual Builder on the front end. */
body #page-container .ampco-footer-sec.et_pb_section {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
@media (min-width:981px){
  body #page-container .ampco-footer-sec .et_pb_row:not(.et_pb_row_inner) > .et_pb_column:first-child {
    width: 32% !important;
    margin-right: 2% !important;
    padding: 58px 40px 58px 56px !important;
  }
  body #page-container .ampco-footer-sec .et_pb_specialty_column {
    width: 66% !important;
    padding: 48px 24px 24px 16px !important;
  }
  .ampco-footer-sec .et_pb_row_inner:has(> .et_pb_column:nth-child(3)) {
    display: flex !important;
    align-items: flex-start;
    gap: 16px;
  }
  .ampco-footer-sec .et_pb_row_inner:has(> .et_pb_column:nth-child(3)) > .et_pb_column {
    float: none !important;
    width: auto !important;
    margin-right: 0 !important;
    flex: 1 1 0;
    min-width: 0;
  }
  .ampco-footer-sec .et_pb_row_inner:has(> .et_pb_column:nth-child(3)) > .et_pb_column:first-child {
    flex: 1.85 1 0;
  }
  .ampco-footer-sec .et_pb_row_inner a {
    white-space: nowrap;
  }
}
@media (min-width:981px) and (max-width:1299px){
  .ampco-footer-sec .et_pb_row_inner a {
    font-size: 14px !important;
  }
}
@media (max-width:980px){
  body #page-container .ampco-footer-sec .et_pb_row:not(.et_pb_row_inner) > .et_pb_column:first-child {
    padding: 40px 28px !important;
  }
}

/* ---- Projects filters: even grid on tablet/phone instead of uneven flex wrap. ---- */
.ampco-tabs{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}
@media (max-width:980px){
  .ampco-tabs{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    align-items:stretch;
  }
  .ampco-tabs a{
    width:auto !important;
    min-width:0 !important;
    height:56px !important;
    padding:8px 8px !important;
    font-size:15px !important;
    line-height:1.25 !important;
    text-align:center;
    white-space:normal;
  }
}
@media (max-width:767px){
  .ampco-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .ampco-tabs a{
    height:52px !important;
    padding:8px 6px !important;
    font-size:14px !important;
  }
  .ampco-tabs a:last-child{grid-column:1 / -1;}
}
@media (max-width:359px){
  .ampco-tabs{grid-template-columns:1fr;}
  .ampco-tabs a:last-child{grid-column:auto;}
}
