/* The collection opens into cases; each case keeps its own visual sequence. */
.collection-dialog{padding:0;width:calc(100% - 64px);height:calc(100dvh - 48px);max-height:calc(100dvh - 48px);max-width:1440px;scrollbar-gutter:stable}
.gallery-header{position:sticky;top:0;z-index:5;background:rgba(255,255,255,.98);padding:28px clamp(24px,4vw,56px) 24px;border-bottom:1px solid var(--line);gap:24px}
.gallery-header h2{font-size:clamp(30px,3.7vw,54px);margin-top:10px;line-height:1.12}
.gallery-header .eyebrow{font-size:9px;line-height:1.6;letter-spacing:.12em}
.gallery-header .close-button{width:40px;height:40px}
.gallery-header>div:first-child{min-width:0}
.gallery-header-actions{display:flex;align-items:center;flex:none;min-height:40px}
.gallery-header .gallery-back{font-size:12px;white-space:nowrap;padding:10px 0;min-height:44px;color:var(--blue)}
.collection-dialog[data-view="project"] .gallery-header h2{font-size:clamp(27px,3.2vw,46px)}
.gallery-categories{margin:0;padding:18px clamp(24px,4vw,56px);border-top:0;gap:10px 24px}
.gallery-category{font-size:11px;line-height:1.5}
.gallery-projects{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:46px 28px;padding:34px clamp(24px,4vw,56px) 12px}
.project-card{display:block;text-align:left;width:100%;padding:0;min-width:0}
.project-card-media{display:block;overflow:hidden;background:#f2f3f3;aspect-ratio:4/3}
.project-card-media img{width:100%;height:100%;object-fit:cover;transition:transform .6s ease}
.project-card:hover .project-card-media img{transform:scale(1.025)}
.project-card-caption{display:flex;gap:20px;align-items:center;justify-content:space-between;padding-top:16px}
.project-card-title{font-size:clamp(18px,1.8vw,24px);line-height:1.25;letter-spacing:-.04em}
.project-card-arrow{color:var(--blue);font-size:21px;flex:none;transition:transform .2s}
.project-card:hover .project-card-arrow{transform:translate(2px,-2px)}
.project-view{padding:0 clamp(24px,4vw,56px)}
.project-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:24px;padding:24px 0 30px}
.project-toolbar .text-link{font-size:11px}
.project-toolbar .counter{font-size:9px;letter-spacing:.1em;white-space:nowrap}
.project-view .gallery-grid{display:block}
.gallery-series+.gallery-series{margin-top:64px}
.gallery-row{display:grid;grid-template-columns:var(--image-columns,minmax(0,1fr));gap:24px;align-items:start}
.gallery-row+.gallery-row{margin-top:24px}
.project-view .gallery-image-button{background:#f3f3f2}
.project-view .gallery-image-button img{aspect-ratio:auto;width:100%;height:auto;object-fit:contain}
.project-view .gallery-image-button picture{display:block;width:100%}
.lightbox-picture{display:flex;align-items:center;justify-content:center;width:100%;height:100%;pointer-events:none}
.lightbox-picture img{display:block;max-width:100%;max-height:calc(100dvh - 150px);width:auto;height:auto;object-fit:contain;pointer-events:auto}
.project-view .gallery-image-button:hover img{transform:none}
.gallery-row.is-single .gallery-image-button.is-portrait{width:min(100%,66%);justify-self:center}
.project-view .image-expand{width:30px;height:30px;right:14px;bottom:14px;font-size:16px;opacity:0;transition:opacity .2s}
.project-view .gallery-image-button:hover .image-expand,.project-view .gallery-image-button:focus-visible .image-expand{opacity:1}
.project-pagination{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:20px;margin-top:40px;padding:24px 0;border-top:1px solid var(--line);font-size:12px}
.project-pagination button{padding:8px 0;text-align:left;justify-self:start}
.project-pagination button:last-child{text-align:right;justify-self:end}
.project-pagination button:hover{color:var(--blue)}
.project-pagination .counter{font-size:9px}
.collection-dialog .gallery-footer{margin:40px clamp(24px,4vw,56px) 0;padding:26px 0 30px}
@media(max-width:800px){.gallery-projects{gap:30px 20px}.gallery-categories{gap:8px 18px}.gallery-row{gap:18px}.gallery-row+.gallery-row{margin-top:18px}}
@media(max-width:640px){
  .collection-dialog{width:100%;height:100dvh;max-height:100dvh;margin:0;max-width:none;scrollbar-gutter:auto}
  .gallery-header{padding:22px 20px 20px;gap:16px}
  .gallery-header h2{font-size:30px;line-height:1.12}
  .gallery-header .eyebrow{font-size:8px;max-width:240px}
  .gallery-header .close-button{width:36px;height:36px}
  .gallery-header-actions{min-height:36px;align-self:flex-start}
  .gallery-header .gallery-back{font-size:11px;min-height:44px}
  .collection-dialog[data-view="project"] .gallery-header h2{font-size:27px}
  .gallery-categories{padding:14px 20px;gap:7px 17px}
  .gallery-category{font-size:10px}
  .gallery-projects{grid-template-columns:minmax(0,1fr);padding:24px 20px 8px;gap:32px}
  .project-card-title{font-size:21px}
  .project-card-caption{padding-top:13px}
  .project-view{padding:0 20px}
  .project-toolbar{padding:21px 0 24px;gap:15px}
  .project-toolbar .text-link{font-size:10px}
  .project-toolbar .counter{font-size:8px}
  .gallery-row{grid-template-columns:minmax(0,1fr);gap:16px}
  .gallery-row+.gallery-row{margin-top:16px}
  .gallery-row.is-single .gallery-image-button.is-portrait{width:100%}
  .gallery-series+.gallery-series{margin-top:36px}
  .project-view .image-expand{opacity:1;width:25px;height:25px;right:10px;bottom:10px;font-size:14px}
  .project-pagination{font-size:10px;gap:12px;margin-top:28px;padding:18px 0}
  .project-pagination .counter{font-size:8px;white-space:nowrap}
  .collection-dialog .gallery-footer{margin:28px 20px 0;padding:23px 0;font-size:11px}
  .gallery-footer .text-link{white-space:nowrap}
  .lightbox-picture img{max-height:calc(100dvh - 170px)}
}
