/*
Theme Name:   Child Theme
Theme URI:    https://example.com
Description:  Minimal child theme for HHA projects
Author:       Your Name
Template:     genesis-block-theme
Version:      1.0.0
*/


/* ============================================
   HHA Project Filters (Merged Styling)
   ============================================ */

/* Wrapper section */
.projects-filters {
  background: #f2f2f2 !important;
  padding: 40px 0;
  margin-bottom: 40px;
  border-bottom: 1px solid #e5e5e5;
  font-family: "circular-book","Helvetica Neue",Helvetica,Arial,sans-serif;
}
.projects-filters .container {
  padding-left: 210px;
  padding-right: 210px;
}
.projects-filters p {
  font-weight: 600;
  margin-bottom: 20px;
  text-align: left;
  color: #000;
}

/* Filter trigger boxes (Sector / Service / Location / All) */
.projects-filters .filter-trigger {
  display: block;
  background: #f2f2f2;
  border: 1px solid #000 !important;
  padding: 6px 15px;
  font-size: 15px;
  font-weight: 400;
  color: #000 !important;
  text-align: left;
  text-decoration: none;
  position: relative;
  transition: border-color 0.3s ease;
}
.projects-filters .filter-trigger[aria-expanded="true"] {
  border: 1px solid #000 !important;
}

/* Hover/active states */
.projects-filters .filter-trigger:hover,
.projects-filters .filter-trigger:focus,
.projects-filters .filter-trigger[aria-expanded="true"] {
  color: #000 !important;
  border-color: #007bff; /* subtle blue border on hover/active */
}
.projects-filters .filter-trigger:hover::after,
.projects-filters .filter-trigger:focus::after,
.projects-filters .filter-trigger[aria-expanded="true"]::after {
  color: #000 !important;
}

/* Reset / Clear filters button */
#clear-filters .filter-trigger {
  border-color: transparent;
  color: #000 !important;
  background: none;
  font-weight: 600;
  padding-left: 10px;
}
#clear-filters .filter-trigger::after {
  display: none;
}

/* Dropdown panels (inside filters) */
.filters-container .collapse {
  margin-top: 10px;
  position: absolute;
  background: #fff;
  left: 15px;
  right: 15px;
  top: 38px;
  z-index: 100;
  box-shadow: 1px 2px 5px -1px rgba(0,0,0,0.25);
}
.filters-container .collapse.show {
  border: 1px solid #3d3935;
}
@media screen and (max-width: 768px) {
  .filters-container .collapse {
    position: relative;
    top: 0;
    width: 100%;
    box-shadow: none;
  }
}

/* Dropdown grid layout */
#alm-filters-work_filter #alm-filter-1 ul,
#alm-filters-work_filter #alm-filter-2 ul,
#alm-filters-work_filter #alm-filter-3 ul {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media screen and (max-width: 768px) {
  #alm-filters-work_filter #alm-filter-1 ul,
  #alm-filters-work_filter #alm-filter-2 ul,
  #alm-filters-work_filter #alm-filter-3 ul {
    grid-template-columns: 1fr;
  }
}

/* Ajax Load More checkboxes (skinned) */
.alm-filters-container .alm-filter li div.alm-filter--link {
  display: block;
  padding: 0 10px 0 28px;
  min-height: 24px;
  line-height: 1.45;
  font-size: 15px;
  position: relative;
  text-decoration: none;
  color: #000; /* black text inside dropdown */
  cursor: pointer;
}
.alm-filters-container .alm-filter li div.alm-filter--link:before {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 1px solid #000;
  content: "";
}
.alm-filters-container .alm-filter li div.alm-filter--link.active {
  color: #000;
}
.alm-filters-container .alm-filter li div.alm-filter--link.active:before {
  background-color: #000;
  border-color: #000;
}
.alm-filters-container .alm-filter li div.alm-filter--link:hover {
  color: #000;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .projects-filters .container {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Default box for checkboxes */
.alm-filters-container .alm-filter li div.alm-filter--link.field-checkbox:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border: 1px solid #000; /* black border for the box */
  background: #fff;
}

/* Remove the unwanted dash before filter items */
.alm-filter--checkbox::before {
  content: none !important;
}

/* Dropdown containers for Sector / Service / Location */
#alm-filters-work_filter #alm-filter-1,
#alm-filters-work_filter #alm-filter-2,
#alm-filters-work_filter #alm-filter-3 {
  top: 2px;
  width: 100%;
  position: absolute;
  background: #fff;
  padding: 10px 20px 25px;
  border: 1px solid #d5d3d2;
  box-shadow: 1px 2px 5px -1px rgba(0, 0, 0, 0.25);
  display: none; /* hidden by default */
}

/* Ensure open dropdowns display */
#alm-filters-work_filter #alm-filter-1.show,
#alm-filters-work_filter #alm-filter-2.show,
#alm-filters-work_filter #alm-filter-3.show {
  display: block;
}

