/* Full-bleed rhythm: explicit section roles, not fragile nth-child indices.
   The approved hero and its theme tokens are deliberately untouched. */
:root{--section-plain:#faf9f5;--section-soft:#e1e7dd;--section-soft-card:#f4f6f0;--section-soft-line:#bfccbf;--section-soft-muted:#536158}
:root[data-theme=dark]{--section-plain:#111816;--section-soft:#243730;--section-soft-card:#30473d;--section-soft-line:#597065;--section-soft-muted:#bdc9c2}
main>:is(#about,#patient,#reviews,#questions),body>.footer{
  background:var(--section-soft);--wash:var(--section-soft-card);--surface:var(--section-soft-card);--line:var(--section-soft-line);--muted:var(--section-soft-muted);
}
main>:is(#procedures,#gallery,#locations,#contact){background:var(--section-plain)}
/* Full frames on desktop; opening any thumbnail always shows the whole photo. */
#gallery .section-heading{align-items:center}
.gallery-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(12px,1.7vw,26px);list-style:none;margin:0;padding:0}
.gallery-list>li{min-width:0}
.gallery-photo{display:block;text-decoration:none;border-radius:3px;outline-offset:6px}
.gallery-frame{position:relative;display:block;overflow:hidden;aspect-ratio:480/639;background:var(--wash);border-radius:3px 3px 24px 3px}
.gallery-frame img{display:block;width:100%;height:100%;object-fit:contain;transition:filter .22s}
.gallery-open-hint{position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:34px;height:34px;border:1px solid #ffffff2e;border-radius:50%;background:#17201e94;color:#ffffffd6;box-shadow:0 3px 12px #17201e1f;backdrop-filter:blur(5px);transition:background-color .2s,color .2s,transform .2s}
.gallery-open-hint svg{width:15px;height:15px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.35}
.gallery-photo:is(:hover,:focus-visible) img{filter:brightness(1.035)}
.gallery-photo:is(:hover,:focus-visible) .gallery-open-hint{background:#17201eb8;color:#fff;transform:translateY(-1px)}
body.gallery-open{overflow:hidden}
.gallery-dialog{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:clamp(12px,3vw,36px);border:0;background:transparent;color:var(--text)}
.gallery-dialog::backdrop{background:#08110edb;backdrop-filter:blur(8px)}
.gallery-dialog[open]{display:flex;align-items:center;justify-content:center}
.gallery-dialog-panel{background:var(--bg);width:min(100%,1000px);max-height:100%;padding:16px;border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;gap:12px}
.gallery-dialog-header{display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-shrink:0}
.gallery-dialog button{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--line);border-radius:50%;flex-shrink:0;font-size:24px;color:var(--text);background:var(--surface);cursor:pointer}
.gallery-dialog button:is(:hover,:focus-visible){background:var(--wash);border-color:var(--accent)}
.gallery-full-image{display:block;width:100%;height:calc(100dvh - 240px);min-height:80px;object-fit:contain;flex:0 1 auto}
.gallery-dialog-footer{display:flex;align-items:center;justify-content:center;gap:24px;flex-shrink:0}
.gallery-counter{font-size:14px;min-width:100px;text-align:center}
@media(min-width:761px) and (max-width:1050px){.gallery-list{gap:12px}.gallery-open-hint{right:8px;bottom:8px}}
@media(max-width:760px){
  .gallery-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .gallery-list>li:first-child{grid-column:1/-1}
  .gallery-list>li:first-child .gallery-frame{aspect-ratio:4/3}
  .gallery-list>li:first-child img{object-fit:cover;object-position:50% 60%}
  .gallery-open-hint{right:8px;bottom:8px}
  .gallery-dialog-panel{padding:12px;gap:10px}
  .gallery-full-image{height:calc(100dvh - 210px)}
}
@media(prefers-reduced-motion:reduce){.gallery-frame img{transition:none}.gallery-dialog::backdrop{backdrop-filter:none}}
