/* =============================================
   Christine Jung Portfolio — project.css
   Shared styles for all project detail pages
   ============================================= */

/* ── Project Nav ── */
.project-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.project-nav.scrolled {
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-color: var(--border);
}

.project-nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.back-link::before {
  content: '\2190';
}

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border-hi);
}

.project-nav-logo {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.2s;
}

.project-nav-logo:hover {
  color: var(--accent);
}

.project-nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.project-nav-right a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.project-nav-right a:hover {
  color: var(--accent);
}

/* ── Project Hero ── */
.project-hero {
  padding: calc(var(--nav-h) + 5rem) 5% 4rem;
  border-bottom: 1px solid var(--border);
  max-width: 1240px;
  margin: 0 auto;
}

.project-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.project-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 2rem;
  max-width: 800px;
}

.project-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-label {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.meta-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.meta-value strong {
  color: var(--text);
  font-weight: 400;
}

.project-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(124, 92, 191, 0.25);
  border-radius: 99px;
  color: var(--accent);
  background: var(--accent-bg);
}

.award-badge::before {
  content: '\2726';
  font-size: 0.6rem;
}

/* ── Hero Cover Image ── */
.project-cover {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.project-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.project-cover-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* ── Project Content ── */
.project-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 5%;
}

/* About intro block — full width, no two-column */
.project-about {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.project-about-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.project-about-body h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.project-about-body p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

/* ── Case Study Sections ── */
.case-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.case-section:last-child {
  border-bottom: none;
}

.section-num {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.case-section h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.case-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

.case-section h3:first-child {
  margin-top: 0;
}

/* FIXED: text spans full width — no max-width restriction */
.case-section p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.case-section ul {
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.case-section li {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.6rem;
}

.case-section li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Two-column layout within case section */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.two-col-text p {
  max-width: 100%;
}

/* Challenge / Solution callout boxes */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
}

.callout-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.callout p {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.7;
}

/* Solution callout — slightly different accent */
.callout-solution {
  border-left-color: #4a9e7a;
}

.callout-solution .callout-label {
  color: #4a9e7a;
}

/* ── Image Gallery ── */
.gallery {
  display: grid;
  gap: 12px;
  margin: 2rem 0;
  background: none;
  border-radius: 0;
}

.gallery-1 { grid-template-columns: 1fr; }
.gallery-2 { grid-template-columns: 1fr 1fr; }
.gallery-3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery-2-1 { grid-template-columns: 2fr 1fr; }
.gallery-1-2 { grid-template-columns: 1fr 2fr; }

.gallery-item {
  position: relative;
  overflow: visible;
  background: none;
  display: flex;
  flex-direction: column;
}

/* Images in multi-column galleries match height via flex */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

.gallery-2 .gallery-item img,
.gallery-3 .gallery-item img,
.gallery-2-1 .gallery-item img,
.gallery-1-2 .gallery-item img {
  flex: 1;
  min-height: 0;
  object-fit: cover;
}

/* Caption — no background box, just clean text beneath */
.gallery-item figcaption {
  padding: 0.6rem 0.25rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  background: none;
  border-top: none;
  flex-shrink: 0;
}

/* Natural-size gallery — no height forcing, images keep their aspect ratio */
.gallery-natural {
  align-items: start;
}

.gallery-natural .gallery-item img {
  flex: none;
  height: auto;
  object-fit: contain;
}

/* Placeholder when no image yet */
.img-placeholder {
  background: var(--surface-hi);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Horizontal Scroll Row ── */
.scroll-row {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  margin: 2rem 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.scroll-row::-webkit-scrollbar {
  height: 4px;
}
.scroll-row::-webkit-scrollbar-track {
  background: transparent;
}
.scroll-row::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 2px;
}

.scroll-row .gallery-item {
  flex: 0 0 auto;
  width: 340px;
  scroll-snap-align: start;
  background: var(--surface);
}

.scroll-row .gallery-item img {
  width: 340px;
  height: 260px;
  object-fit: contain;
  background: var(--surface);
  display: block;
}

/* ── Video Embed ── */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--surface-hi);
  border-radius: var(--radius);
  margin: 2rem 0;
}

.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ── Tags row ── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

/* ── Project Footer / Next ── */
.project-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 5%;
  max-width: 1240px;
  margin: 0 auto;
}

.project-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.back-to-work {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.back-to-work::before { content: '\2190'; }

.back-to-work:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.footer-copy-sm {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ── Image Lightbox ── */
.gallery-item {
  cursor: pointer;
}

.gallery-item img {
  position: relative;
}

/* Expand icon overlay */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close::before,
.lightbox-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after { transform: rotate(-45deg); }

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-align: center;
  max-width: 600px;
  pointer-events: none;
}

/* ── Carousel (one image at a time with arrows) ── */
.carousel {
  position: relative;
  margin: 2rem 0;
  user-select: none;
}

.carousel-track {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-hi);
}

.carousel-slide {
  display: none;
  width: 100%;
  margin: 0;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  display: block;
  background: #4a4a4a;
  border-radius: var(--radius);
}

.carousel-slide figcaption {
  padding: 0.6rem 0.25rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.carousel-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.carousel-prev { left: -20px; }
.carousel-next { right: -20px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.carousel-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.carousel-dot:hover {
  border-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .project-about {
    padding: 3rem 0;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .gallery-2,
  .gallery-3,
  .gallery-2-1,
  .gallery-1-2 {
    grid-template-columns: 1fr;
  }

  .gallery-2 .gallery-item img,
  .gallery-3 .gallery-item img,
  .gallery-2-1 .gallery-item img,
  .gallery-1-2 .gallery-item img {
    height: auto;
  }

  .project-meta-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .project-nav-right {
    display: none;
  }

  .project-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}
