/* Mounted artwork, shared caption baseline, and one quietly selected work. */
#cases {
  --poster-art-height: clamp(300px, 27vw, 370px);
  --poster-card-width: calc(var(--poster-art-height) * .7 + 20px);
  --poster-wide-width: min(60vw, calc(var(--poster-art-height) * 1.62));
  --gallery-caption-height: 96px;
  background: linear-gradient(180deg, #fcfefe 0%, #f2f8f9 72%, #f8fcfc 100%);
}
#cases .cases-head { gap: 28px; align-items: flex-end; }
#cases .case-controls {
  padding: 4px;
  border: 0;
  border-radius: 13px;
  background: #e8f1f3;
  box-shadow: none;
}
#cases .filter {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #426b79;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
#cases .filter.active {
  border-color: #fff;
  background: #fff;
  color: #096e88;
  box-shadow: 0 3px 9px #214f5c0b;
  font-weight: 600;
}
#cases .filter:focus-visible,
#cases .gallery-buttons button:focus-visible {
  outline: 2px solid #147d96;
  outline-offset: 3px;
}
#cases .case-grid {
  align-items: stretch;
  gap: 20px;
  margin-top: 26px;
  padding: 11px 3px 25px;
  scroll-padding-inline: 3px;
  background: none;
  cursor: grab;
}
#cases .case-grid.is-dragging { cursor: grabbing; scroll-snap-type: none; }
#cases .case-card,
#cases .case-card.case-wide,
#cases .case-card.case-large,
#cases .case-card.case-landscape,
#cases .case-card.visual-poster {
  align-self: stretch;
  grid-template-rows: var(--poster-art-height) var(--gallery-caption-height);
  height: calc(var(--poster-art-height) + var(--gallery-caption-height));
  min-height: 0;
  border: 1px solid #dbe7e9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 7px 16px -12px #27505d40;
  transform: none;
  scale: none;
  opacity: 1;
  transition: border-color .35s ease, box-shadow .35s ease, opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
  transition-delay: 0s;
}
#cases .case-card img,
#cases .case-card.case-landscape img {
  width: 100%;
  height: var(--poster-art-height);
  min-height: 0;
  padding: 10px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: linear-gradient(140deg, #eaf0f2, #f7fafa 58%, #e9f1f3);
  filter: none;
  transform: none;
  transition: none;
}
#cases .case-card.case-landscape img { padding: 15px; }
#cases .case-overlay {
  min-height: 0;
  height: var(--gallery-caption-height);
  padding: 13px 16px 14px;
  gap: 3px;
  border-top: 0;
  background: #fff;
  justify-content: start;
  align-content: center;
}
#cases .case-overlay span { color: #537884; font-size: 10px; letter-spacing: .075em; }
#cases .case-overlay h3 { font-size: 17px; line-height: 1.5; font-weight: 600; color: #173e50; }
#cases .case-overlay p { color: #557580; font-size: 12px; line-height: 1.6; }
#cases.gallery-ready .case-card { opacity: .84; }
#cases.gallery-ready .case-card.is-gallery-current {
  opacity: 1;
  border-color: #74aab8;
  box-shadow: 0 14px 22px -16px #164f6466, 0 0 0 1px #b5d1d866;
  transform: translateY(-3px);
}
#cases .case-card:focus-visible {
  opacity: 1;
  outline: 2px solid #147d96;
  outline-offset: 2px;
}
#cases .case-card:hover img { transform: none; filter: none; }
#cases .gallery-toolbar { gap: 24px; padding-top: 0; min-height: 46px; }
#cases .gallery-counter { min-width: 62px; color: #1c657a; font-size: 13px; font-variant-numeric: tabular-nums; }
#cases .gallery-counter span { color: #678794; }
#cases .gallery-track { height: 3px; border-radius: 3px; background: #dbe9ec; }
#cases .gallery-track i { border-radius: inherit; background: linear-gradient(90deg, #137c94, #6fbabf); }
#cases .gallery-buttons { gap: 8px; }
#cases .gallery-buttons button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  border-color: #b9d0d7;
  background: #fff;
  color: #17667d;
  box-shadow: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
#cases .gallery-buttons button:disabled { opacity: .38; }
@media (hover: hover) and (pointer: fine) {
  #cases.gallery-ready .case-card:hover { opacity: 1; transform: translateY(-3px); border-color: #88b2c0; box-shadow: 0 14px 22px -16px #164f6466; }
  #cases .gallery-buttons button:not(:disabled):hover { color: #fff; background: #147b93; border-color: #147b93; }
  #cases .filter:not(.active):hover { color: #17667d; background: #f5fafb; }
}
@media (max-width: 760px) {
  #cases {
    --poster-art-height: clamp(252px, 69vw, 300px);
    --poster-card-width: calc(var(--poster-art-height) * .7 + 18px);
    --poster-wide-width: calc(100vw - 74px);
    --gallery-caption-height: 94px;
  }
  #cases .case-controls { margin-top: 20px; width: 100%; gap: 0; padding: 3px; border-radius: 11px; }
  #cases .filter { flex: 1 0 auto; padding: 9px 10px; font-size: 12px; line-height: 1.5; }
  #cases .case-grid { margin-top: 14px; gap: 14px; padding-top: 10px; padding-bottom: 22px; }
  #cases .case-card img { padding: 8px; }
  #cases .case-card.case-landscape img { padding: 9px; }
  #cases .case-overlay { padding: 12px 13px; gap: 3px; }
  #cases .case-overlay h3 { font-size: 16px; }
  #cases .case-overlay p { font-size: 12px; }
  #cases.gallery-ready .case-card { opacity: .9; }
  #cases .gallery-toolbar { gap: 17px; }
  #cases .gallery-buttons button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}
@media (max-width: 350px) {
  #cases .filter { font-size: 11px; padding-inline: 8px; }
  #cases .case-controls { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  #cases .case-card,
  #cases .case-card.is-gallery-current,
  #cases.gallery-ready .case-card:hover { transform: none; transition: none; }
  #cases .gallery-track i { transition: none; }
}
