/* =============================================================================
   Project Grid — [project_grid] shortcode
   ============================================================================= */

.pgrid-wrap {
  margin: 0 auto;
  background-color: var(--global-palette7);
}

/* ---- Filters ---- */

.pgrid-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(116, 140, 164, 0.4);
}

.pgrid-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 1025px) {
  .pgrid-filter-group {
    max-width: 50vw;
  }
}

.pgrid-filter-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(12, 36, 74, 0.45);
  min-width: 68px;
  padding-right: 4px;
}

.pgrid-filter-btn {
  background-color: transparent !important;
  border: 1px solid rgba(116, 140, 164, 0.4);
  padding: 5px 14px;
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #0C244A;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  font-family: inherit;
  line-height: 1.5;
  box-shadow: none !important;
}

.pgrid-filter-btn:hover,
.pgrid-filter-btn:focus,
.pgrid-filter-btn:focus-visible,
.pgrid-filter-btn:active {
  background-color: rgba(12, 36, 74, 0.07) !important;
  outline: none;
  box-shadow: none !important;
}

.pgrid-filter-btn.is-active,
.pgrid-filter-btn.is-active:hover,
.pgrid-filter-btn.is-active:focus,
.pgrid-filter-btn.is-active:active {
  background-color: #0C244A !important;
  border-color: #0C244A;
  color: #fff;
}

/* ---- Grid — masonry columns ----
   column-rule draws the vertical divider in the column-gap without needing
   a container background-color (which would bleed into empty column space). */

.pgrid {
  columns: var(--pgrid-cols, 3);
  column-gap: 24px;
  column-rule: 1px solid rgba(116, 140, 164, 0.35);
}

/* ---- Item ---- */

.pgrid-item {
  break-inside: avoid;
  background-color: #fff;
  border-bottom: 1px solid rgba(116, 140, 164, 0.35);
  margin-bottom: 0;
  padding-bottom: 32px;
  transition: opacity 0.25s ease;
  position: relative;
}

.pgrid-item.is-hidden {
  display: none;
}

/* ---- Image ---- */


.pgrid-image-link {
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.pgrid-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.pgrid-item:hover .pgrid-img {
  transform: scale(1.03);
}

/* ---- Meta strip (services left, location right) ---- */

.pgrid-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 18px 24px 0;
}

.pgrid-meta-services,
.pgrid-meta-area {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(12, 36, 74, 0.55);
  line-height: 1.4;
}

.pgrid-meta-area {
  text-align: right;
  flex-shrink: 0;
}

/* ---- Title ---- */

.pgrid-body {
  padding: 10px 24px 0;
}

.pgrid-title {
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
  color: #0C244A;
  letter-spacing: -0.01em;
}

.pgrid-title a {
  color: inherit;
  text-decoration: none;
}

/* Stretch the title link to cover the entire card */
.pgrid-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* ---- No results message ---- */

.pgrid-no-results {
  break-inside: avoid;
  background-color: #fff;
  padding: 64px 24px;
  text-align: center;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(12, 36, 74, 0.4);
  margin: 0;
  display: none;
  width: 100%;
}

.pgrid-no-results.is-visible {
  display: block;
}

/* ---- Load more ---- */

.pgrid-load-more-wrap {
  text-align: center;
  padding-top: 40px;
}

.pgrid-load-more {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 1px solid rgba(12, 36, 74, 0.3);
  border-radius: 8px;
  color: #0C244A;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  padding: 14px 24px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s ease, border-color 0.3s ease;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.pgrid-load-more:focus,
.pgrid-load-more:active {
  outline: none;
  box-shadow: none !important;
  background: none;
}

.pgrid-load-more::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0C244A;
  clip-path: circle(0.5px at var(--x, 50%) var(--y, 50%));
  transition: clip-path 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.pgrid-load-more:hover::before {
  clip-path: circle(140% at var(--x, 50%) var(--y, 50%));
}

.pgrid-load-more:hover {
  color: #fff;
  border-color: #0C244A;
}

.pgrid-load-more span,
.pgrid-load-more svg {
  position: relative;
  z-index: 1;
}

.pgrid-load-more svg {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.pgrid-load-more:hover svg {
  transform: translateX(3px);
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
  .pgrid {
    --pgrid-cols: 2 !important;
  }
}

@media (max-width: 600px) {
  .pgrid {
    --pgrid-cols: 1 !important;
  }

  .pgrid-filters {
    gap: 18px;
    margin-bottom: 32px;
  }
}
