/* Обложка работы */
.cover {
  display: block;
  max-width: 400px;
  width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cover:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Основной блок */
.work-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.work-detail h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: var(--text);
}

.work-detail .category {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.work-detail .description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.work-detail .extras {
  margin-top: 2rem;
}

.work-detail a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}

.work-detail a:hover {
  text-decoration: underline;
  color: var(--primary-light);
}

/* Галерея */
.thumbnail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.thumbnail-grid img {
  max-width: 150px;
  width: 100%;
  height: auto;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.thumbnail-grid img:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}

.modal img {
  max-width: 75vw;
  max-height: 75vh;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.modal img:hover {
  transform: scale(1.03);
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--primary-light);
}

.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: white;
  cursor: pointer;
  z-index: 10000;
  user-select: none;
  transition: color 0.2s;
}

.modal-arrow:hover {
  color: var(--primary-light);
}

.modal-arrow.left {
  left: 40px;
}

.modal-arrow.right {
  right: 40px;
}

/* Адаптация */
@media (max-width: 768px) {
  .cover {
    max-width: 90%;
  }

  .thumbnail-grid {
    gap: 6px;
  }

  .thumbnail-grid img {
    max-width: 30%;
  }

  .modal img {
    max-width: 90vw;
    max-height: 70vh;
  }

  .modal-arrow.left {
    left: 20px;
  }

  .modal-arrow.right {
    right: 20px;
  }
}
