
.grid-item {
  float: left;
  position: relative;
  cursor: pointer; /* items open lightbox on click */
  overflow: hidden; /* clip the absolutely-positioned subtitle overlay */
}

.grid-item img {
  display: block;
  max-width: 99%;
  transition: opacity 0.3s ease; /* on base state so both enter AND exit animate */
}

.grid-item img:hover {
  opacity: 0.3;
}

/* ── Desktop: subtitle overlay — hidden by default, shown on hover via hover-images.js ── */
@media (min-width: 992px) {
  .centered {
    visibility: hidden; /* JS toggles this; do NOT use display:none here */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 12px;
    font-weight: 500;
    color: #3d5f7a;
    background: rgba(255, 255, 255, 0.72);
    padding: 6px 14px;
    border-radius: 3px;
    text-align: center;
    max-width: 90%;
    pointer-events: none;
    line-height: 1.4;
    white-space: normal;
  }
}

/* ── Mobile: subtitle hidden entirely — only appears in lightbox caption ── */
@media (max-width: 991px) {
  .cell {
    display: none !important;
  }
}

.filters-height{
    width: 100%;
    height: 96px; /* increased from 75px to accommodate image + label */
}

.filters-imgs{
    margin: 4px 0 2px 0;
    display: block;
}

/* ── Desktop filter nav item — image + always-visible label ── */
.filter-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    gap: 2px;
    padding: 4px 0;
}

.filter-nav-label {
    font-size: 10px;
    text-align: center;
    color: #5a7694;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Active filter: terracotta label + slightly brighter image */
.filter-nav-active .filter-nav-label {
    color: #b47d5f;
    font-weight: 700;
}

.filter-nav-active .filters-imgs {
    opacity: 1;
    filter: drop-shadow(0 1px 3px rgba(180, 125, 95, 0.45));
}


@media (max-width: 980px){

  .mb-mob{
    margin-bottom: 20px;
  }

  .projects-position{
    margin-top:140px; 
    margin-left: 15px; 
    max-width: 99%;
  }

}

@media (min-width: 981px){
  .projects-position{
    margin-top:140px; 
    margin-left: 50px; 
    max-width: 99%;
  }

}

.form-response {
    text-align: center;
    margin-top: 100px;
    font-size: 24px;
    color: #5a7694;
    font-weight: bold;
}

@media (max-width: 980px){
  .form-response {
      text-align: center;
      margin-top: 100px;
      font-size: 50px;
      color: #5a7694;
      font-weight: bold;
      line-height: 70px;
  }
}

.body-portfolio {
  background-color: #d6dde4;
}

/* ── Responsive grid (replaces grid-mobile.html / grid-non-mobile.html) ── */
.grid-sizer,
.grid-item {
    width: 100%;
    margin-bottom: 10px;
    margin-left: 5px;
}

@media (min-width: 992px) {
    .grid-sizer,
    .grid-item {
        width: 32%;
    }
    #projects-container {
        margin-left: 20px;
    }
}

/* ── Mobile chip-strip filters — horizontal scroll, single row ── */
.mobile-filter-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 16px;
    background: #d6dde4;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain; /* prevent pull-to-refresh when swiping chips */
    scrollbar-width: none; /* Firefox */
}

.mobile-filter-chips::-webkit-scrollbar {
    display: none; /* Chrome / Safari */
}

.filter-chip {
    display: inline-block;
    flex-shrink: 0; /* prevent chips from collapsing */
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid #5a7694;
    color: #5a7694;
    background: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation; /* remove 300ms tap delay on mobile */
    transition: background-color 0.15s ease, color 0.15s ease;
}

.filter-chip.active,
.filter-chip:hover {
    background-color: #5a7694;
    color: #fff;
    text-decoration: none;
}

/* ── PhotoSwipe v5 custom caption ── */
.pswp__custom-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.pswp__custom-caption:empty {
    display: none;
}

.pswp__custom-caption-inner {
    background: rgba(89, 118, 148, 0.82);
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-size: 16px;
    font-family: Century Gothic, CenturyGothic, AppleGothic, sans-serif;
    line-height: 1.3;
}

@media (max-width: 980px) {
    .pswp__custom-caption-inner {
        font-size: 20px;
    }
}

/* ── Portfolio page header alignment
   Text aligns with first grid image.
   Offset = sidebar(300) + .info margin(20) + #projects-container(20) + BS gutter net(20) + grid-item margin(5) = -8px  correction
   Empirical: 337px ── */
@media (min-width: 992px) {
    .page-header-bar {
        padding-left: 337px;
    }
}

/* ── Filter labels: hide below 1775px (icons only on narrower desktops) ── */
@media (max-width: 1774px) {
    .filter-nav-label {
        display: none;
    }
    .filters-height {
        height: 72px;
    }
}

/* ── Mobile grid: remove Bootstrap container/col gutters so images fill the screen ── */
@media (max-width: 991px) {
    /* Zero out .info side margins (base.css adds margin:20px) */
    .info {
        margin-left: 0;
        margin-right: 0;
    }
    #projects-container.container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    #projects-container .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    #projects-container .col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .grid-sizer,
    .grid-item {
        margin-bottom: 4px;
        margin-left: 0;
    }
}