/* v7 authentic-media gallery: source files untouched, full image visible.
   Natural image proportions and a masonry-style column flow avoid letterboxing. */
.project-gallery{padding:34px 0 48px}
.project-gallery__eyebrow{display:flex;justify-content:space-between;align-items:center;gap:14px;border-top:1px solid var(--line);padding-top:15px}
.project-gallery__count{font-size:10px;font-weight:700;letter-spacing:.13em;color:var(--muted)}
.project-gallery__heading{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:26px;margin:18px 0 23px}
.project-gallery__heading h2{font:normal clamp(35px,4.2vw,59px)/1.07 var(--serif);letter-spacing:-.035em;color:var(--deep);margin:0}
.project-gallery__heading p{line-height:1.7;color:var(--muted);font-size:13px;margin:0 0 3px;max-width:530px}
.project-gallery__grid{column-count:3;column-gap:13px}
.project-gallery__item{display:inline-block;width:100%;margin:0 0 13px;vertical-align:top;break-inside:avoid;page-break-inside:avoid;min-width:0;background:#fffefa;border:1px solid #e4e6dd;transition:box-shadow .17s}
.project-gallery__item:hover{box-shadow:0 8px 22px #15362b20}
.project-gallery__item:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.project-gallery__item[hidden]{display:none!important}
.project-gallery__image{position:relative;background:#e9eae5}
.project-gallery__image img{display:block;width:100%;height:auto;object-fit:contain}
.project-gallery__view{position:absolute;right:10px;bottom:10px;padding:7px 10px;background:#fffefaed;color:#1a463a;font-weight:700;font-size:10px}
.project-gallery__info{padding:13px 15px 16px;display:flex;flex-direction:column;gap:6px}
.project-gallery__type{font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#8d7250;font-weight:750}
.project-gallery__info strong{font:normal 21px/1.14 var(--serif);color:#15352e}
.project-gallery__info small{font-size:11px;line-height:1.55;color:#68756b}
.project-gallery__source{font-size:11px;line-height:1.7;color:#6f786d;margin:19px 0 0;max-width:980px}
.project-gallery__source strong{color:#33463c}
.project-gallery__dialog{border:0;padding:15px;max-width:min(96vw,1100px);width:96vw;max-height:94vh;overflow:auto;background:#fdfdf9;color:var(--ink);box-shadow:0 20px 80px #09181380}
.project-gallery__dialog::backdrop{background:#041713cf}
.project-gallery__dialog-bar{display:flex;gap:20px;justify-content:space-between;align-items:center;margin:2px 3px 14px}
.project-gallery__dialog-bar div{display:flex;flex-direction:column;gap:4px}
.project-gallery__dialog-bar strong{font:normal 22px var(--serif)}
.project-gallery__dialog-bar span{font-size:12px;line-height:1.5;color:#6b746a}
.project-gallery__dialog-bar button{font-weight:700;border:1px solid var(--line);background:#f6f6ef;padding:8px 12px;min-height:40px;cursor:pointer}
.project-gallery__dialog>img{max-width:100%;max-height:68vh;height:auto;width:auto;margin:0 auto;object-fit:contain}
.project-gallery__dialog>a{display:block;text-align:center;font-size:12px;font-weight:750;color:#2b5a49;padding:13px}
@media(max-width:850px){.project-gallery__grid{column-count:2}.project-gallery__heading{grid-template-columns:1fr;gap:12px}.project-gallery__heading p{max-width:100%}}
@media(max-width:550px){.project-gallery{padding:26px 0 35px}.project-gallery__heading h2{font-size:37px}.project-gallery__grid{column-count:1}.project-gallery__item{margin-bottom:12px}.project-gallery__info{padding:12px 15px 14px}.project-gallery__dialog{padding:10px}.project-gallery__dialog-bar strong{font-size:18px}}
@media(prefers-reduced-motion:reduce){.project-gallery__item{transition:none}}

/* v8 screenshot review: two authentic images should fill the available row. */
@media(min-width:551px){
  .project-gallery__grid--two{column-count:2}
}

/* v9: photos keep their own proportions; plans remain on plain paper for legibility */
.project-gallery__image.media-frame{aspect-ratio:var(--ratio,4/3);background:#e9ebe4}
.project-gallery__image.media-frame img{position:absolute;inset:0;height:100%}

/* v11 gallery grid: six-column desktop rhythm so every row is completely filled.
   Photos appear whole in uniform 4:3 frames (contain + subtle blurred backdrop; nothing cropped). */
.project-gallery__grid,.project-gallery__grid--two{column-count:auto;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:24px 18px;align-items:start}
.project-gallery__item{display:flex;flex-direction:column;width:auto;margin:0;grid-column:span 2;break-inside:auto}
.project-gallery__image{position:relative;aspect-ratio:4/3;overflow:hidden}
.project-gallery__image.media-frame{aspect-ratio:4/3}
.project-gallery__image img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain}
.project-gallery__image--plan{background:#fbfaf7}
/* Two images: two equal columns */
.project-gallery__grid--two{grid-template-columns:repeat(2,minmax(0,1fr))}
.project-gallery__grid--two .project-gallery__item{grid-column:auto}
/* Remainder 2 (e.g. five images): the final two tiles share the last row equally */
.project-gallery__grid--rem2 .project-gallery__item:nth-last-child(-n+2){grid-column:span 3}
/* Remainder 1 (e.g. four images): the final tile becomes a full-width panoramic band */
.project-gallery__grid--rem1 .project-gallery__item:last-child{grid-column:1/-1}
.project-gallery__grid--rem1 .project-gallery__item:last-child:not(:has(.project-gallery__image--plan)) .project-gallery__image{aspect-ratio:21/9}
/* A lone floor plan or master plan keeps its proportions, centered at a readable width (no empty band) */
.project-gallery__grid--rem1 .project-gallery__item:last-child:has(.project-gallery__image--plan){justify-self:center;width:min(100%,760px)}
@media(max-width:850px){
  .project-gallery__grid,.project-gallery__grid--two{grid-template-columns:repeat(2,minmax(0,1fr))}
  .project-gallery__item,.project-gallery__grid--rem2 .project-gallery__item:nth-last-child(-n+2),.project-gallery__grid--rem1 .project-gallery__item:last-child{grid-column:auto}
  .project-gallery__grid .project-gallery__item:last-child:nth-child(odd){grid-column:1/-1}
  .project-gallery__grid .project-gallery__item:last-child:nth-child(odd) .project-gallery__image{aspect-ratio:16/10}
  .project-gallery__grid--rem1 .project-gallery__item:last-child .project-gallery__image{aspect-ratio:4/3}
  .project-gallery__grid--rem1 .project-gallery__item:last-child:has(.project-gallery__image--plan){justify-self:stretch;width:auto}
}
@media(max-width:550px){
  .project-gallery__grid,.project-gallery__grid--two{grid-template-columns:1fr}
  .project-gallery__grid .project-gallery__item:last-child:nth-child(odd){grid-column:auto}
  .project-gallery__grid .project-gallery__item:last-child:nth-child(odd) .project-gallery__image{aspect-ratio:4/3}
}

/* v12 UX: floor plans keep their exact proportions (no letterboxing or cropping) and the
   Expand control sits in the caption area, never over the drawing. */
.project-gallery__image--plan{aspect-ratio:var(--ratio,4/3);background:#fbfaf7;border-bottom:1px solid #e4e6dd}
.project-gallery__image--plan img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.project-gallery__view{display:inline-flex;align-self:flex-start;align-items:center;gap:4px;margin-top:6px;padding:0 0 2px;font-size:10px;font-weight:750;letter-spacing:.09em;text-transform:uppercase;color:#2b5a49;border-bottom:1px solid #b7a17f}
.project-gallery__item:hover .project-gallery__view{color:#15352e;border-color:#15352e}
@media(max-width:550px){.project-gallery__view{min-height:24px;align-items:center}}
/* v12: the expand label now lives in the caption block (static flow, no picture overlay). */
.project-gallery__view{position:static;right:auto;bottom:auto;background:none;color:#2b5a49}
/* Cards in the same row share one height so the grid reads as a clean, aligned rhythm. */
.project-gallery__grid,.project-gallery__grid--two{align-items:stretch}
