/* Project photography: quiet framing lets the actual work take the lead. */
.gallery-heading { padding-block: 34px 48px; }
.gallery-heading h1 { max-width: 900px; margin-bottom: 16px; font-size: clamp(2.8rem, 6vw, 4.8rem); }
.gallery-heading > p:last-child { margin: 0; font-size: 1.12rem; }
.gallery-project { padding-bottom: 90px; }
.gallery-project__intro { display: grid; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 54px; padding-block: 32px; border-top: 1px solid var(--line); }
.gallery-project__intro .eyebrow { margin-bottom: 12px; }
.gallery-project__intro h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); }
.gallery-project__intro h2 span { display: block; margin-top: 12px; color: var(--muted); font-family: var(--sans); font-size: 1rem; line-height: 1.5; letter-spacing: 0; font-weight: 450; }
.gallery-project__intro > p { max-width: 490px; margin: 0; }
.gallery-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.gallery-comparison__photo { position: relative; display: block; overflow: hidden; color: var(--evergreen); border-radius: 6px; background: var(--stone); box-shadow: 0 5px 20px #153c340c; text-decoration: none; }
.gallery-comparison__photo > img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .35s ease; }
.gallery-comparison__photo:hover > img { transform: scale(1.025); }
.gallery-stage { position: absolute; top: 18px; left: 18px; z-index: 1; padding: 6px 14px; border-radius: 3px; color: var(--evergreen); background: var(--ivory); font-size: .78rem; font-weight: 760; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 2px 8px #0002; }
.gallery-stage--after { color: var(--white); background: var(--evergreen); }
.gallery-comparison__caption { position: relative; display: flex; min-height: 68px; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: #fff; font-size: .95rem; font-weight: 620; }
.gallery-expand, .gallery-card__expand { display: grid; width: 34px; height: 34px; flex-shrink: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.gallery-expand svg, .gallery-card__expand svg { width: 18px; height: 18px; }
.gallery-details { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 18px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.gallery-details p { margin: 0; }
.gallery-details > span { color: var(--forest); }
.gallery-details > span > span { margin-inline: 7px; color: var(--sage); }
.gallery-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-block: 54px 26px; }
.gallery-toolbar h3 { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-filters[hidden] { display: none; }
.gallery-filters button { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 30px; color: var(--evergreen); background: transparent; font-size: .85rem; font-weight: 650; cursor: pointer; }
.gallery-filters button:hover { border-color: var(--forest); }
.gallery-filters button[aria-pressed="true"] { border-color: var(--evergreen); color: white; background: var(--evergreen); }
.gallery-filters button span { opacity: .75; font-size: .75rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.gallery-card { min-width: 0; margin: 0; }
.gallery-card[hidden] { display: none; }
.gallery-card > a { position: relative; display: block; border-radius: 5px; background: var(--stone); overflow: hidden; }
.gallery-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .3s ease; }
.gallery-card a:hover img { transform: scale(1.04); }
.gallery-card .gallery-stage { top: 12px; left: 12px; padding: 5px 10px; font-size: .65rem; }
.gallery-card__expand { position: absolute; right: 12px; bottom: 12px; color: var(--evergreen); background: var(--ivory); }
.gallery-card figcaption { padding-top: 12px; color: var(--evergreen); font-size: .87rem; line-height: 1.5; }
.gallery-cta { padding-block: 72px; background: var(--evergreen); text-align: center; }
.gallery-cta h2 { margin-bottom: 18px; color: white; }
.gallery-cta p:not(.eyebrow) { max-width: 580px; margin: 0 auto 26px; color: #dce7e0; }
.project-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.project-preview__photo { position: relative; display: block; }
.project-preview__photo img { width: 100%; max-height: 580px; object-fit: cover; border-radius: 5px; }
.project-preview__photo > span { position: absolute; inset: auto 20px 20px; display: flex; justify-content: space-between; padding: 15px 20px; color: var(--evergreen); background: var(--ivory); font-weight: 650; }
body.gallery-is-open { overflow: hidden; }
.gallery-modal { --focus-ring: var(--water-light); width: min(1040px, calc(100% - 36px)); max-width: none; max-height: calc(100dvh - 36px); padding: 0; border: 1px solid #ffffff25; border-radius: 10px; color: white; background: #102c26; box-shadow: 0 24px 100px #0005; }
.gallery-modal:not([open]) { display: none; }
.gallery-modal::backdrop { background: #071d18ed; }
.gallery-modal__inner { padding: 20px 28px 16px; }
.gallery-modal__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.gallery-modal__header p { margin-bottom: 3px; color: #b7d0c1; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.gallery-modal__header h2 { margin: 0; color: white; font-family: var(--sans); font-size: .95rem; font-weight: 550; letter-spacing: 0; }
.gallery-modal button { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; gap: 12px; border: 1px solid #8eaa9c80; border-radius: 4px; color: white; background: transparent; cursor: pointer; }
.gallery-modal button:hover { color: var(--evergreen); background: var(--water-light); }
.gallery-modal .gallery-modal__close { border-radius: 50%; font-size: 1.8rem; line-height: 1; }
.gallery-modal__figure { margin: 0; }
.gallery-modal__stage { position: relative; display: grid; height: min(65dvh, 700px); min-height: 100px; place-items: center; background: #091f1a; touch-action: pan-y pinch-zoom; }
.gallery-modal__stage img { width: 100%; height: 100%; max-height: min(65dvh, 700px); object-fit: contain; }
.gallery-modal__stage.is-loading img { opacity: 0; }
.gallery-modal__stage.is-loading::after { position: absolute; content: "Loading photo…"; color: #dce7e0; font-size: .9rem; }
.gallery-modal__error { position: absolute; padding: 20px; color: white; text-align: center; }
.gallery-modal__error a { color: var(--water-light); }
.gallery-modal__figure figcaption { margin-top: 14px; min-height: 24px; color: #e3ece7; font-size: .9rem; text-align: center; }
.gallery-modal__controls { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 16px; }
.gallery-modal__controls button { padding: 8px 16px; font-size: .84rem; }
.gallery-modal__controls > span { color: #dce7e0; font-size: .8rem; font-variant-numeric: tabular-nums; }
.gallery-modal__help { margin: 12px 0 0; color: #b7d0c1; font-size: .7rem; text-align: center; }
@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .gallery-heading { padding-block: 26px 32px; }
  .gallery-project__intro { grid-template-columns: 1fr; gap: 18px; padding-block: 26px; }
  .gallery-comparison { gap: 14px; }
  .gallery-comparison__caption { min-height: 74px; gap: 8px; padding: 12px; font-size: .8rem; }
  .gallery-expand { width: 28px; height: 28px; }
  .gallery-stage { top: 12px; left: 12px; padding: 5px 10px; font-size: .68rem; }
  .gallery-details { font-size: .75rem; }
  .project-preview { grid-template-columns: 1fr; gap: 30px; }
  .project-preview__photo img { max-height: 540px; }
  .gallery-modal__inner { padding: 16px; }
  .gallery-modal__stage, .gallery-modal__stage img { height: 56dvh; max-height: 56dvh; }
}
@media (max-width: 600px) {
  .gallery-heading h1 { max-width: 390px; }
  .gallery-project { padding-bottom: 58px; }
  .gallery-comparison__caption { min-height: 82px; align-items: start; }
  .gallery-comparison__caption .gallery-expand { display: none; }
  .gallery-comparison__photo > img { aspect-ratio: 3 / 4; }
  .gallery-toolbar { margin-top: 36px; gap: 18px; }
  .gallery-toolbar h3 { font-size: 1.8rem; }
  .gallery-filters { gap: 6px; }
  .gallery-filters button { padding-inline: 13px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .gallery-card figcaption { font-size: .8rem; }
  .gallery-modal { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .gallery-modal__inner { padding: 12px; }
  .gallery-modal__header { margin-bottom: 12px; }
  .gallery-modal__stage, .gallery-modal__stage img { height: 54dvh; max-height: 54dvh; }
  .gallery-modal__figure figcaption { min-height: 42px; font-size: .8rem; }
  .gallery-modal__controls button { padding-inline: 12px; }
}
