/* =========================================================================
   Case studies — hub (/case-studies) + the six portfolio item pages
   Page-specific additions on top of /styles.css
   ========================================================================= */

/* active nav item: 1px underline drawn 0.1em above the text bottom */
.header-nav-item--active > a {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: repeat-x;
  background-size: 1px 1px;
  background-position: 0 calc(100% - .1em);
}

/* Squarespace heading margins are 2rem top & bottom */
.cs-page .txt :is(h1, h2, h3) { margin-bottom: 2rem; }
.cs-page .txt > :last-child { margin-bottom: 0; }

/* first section sits under the absolutely positioned header */
.first-section { padding-top: var(--header-height); }

/* section heights (Squarespace section-height small / medium) */
.sh-small  { --min-h: 33vh; --cw-pad: 3.3vmax; }
.sh-medium { --min-h: 66vh; --cw-pad: 6.6vmax; }

/* =========================================================================
   Classic layout engine (sqs-layout, 12 columns, 17px block padding)
   ========================================================================= */
.cl {
  width: 100%;
  max-width: calc(var(--sqs-site-max-width) + 8vw);
  margin: 0 auto;
  padding: 0 4vw;
}
.cl-row { display: flex; margin: 0 -17px; }
.cl-col { min-width: 0; }
.cl-col.span-12 { width: 100%; }
.cl-col.span-6  { width: 50%; }
.cl-block { padding: 17px; }
.cl > .cl-row:first-child > .cl-col > .cl-block:first-child { padding-top: 0; }
.cl-spacer { height: 34px; padding: 0 17px; }
.cl-block.hr hr { margin: 8px 0; }

/* rich text lists */
.txt ul {
  list-style: disc;
  margin: 1rem 0;
  padding: 0 0 0 40px;
}
.txt li > p { margin: .5em 0; }

/* image block with fixed crop ratio, rounded 20px */
.cl-img-wrap { position: relative; }
.cl-img-shape {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: var(--ratio, 75%);
  border-radius: 20px;
  overflow: hidden;
}
.cl-img-shape img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--focal, 50% 50%);
  display: block;
}

@media (max-width: 767px) {
  .cl { padding: 0 6vw; }
  .cl-row { display: block; }
  .cl-col.span-6 { width: 100%; }
  .cl > .cl-row:first-child > .cl-col > .cl-block:first-child { padding-top: 17px; }
  .cl-spacer { display: none; }
}

/* =========================================================================
   Impact cards (Fluid Engine text blocks with a white background)
   ========================================================================= */
.impact-card { background: var(--white); border-radius: 20px; }
.impact-card > .txt { padding: 8%; }

/* =========================================================================
   Item pagination (portfolio prev / next)
   ========================================================================= */
.item-pagination {
  display: flex;
  padding: 3vw 4vw;
  background: var(--light);
  color: var(--black);
}
.item-pagination-link {
  display: flex;
  align-items: center;
  max-width: 50%;
  width: auto;
  text-align: left;
  color: var(--black);
  text-decoration: none;
}
.item-pagination-link--prev { margin-left: 0; margin-right: auto; }
.item-pagination-link--next { margin-left: auto; margin-right: 0; text-align: right; }
.item-pagination-prev-next { display: none; }
.item-pagination-title {
  margin: 0; padding: 0;
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: var(--fs-large);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--black);
}
.item-pagination-icon { width: 18px; height: 32px; padding-right: 25px; box-sizing: content-box; line-height: 1em; }
.item-pagination-link--next .item-pagination-icon { padding-right: 0; padding-left: 25px; }
.item-pagination-icon svg { display: block; width: 18px; height: 32px; stroke: var(--black); stroke-width: 1px; }
@media (max-width: 767px) {
  .item-pagination { padding: 3vw 6vw; }
}

/* =========================================================================
   Hub — portfolio grid (basic, 3 columns, 3:2, zoom hover)
   ========================================================================= */
.portfolio-section { display: block; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  padding: 6.6vw 4vw;
}
.grid-item {
  display: flex;
  flex-direction: column;
  color: var(--black);
  text-decoration: none;
}
.grid-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 66.6667%;
  overflow: hidden;
  margin: 0;
  line-height: 0;
  transition: opacity ease 200ms;
  border-radius: 15px;
  overflow: hidden;
}
.grid-image-inner { position: absolute; inset: 0; }
.grid-image img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transition: transform .4s;
}
.grid-item:hover .grid-image img { transform: scale(1.1); }
.portfolio-text { position: relative; margin-top: 20px; }
.portfolio-title {
  margin: 0 0 .5em;
  padding: 0;
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: var(--fs-h4);
  line-height: 1.2em;
  letter-spacing: -.02em;
  color: var(--black);
}
@media (max-width: 767px) {
  .portfolio-grid { grid-template-columns: minmax(0, 1fr); padding: 6.6vw 6vw; }
}

/* Hub (27 Oct 2026): one key result under each title, and service filters above the grid */
.portfolio-result { margin: .4rem 0 0; font-size: .95rem; line-height: 1.45; color: var(--grey, #686868); }
.work-filters { position: relative; display: flex; flex-wrap: wrap; gap: .5rem; width: min(var(--sqs-site-max-width), calc(100% - var(--sqs-site-gutter) * 2)); margin: 0 auto; padding-top: 5vw; }
.work-filters + .portfolio-grid { padding-top: 2.5vw; }
.work-filters .chip { padding: .55rem 1.1rem; border: 1px solid rgba(38, 59, 80, .25); border-radius: 300px; background: transparent; font: inherit; font-size: .9rem; font-weight: 500; color: var(--black); cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.work-filters .chip:hover { border-color: var(--black); }
.work-filters .chip[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: var(--white); }
.work-filters .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid-item[hidden] { display: none; }
.portfolio-grid { width: min(var(--sqs-site-max-width), calc(100% - var(--sqs-site-gutter) * 2)); margin: 0 auto; padding-left: 0; padding-right: 0; }
@media (max-width: 767px) {
  .work-filters, .portfolio-grid { width: calc(100% - var(--sqs-mobile-site-gutter) * 2); }
  .work-filters { padding-top: 8vw; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .work-filters::-webkit-scrollbar { display: none; }
  .work-filters .chip { flex: 0 0 auto; }
}
