/*
 * @华创联合智控-css-index
 * 文件: case/css/case-gallery.css
 * 引用: case.html
 */

.case-page {
  padding: 32px 0 72px;
}

.case-intro__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 400;
  color: #1d5198;
}

.case-intro__lead {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.75;
  color: #555;
}

.case-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.case-jump a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.3;
  font-family: var(--site-ui-font, 'Segoe UI', system-ui, -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif);
  font-weight: 500;
  color: var(--menu-sub-brand, #1d5198);
  text-decoration: none;
  background: #f8f9fb;
  border: 1px solid #e1e5ea;
  border-radius: 5px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.case-jump a:hover,
.case-jump a.is-active {
  color: #1d5198;
  background: rgba(29, 81, 152, 0.08);
  border-color: #1d5198;
}

.case-section {
  margin-bottom: 48px;
  padding-top: 8px;
  scroll-margin-top: 120px;
}

.case-section__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.case-section__desc {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #6c757d;
}

.case-section__links {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.3;
  font-family: var(--site-ui-font, 'Segoe UI', system-ui, -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif);
}

.case-section__links a {
  font-weight: 500;
  color: var(--menu-sub-brand, #1d5198);
  text-decoration: none;
}

.case-section__links a:hover {
  color: var(--menu-sub-brand-hover, #16467f);
}

.case-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
}

.case-gallery li {
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.case-gallery li:hover {
  box-shadow: 0 8px 24px rgba(29, 81, 152, 0.16);
  transform: translateY(-2px);
}

.case-gallery__link {
  position: relative;
  display: block;
  border: none;
  padding: 0;
  width: 100%;
  cursor: pointer;
  background: none;
  text-align: left;
  overflow: hidden;
}

.case-gallery__link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
}

.case-gallery__link::after {
  content: attr(data-caption);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.case-gallery__link:focus-visible {
  outline: 2px solid #1d5198;
  outline-offset: 2px;
}

.case-links-section {
  margin-bottom: 36px;
}

.case-links-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.case-links-section ul {
  margin: 0;
  padding-left: 20px;
  line-height: 2;
}

.case-links-section a {
  font-size: 14px;
  line-height: 1.3;
  font-family: var(--site-ui-font, 'Segoe UI', system-ui, -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif);
  font-weight: 500;
  color: var(--menu-sub-brand, #1d5198);
  text-decoration: none;
}

.case-links-section a:hover {
  color: var(--menu-sub-brand-hover, #16467f);
}

/* Lightbox */
.case-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.case-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.case-lightbox__dialog {
  position: relative;
  max-width: min(960px, 100%);
  width: 100%;
}

.case-lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 5px;
}

.case-lightbox__caption {
  margin: 12px 0 0;
  font-size: 14px;
  color: #e9ecef;
  text-align: center;
}

.case-lightbox__close,
.case-lightbox__prev,
.case-lightbox__next {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.case-lightbox__close:hover,
.case-lightbox__prev:hover,
.case-lightbox__next:hover {
  background: rgba(255, 255, 255, 0.22);
}

.case-lightbox__close {
  top: -52px;
  right: 0;
  font-size: 28px;
}

.case-lightbox__prev {
  left: -56px;
  top: 50%;
  transform: translateY(-50%);
}

.case-lightbox__next {
  right: -56px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 1100px) {
  .case-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-lightbox__prev {
    left: 8px;
  }

  .case-lightbox__next {
    right: 8px;
  }
}

@media (max-width: 600px) {
  .case-gallery {
    grid-template-columns: 1fr;
  }
}
