/* Shared frame for project pages only; the global site container stays unchanged. */
.project-container { width: min(1440px, 90%); margin-inline: auto; }
.project-hero .page-hero-grid { grid-template-columns: 1.25fr 1fr; gap: clamp(40px, 4vw, 72px); padding-block: 18px 38px; }
.project-hero h1 { max-width: none; font-size: clamp(2.5rem, 4vw, 4rem); line-height: 1.08; }
.project-hero h1 span { display: block; }
.project-hero .page-hero-introduction { border-left-color: var(--cyan); margin-bottom: 12px; }
.project-hero .page-hero-introduction > p { font-size: 1.125rem; line-height: 1.65; max-width: 34ch; }
.project-story { padding-block: 18px 44px; }
/* Intrinsic image dimensions shrink with both viewport axes; no crop or empty photo track. */
.project-lead { display: flex; justify-content: center; align-items: center; width: min(1440px, 90%); gap: clamp(28px, 2.5vw, 48px); margin-inline: auto; }
.project-cover { flex: 0 1 auto; min-width: 0; max-width: 65%; }
.project-cover img { width: auto; height: auto; max-width: 100%; max-height: min(62dvh, 660px); object-fit: contain; clip-path: none; border-radius: 8px; box-shadow: 0 8px 20px color-mix(in srgb, var(--navy) 8%, transparent); }
.project-introduction { flex: 0 1 38ch; max-width: 38ch; }
.project-introduction::before { content: ''; display: block; width: 48px; height: 3px; background: var(--cyan); margin-bottom: 22px; }
.project-introduction h2 { font-size: clamp(1.9rem, 2.6vw, 2.8rem); line-height: 1.16; margin-bottom: 22px; }
.project-introduction > p { font-size: 1.0625rem; line-height: 1.75; }
.project-features { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 18px; }
.project-features li { display: flex; align-items: center; gap: 16px; font-size: 1rem; color: var(--navy); }
.project-features svg { color: #00758d; flex-shrink: 0; }
.project-story .project-highlight { margin-block: 20px 38px; }
.project-story .project-highlight-inner { padding-block: 34px; }
.project-story .project-highlight-copy p { font-size: 1.0625rem; max-width: 44ch; }
.project-story .project-highlight-copy .project-highlight-detail { font-size: .875rem; }
.project-gallery {
  --gallery-radius: 8px;
  --gallery-shadow: 0 12px 28px color-mix(in srgb, var(--navy) 12%, transparent), 0 2px 6px color-mix(in srgb, var(--navy) 6%, transparent);
  display: grid; gap: 44px;
}
.gallery-group { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 36px; align-items: start; }
.gallery-editorial { padding-top: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.group-number { color: var(--muted); font-size: 3.5rem; font-weight: 800; line-height: 1; }
.gallery-editorial h3 { font-size: 1.625rem; line-height: 1.22; margin-bottom: 18px; }
.gallery-editorial h3::before { content: ''; display: block; width: 36px; height: 2px; background: var(--cyan); margin-bottom: 16px; }
.gallery-editorial p { font-size: 1rem; line-height: 1.7; max-width: 42ch; }
.gallery-editorial p + p { margin-top: 14px; }
.photo-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 20px; align-items: start; }
.photo-set[data-count='3'] { grid-template-columns: 1.6fr 1fr 1fr; }
/* Four mixed views stay in a compact two-by-two composition without cropping portraits. */
.photo-set[data-count='4'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-set[data-count='4'] > figure { width: fit-content; max-width: 100%; justify-self: center; }
.photo-set[data-count='4'] .gallery-link { display: flex; justify-content: center; align-items: center; width: fit-content; max-width: 100%; background: transparent; }
.photo-set[data-count='4'] .gallery-link img { width: auto; max-width: 100%; max-height: clamp(220px, 25vw, 300px); object-fit: contain; }
.photo-set[data-count='4'] figcaption { contain: inline-size; }
/* Five views: leading photograph and two details, then a pair of full portraits. */
.photo-set[data-count='5'] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.photo-set[data-count='5'] > figure { grid-column: span 2; }
.photo-set[data-count='5'] > figure:nth-child(2), .photo-set[data-count='5'] > figure:nth-child(3) { grid-column: span 1; }
.gallery-link { display: block; position: relative; background: var(--paper); border-radius: var(--gallery-radius); box-shadow: var(--gallery-shadow); overflow: hidden; cursor: zoom-in; }
.gallery-link:focus-visible { outline: 3px solid var(--navy); outline-offset: 5px; }
.gallery-link img { width: 100%; height: auto; border-radius: inherit; }
/* Secondary figures follow the image width; captions must not widen the link. */
.photo-set > figure:not(.primary-photo) { width: fit-content; max-width: 100%; justify-self: center; }
.photo-set > figure:not(.primary-photo) .gallery-link { display: flex; justify-content: center; align-items: center; width: fit-content; max-width: 100%; background: transparent; }
.photo-set > figure:not(.primary-photo) .gallery-link img { width: auto; max-width: 100%; max-height: clamp(240px, 25vw, 320px); object-fit: contain; }
.photo-set > figure:not(.primary-photo) figcaption { contain: inline-size; }
.photo-set[data-count='4'] > figure:not(.primary-photo) .gallery-link img { max-height: clamp(220px, 25vw, 300px); }
.enlarge { position: absolute; right: 12px; bottom: 12px; padding: 8px 12px; border: 1px solid color-mix(in srgb, white 30%, transparent); border-radius: 4px; background: var(--navy); color: white; font-size: .8125rem; font-weight: 700; line-height: 1.35; }
.photo-set figcaption { margin-top: 14px; padding-inline: 2px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; color: var(--muted); font-size: .8125rem; line-height: 1.65; }
.photo-set figcaption span { color: #00758d; font-weight: 800; letter-spacing: .04em; }
.project-scope { max-width: 78ch; margin: 32px auto; font-size: .875rem; }
.project-scope p + p { margin-top: 8px; }
.review-note { color: #52636e; }
.project-cta { display: flex; justify-content: space-between; align-items: center; gap: 36px; background: var(--paper); padding: 36px 44px; margin-top: 24px; }
.project-cta h2 { max-width: 660px; font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1.18; margin-bottom: 14px; }
.project-cta p { font-size: 1rem; }
.project-cta .button { flex-shrink: 0; }
.project-return { margin-top: 24px; min-height: 44px; }
body:has(.photo-dialog[open]) { overflow: hidden; }
.photo-dialog { width: min(1120px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 0; border-radius: 6px; color: var(--navy); background: white; }
.photo-dialog::backdrop { background: rgb(5 20 30 / .9); }
.dialog-top, .dialog-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-top { margin-bottom: 16px; }
.dialog-top h2 { font-size: 1rem; letter-spacing: -.02em; }
.photo-dialog button { min-height: 44px; padding: 8px 14px; background: var(--navy); color: white; border: 0; border-radius: 3px; cursor: pointer; font-size: .875rem; }
.dialog-photo { width: 100%; height: min(65dvh, 720px); object-fit: contain; background: var(--paper); }
.dialog-bottom { margin-top: 16px; }
.dialog-bottom p { text-align: center; font-size: .875rem; }
.project-cover .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.standalone-sections:not(:empty) { display: grid; gap: 28px; margin-bottom: 32px; }
.standalone-sections h2 { font-size: 1.75rem; margin-bottom: 16px; }
.standalone-sections p { max-width: 75ch; font-size: 1.0625rem; }
@media (max-width: 1100px) {
  .project-container { width: calc(100% - 48px); }
  .project-lead { width: calc(100% - 48px); }
  .project-introduction h2 { font-size: 1.9rem; }
  .project-features { gap: 14px; margin-top: 20px; }
  .gallery-group { grid-template-columns: 1fr; gap: 24px; }
  .gallery-editorial { padding-top: 0; grid-template-columns: 64px 1fr; }
  .gallery-editorial p { max-width: 65ch; }
}
@media (max-width: 900px) {
  .project-hero .page-hero-grid { grid-template-columns: 1fr; gap: 20px; padding-block: 18px 28px; }
  .project-hero h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
  .project-hero .page-hero-introduction { border: 0; margin: 0; padding: 0; }
  .project-hero .page-hero-introduction > p { max-width: 52ch; font-size: 1rem; }
  .project-lead { flex-direction: column; width: 100%; gap: 28px; }
  .project-cover { flex: none; max-width: 100%; }
  .project-introduction { flex: none; width: 100%; padding-inline: 24px; max-width: 68ch; }
}
@media (max-width: 760px) {
  .project-hero h1 { font-size: clamp(1.75rem, 7.5vw, 2.6rem); }
  .project-story { padding-block: 16px 32px; }
  .project-introduction h2 { max-width: 390px; font-size: 1.9rem; margin-bottom: 18px; }
  .project-introduction > p { font-size: 1rem; }
  .project-features { gap: 16px; margin-top: 24px; }
  .project-features li { font-size: .9375rem; }
  .project-story .project-highlight { margin-block: 30px; }
  .project-story .project-highlight-inner { padding-block: 28px; }
  .project-story .project-highlight-copy p { font-size: 1rem; }
  .project-story .project-highlight-copy .project-highlight-detail { font-size: .8125rem; }
  .gallery-editorial { grid-template-columns: 48px minmax(0, 1fr); gap: 16px; }
  .group-number { font-size: 2.75rem; }
  .gallery-editorial h3 { font-size: 1.5rem; }
  .project-gallery { --gallery-shadow: 0 8px 20px color-mix(in srgb, var(--navy) 10%, transparent); gap: 36px; }
  .photo-set, .photo-set[data-count='3'], .photo-set[data-count='5'] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .photo-set[data-count='4'] { gap: 24px 16px; }
  .photo-set[data-count='4'] .gallery-link img { max-height: clamp(180px, 58vw, 240px); }
  .photo-set[data-count='5'] > figure { grid-column: auto; }
  .photo-set[data-count='3'] .primary-photo, .photo-set[data-count='5'] .primary-photo, .photo-set[data-count='1'] .primary-photo { grid-column: 1 / -1; }
  .project-cta { flex-direction: column; align-items: start; padding: 26px 22px; gap: 24px; }
  .project-cta h2 { font-size: 1.8rem; }
  .photo-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); padding: 12px; }
  .dialog-top { gap: 8px; }
  .dialog-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .dialog-bottom p { grid-column: 1 / -1; grid-row: 1; }
  .dialog-photo { height: 58dvh; }
}