/* Z-index stacking for each filter */
#alm-filters-work_filter #alm-filter-1 { z-index: 100; }
#alm-filters-work_filter #alm-filter-2 { z-index: 101; }
#alm-filters-work_filter #alm-filter-3 { z-index: 103; }

/* Layout inside dropdowns */
#alm-filters-work_filter #alm-filter-1 ul,
#alm-filters-work_filter #alm-filter-2 ul,
#alm-filters-work_filter #alm-filter-3 ul {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 10px;
}

@media screen and (max-width: 768px) {
  #alm-filters-work_filter #alm-filter-1,
  #alm-filters-work_filter #alm-filter-2,
  #alm-filters-work_filter #alm-filter-3 {
    position: relative;
    top: 0;
    width: 100%;
    box-shadow: none;
  }

  #alm-filters-work_filter #alm-filter-1 ul,
  #alm-filters-work_filter #alm-filter-2 ul,
  #alm-filters-work_filter #alm-filter-3 ul {
    grid-template-columns: 1fr;
  }
}


/* Active tab styling */
.box-link[aria-expanded="true"] {
  background: #fff;              /* white background */
  color: #0099dd;                /* HHA blue text */
  border: 1px solid #d5d3d2;     /* light grey border */
  border-bottom: none;           /* open bottom to connect */
  position: relative;
  z-index: 105;
}



/* Dropdown panels */
#alm-filters-work_filter .alm-filter {
  position: absolute;
  top: calc(100% - 1px);          /* flush under connector */
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 1px 2px 5px -1px rgba(0, 0, 0, 0.25);
  border: 1px solid #d5d3d2;
  border-top: none;               /* prevents double border */
  z-index: 100;
  padding: 15px 20px;
}

/* Mobile override — no connector, stacked */
@media screen and (max-width: 768px) {
  .box-link[aria-expanded="true"]::after {
    display: none;
  }
  #alm-filters-work_filter .alm-filter {
    position: relative;
    top: 0;
    border-top: 1px solid #d5d3d2; /* restore top border */
    box-shadow: none;
  }
}

/* Active tab text should be HHA blue */
.projects-filters .filter-trigger[aria-expanded="true"],
.box-link[aria-expanded="true"] {
  color: #0099dd !important; /* HHA blue */
}

/* Page Title Section */
[aria-label="Page title section"] .container {
  padding-left: 90px;
  padding-right: 90px;
}

.inpage-title {
  font-size: 45px;        /* same as HHA */
  line-height: 1.2;
  margin: 0 0 40px 0;     /* spacing below title before filters */
  font-family: "circular-book","Helvetica Neue",Helvetica,Arial,sans-serif;
  font-weight: 400;
  color: #000;
}

.inpage-title .black {
  color: #000;            /* ensure subline stays black */
}

/* Force title full-width with 90px padding */
[aria-label="Page title section"] .container,
[aria-label="Page title section"] .row,
[aria-label="Page title section"] .col-md-12 {
  max-width: 100% !important;
  padding-left: 75px !important;
  padding-right: 70px !important;
}

/* Default arrow (closed state) */
.box-link::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: url("https://arms3stg.wpenginepowered.com/wp-content/uploads/2025/09/arrow-sm-down.svg") center center no-repeat;
  background-size: contain;
}

/* Active state (open → X) */
.box-link[aria-expanded="true"]::before {
  background: url("https://arms3stg.wpenginepowered.com/wp-content/uploads/2025/09/error.svg") center center no-repeat;
  background-size: contain;
}


/* ===============================================
   RESPONSIVE FIX — Keep desktop crop, limit mobile height
   =============================================== */

/* Default desktop/tablet — keep ALM's aspect ratio intact */
@media (min-width: 781px) {
  .project-item .project-image[style] {
    aspect-ratio: 360 / 360 !important; /* restores rectangular crop */
    height: auto !important;
    min-height: unset !important;
  }
}

/* Add left/right padding to Projects grid (desktop default) */
.alm-listing {
  padding-left: 75px !important;
  padding-right: 75px !important;
  box-sizing: border-box !important;
}

