.projects-page .brand-header { color:var(--basalt); background:var(--limestone); border-color:var(--line); }
/* Enhanced gallery keeps the original figures as a no-JavaScript fallback. */
.has-gallery { display:grid; grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr); gap:24px 60px; padding-top:40px; margin-bottom:32px; border-top:1px solid var(--line); }
.has-gallery .built-project-heading { display:block; padding:0; border:0; }
.has-gallery .built-project-heading h2 { font-size:clamp(2.5rem,4vw,4rem); margin-bottom:28px; }
.has-gallery .built-project-heading h3 { font-size:1.7rem; }
.project-craft { margin-top:40px; padding-top:24px; border-top:1px solid var(--line); max-width:460px; }
.has-gallery .project-craft h3 { font-family:var(--sans); font-size:.75rem; letter-spacing:.1em; text-transform:uppercase; color:var(--granite); margin:0 0 24px; }
.project-craft dl { margin:0; }
.project-craft dl > div + div { margin-top:22px; }
.project-craft dt { font-family:var(--serif); font-size:1.5rem; line-height:1.2; margin-bottom:8px; }
.project-craft dd { margin:0; font-size:.9rem; line-height:1.7; color:var(--granite); }
@media(max-width:800px) { .project-craft { display:none; } }
.has-gallery .project-photo-note { grid-column:2; margin:0; padding:0; }
.built-gallery.is-interactive { display:block; min-width:0; }
.built-gallery.is-interactive figure[hidden] { display:none; }
.built-gallery.is-interactive figure img { height:auto; max-height:560px; width:auto; max-width:100%; object-fit:contain; object-position:left; background:transparent; }
#budapest.has-gallery { grid-template-columns:minmax(0,.65fr) minmax(0,1.35fr); }
#budapest.has-gallery .built-gallery { width:min(100%,660px); justify-self:end; }
#budapest.has-gallery .project-photo-note { width:min(100%,660px); justify-self:end; }
#budapest .built-gallery.is-interactive figure img { width:100%; height:auto; max-height:none; }
@media(max-width:720px) { #budapest.has-gallery { grid-template-columns:1fr; } }
.built-gallery.is-interactive figcaption { min-height:3.5em; }
.project-thumbnails { display:flex; gap:10px; padding:8px 0; flex-wrap:wrap; }
@media(max-width:800px) {
 .project-thumbnails { flex-wrap:nowrap; overflow-x:auto; padding:8px 4px 12px; }
 .project-thumbnail { flex:0 0 auto; }
}
.project-thumbnail { padding:3px; border:2px solid transparent; background:none; cursor:pointer; }
.project-thumbnail[aria-pressed="true"] { border-color:var(--rosso); }
.project-thumbnail:hover { border-color:var(--granite); }
.built-gallery .project-thumbnail img { display:block; width:76px; height:56px; object-fit:cover; }
.project-gallery-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:12px; font-size:.875rem; }
.project-gallery-open { border:0; border-bottom:1px solid currentColor; background:none; color:var(--basalt); min-height:48px; padding:8px 0; cursor:pointer; }
.project-gallery-open:hover { color:var(--rosso); }
.projects-page button:focus-visible,.project-lightbox a:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
body.photo-viewer-open { overflow:hidden; }
.project-lightbox { width:100%; max-width:none; height:100dvh; max-height:none; margin:0; padding:max(16px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)); border:0; color:var(--white); background:var(--basalt); }
.project-lightbox[open] { display:flex; flex-direction:column; gap:12px; }
.project-lightbox::backdrop { background:var(--basalt); }
.lightbox-bar { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.lightbox-bar h2 { font-family:var(--sans); font-size:1rem; line-height:1.4; margin:0; }
.project-lightbox button { min-width:48px; min-height:48px; padding:10px 14px; border:1px solid #ffffff70; background:transparent; color:inherit; cursor:pointer; }
.project-lightbox button:hover { background:#ffffff20; }
.lightbox-close { flex-shrink:0; }
.lightbox-stage { flex:1; min-height:0; margin:0; display:flex; flex-direction:column; gap:12px; touch-action:pan-y pinch-zoom; }
.lightbox-stage img { width:100%; flex:1; min-height:0; object-fit:contain; }
.lightbox-stage figcaption { text-align:center; font-size:.875rem; line-height:1.4; }
.lightbox-controls { display:flex; justify-content:center; align-items:center; gap:24px; }
.lightbox-error { text-align:center; text-decoration:underline; }
@media(max-width:720px) {
 .has-gallery { grid-template-columns:1fr; gap:24px; }
 .has-gallery .project-photo-note { grid-column:auto; }
 .built-gallery.is-interactive figure img { height:auto; max-height:480px; }
 .built-gallery .project-thumbnail img { width:64px; height:48px; }
 .lightbox-bar h2 { font-size:.875rem; }
}
.projects-heading { padding-top:clamp(140px,15vw,220px); padding-bottom:64px; position:relative; isolation:isolate; }
.projects-heading::before { content:''; position:absolute; z-index:-1; inset:0 calc((100% - 100vw)/2); background:linear-gradient(90deg,rgba(247,244,238,.35),rgba(247,244,238,.08)),url('/assets/images/projects/mineral-hero.webp') center/cover no-repeat; }
.projects-heading h1 { font-size:clamp(4rem,8vw,8rem); line-height:1; margin:0 0 24px; }
.projects-heading > p:last-child { max-width:620px; color:var(--granite); }
.built-project { padding-bottom:64px; scroll-margin-top:110px; }
.built-project-heading { display:grid; grid-template-columns:1fr 1fr; gap:40px; align-items:start; padding:40px 0; border-top:1px solid var(--line); }
.built-project-heading h2 { font-size:clamp(3rem,5vw,5rem); margin:0; }
.built-project-heading h3 { font-size:2rem; margin:0 0 12px; }
.built-project-heading p { max-width:580px; }
.built-gallery { display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:start; }
.built-gallery figure { margin:0; min-width:0; }
.built-gallery figure:first-child { grid-row:span 2; }
.built-gallery img { width:100%; height:auto; display:block; }
.built-gallery figure:not(:first-child) img { max-height:540px; object-fit:contain; object-position:left; }
.built-gallery figcaption,.project-photo-note { color:var(--granite); font-size:.875rem; padding-top:12px; }
.built-gallery-landscape figure:first-child { grid-row:auto; grid-column:1 / -1; }
.built-gallery-landscape figure:last-child { grid-column:1 / -1; }
.built-gallery-landscape figure img { width:100%; height:auto; max-height:none; object-fit:contain; }
.built-project-heading h2 { overflow-wrap:anywhere; }
.projects-contact { padding-block:48px 100px; border-top:1px solid var(--line); }
.projects-contact h2 { font-size:clamp(2.5rem,4vw,4rem); }
@media(max-width:720px) {
 .projects-heading { padding-bottom:32px; }
 .built-project-heading,.built-gallery { grid-template-columns:1fr; gap:24px; }
 .built-gallery figure:first-child { grid-row:auto; }
 .built-gallery figure:not(:first-child) img { max-height:none; }
}
