/**
 * 工具类样式
 * Utilities CSS - Gallery, Direct Links, Icons, etc.
 */

/* 文章图片幻灯片 */
.post-gallery-slideshow {
  margin: 0 0 var(--spacing-xl) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--white);
}

body.dark-mode .post-gallery-slideshow {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.slideshow-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-light);
  overflow: hidden;
}

.slide-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-item.active {
  opacity: 1;
  z-index: 1;
}

.slide-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide-counter {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  z-index: 10;
}

.slide-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.slide-control:hover {
  background: rgba(0, 0, 0, 0.8);
}

.slide-control.prev {
  left: 20px;
}

.slide-control.next {
  right: 20px;
}

.slide-indicators {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.slide-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.slide-dot.active {
  background: white;
  width: 24px;
  border-radius: 5px;
}

/* 文章直达链接 */
.post-direct-link {
  color: var(--primary-color) !important;
  background: rgba(94, 114, 228, 0.1);
  padding: var(--spacing-xs) var(--spacing-sm) !important;
  border-radius: var(--radius-sm);
  margin-left: auto;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.post-direct-link:hover {
  background: var(--primary-color);
  color: white !important;
}

body.dark-mode .post-direct-link {
  background: rgba(94, 114, 228, 0.2);
}

body.dark-mode .post-direct-link:hover {
  background: var(--primary-color);
}

.post-direct-link svg,
.post-direct-link img {
  width: 16px;
  height: 16px;
}

.post-direct-link img {
  border-radius: 3px;
}

/* 文章图标样式已移至 blog.css */

/* 响应式 - 幻灯片 */
@media (max-width: 768px) {
  .post-gallery-slideshow {
    margin-bottom: 24px;
  }

  .slideshow-container {
    aspect-ratio: 16/9;
  }

  .slide-control {
    width: 40px;
    height: 40px;
  }

  .slide-control.prev {
    left: 10px;
  }

  .slide-control.next {
    right: 10px;
  }

  .slide-counter {
    font-size: 12px;
    padding: 4px 10px;
  }

  .slide-indicators {
    bottom: 12px;
  }

  .slide-dot {
    width: 8px;
    height: 8px;
  }

  .slide-dot.active {
    width: 20px;
  }

  .post-direct-link {
    padding: 6px 10px !important;
    font-size: 13px;
  }

  .post-direct-link svg,
  .post-direct-link img {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .post-gallery-slideshow {
    margin-bottom: 20px;
  }

  .slideshow-container {
    aspect-ratio: 4/3;
  }

  .slide-control {
    width: 36px;
    height: 36px;
  }

  .slide-control svg {
    width: 18px;
    height: 18px;
  }

  .slide-counter {
    font-size: 11px;
    padding: 3px 8px;
  }

  .slide-indicators {
    gap: 6px;
  }

  .slide-dot {
    width: 6px;
    height: 6px;
  }

  .slide-dot.active {
    width: 16px;
  }
}

/* 打印样式 */
@media print {
  .slide-control,
  .slide-indicators,
  .slide-counter {
    display: none;
  }

  .slide-item {
    position: static;
    opacity: 1 !important;
    page-break-inside: avoid;
  }
}

@media print {
  .post-direct-link,
  .link-item-direct,
  .nav-link-direct,
  .hot-nav-direct {
    display: none !important;
  }
}

