/* Shared project gallery. The native theme owns Cairo and the surrounding page. */
.sm-project-gallery{--smg-paper:#fffdf8;--smg-soft:#f7f4ee;--smg-ink:#252729;--smg-muted:#62615b;--smg-line:#deddd7;--smg-sand:#cdbb94;width:100%;min-width:0;margin:0 0 24px;color:var(--smg-ink);scroll-margin-top:110px}
.sm-project-gallery *{box-sizing:border-box}
.sm-project-gallery [hidden]{display:none!important}
.sm-project-gallery button,.sm-project-gallery a{font-family:inherit;font-weight:600;font-size:13px;line-height:1.6;color:var(--smg-ink);-webkit-tap-highlight-color:transparent;cursor:pointer}
.sm-project-gallery :is(button,a,input,select):focus-visible{outline:3px solid var(--smg-ink);outline-offset:3px}
.sm-project-gallery #plans.smg-anchor{display:block;height:0;min-height:0;margin:0;padding:0;border:0;scroll-margin-top:110px}
.sm-project-gallery .smg-heading{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}
.sm-project-gallery h2{font-family:inherit;font-size:24px;line-height:1.5;margin:0;color:var(--smg-ink)}
.sm-project-gallery .smg-heading p{font-size:13px;line-height:1.8;color:var(--smg-muted);margin:4px 0 0}
.sm-project-gallery .smg-switch{display:flex;flex-wrap:wrap;max-width:100%;gap:4px;padding:4px;border:1px solid var(--smg-line);border-radius:10px;background:var(--smg-paper);flex-shrink:0}
.sm-project-gallery .smg-switch button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;border:0;border-radius:7px;background:transparent;padding:10px 13px;white-space:nowrap}
.sm-project-gallery .smg-switch button[aria-pressed=true]{background:var(--smg-ink);color:var(--smg-paper)}
.sm-project-gallery .smg-switch button:hover:not([aria-pressed=true]){background:var(--smg-soft)}
.sm-project-gallery .smg-tab-count{font-size:11px;line-height:1.5;font-variant-numeric:tabular-nums;opacity:.8}
.sm-project-gallery .smg-finder{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 16px;margin:0 0 14px}
.sm-project-gallery .smg-finder label{display:grid;gap:6px;min-width:0;font-size:13px;line-height:1.7}
.sm-project-gallery .smg-finder :is(input,select){display:block;width:100%;min-width:0;min-height:44px;font:inherit;font-size:14px;line-height:1.7;color:var(--smg-ink);border:1px solid var(--smg-line);border-radius:7px;padding:9px 12px;background:var(--smg-paper)}
.sm-project-gallery .smg-search-summary{grid-column:1/-1;display:flex;align-items:center;gap:14px;font-size:12px;color:var(--smg-muted)}
.sm-project-gallery .smg-search-summary button{border:0;background:transparent;padding:8px 0;text-decoration:underline;text-underline-offset:3px;min-height:44px}
.sm-project-gallery .smg-finder>p{grid-column:1/-1;margin:0;font-size:13px;color:var(--smg-muted);line-height:1.7}
.sm-project-gallery svg{width:18px;height:18px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sm-project-gallery[dir=ltr] .smg-arrow svg{transform:rotate(180deg)}
.sm-project-gallery .smg-frame{border:1px solid var(--smg-line);border-radius:12px;overflow:hidden;background:var(--smg-paper)}
.sm-project-gallery .smg-figure{margin:0}
.sm-project-gallery .smg-stage{position:relative;width:100%;background:var(--smg-soft);touch-action:pan-y pinch-zoom}
.sm-project-gallery .smg-stage img{display:block;width:100%;height:auto;max-height:none;max-width:100%;margin-inline:auto;object-fit:contain;object-position:center;border:0;border-radius:0;transform:none;user-select:none;-webkit-user-drag:none}
.sm-project-gallery .smg-stage[data-kind=photos] img[data-smg-resolution=limited]{max-width:min(100%,var(--smg-source-width,100%))}
.sm-project-gallery .smg-stage[data-kind=photos] img[data-smg-resolution=unknown]{width:auto;max-width:100%}
.sm-project-gallery .smg-stage:not([data-kind=photos]){display:flex;align-items:center;justify-content:center;height:min(68vh,640px);min-height:340px;padding:14px;background:#fff}
.sm-project-gallery .smg-stage:not([data-kind=photos]) img{height:100%;width:100%;max-width:100%;max-height:none;object-fit:contain}
.sm-project-gallery .smg-captionbar{display:flex;gap:12px;align-items:center;padding:12px 16px;border-block:1px solid var(--smg-line);text-align:start}
.sm-project-gallery .smg-caption{flex:1;min-width:0}
.sm-project-gallery .smg-caption strong{display:block;font-size:15px;line-height:1.7;font-weight:700;overflow-wrap:anywhere}
.sm-project-gallery .smg-caption span{display:block;font-size:12px;line-height:1.8;color:var(--smg-muted)}
.sm-project-gallery .smg-paging{display:flex;align-items:center;gap:8px;flex-shrink:0}
.sm-project-gallery .smg-arrow{width:44px;height:44px;display:flex;justify-content:center;align-items:center;border:1px solid var(--smg-line);border-radius:50%;background:var(--smg-paper);padding:0;box-shadow:none}
.sm-project-gallery .smg-arrow:hover{background:var(--smg-soft);border-color:var(--smg-sand)}
.sm-project-gallery .smg-count{min-width:46px;text-align:center;font-size:12px;color:var(--smg-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.sm-project-gallery .smg-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:14px 16px}
.sm-project-gallery .smg-thumbs{display:flex;flex-wrap:wrap;gap:8px;min-width:0;max-width:100%}
.sm-project-gallery .smg-thumb{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:104px;min-height:80px;padding:6px;border:1px solid var(--smg-line);border-radius:7px;background:#fff;text-align:center;text-decoration:none;transition:border-color 160ms ease}
.sm-project-gallery .smg-thumb[aria-pressed=true]{border-color:var(--smg-ink);box-shadow:inset 0 0 0 1px var(--smg-ink)}
.sm-project-gallery .smg-thumb img{display:block;width:100%;height:44px;object-fit:contain;object-position:center;border-radius:0;transform:none}
.sm-project-gallery .smg-thumb img:not([src]){display:none}
.sm-project-gallery .smg-thumb span{display:block;font-size:12px;line-height:1.6;color:var(--smg-ink);overflow-wrap:anywhere}
.sm-project-gallery .smg-thumb:hover{border-color:var(--smg-ink)}
.sm-project-gallery .smg-browse{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:8px;width:100%;font-size:12px;color:var(--smg-muted)}
.sm-project-gallery .smg-browse button{min-height:44px;border:1px solid var(--smg-line);border-radius:7px;background:var(--smg-paper);padding:8px 12px;font-size:12px}
.sm-project-gallery .smg-browse output{min-width:70px;text-align:center;font-variant-numeric:tabular-nums}
.sm-project-gallery button:disabled{opacity:.45;cursor:default}
.sm-project-gallery .smg-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.sm-project-gallery :is(.smg-read-plan,.smg-original){display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;background:var(--smg-soft);color:var(--smg-ink);border:1px solid var(--smg-line);border-radius:7px;padding:9px 12px;text-align:center;text-decoration:none}
.sm-project-gallery :is(.smg-read-plan,.smg-original):hover{border-color:var(--smg-ink)}
.sm-project-gallery .smg-plan-details{margin:0 16px 16px;border-top:1px solid var(--smg-line);padding-top:14px}
.sm-project-gallery h3{font-family:inherit;font-weight:700;font-size:14px;line-height:1.6;margin:0 0 12px;color:var(--smg-ink)}
.sm-project-gallery .smg-plan-details dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 16px;margin:0}
.sm-project-gallery .smg-plan-details dl>div{min-width:0;border-inline-start:2px solid var(--smg-sand);padding-inline-start:10px}
.sm-project-gallery .smg-plan-details dt{font-size:12px;line-height:1.7;color:var(--smg-muted);margin-bottom:2px}
.sm-project-gallery .smg-plan-details dd{margin:0;font-size:13px;line-height:1.7;font-weight:600}
.sm-project-gallery .smg-measure{display:inline-flex;align-items:baseline;direction:ltr;unicode-bidi:isolate;gap:4px;white-space:nowrap;font-variant-numeric:tabular-nums}
.sm-project-gallery .smg-measure small{font-size:11px;font-weight:400;color:var(--smg-muted)}
.sm-project-gallery .smg-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:767px){
 .sm-project-gallery .smg-stage:not([data-kind=photos]){height:min(64vh,460px);min-height:280px;padding:10px}
 .sm-project-gallery .smg-heading{align-items:flex-start;flex-direction:column;gap:12px}
 .sm-project-gallery .smg-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
 .sm-project-gallery .smg-switch button{min-width:0;padding:9px 8px;white-space:normal}
 .sm-project-gallery .smg-plan-details dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px}
}
@media(max-width:640px){
 .sm-project-gallery .smg-heading{align-items:flex-start;flex-direction:column;gap:12px}
 .sm-project-gallery h2{font-size:21px}
 .sm-project-gallery .smg-switch{width:100%}
 .sm-project-gallery .smg-switch button{flex:1}
 .sm-project-gallery .smg-finder{grid-template-columns:minmax(0,1fr)}
 .sm-project-gallery .smg-captionbar{flex-wrap:wrap;padding:11px 12px;gap:8px}
 .sm-project-gallery .smg-caption{flex:1 1 100%}
 .sm-project-gallery .smg-paging{width:100%;justify-content:flex-start}
 .sm-project-gallery .smg-tools{padding:12px;gap:10px}
 .sm-project-gallery .smg-thumbs{width:100%;gap:8px}
 .sm-project-gallery .smg-thumb{width:calc((100% - 16px)/3);padding:5px;min-height:78px}
 .sm-project-gallery .smg-plan-details{margin-inline:12px}
}
@media(max-width:360px){
 .sm-project-gallery .smg-switch button{padding:9px 8px;font-size:12px}
 .sm-project-gallery .smg-stage:not([data-kind=photos]){min-height:250px;padding:6px}
 .sm-project-gallery .smg-thumb span{font-size:11px}
 .sm-project-gallery .smg-measure{font-size:12px;gap:3px}
}
@media(prefers-reduced-motion:reduce){.sm-project-gallery *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
