*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{font:1rem/1.35 system-ui,sans-serif;color:#252525}
#gallery-state{display:grid;place-items:center;min-height:84px;margin:0;padding:16px;border:1px solid #e8e4e3;border-radius:16px;background:#faf9f8}
#gallery{height:100%;margin:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;border-radius:16px;background:#271c1d;color:white}
#gallery-photo{display:block;width:100%;height:100%;object-fit:contain}
figcaption{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 20px;padding:8px 12px;background:#4f2227}
#gallery-caption{overflow-wrap:anywhere}
#gallery-caption:empty{display:none}
figcaption:has(#gallery-caption:empty):has(#gallery-controls[hidden]){display:none}
#gallery-controls{display:flex;gap:6px;align-items:center;margin-left:auto}
button{min-height:44px;min-width:44px;padding:4px 10px;border:1px solid #cfa9ad;border-radius:9px;background:transparent;color:inherit;font:inherit;cursor:pointer}
button:focus-visible{outline:2px solid white;outline-offset:2px}
#gallery-count{font-variant-numeric:tabular-nums;margin-left:4px}
