/**
 * PDG Project Detail CSS
 * Page-specific styles for single project detail pages.
 * Requirements: 3.2, 3.3, 3.4, 6.1, 6.3, 6.4, 1.1-1.10, 16.1-16.2
 */

/* =============================================================
   PROJECT HERO
   Requirements: 3.1, 1.9, 6.4
   ============================================================= */
.project-hero {
  height: 100vh;
  min-height: 600px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #1A1A1A;
}

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

.project-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.7) 0%, rgba(26, 26, 26, 0.2) 50%, transparent 100%);
  pointer-events: none;
}

.project-hero__content {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem 4rem;
  max-width: 34rem;
  width: min(100%, 34rem);
}

.project-hero__kicker {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.project-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  color: #F9F8F6;
  text-wrap: balance;
}

/* =============================================================
   PROJECT DATA BAR
   Requirements: 3.2
   ============================================================= */
.project-data-bar {
  background: #1A1A1A;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid rgba(249, 248, 246, 0.1);
}

.project-data-bar__item {
  padding: 1.5rem 2rem;
  border-right: 1px solid rgba(249, 248, 246, 0.1);
  flex-shrink: 0;
}

.project-data-bar__item:last-child {
  border-right: none;
}

.project-data-bar__label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(249, 248, 246, 0.5);
  line-height: 1.2;
}

.project-data-bar__value {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: #F9F8F6;
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* =============================================================
   STICKY CHAPTER NAV
   Requirements: 3.4, 6.1
   ============================================================= */
.project-chapter-nav {
  background: rgba(249, 248, 246, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #E2E0DC;
  display: flex;
  gap: 0;
  z-index: 90;
  position: sticky;
  top: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.project-chapter-nav::-webkit-scrollbar {
  display: none;
}

.project-chapter-nav__link {
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: #6B6B6B;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s ease-out,
    border-bottom-color 0.2s ease-out;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.project-chapter-nav__link:hover {
  color: #1A1A1A;
}

.project-chapter-nav__link:focus-visible {
  color: #1A1A1A;
  border-bottom-color: #D4AF37;
}

.project-chapter-nav__link.is-active {
  color: #1A1A1A;
  border-bottom-color: #D4AF37;
}

/* =============================================================
   STORY SECTIONS
   Requirements: 3.3
   ============================================================= */
.project-section {
  padding: 6rem 0;
  scroll-margin-top: 8rem;
}

.project-section--dark {
  background: #1A1A1A;
  color: #F9F8F6;
}

.project-section--dark .project-section__heading {
  color: #F9F8F6;
}

.project-section--dark .project-section__body {
  color: rgba(249, 248, 246, 0.7);
}

.project-section__kicker {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}

.project-section__heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-fg);
  margin-bottom: 2rem;
  text-wrap: balance;
}

.project-section__body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #6B6B6B;
  max-width: 640px;
}

.project-section__body p + p {
  margin-top: 1.25rem;
}

/* Drop cap for overview section */
.project-section__drop-cap::first-letter {
  float: left;
  font-family: var(--font-heading);
  font-size: 5rem;
  line-height: 0.8;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
}

/* Two-column grid layout */
.project-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.project-section__grid--reverse {
  direction: rtl;
}

.project-section__grid--reverse > * {
  direction: ltr;
}

/* Image container */
.project-section__image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.project-section__image .pdg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================================
   GALLERY SECTION
   Requirements: 3.3, 1.9
   ============================================================= */
.project-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.project-gallery__item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.project-gallery__item .pdg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================================
   RESPONSIVE: TABLET (768px – 1023px)
   Requirements: 16.1, 16.2
   ============================================================= */
@media (max-width: 1023px) {
  .project-section__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .project-section__grid--reverse {
    direction: ltr;
  }

  .project-hero__content {
    padding: 2rem 1.5rem 3rem;
  }

  .project-section {
    scroll-margin-top: 7rem;
  }
}

/* =============================================================
   RESPONSIVE: MOBILE (< 768px)
   Requirements: 16.1, 16.2, 16.3
   ============================================================= */
@media (max-width: 767px) {
  .project-hero {
    height: min(88svh, 32rem);
    min-height: 420px;
  }

  .project-hero__content {
    padding: 1.5rem 1.25rem 2.5rem;
  }

  .project-hero__title {
    font-size: clamp(2.15rem, 11.5vw, 3.5rem);
    max-width: 8ch;
  }

  .project-data-bar__item {
    padding: 1.25rem 1.5rem;
    flex-basis: 50%;
    border-right: none;
    border-bottom: 1px solid rgba(249, 248, 246, 0.1);
  }

  .project-data-bar__item:nth-child(odd) {
    border-right: 1px solid rgba(249, 248, 246, 0.1);
  }

  .project-section {
    padding: 4rem 0;
    scroll-margin-top: 6.5rem;
  }

  .project-section__heading {
    font-size: clamp(1.75rem, 10vw, 2.5rem);
  }

  .project-section__body {
    font-size: 1rem;
    line-height: 1.7;
  }

  .project-section__drop-cap::first-letter {
    font-size: 3.5rem;
    margin-top: 0.05rem;
  }

  .project-gallery__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Touch targets: min 44px */
  .project-chapter-nav__link {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
  }
}

@media (max-width: 479px) {
  .project-hero__content {
    padding: 1.25rem 1rem 2rem;
    width: min(100%, 22rem);
  }

  .project-data-bar__item {
    flex-basis: 100%;
    border-right: none;
  }

  .project-data-bar__item:nth-child(odd) {
    border-right: none;
  }

  .project-chapter-nav__link {
    padding: 0.75rem 1rem;
  }
}

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .project-hero__bg,
  .project-chapter-nav__link,
  .project-section__image .pdg-image,
  .project-gallery__item .pdg-image {
    transition: none;
  }
}
