/* Restore styling fixes for newengland.media (Themify Ultra Agency skin).
 * Loaded after the archived theme & builder stylesheets to repair missing
 * dynamic assets, FA 4.2+ icons absent from archived FA 4.0, archive layouts,
 * and responsive behavior without live WordPress AJAX.
 */

/* Ensure Themify WOW / scroll-animated modules never remain stuck hidden */
.themify_builder .wow,
.module.wow,
.module_row.wow,
.builder-posts-wrap > .post.wow {
  visibility: visible !important;
  opacity: 1 !important;
  animation-name: none !important;
}

body.themify_builder_active,
body.ready-view {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Prevent horizontal overflow from fullwidth Themify Builder rows */
html,
body {
  overflow-x: hidden;
}
.full_width #pagewrap #content {
  width: 100%;
  max-width: 100%;
}

/* Header logo and horizontal bar */
#headerwrap {
  z-index: 999;
}
#headerwrap.fixed-header {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}
#header #site-logo img {
  max-width: 200px;
  height: auto;
  display: block;
}

/* Do not permanently underline same-page anchor links (#services, #blog, #staff) on homepage */
body.home #main-nav > li.current-menu-item > a[href*="#"] {
  color: #2a6c35;
}
body.home.header-horizontal #main-nav > li.current-menu-item > a[href*="#"]:after,
body.home.header-horizontal #main-nav > li.current_page_item > a[href*="#"]:after {
  width: 0;
}
body.home.header-horizontal #main-nav > li:hover > a[href*="#"]:after {
  width: 100%;
  border-color: #676767;
}

/* Desktop dropdown menus work cleanly on hover even without JS */
@media screen and (min-width: 1201px) {
  #main-nav li.menu-item-has-children {
    position: relative;
  }
  #main-nav li.menu-item-has-children > ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-top: 2px solid #2a6c35;
    padding: 8px 0;
    z-index: 1000;
  }
  #main-nav li.menu-item-has-children:hover > ul.sub-menu,
  #main-nav li.menu-item-has-children:focus-within > ul.sub-menu {
    display: block;
  }
  #main-nav ul.sub-menu li {
    display: block;
    margin: 0;
    padding: 0;
  }
  #main-nav ul.sub-menu li a {
    display: block;
    padding: 8px 18px;
    color: #2a6c35 !important;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
  }
  #main-nav ul.sub-menu li a:hover {
    background-color: #f4f7f4;
    color: #1c4a24 !important;
  }
}

/* Hide unused WooCommerce cart icon and hidden homepage query-portfolio controls */
.cart-wrap,
#slide-cart,
body.home .post-filter,
body.home #load-more {
  display: none !important;
}

/* Feature circle charts (DESIGN / DISTRIBUTE / DELIVER & About Services) */
.module-feature .module-feature-chart-html5 {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.module-feature .module-feature-chart-html5 .chart-html5-circle,
.module-feature .module-feature-chart-html5 .chart-html5-inset {
  border-radius: 50%;
}
.module-feature .module-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Crisp SVG icons for FontAwesome 4.2+ icons absent from the archived FA 4.0 font */
.fa.fa-share-alt:before,
.fa.fa-line-chart:before,
.fa.fa-sliders:before,
.fa.fa-connectdevelop:before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  vertical-align: -0.1em;
}
.fa.fa-share-alt:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z'/%3E%3C/svg%3E");
}
.fa.fa-line-chart:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3v18h18v-2H5V3H3zm4 12l4-4 3 3 6-6-1.41-1.41L14 11.17l-3-3L5.59 13.59 7 15z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3v18h18v-2H5V3H3zm4 12l4-4 3 3 6-6-1.41-1.41L14 11.17l-3-3L5.59 13.59 7 15z'/%3E%3C/svg%3E");
}
.fa.fa-sliders:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z'/%3E%3C/svg%3E");
}
.fa.fa-connectdevelop:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L3 7v10l9 5 9-5V7l-9-5zm0 2.3L18.4 8 12 11.7 5.6 8 12 4.3zM5 9.8l6 3.5v6.4l-6-3.4V9.8zm8 9.9v-6.4l6-3.5v6.5l-6 3.4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L3 7v10l9 5 9-5V7l-9-5zm0 2.3L18.4 8 12 11.7 5.6 8 12 4.3zM5 9.8l6 3.5v6.4l-6-3.4V9.8zm8 9.9v-6.4l6-3.5v6.5l-6 3.4z'/%3E%3C/svg%3E");
}

/* Improve readability of white copy over the Golf Content Network background photo */
.themify_builder_18_row.module_row_4.module_row > .builder_row_cover::before {
  background-color: rgba(15, 22, 18, 0.56);
}

/* Typewriter highlight */
.module-typewriter .typewriter-span {
  display: inline-block;
}

/* Portfolio & gallery images */
.module-gallery .gallery-item img,
.module-image img {
  max-width: 100%;
  height: auto;
}

/* Staff circular headshots and fallback initials badge */
.tb_section-staff .module-image img {
  border-radius: 50%;
  object-fit: cover;
}
.restore-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d6f36 0%, #419343 100%);
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 32px;
  letter-spacing: 0.04em;
  margin: 0 auto;
}

