/* ——— Project Detail Page ——— */

/* Headlines */
.project-headlines {
  padding: 130px var(--gutter) 90px;
  text-align: center;
  max-width: var(--container);
  margin: 0 auto;
}

.project-page-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 20px;
}

.project-page-subtitle {
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1.3;
  color: var(--color-text);
  max-width: 700px;
  margin: 0 auto;
}

/* Description + Main Image (2-col) */
.project-description-section {
  padding: 0 0 80px;
}

.project-description-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 50px var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  align-items: start;
}

.project-description-wrapper {
  padding-right: 20px;
}

.project-text {
  font-size: 18px;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.project-text a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-text p { margin-bottom: 1rem; }
.project-text p:last-child { margin-bottom: 0; }

.project-sub-headline {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin: 24px 0 8px;
}

.project-main-image-wrapper {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  border-radius: 4px;
  overflow: hidden;
}

.project-main-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* Content / Gallery */
.project-content-section {
  border-top: 1px solid var(--color-border);
  padding: 64px 0;
}

.project-content-section .container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.project-content-headline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 32px;
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-gallery-item img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.project-slider-description {
  font-size: 14px;
  color: var(--color-text-dim);
  margin-top: 24px;
  line-height: 1.6;
}

/* Video embed */
.project-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 4px;
}

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

/* Browser iframe embed */
.project-browser {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.project-browser-bar {
  background: rgba(255,255,255,0.05);
  padding: 10px 16px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.project-browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.project-browser-content {
  position: relative;
  padding-bottom: 65%;
  height: 0;
}

.project-browser-content iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ——— Flexible Content Blocks ——— */

.project-blocks {
  border-top: 1px solid var(--color-border);
  padding: 0 0 80px;
}

.project-block {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--gutter) 0;
}

.project-block-inner {
  width: 100%;
}

/* Image block */
.project-block--image figure,
.project-block--filevideo figure {
  margin: 0;
}

.project-block--image img,
.project-block--filevideo .block-video {
  width: 100%;
  border-radius: 4px;
  display: block;
}

/* Video / Image block */
.block-video-figure { margin: 0; }

.block-media-wrap { position: relative; }

.block-video,
.block-image {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.block-video {
  background: #000;
  max-height: 80vh;
  object-fit: contain;
}

.block-media-wrap.has-ratio .block-video {
  max-height: none;
}

@media (min-width: 601px) {
  .block-media-wrap.has-ratio--portrait {
    /* cap height at 80vh via max-width: at aspect-ratio 9/16, width = height × 9/16 */
    max-width: calc(80vh * 9 / 16);
    margin-left: auto;
    margin-right: auto;
  }
}


/* Caption shared — reset padding from index.css, use margin only */
.block-caption,
.img-caption {
  font-size: 16px;
  color: var(--color-text);
  padding-top: 0;
  margin-top: 16px;
  line-height: 1.6;
  max-width: 700px;
}

/* ——— Heading block ——— */
.project-block--heading {
  padding-bottom: 0;
  margin-bottom: -24px;
}

.project-block--heading h1,
.project-block--heading h2,
.project-block--heading h3,
.project-block--heading h4,
.project-block--heading h5 {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
  text-align: center;
}

.project-block--heading h1 {
  font-size: 72px;
  font-weight: 600;
  line-height: 1.1;
}

.project-block--heading h2 {
  font-size: 48px;
  line-height: 1.2;
}

.project-block--heading h3 {
  font-size: 36px;
  line-height: 1.2;
}

.project-block--heading h4 {
  font-size: 28px;
  line-height: 1.3;
}

.project-block--heading h5 {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 400;
}

/* Rich text (built-in text block) */
.project-block--text .project-block-inner {
  max-width: 900px;
  margin-left: 0;
}

.project-block--text p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.project-block--text h2,
.project-block--text h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin: 32px 0 12px;
}

.project-block--text a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ——— Slider (gallery block) ——— */
.block-slider-figure { margin: 0; }

.block-slider-wrap {
  position: relative;
}

.block-slider {
  position: relative;
  overflow: visible;
}

.block-slider-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  border-radius: 4px;
}

.block-slider-track::-webkit-scrollbar { display: none; }

.block-slider-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.block-slider-slide img {
  width: 100%;
  height: auto;
  display: block;
}

/* Slider navigation buttons */
.block-slider-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.2s ease;
}

/* Desktop: absolutely positioned on image edges */
.block-slider-btn--desktop {
  position: absolute;
  top: 50%;
  z-index: 2;
}
.block-slider-btn--desktop.block-slider-btn--prev {
  left: 0;
  transform: translate(-50%, -50%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.block-slider-btn--desktop.block-slider-btn--prev:hover {
  transform: translate(calc(-50% - 6px), -50%);
}
.block-slider-btn--desktop.block-slider-btn--next {
  right: 0;
  transform: translate(50%, -50%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.block-slider-btn--desktop.block-slider-btn--next:hover {
  transform: translate(calc(50% + 6px), -50%);
}

/* Mobile: hidden desktop buttons, visible mobile buttons */
.block-slider-btn--mobile { display: none; }

/* Controls row (dots + mobile buttons) */
.block-slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

/* Slider dots */
.block-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.block-slider-dots.has-many {
  overflow: hidden;
  justify-content: flex-start;
  /* show exactly 5 slots: 5×12px + 4×8px = 92px */
  max-width: 92px;
}

.block-slider-dots-inner {
  display: flex;
  gap: 8px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.block-slider-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--color-text);
  cursor: pointer;
  padding: 0;
  transition: transform 0.25s ease, background 0.2s;
  transform-origin: center;
}

.block-slider-dot.is-active {
  background: var(--color-text);
}

.block-slider-dot:hover {
  background: rgba(var(--color-text-rgb), 0.4);
}


/* Related section */
.related-section {
  padding-top: 50px;
  padding-bottom: 80px;
}

/* Responsive */
@media screen and (max-width: 600px) {
  .project-page-title {
    font-size: 4.5rem;
    line-height: 1;
  }

  .project-page-subtitle {
    font-size: 1.6rem;
  }

  .project-text {
    line-height: 1.5;
  }
}

@media screen and (max-width: 768px) {
  .project-description-inner {
    grid-template-columns: 1fr;
    padding: 40px var(--gutter);
  }

  .project-main-image-wrapper {
    position: static;
  }

  .project-block--heading h1 { font-size: 46px; }
  .project-block--heading h2 { font-size: 34px; }
  .project-block--heading h3 { font-size: 26px; }
  .project-block--heading h4 { font-size: 18px; }
  .project-block--heading h5 { font-size: 14px; }
}

@media screen and (max-width: 600px) {
  .block-slider-btn--desktop { display: none; }
  .block-slider-btn--mobile  { display: flex; }

  .block-slider-controls {
    justify-content: space-between;
  }

  .block-slider-btn--mobile {
    padding: 12px;
  }
}