/* Tablet */
@media (max-width: 1024px) {
  .alm-listing {
    padding-left: 40px !important;
    padding-right: 40px !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .alm-listing {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}




#projectsgrid .project-item .project-image img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

@media (max-width: 768px) {
  #projectsgrid .project-item .project-image {
    aspect-ratio: 4 / 3 !important;
  }
}


/* Force consistent mobile image size: 580 × 480 */
@media (max-width: 768px) {
  .alm-listing .project-item .project-image {
    aspect-ratio: 580 / 530 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .alm-listing .project-item .project-image img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}


/* Hover zoom preserved */
.project-link:hover .project-image img {
  transform: scale(1.05);
  transition: transform 0.35s ease;
}


/* ==========================================
   Center project archive title (CSS only)
   ========================================== */

/* Make the container full-width for this section only */
[aria-label="Page title section"] .container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 40px !important; /* ⬅️ Added top padding */
}

/* Center align text and control spacing */
.inpage-title {
    text-align: center !important;
    margin: 0 auto 40px auto !important;
    font-family: "circular-book", "Helvetica Neue", Helvetica, Arial, sans-serif;
    max-width: 900px;
}

/* Keep the second line black (HHA-style) */
.inpage-title .black {
    color: #000 !important;
}

/* Responsive Typography */
@media (max-width: 992px) {
    .inpage-title { font-size: 40px; }
}
@media (max-width: 768px) {
    .inpage-title { font-size: 34px; }
}
@media (max-width: 560px) {
    .inpage-title { font-size: 30px; }
}
@media (max-width: 380px) {
    .inpage-title { font-size: 26px; }
}

/* ==========================================
   Force title into one line on mobile
   ========================================== */

/* Wrap both parts on one line */
.inpage-title {
    white-space: normal !important; /* default on desktop */
}

@media (max-width: 560px) {
    .inpage-title {
        white-space: nowrap !important;   /* keep whole text on one line */
        font-size: 26px !important;       /* optional: shrink font so it fits */
    }

    .inpage-title br {
        display: none !important;         /* hide the forced line break */
    }
}

/* Temporarily hide ONLY the filter UI, NOT the load more button */
.projects-filters,
#filtersGroup {
    display: none !important;
}



/* Bottom breathing room under the Projects grid section */
.projects-grid {
    padding-bottom: 60px !important;   /* adjust to taste */
}

/* Add space between project image and project title */
.project-item .project-image {
    margin-bottom: 10px !important;   /* adjust to taste */
}

/* Page title: Featured Projects */
.inpage-title {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 400 !important; /* Montserrat Regular */
}

/* Project title + arrow */
.project-item .project-name {
    position: relative !important;
    padding-right: 60px !important; /* space for arrow */
    display: block !important;
    margin-top: 15px !important;    /* optional: match HHA tighter spacing */
}

/* Arrow icon (right-aligned) */
.project-item .project-name::after {
    content: "" !important;
    position: absolute;
    top: 50%;
    right: 0;
    width: 50px;
    height: 15px;
    transform: translateY(-50%);
    background: url("https://arms3stg.wpenginepowered.com/wp-content/uploads/2025/11/arrow-right-long-black.svg") center right no-repeat !important;
    background-size: contain !important;
    transition: transform 0.3s ease-in-out;
}

/* Hover movement (like HHA site) */
.project-item:hover .project-name::after {
    transform: translateY(-50%) translateX(5px);
}

/* Arrow always aligned to the top line */
.project-item .project-name::after {
    top: 4px !important;   /* adjust height as needed */
    transform: none !important;
}

/* Ajax Load More button wrapper */
.alm-btn-wrap {
  display: block !important;
  text-align: center !important;
  padding: 40px 0 60px !important;
  background: transparent !important;
  border: none !important;
  clear: both !important;
}

/* Button Reset */
.alm-load-more-btn {
  all: unset !important;
  display: inline-block !important;
  width: 133px !important;
  height: 133px !important;
  position: relative !important;
  cursor: pointer !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
  background: transparent !important;
  border: none !important;
}

/* Force kill any background-image, opacity/visibility on ::before */
.alm-load-more-btn::before,
.alm-load-more-btn::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  background: #333 !important;
  background-image: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  z-index: 2 !important;
}

/* Horizontal line */
.alm-load-more-btn::before {
  top: 50% !important;
  left: 0 !important;
  width: 100% !important; /* Changed to 100% to auto-scale */
  height: 1px !important;
  transform: translateY(-50%) !important;
}

/* Vertical line */
.alm-load-more-btn::after {
  top: 0 !important;
  left: 50% !important;
  width: 1px !important;
  height: 100% !important; /* Changed to 100% to auto-scale */
  transform: translateX(-50%) !important;
}

/* Optional hover effect */
.alm-load-more-btn:hover {
  opacity: 0.7 !important;
}

/* Responsive for mobile */
@media (max-width: 768px) {
  .alm-load-more-btn {
    width: 100px !important;
    height: 100px !important;
  }
  /* Note: No need to resize before/after here because I changed them to 100% above */
}

/* --- THE FIX IS BELOW --- */

/* I added 'body' to the start of this selector. 
   This makes it more "specific" than the plugin's rule, 
   forcing the vertical line to appear.
*/
body .alm-btn-wrap .alm-load-more-btn::after {
  display: block !important;
  content: '' !important;
  height: 100% !important;
  width: 1px !important;
  background: #333 !important;
}

/* TEMP: hide Ajax Load More plus button */
.alm-btn-wrap {
  display: none !important;
}
