/**
 * Ceramum — Стили для CPT (Портфолио, События, Публикации)
 */

/* ============================================================
   ARCHIVE — Описание под заголовком
   ============================================================ */

.cpt-archive-description {
  margin: 0 0 20px 1vw;
  font-size: 16px;
  line-height: 1.5em;
  color: #555;
  border-left: 3px solid #e11e79;
  padding-left: 12px;
}

.cpt-archive-description p {
  margin: 0 0 0.5em 0;
}

.cpt-archive-description p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   ARCHIVE — Список карточек
   ============================================================ */

.cpt-archive-list {
  margin-top: 20px;
}

.cpt-card {
  padding: 30px 0;
  border-bottom: 1px solid #eee;
  margin-left: 1vw;
}

.cpt-card:first-child {
  padding-top: 0;
}

.cpt-card h2 {
  margin-bottom: 15px;
}

.cpt-card h2 a {
  color: #231f20;
  font-size: 24px;
  font-weight: 300;
}

.cpt-card h2 a:hover {
  text-decoration: underline;
}

/* Фотографии в карточке — 3 в ряд */
.cpt-card-photos {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
}

.cpt-card-photo {
  flex: 1;
  max-width: 33.333%;
  overflow: hidden;
  border-radius: 6px;
}

.cpt-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* Ссылка «Подробнее» */
.cpt-card-more {
  margin-top: 10px;
}

.cpt-card-more a {
  color: #e11e79;
  font-size: 16px;
  text-decoration: underline;
}

.cpt-card-more a:hover {
  color: #e11e79;
}

/* ============================================================
   ARCHIVE — Пагинация
   ============================================================ */

.navigation.pagination {
  text-align: left;
  margin: 40px 0 20px 1vw;
  font-size: 22px;
}

.navigation.pagination .nav-links {
  display: inline-block;
}

.navigation.pagination .page-numbers {
  display: inline-block;
  padding: 5px 10px;
  color: #000;
  text-decoration: none;
}

.navigation.pagination .page-numbers:hover {
  text-decoration: underline;
}

.navigation.pagination .page-numbers.current {
  font-weight: bold;
  background: #00b500;
  border-radius: 20px;
  color: #fff;
  padding: 5px 12px;
}

.navigation.pagination .page-numbers.prev,
.navigation.pagination .page-numbers.next {
  color: #000;
}

/* ============================================================
   SINGLE — Карточка записи (галерея + текст)
   ============================================================ */

.cpt-single {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

/* Левая часть — галерея */
.cpt-single-gallery {
  width: 55%;
  flex-shrink: 0;
}

/* Основное фото — обрезка 870×544 */
.cpt-gallery-main {
  margin-bottom: 10px;
  overflow: hidden;
  aspect-ratio: 870 / 544;
}

.cpt-gallery-main a {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.cpt-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* Превьюшки */
.cpt-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cpt-gallery-thumb {
  cursor: pointer;
  border: 1px solid #ddd;
  overflow: hidden;
  aspect-ratio: 205 / 128;
}

.cpt-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.cpt-gallery-thumb:hover img,
.cpt-gallery-thumb.active img {
  opacity: 1;
}

.cpt-gallery-thumb.active {
  border-color: #000;
  border-width: 2px;
}

/* Правая часть — контент */
.cpt-single-body {
  flex: 1;
  min-width: 0;
}

.cpt-single-body-full {
  width: 100%;
}

.cpt-single-body h1 {
  font-size: 34px;
  margin: 5px 0 20px 0;
  line-height: 1.2em;
  font-weight: 300;
  margin-left: 0;
}

.cpt-single-content {
  font-size: 18px;
  line-height: 1.6em;
  color: #231f20;
}

.cpt-single-content p {
  margin: 0 0 1em 0;
  line-height: 1.6em;
}

.cpt-single-content ul,
.cpt-single-content ol {
  margin: 0 0 1em 30px;
}

.cpt-single-content li {
  margin: 5px 0;
}

.cpt-single-content img {
  max-width: 100%;
  height: auto;
}

.cpt-single-content a {
  color: #e11e79;
  text-decoration: underline;
}

.cpt-single-content a:hover {
  color: #c91568;
}

/* ============================================================
   SINGLE — Таксономии (Технология, Материал)
   ============================================================ */

.cpt-single-terms {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  font-size: 16px;
  color: #888;
}

.cpt-term-row {
  margin: 5px 0;
}

.cpt-term-row strong {
  color: #888;
  font-weight: normal;
}

.cpt-term-row a {
  color: #888;
  text-decoration: none;
}

.cpt-term-row a:hover {
  text-decoration: underline;
  color: #e11e79;
}

/* ============================================================
   PROJECT — Кнопка «Заказать»
   ============================================================ */

.project-order-block {
  margin: 15px 0 25px 0;
}

.project-order-btn {
  display: inline-block;
  padding: 6px 20px;
  font-size: 22px;
  font-family: "Source Sans Pro", sans-serif;
  font-weight: 300;
  color: #fff;
  background: #666;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 10px;
}

.project-order-btn:hover {
  background: #555;
}

.project-order-subtitle {
  font-size: 14px;
  color: #888;
}

/* ============================================================
   PROJECT — Попап «Заказать»
   ============================================================ */

.project-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.project-popup {
  background: #fff;
  border-radius: 10px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: popupFadeIn 0.25s ease;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  z-index: 1;
}

.project-popup-close:hover {
  color: #333;
}

.project-popup-content {
  padding: 30px 35px;
  font-size: 16px;
  line-height: 1.6em;
  color: #231f20;
}

.project-popup-content p {
  margin: 0 0 1em 0;
}

.project-popup-content strong {
  font-weight: 600;
}

.project-popup-content ul {
  margin: 0 0 1em 25px;
  padding: 0;
}

.project-popup-content li {
  margin: 4px 0;
}

.project-popup-content a {
  color: #e11e79;
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media screen and (max-width: 1024px) {
  .cpt-single {
    flex-direction: column;
  }

  .cpt-single-gallery {
    width: 100%;
  }

  .cpt-single-body h1 {
    text-align: center;
    font-size: 28px;
  }

  .cpt-card {
    margin-left: 0;
  }

  .cpt-card-photos {
    flex-direction: column;
  }

  .cpt-card-photo {
    max-width: 100%;
  }

  .cpt-archive-description {
    margin-left: 0;
  }

  .navigation.pagination {
    margin-left: 0;
    text-align: center;
  }

  .project-popup {
    max-width: 95%;
    max-height: 90vh;
  }

  .project-popup-content {
    padding: 20px;
  }
}

.cpt-card-photos--project .cpt-card-photo img {
  height: 295px;
}
