.case-detail { color: #222; background: #fff; }
.case-detail__header, .case-gallery, .case-points, .case-related { width: calc(100% - 48px); max-width: var(--container-max); margin-inline: auto; }
.case-detail__header { padding-top: 56px; }
.case-detail__header h1 { display: inline; margin: 0; font-size: 30px; letter-spacing: .04em; }
.case-detail__header > p:first-of-type { display: inline; margin-left: 24px; font-size: 14px; }
.case-detail__header > p span { margin: 0 12px; color: #aaa; }
.case-detail__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.case-detail__tags span { padding: 4px 9px; border-radius: 3px; background: #e9e9e7; color: #777; font-size: 11px; }
.case-detail__date { margin: 16px 0 12px; color: #777; font-size: 13px; }

.case-gallery { display: grid; grid-template-columns: minmax(0, 4fr) minmax(230px, 1.35fr); gap: 18px; }
.case-gallery__main { position: relative; aspect-ratio: 16 / 10;}
.case-gallery__zoom { width: 100%; height: 100%; padding: 0; }
.case-gallery__main img { width: 100%; height: 100%; display: block; object-fit: cover; }
.case-gallery__nav { position: absolute; z-index: 2; top: 50%; width: 30px; height: 70px; transform: translateY(-50%); background: rgba(15,15,15,.82); color: #fff; font-size: 30px; }
.case-gallery__nav img { width: 14px; height: auto; margin: auto; transform: rotate(-90deg); object-fit: contain; pointer-events: none; }
.case-gallery__nav--prev { left: 0; }.case-gallery__nav--next { right: 0; }
.case-gallery__side { display: flex; flex-direction: column; }
.case-gallery__thumbs { width: 100%; overflow: hidden; }
.case-gallery__thumb-track { display: grid; grid-template-rows: repeat(4, auto); grid-auto-flow: column; grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; transition: transform .38s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.case-gallery__thumbs button { width: 100%; padding: 0; aspect-ratio: 4 / 3; overflow: hidden; opacity: .75; }
.case-gallery__thumbs button[aria-current="true"] { opacity: 1; outline: 3px solid #2f765e; outline-offset: -3px; }
.case-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.case-gallery__controls { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.case-gallery__controls button { min-width: 72px; min-height: 40px; border: 1px solid #ddd; color: #555; }
.case-gallery__controls button:disabled { opacity: .35; cursor: not-allowed; }
.case-gallery__controls span { display: flex; gap: 8px; }.case-gallery__controls i { width: 9px; height: 9px; border-radius: 50%; background: #ddd; }.case-gallery__controls i.is-active { background: #2f765e; }

.case-points { padding: 42px 0 90px; }
.case-points > h2 { margin: 0 0 10px; font-size: 20px; }
.case-points > p { margin: 0 0 12px; font-size: 14px; line-height: 2; }
.case-specs { margin: 54px 0 0; border-top: 1px solid #e5e5e3; }
.case-specs div { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid #e5e5e3; }
.case-specs dt, .case-specs dd { margin: 0; padding: 15px 20px; font-size: 14px; }.case-specs dt { font-weight: 700; }
.case-glossary { position: relative; margin-top: 68px; padding: 62px 40px 30px; border-radius: 20px; background: #f5f5f3; }
.case-glossary > h2 { position: absolute; top: 0; left: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 176px; height: 40px; margin: 0; padding: 0 20px; border-radius: 20px 0 20px 0; background: #2f765e; color: #fff; font-size: 17px; font-weight: 500; line-height: 1; }
.case-glossary dl { margin: 0; }.case-glossary div { margin-bottom: 27px; }.case-glossary div:last-child { margin-bottom: 0; }.case-glossary dt { margin: 0 0 5px; font-size: 15px; font-weight: 700; }.case-glossary dd { margin: 0; color: #555; font-size: 13px; line-height: 1.8; }

.case-related { padding-bottom: 2px; }
.case-related__section { margin-bottom: 58px; }
.case-related__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }.case-related__head h2 { margin: 0; font-size: 22px; }
.case-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.case-related .case-card { box-shadow: none; }
.case-related-card { overflow: hidden; border: 1px solid #e4e4e1; border-radius: 14px; background: #fff; }
.case-related-card > a > div { position: relative; aspect-ratio: 4 / 3; }.case-related-card img { width: 100%; height: 100%; object-fit: cover; display: block; }.case-related-card time { position: absolute; top: 0; left: 0; padding: 5px 14px; border-radius: 0 0 10px 0; background: #181818; color: #fff; font-size: 11px; }
.case-related-card section { min-height: 235px; padding: 18px; display: flex; flex-direction: column; }.case-related-card h3 { margin: 0 0 5px; font-size: 15px; }.case-related-card h3 small { font-size: 11px; font-weight: 400; }.case-related-card p { margin: 0 0 10px; font-size: 12px; }.case-related-card section > div { display: flex; flex-wrap: wrap; gap: 5px; }.case-related-card section span { padding: 3px 6px; background: #ececea; color: #777; font-size: 9px; }.case-related-card b { margin-top: auto; padding-top: 16px; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .08em; }
.case-lightbox { width: min(92vw, 1200px); padding: 0; border: 0; background: transparent; }.case-lightbox::backdrop { background: rgba(0,0,0,.88); }.case-lightbox img { width: 100%; max-height: 88vh; object-fit: contain; display: block; }.case-lightbox button { position: fixed; top: 20px; right: 24px; width: 48px; height: 48px; color: #fff; font-size: 32px; }

@media (min-width: 768px) {
  .case-related .case-card { border: 1px solid #e4e4e1; }
}

@media (max-width: 767px) {
  .case-detail__header, .case-gallery, .case-points, .case-related { width: calc(100% - 32px); }
  .case-detail__header { padding-top: 38px; }.case-detail__header h1 { display: block; font-size: 24px; }.case-detail__header > p:first-of-type { display: block; margin: 8px 0 0; font-size: 12px; }
  .case-gallery { width: 100%; max-width: 100vw; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .case-gallery__main { aspect-ratio: 4 / 3; }
  .case-gallery__side { width: 100%; min-width: 0; display: block; overflow: hidden; }
  .case-gallery__thumbs { overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .case-gallery__thumbs::-webkit-scrollbar { display: none; }
  .case-gallery__thumb-track { width: 100%; display: flex; gap: 4px; transform: none !important; }
  .case-gallery__thumbs button { flex: 0 0 calc((100% - 12px) / 4); aspect-ratio: 4 / 3; scroll-snap-align: start; }
  .case-gallery__controls { display: none; }
  .case-points { padding: 32px 0 64px; }.case-points > p { font-size: 13px; }.case-specs { margin-top: 38px; }.case-specs div { grid-template-columns: 1fr; }.case-specs dt { padding-bottom: 3px; }.case-specs dd { padding-top: 3px; }
  .case-glossary { margin-top: 48px; padding: 60px 22px 24px; border-radius: 16px; }
  .case-glossary > h2 { width: 168px; height: 40px; border-radius: 16px 0 16px 0; font-size: 16px; }
  .case-detail .case-related {
    width: calc(100% - 20px);
    padding-top: 42px;
    padding-bottom: 100px;
    background: #d9d9d2;
    box-shadow: 0 0 0 100vmax #d9d9d2;
    clip-path: inset(0 -100vmax);
  }
  .case-related .case-card { border: 0; }
  .case-related__section { margin-bottom: 130.5px; }
  .case-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .case-related__grid > .case-card:nth-child(n + 3) { display: none; }
  .case-related__head h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .case-gallery__thumb-track { transition: none; }
}
