/*
 * Before / After case section (#cases), inserted after #services by cases-v20261206.js.
 * Every selector is scoped under #cases so existing styles are not affected.
 * /assets/* is cached as immutable: bump the version in the file name when this changes.
 */

#cases {
  padding: 48px 16px;
  background: #FFFDF5;
  border-bottom: 4px solid #000;
  color: #000;
}

#cases .kc-inner {
  max-width: 80rem;
  margin: 0 auto;
}

/* Heading */
#cases .kc-head {
  max-width: 48rem;
  margin-bottom: 32px;
}

#cases .kc-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 2px 10px;
  background: #FFC900;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

#cases .kc-title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

#cases .kc-mark {
  background: linear-gradient(transparent 62%, #FFC900 62%);
}

#cases .kc-lead {
  margin: 16px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.75;
}

/* Case cards */
#cases .kc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

#cases .kc-more {
  margin-top: 32px;
}

#cases .kc-more[hidden] {
  display: none;
}

#cases .kc-card {
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
}

#cases .kc-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#cases .kc-card .kc-pair {
  cursor: zoom-in;
}

#cases .kc-shot {
  position: relative;
  min-width: 0;
  margin: 0;
  background: #E8E4D6;
  border: 3px solid #000;
  line-height: 0;
}

#cases .kc-shot picture {
  display: block;
}

#cases .kc-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

#cases .kc-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 8px;
  background: #000;
  color: #fff;
  border: 2px solid #000;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
}

#cases .kc-tag-after {
  background: #FFC900;
  color: #000;
}

#cases .kc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

#cases .kc-name {
  min-width: 0;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 900;
  line-height: 1.4;
}

#cases .kc-text {
  margin: 8px 0 0;
  color: #1F2937;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.7;
}

/* Buttons */
#cases .kc-zoom,
#cases .kc-close {
  flex: none;
  min-height: 44px;
  padding: 4px 14px;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}

#cases .kc-actions {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

#cases .kc-toggle {
  min-height: 56px;
  padding: 12px 24px;
  background: #fff;
  color: #000;
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
  font-size: 1.0625rem;
  font-weight: 900;
  line-height: 1.5;
  cursor: pointer;
}

#cases .kc-zoom:hover,
#cases .kc-close:hover,
#cases .kc-toggle:hover {
  background: #FFC900;
}

#cases button:focus-visible,
#cases a:focus-visible {
  outline: 3px solid #0090FF;
  outline-offset: 3px;
}

/* Notes and contact */
#cases .kc-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 3px solid #000;
}

#cases .kc-notes {
  flex: 1 1 28rem;
  min-width: 0;
  max-width: 48rem;
}

#cases .kc-note {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.8;
}

#cases .kc-note + .kc-note {
  margin-top: 8px;
}

#cases .kc-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 28px;
  background: #FFC900;
  color: #000;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  font-size: 1.125rem;
  font-weight: 900;
  line-height: 1.5;
  text-decoration: none;
}

#cases .kc-cta:hover {
  background: #fff;
}

/* Enlarged view: a modal <dialog> sits in the top layer, above the sticky navbar. */
#cases .kc-dialog {
  /* Width at which two 3:4 photos fit the viewport height; 230px is heading, text and padding. */
  width: min(70rem, max(560px, calc((100vh - 230px) * 1.5 + 60px)));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #FFFDF5;
  color: #000;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 #000;
}

#cases .kc-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

#cases .kc-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #FFC900;
  border-bottom: 3px solid #000;
}

#cases .kc-dialog-title {
  min-width: 0;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.4;
}

#cases .kc-dialog-body {
  padding: 16px;
}

#cases .kc-dialog-text {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.7;
}

#cases .kc-dialog-pair {
  /* Never upscale past the photo's own pixel width. */
  grid-template-columns: repeat(2, minmax(0, var(--kc-natural, 900px)));
  justify-content: center;
  gap: 12px;
}

@media (min-width: 768px) {
  #cases {
    padding: 80px 32px;
  }

  #cases .kc-head {
    margin-bottom: 48px;
  }

  #cases .kc-title {
    font-size: 3.75rem;
  }

  #cases .kc-lead {
    font-size: 1.125rem;
  }
}

@media (max-width: 767px) {
  #cases .kc-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  #cases .kc-more {
    margin-top: 24px;
  }

  #cases .kc-card {
    padding: 12px;
  }

  #cases .kc-card .kc-pair {
    gap: 6px;
  }

  #cases .kc-cta {
    width: 100%;
  }
}

/* On narrow screens side by side would barely enlarge anything, so stack the two photos. */
@media (max-width: 599px) {
  #cases .kc-dialog {
    width: calc(100vw - 24px);
  }

  #cases .kc-dialog-body {
    padding: 12px;
  }

  /* Two descriptions say "the left photo", which is wrong when stacked; the stage tags remain. */
  #cases .kc-dialog-text {
    display: none;
  }

  #cases .kc-dialog-pair {
    grid-template-columns: minmax(0, var(--kc-natural, 900px));
  }
}
