/* ===== PHOTO MODAL ===== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 20, 0.92);
  backdrop-filter: blur(6px);
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  background: #111b22;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
  margin-left: 12px;
}
.modal-close:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Stage */
.modal-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  background: #0a1014;
}

.modal-slides {
  width: 100%;
  height: 100%;
  position: relative;
  min-height: 380px;
  max-height: 60vh;
  overflow: hidden;
}

.modal-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

.modal-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

.modal-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 60vh;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Arrows */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.18s;
  backdrop-filter: blur(4px);
}
.modal-arrow:hover {
  background: rgba(201,162,100,0.85);
  color: #1c2b35;
}
.modal-arrow svg { width: 20px; height: 20px; }
.modal-prev { left: 12px; }
.modal-next { right: 12px; }

/* Footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px 8px;
  flex-shrink: 0;
}

.modal-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}

.modal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.18s, transform 0.18s;
}
.modal-dot.active {
  background: var(--gold, #c9a264);
  transform: scale(1.3);
}
.modal-dot:hover { background: rgba(255,255,255,0.5); }

.modal-counter {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  font-family: 'Inter', sans-serif;
  min-width: 36px;
  text-align: center;
}

/* Thumbnails */
.modal-thumbs {
  display: flex;
  gap: 8px;
  padding: 8px 16px 16px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.modal-thumb {
  width: 68px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
  transition: border-color 0.18s, opacity 0.18s;
  opacity: 0.55;
}
.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal-thumb.active {
  border-color: var(--gold, #c9a264);
  opacity: 1;
}
.modal-thumb:hover { opacity: 0.85; }

/* Project card click hint */
.project-card[data-photos] .project-image-wrap::after {
  content: 'View Photos';
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 3;
  padding: 6px 14px;
  background: rgba(201,162,100,0.9);
  color: #1c2b35;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 40px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}
.project-card[data-photos]:hover .project-image-wrap::after {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .modal-slides { min-height: 260px; max-height: 50vh; }
  .modal-slide img { max-height: 50vh; }
  .modal-arrow { width: 36px; height: 36px; }
  .modal-arrow svg { width: 16px; height: 16px; }
  .modal-thumb { width: 52px; height: 38px; }
}
