/*
  Consolidated shared styles for Victor F. M. Torres portfolio project pages.
  Replaces the separate project.css variants with one cumulative stylesheet.
*/

/* =========================================================
   PROJECT PAGE FRAME
   ========================================================= */

.project-page {
  width: min(calc(100% - 48px), 1320px);
  margin: 0 auto;
  padding: 54px 0 96px;
}

/* Keep the site chrome aligned with project-page margins on project pages.
   `main` is intentionally NOT included here to avoid double-constraining content. */
.site-header,
.site-footer {
  width: min(calc(100% - 48px), var(--max-width, 1320px));
  margin-left: auto;
  margin-right: auto;
}

.project-back {
  display: inline-block;
  margin-bottom: 38px;
  color: #555;
  font-size: .9rem;
  text-decoration: none;
}

.project-back:hover,
.project-back:focus-visible {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.project-header {
  max-width: 940px;
  margin-bottom: 46px;
}

.project-header h2 {
  margin: 0 0 16px;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: .96;
  letter-spacing: -.045em;
  font-weight: 600;
}

.project-meta {
  margin: 0;
  color: #666;
  font-size: .95rem;
}

/* Reset figure margins only inside project pages. */
.project-page figure {
  margin: 0;
  padding: 0;
}

.project-page figcaption {
  margin-top: 9px;
  color: #777;
  font-size: .8rem;
  line-height: 1.45;
}

/* Baseline protection for all project images. More specific layouts below
   can still choose their own width. */
.project-page img {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   TEXT / COPY
   ========================================================= */

.project-copy {
  max-width: 790px;
  margin: 0 0 58px;
  font-size: 1.08rem;
  line-height: 1.68;
}

.project-copy h3 {
  margin: 0 0 20px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 600;
}

.project-copy p {
  margin: 0 0 1.2em;
}

.project-copy p:last-child {
  margin-bottom: 0;
}

.works-intro {
  max-width: 760px;
  margin: 0 0 58px;
  color: #333;
  font-size: 1.04rem;
  line-height: 1.65;
}

/* =========================================================
   SINGLE / LARGE IMAGES
   ========================================================= */

.project-hero {
  max-width: 1180px;
  margin: 0 0 62px;
}

.project-image-full {
  width: 100%;
  margin: 0 0 62px;
}

.project-image-medium {
  max-width: 960px;
  margin: 0 0 62px;
}

.project-image-large {
  max-width: 1200px;
  margin: 0 0 62px;
}

/* Large standalone images stay aligned to the LEFT edge of project copy,
   and are prevented from becoming taller than the viewport. */
.project-hero img,
.project-image-full img,
.project-image-medium img,
.project-image-large img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  object-position: left top;
}

/* Medium images should never exceed their container, but may display at
   intrinsic width when that produces a more natural presentation. */
.project-image-medium img {
  max-height: 84vh;
}

/* =========================================================
   IMAGE GRIDS / DETAIL STRIPS
   ========================================================= */

.project-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  align-items: start;
  margin: 0 0 66px;
}

.project-image-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-image-grid figure {
  min-width: 0;
}

.project-image-grid img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 76vh;
  object-fit: contain;
  object-position: left top;
}

.project-detail-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 62px;
}

.project-detail-strip figure {
  min-width: 0;
}

.project-detail-strip img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 76vh;
  object-fit: contain;
  object-position: left top;
}

/* =========================================================
   VIDEO
   ========================================================= */

.project-video {
  width: min(100%, 1180px);
  margin: 0 0 62px;
}

.project-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.project-video-frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================================
   LINKS / NOTES / DIVIDERS / PAGE END
   ========================================================= */

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 0;
}

.project-links a {
  display: inline-block;
  border: 1px solid #222;
  padding: 10px 14px;
  color: #111;
  text-decoration: none;
  font-size: .9rem;
}

.project-links a:hover,
.project-links a:focus-visible {
  background: #111;
  color: #fff;
}

.project-note,
.exhibition-note {
  max-width: 790px;
  margin: 0 0 58px;
  padding-top: 22px;
  border-top: 1px solid #e7e7e7;
}

.project-note h3,
.exhibition-note h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 600;
}

.project-note p,
.exhibition-note p {
  margin: 0 0 1em;
  color: #444;
  font-size: .96rem;
  line-height: 1.62;
}

.project-divider {
  border: 0;
  border-top: 1px solid #e7e7e7;
  margin: 76px 0 62px;
}

.project-end {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 76px;
  padding-top: 24px;
  border-top: 1px solid #e7e7e7;
  font-size: .9rem;
}

.project-end a {
  text-decoration: none;
}

.project-end a:hover,
.project-end a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* =========================================================
   PRINT-SERIES LAYOUT
   ========================================================= */

.print-hero {
  max-width: 900px;
  margin: 0 0 62px;
}

.print-hero img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  object-position: left top;
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  margin: 0 0 64px;
}

.print-grid figure {
  min-width: 0;
}

.print-grid img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 76vh;
  object-fit: contain;
  object-position: left top;
}

.print-grid .wide {
  grid-column: 1 / -1;
  max-width: 920px;
}

/* =========================================================
   2D WORKS LAYOUT
   ========================================================= */

.two-d-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 58px 34px;
  margin: 0 0 68px;
}

.two-d-work {
  min-width: 0;
}

.two-d-image {
  margin: 0;
  
}

.two-d-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 76vh;
  object-fit: contain;
  object-position: left top;
}

.two-d-caption {
  margin-top: 14px;
}

.two-d-caption h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  font-weight: 600;
}

.two-d-caption p {
  margin: 0;
  color: #666;
  font-size: .88rem;
  line-height: 1.5;
}

.two-d-caption .exhibited {
  margin-top: 6px;
  color: #444;
  font-style: italic;
}

.two-d-work.featured {
  grid-column: 1 / -1;
  max-width: 920px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {
  .project-page {
    width: min(calc(100% - 32px), 1320px);
    padding-top: 38px;
    padding-bottom: 64px;
  }

  .site-header,
  .site-footer {
    width: min(calc(100% - 32px), var(--max-width, 1320px));
  }

  .project-header {
    margin-bottom: 34px;
  }

  .project-hero,
  .project-image-full,
  .project-image-medium,
  .project-image-large,
  .project-video {
    margin-bottom: 46px;
  }

  .project-image-grid,
  .project-image-grid.three,
  .project-detail-strip,
  .print-grid,
  .two-d-grid {
    grid-template-columns: 1fr;
    margin-bottom: 46px;
  }

  .project-image-grid {
    gap: 28px;
  }

  .project-detail-strip {
    gap: 24px;
  }

  .print-grid {
    gap: 26px;
  }

  .two-d-grid {
    gap: 42px;
  }

  .project-copy {
    margin-bottom: 46px;
  }

  .project-links {
    display: block;
  }

  .project-links a {
    display: block;
    width: fit-content;
    margin-bottom: 10px;
  }

  .project-end {
    display: block;
  }

  .project-end a + a {
    display: block;
    margin-top: 12px;
  }

  .print-grid .wide,
  .two-d-work.featured {
    grid-column: auto;
    max-width: none;
  }
}