/* Hide unarchived broken images cleanly */
img.restore-img-missing {
  display: none !important;
}

/* Hide empty transparent post-date badge circles (text was made transparent in customizer) */
.post-date-wrap .post-date {
  display: none !important;
}

/* Fix About Us page (page-id-4) header overlap and unarchived builder-4 CSS */
body.page-id-4 #headerwrap {
  position: relative !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid #e6ece7;
}
body.page-id-4 .themify_builder_4_row.module_row_0 {
  background: linear-gradient(135deg, #eef5ef 0%, #f8faf8 100%);
  padding: 64px 0 48px !important;
  text-align: center;
}
body.page-id-4 .themify_builder_4_row.module_row_0 h1 {
  color: #2a6c35;
  margin-bottom: 0.35em;
}
body.page-id-4 .themify_builder_4_row {
  padding-top: 36px;
  padding-bottom: 36px;
}

/* Reveal Themify slider/testimonial items cleanly instead of infinite loader */
.tb_slider_loader,
.themify_builder_slider_wrap .themify_builder_slider_loader {
  display: none !important;
}
.themify_builder_slider_wrap {
  height: auto !important;
  visibility: visible !important;
  overflow: visible !important;
  opacity: 1 !important;
}
.themify_builder_slider_wrap ul.themify_builder_slider {
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.themify_builder_slider_wrap ul.themify_builder_slider > li {
  float: none !important;
  width: auto !important;
  background: #f7faf7;
  border: 1px solid #e3ebe4;
  border-radius: 6px;
  padding: 20px 22px;
}

/* Portfolio category archives: populated project card grid */
.tax-portfolio-category #content {
  padding-top: 36px;
  padding-bottom: 56px;
}
.tax-portfolio-category .loops-wrapper.portfolio {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
  margin-top: 28px;
}
.tax-portfolio-category .loops-wrapper.portfolio .portfolio-post {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  border: 1px solid #e3e8e4;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tax-portfolio-category .loops-wrapper.portfolio .portfolio-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09);
}
.restore-portfolio-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.restore-portfolio-thumb {
  background: #f3f6f4;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}
.restore-portfolio-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.restore-portfolio-placeholder {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #2a6c35;
  text-align: center;
  padding: 12px;
}
.restore-portfolio-body {
  padding: 16px 18px 20px;
}
.restore-portfolio-body h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
  color: #2a6c35;
}
.restore-portfolio-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5f6660;
}

/* Blog/category/tag/author archives & single posts */
.archive #content,
.single #content,
.error404 #content,
.search-results #content {
  padding-top: 32px;
  padding-bottom: 52px;
}
.archive:not(.tax-portfolio-category) .loops-wrapper .post {
  margin-bottom: 2.5em;
  padding-bottom: 2em;
  border-bottom: 1px solid #e6e6e6;
}
.archive .loops-wrapper .post .post-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.archive .loops-wrapper .post .post-title a {
  color: #2a6c35;
}
.archive .loops-wrapper .post .post-title a:hover {
  color: #419343;
}

/* Clean up Feedzy RSS sidebar spacing when external feed thumbnails are absent */
.feedzy-rss .rss_item .rss_image {
  display: none !important;
}
.feedzy-rss .rss_item .title,
.feedzy-rss .rss_item .rss_content {
  margin-left: 0 !important;
}

/* Search results page styling */
.search-results-list {
  margin-top: 1.5em;
}
.search-result-item {
  margin-bottom: 1.8em;
  padding-bottom: 1.4em;
  border-bottom: 1px solid #e5e5e5;
}
.search-result-item .post-title {
  margin: 0 0 0.4em;
  font-size: 1.35em;
}
.search-result-item .post-title a {
  color: #2a6c35;
  text-decoration: none;
}
.search-result-item .post-title a:hover {
  text-decoration: underline;
}

/* Contact form (Gravity Forms) polish */
.gform_wrapper .gform_button,
.gform_wrapper input[type="submit"] {
  background-color: #419343;
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
}
.gform_wrapper .gform_button:hover,
.gform_wrapper input[type="submit"]:hover {
  background-color: #2d6f36;
}
.gform_wrapper .ginput_recaptcha,
.gform_wrapper li.gfield:has(.ginput_recaptcha) {
  display: none !important;
}

/* Restore authentic light Agency footer with crisp dark-green branding */
#footerwrap {
  background-color: #ffffff;
  color: #555555;
  border-top: 1px solid #e6ece7;
}
#footerwrap a {
  color: #2a6c35;
}
#footerwrap a:hover {
  color: #1c4a24;
}
.footer-horizontal-left #footer .back-top .arrow-up a {
  background-color: #2a6c35 !important;
  color: #ffffff !important;
}

/* Simple lightbox modal for portfolio gallery items */
#restore-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 24px;
}
#restore-lightbox.open {
  display: flex;
}
#restore-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: #fff;
}
#restore-lightbox button {
  position: absolute;
  top: 18px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* Mobile menu button and drawer fallback */
#menu-icon {
  cursor: pointer;
}
@media screen and (max-width: 1200px) {
  body.restore-mobile-open #mobile-menu {
    right: 0 !important;
    display: block !important;
    visibility: visible !important;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
  }
}
