/* Canonical concise Project Detail — shared master styles.
   Reference implementation: /projects/zilart/
   Legacy room/caption/swatch rules intentionally live outside this file. */

.page--project-detail {
  --project-caption-size: 16px;
  --project-caption-line-height: 24px;
}

.editorial-lead {
  max-width: 720px;
  margin: 32px 0 0;
  font-size: 20px;
  line-height: 30px;
  color: var(--muted);
}

.editorial-hero {
  padding: 10px 0 70px;
}

.editorial-media {
  display: block;
  width: 100%;
  overflow: hidden;
  background: #f4f4f1;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.editorial-media--static {
  cursor: default;
}

.editorial-media img,
.project-watermark-picture {
  display: block;
  width: 100%;
}

.editorial-media img {
  height: auto;
}

.editorial-figure {
  min-width: 0;
  margin: 0;
}

.editorial-section {
  padding: 70px 0;
}

.editorial-prose {
  width: 100%;
  max-width: none;
}

.editorial-prose p {
  width: 100%;
  max-width: none;
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 30px;
}

.editorial-prose p:last-child {
  margin-bottom: 0;
}

.editorial-wide-media {
  display: grid;
  gap: 28px;
}

.editorial-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.editorial-pair--single-portrait > .editorial-figure {
  grid-column: 1 / -1;
  width: calc((100% - 20px) / 2);
  justify-self: center;
}

.editorial-wide-media + .editorial-wide-media,
.editorial-wide-media + .editorial-pair,
.editorial-pair + .editorial-wide-media,
.editorial-pair + .editorial-pair {
  margin-top: 28px;
}

.editorial-plan-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Canonical Project Detail plan geometry:
   desktop max 1200px, tablet/container width, mobile full width.
   Height always follows the real cropped plan aspect ratio; never crop the plan in CSS. */
.page--project-detail .plan-media {
  width: min(1200px, 100%);
  min-height: 0;
  aspect-ratio: var(--project-plan-aspect, auto);
  overflow: hidden;
}

.page--project-detail .plan-media > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 767px) {
  .page--project-detail .plan-media {
    width: 100%;
    aspect-ratio: auto;
    overflow: visible;
  }

  .page--project-detail .plan-media > img {
    width: 100%;
    height: auto;
    max-height: none;
  }
}

.editorial-section--plan,
.editorial-section--plan .editorial-plan-wrap,
.editorial-section--plan .plan-media {
  background: #fff !important;
}

.editorial-material-board {
  display: block;
}

.editorial-material-board--inline {
  margin-bottom: 56px;
}

.material-board-image-pair {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.material-board-image-card {
  margin: 0;
  min-width: 0;
  aspect-ratio: 1 / 1;
  background: var(--media-bg);
}

.material-board-image-card a,
.material-board-image-card img {
  display: block;
  width: 100%;
}

.material-board-image-card img {
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Reuse an approved two-panel 2:1 board without changing the source image.
   Both square crops share the same cached binary; narrow layouts stack. */
.material-board-image-card--source-left img {
  object-position: left center;
}

.material-board-image-card--source-right img {
  object-position: right center;
}

.editorial-back {
  margin-bottom: 70px;
}

.project-detail-copy-grid {
  width: 100%;
  margin: 0 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  gap: 80px;
  align-items: start;
}

.editorial-section--about-project .project-detail-copy-grid {
  margin-bottom: 0;
}

.editorial-section--materials .project-detail-copy-grid {
  margin-bottom: 64px;
}

.project-detail-copy-heading {
  min-width: 0;
}

.project-detail-section-title {
  margin: 0;
}

.project-detail-section-intro {
  margin: 30px 0 0;
  font-size: 44px;
  line-height: 54px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.project-detail-copy-grid .editorial-prose {
  width: 100%;
  max-width: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
  .material-board-image-pair {
    gap: 16px;
  }

  .project-detail-copy-grid {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 48px;
  }
}

@media (max-width: 767px) {
  /*
   * Mobile first-paint rule:
   * Eyebrow, H1 and lead are visible immediately.
   * Motion starts from project-meta-grid onward; below-fold motion stays unchanged.
   */
  html.site-motion-enabled .page--project-detail .project-intro .eyebrow[data-motion-item],
  html.site-motion-enabled .page--project-detail .project-intro h1[data-motion-item],
  html.site-motion-enabled .page--project-detail .project-intro .editorial-lead[data-motion-item] {
    opacity: 1;
    transform: none;
    transition: none;
    transition-delay: 0s;
  }

  html.site-motion-enabled .page--project-detail .project-intro [data-motion-sequence].is-visible .project-meta-grid > [data-motion-item]:nth-child(1) {
    transition-delay: 0ms;
  }

  html.site-motion-enabled .page--project-detail .project-intro [data-motion-sequence].is-visible .project-meta-grid > [data-motion-item]:nth-child(2) {
    transition-delay: 90ms;
  }

  html.site-motion-enabled .page--project-detail .project-intro [data-motion-sequence].is-visible .project-meta-grid > [data-motion-item]:nth-child(3) {
    transition-delay: 180ms;
  }

  html.site-motion-enabled .page--project-detail .project-intro [data-motion-sequence].is-visible .project-meta-grid > [data-motion-item]:nth-child(4) {
    transition-delay: 270ms;
  }

  html.site-motion-enabled .page--project-detail .project-intro [data-motion-sequence].is-visible .legal[data-motion-item] {
    transition-delay: 360ms;
  }


  .editorial-lead {
    margin-top: 24px;
    font-size: 17px;
    line-height: 27px;
  }

  .editorial-hero {
    padding: 0 0 42px;
  }

  .editorial-section {
    padding: 48px 0;
  }

  .editorial-prose p {
    font-size: 16px;
    line-height: 26px;
  }

  .editorial-pair {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Kazan Usadba: keep source-numbered portrait pairs side-by-side
     on narrow screens as explicitly requested. Other pages stay 1-up. */
  .page--kazan-usadba .project-detail-gallery .editorial-pair:not(.editorial-pair--single-portrait) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .editorial-pair--single-portrait > .editorial-figure {
    width: 100%;
  }

  .editorial-wide-media {
    gap: 20px;
  }

  .editorial-wide-media + .editorial-wide-media,
  .editorial-wide-media + .editorial-pair,
  .editorial-pair + .editorial-wide-media,
  .editorial-pair + .editorial-pair {
    margin-top: 20px;
  }

  .editorial-material-board--inline {
    margin-bottom: 34px;
  }

  .material-board-image-pair {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .editorial-back {
    margin-bottom: 48px;
  }

  .project-detail-copy-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 30px;
  }

  .editorial-section--materials .project-detail-copy-grid {
    margin-bottom: 48px;
  }

  .project-detail-section-intro {
    margin-top: 20px;
    font-size: 36px;
    line-height: 44px;
  }
}

/* Editorial line balancing for unusually long approved Project Detail titles. */
.project-intro h1.project-title--balanced { text-wrap: balance; }
