.case-detail { background: #fff; }
.case-banner { display: block; width: 100%; aspect-ratio: 1280 / 676; object-fit: cover; }
.case-banner-compact { max-height: 480px; object-fit: contain; background: var(--light, #e5e5e5); }
.case-detail-inner { max-width: 1440px; margin-inline: auto; padding: clamp(44px, 8vw, 100px) clamp(20px, 3.75vw, 54px) clamp(32px, 4vw, 56px); }
.case-capabilities { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: clamp(32px, 4.5vw, 58px); }
.case-capabilities h2 { margin: 0; font-size: 1.125rem; }
.case-capabilities ul { display: flex; flex-wrap: wrap; gap: .5rem .625rem; list-style: none; padding: 0; margin: 0; }
.case-capabilities li { padding: .45rem .65rem; border-radius: 999px; background: var(--navy, #153162); color: #fff; }
.case-detail h1 { margin: 0 0 clamp(20px, 3vw, 36px); font-size: clamp(1.75rem, 2.6vw, 2.5rem); }
.case-detail-grid.has-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.case-narrative { color: #1a1a19; font-size: 1.125rem; line-height: 1.5; }
.case-narrative:has(.case-narrative-section) { background: #e8e8e8; border-radius: 10px; padding: clamp(18px, 2.35vw, 30px); }
.case-narrative-section + .case-narrative-section { margin-top: clamp(32px, 6vw, 76px); }
.case-narrative-section > h2 { font-size: 1.375rem; margin: 0 0 1rem; }
.case-narrative-section > :last-child { margin-bottom: 0; }
.case-summary { margin: 0 0 1rem; }
.case-back-link { display: inline-block; margin-top: 28px; color: var(--navy, #153162); text-decoration: underline; text-underline-offset: 4px; font-weight: 650; }

.related h2 { font-size: clamp(1.65rem, 3.3vw, 2.65rem); }
.case-gallery, .case-gallery .wrap { padding: 0; }
.case-gallery h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.gallery-grid { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gallery-tile { position: relative; display: block; overflow: hidden; border-radius: 10px; }
.gallery-tile img { display: block; width: 100%; height: auto; }
.gallery-tile-label {
  position: absolute;
  right: .65rem;
  bottom: .65rem;
  padding: .4rem .65rem;
  border-radius: .45rem;
  background: #fff;
  color: #153162;
  font-size: .875rem;
  font-weight: 700;
}
.gallery-tile-label { opacity: 0; }
.gallery-tile:hover .gallery-tile-label, .gallery-tile:focus-visible .gallery-tile-label { opacity: 1; }
.gallery-tile:focus-visible, .gallery-viewer :focus-visible { outline: 3px solid #b3603c; outline-offset: 3px; }
.gallery-dialog {
  box-sizing: border-box;
  width: min(1050px, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100% - 1.5rem);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #1c2535;
}
.gallery-dialog::backdrop { background: rgb(7 19 35 / .85); }
.gallery-viewer { padding: clamp(.75rem, 2.5vw, 1.4rem); }
.gallery-viewer-header, .gallery-viewer-footer { display: flex; align-items: center; gap: .6rem; }
.gallery-viewer-header { justify-content: space-between; margin-bottom: .75rem; }
.blog-editor .gallery-viewer-header form { padding: 0; border: 0; }
.gallery-viewer-header h3, .gallery-viewer-footer p { margin: 0; }
.gallery-viewer-footer { flex-wrap: wrap; justify-content: center; margin-top: .75rem; }
.gallery-viewer-image {
  display: grid;
  place-items: center;
  height: min(64vh, 680px);
  height: min(64dvh, 680px);
  overflow: hidden;
  border-radius: 8px;
  background: #eef0f4;
}
.gallery-viewer-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gallery-viewer button, .gallery-viewer .gallery-full-image {
  padding: .5rem .7rem;
  border: 1px solid #153162;
  border-radius: .4rem;
  background: #fff;
  color: #153162;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.gallery-viewer button:hover, .gallery-viewer .gallery-full-image:hover { background: #153162; color: #fff; }
.gallery-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.related { background: #f3f3f3; }
.related-project { display: grid; background: white; border-radius: 12px; overflow: hidden; }
.related-project img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.related-project div { padding: 18px; }
.related-project h3 { font-size: 1.3rem; }
.related-project p { margin: 0; }
.related-project:hover h3, .related-project:focus-visible h3 { text-decoration: underline; }
@media (max-width: 700px) {
  .case-detail-grid.has-gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery-tile-label { right: .4rem; bottom: .4rem; }
}
