/* Project styles: hero, centered description, horizontal gallery */

/* Reset for this area */
.project-hero,
.project-description,
.project-collage-scroll {
  width: 100%;
  box-sizing: border-box;
}

/* Hero - large centered image with generous whitespace */
.project-hero {
  display: flex;
  justify-content: center;
  padding: 5vh 2rem 6vh;
}
.project-hero figure {
  max-width: 720px;
  width: 90vw;
  margin: 0;
}
.project-hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.project-hero .hero-caption {
  margin-top: 1rem;
  color: #333;
  font-size: 0.95rem;
  text-align: left;
}

/* Description - narrow, centered column */
.project-description {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem 0.75rem;
}
.project-desc-text {
  max-width: 720px; /* align with small media width for pixel-perfect edges */
  width: 86vw;
  color: #111;
  line-height: 1.6;
  font-size: 1rem;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.project-titleline { display: block; font-family: 'Instrument Sans', sans-serif; font-weight: 400; letter-spacing: 0.01em; }
.project-desc-text .project-titleline + p { margin-top: 0; }
.project-title-year + .project-description { padding-top: 0; }

/* Horizontal scroll collage for remaining images */
.project-collage-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1.25rem 1rem 3rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.project-collage-item {
  flex: 0 0 auto;
  min-width: 60vw;
  max-width: 80vw;
  position: relative;
  scroll-snap-align: center;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f8f8;
}
.project-collage-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* caption overlay */
.project-collage-item.has-caption .caption-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* Responsive tweaks */
@media (min-width: 900px) {
  .project-hero figure { max-width: 900px; }
  .project-collage-item { min-width: 45vw; max-width: 60vw; }
  .project-desc-text { width: 60vw; }
}

@media (min-width: 1300px) {
  .project-hero { padding-top: 8vh; padding-bottom: 8vh; }
  .project-hero figure { max-width: 1100px; }
  .project-collage-item { min-width: 36vw; max-width: 44vw; }
}

/* Single-column project-inline styles */
.project-single-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1rem;
  box-sizing: border-box;
}
.project-single-item {
  width: 100%;
}
.project-single-item.image-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}
.project-single-item.text-item,
.project-single-item.description-block,
.project-single-item.content-item {
  color: #111;
  line-height: 1.6;
  font-size: 1rem;
}
.project-single-item.text-item { font-size: 1.02rem; }
.project-single-item.description-block { margin-top: 0.5rem; }

/* ensure caption overlay works with single column */
.project-single-item.has-caption .caption-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
  color: #fff;
}

@media (min-width: 900px) {
  .project-single-col { padding: 4rem 2rem; }
}

/* Project header (title left, close right) */
.project-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: transparent;
}



/* Ensure project content is not hidden behind the fixed header */
/* Give the first narrow block (title/description) a bit more top offset */
.project-description.project-description-inline { padding-top: 10.5rem; }
.project-stack,
.project-single-col { padding-top: 6rem; }

/* When a stack follows the description block, reduce the gap between them */
.project-description.project-description-inline + .project-stack { padding-top: 1.25rem; }

/* Stacked project items */
.project-stack {
  display: flex;
  flex-direction: column;
  gap: 4rem; /* slightly increased */
  max-width: 1200px; /* container wide enough to allow is-big to take effect */
  margin: 0 auto 4rem;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}
.project-stack-item {
  width: 100%;
  margin: 0 auto;
}
.project-stack-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: #f4f4f4;
}
.project-stack-item video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}
.project-stack-item.text-block {
  max-width: 720px;
  margin: 0 auto;
  color: #111;
  line-height: 1.6;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Ensure captions use the same font */
.caption-overlay {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Divider */
.project-divider {
  height: 1px;
  background: #e3e3e3;
  width: 100%;
  margin: 1.5rem auto;
}

/* Text variants (future-proof): body/header/etc. */
.project-text--body { font-size: 1rem; }
.project-text--header { font-size: 1.125rem; font-weight: 600; }
.project-text--kicker { font-size: 0.9rem; color: #666; }

/* Width variants controlled by `big` flag */
.project-stack-item.is-big,
.project-single-item.is-big {
  max-width: 1100px; /* existing big width */
}
.project-stack-item.is-small,
.project-single-item.is-small {
  max-width: 720px; /* narrower width for non-big images */
}

/* Ensure on small viewports the items still shrink */
@media (max-width: 900px) {
  .project-stack-item,
  .project-single-item {
    max-width: 90vw;
  }
  /* Reduce the top space before the title/description on mobile by ~50% (desktop 10.5rem -> mobile 5.25rem) */
  .project-description.project-description-inline { padding-top: 5.25rem; }
}

@media (min-width: 900px) {
  .project-stack { gap: 5rem; padding-top: 7rem; }
}

/* Process section: two flowing columns within narrow width */
.project-process {
  max-width: 720px; /* align with small item width */
  margin: 0 auto 4rem;
  padding: 0 1rem;
}
.project-process-heading {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 auto 1.25rem;
  max-width: 720px; /* match description width exactly */
  width: 86vw; /* same fluid width as description */
}
.project-process-label {
  font-size: 1rem;
  line-height: 1.6;
  color: #111;
  text-align: left; /* match description */
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.project-description,
.project-process-heading {
  font-family: 'Instrument Sans', sans-serif;
}
.project-process-cols {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px; /* exact spine between columns */
}
.project-process-col { flex: 0 0 calc(50% - 5px); width: calc(50% - 5px); display: flex; flex-direction: column; gap: 0.75rem; }
.project-process-item { border-radius: 0; overflow: hidden; background: #f4f4f4; }
.project-process-item { margin: 0; }
.project-process-item img { width: 100%; height: auto; display: block; object-fit: cover; }

@media (max-width: 800px) {
  .project-process { max-width: 90vw; padding: 0; }
  .project-process-cols { flex-direction: column; gap: 0.75rem; }
}

/* === Dark mode for project pages === */
@media (prefers-color-scheme: dark) {
  /* Text colors */
  .project-desc-text,
  .project-titleline,
  .project-stack-item.text-block,
  .project-process-label {
    color: #eee;
  }
  /* Image/video placeholder backgrounds */
  .project-stack-item img { background: #1a1a1a; }
  .project-stack-item video { background: #000; }
  .project-process-item { background: #202020; }
  /* Dividers */
  .project-divider { background: #333; }
}
