/* v9.3.103: gallery-only square previews and sticky theme controls. */
body.gallery-page #ribbon[hidden]{display:none!important}
.photo-gallery{padding-block:48px 80px}
.gallery-intro{max-width:760px;margin-bottom:34px}
.gallery-intro h1{margin-bottom:22px}
.gallery-intro .lede{max-width:660px}
.gallery-anchor{height:0;overflow-anchor:none}
.gallery-controls{position:sticky;top:var(--gallery-top,88px);z-index:55;background:var(--paper);padding:14px 0;margin:0;border-bottom:1px solid var(--line);overflow-anchor:none}
.gallery-filters{display:flex;flex-wrap:wrap;gap:8px}
.gallery-filter{font:inherit;font-size:.82rem;line-height:1.4;padding:9px 14px;border:1px solid var(--line);border-radius:99px;color:var(--ink-2);background:var(--paper-2);cursor:pointer;white-space:normal;text-align:center;overflow-wrap:break-word}
.gallery-filter[aria-pressed="true"]{color:var(--paper);background:var(--ink);border-color:var(--ink)}
.gallery-compact{display:none}
.gallery-result{display:flex;align-items:baseline;justify-content:space-between;gap:18px;margin:22px 0 24px}
.gallery-result h2{font-family:Manrope,sans-serif;font-size:.92rem;line-height:1.5;letter-spacing:0;font-weight:600;min-width:0;overflow-wrap:break-word}
.gallery-count{margin:0;color:var(--ink-2);font-size:.8rem;white-space:nowrap}
.gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px;row-gap:36px;align-items:start}
.gallery-card{margin:0;min-width:0}
.gallery-card[hidden],.gallery-controls[hidden],.gallery-theme-options[hidden]{display:none}
.gallery-open{display:block;position:relative;aspect-ratio:1/1;height:auto;border-radius:var(--r);background:none;overflow:hidden;cursor:zoom-in;scroll-margin-top:calc(var(--gallery-top,88px) + var(--gallery-controls-height,76px) + 16px)}
.gallery-open img{display:block;position:absolute;max-width:none;width:var(--cw);height:auto;left:var(--cx);top:var(--cy)}
.gallery-card figcaption{margin:13px 0 0;font-size:.9rem;line-height:1.65;color:var(--ink-2);overflow-wrap:break-word;hyphens:manual}
.gallery-category{display:block;margin-bottom:5px;font-size:.65rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--gold-text)}
.photo-gallery[data-theme]:not([data-theme="all"]) .gallery-category{display:none}
.photo-gallery :focus-visible{outline:2px solid var(--gold);outline-offset:4px}
/* v9.3.102: approved dark lightbox; changes scoped to the dialog. */
.gallery-dialog :focus-visible{outline:2px solid #C89A4C;outline-offset:4px}
.gallery-dialog{position:fixed;inset:0;margin:auto;width:min(1200px,calc(100% - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:18px 22px;border:1px solid #6B6358;border-radius:var(--r);background:#161310;color:#F3EFE7;color-scheme:dark;box-shadow:var(--shadow);overflow:auto}
.gallery-dialog::backdrop{background:rgba(22,19,16,.88)}
.gallery-dialog-top,.gallery-dialog-bottom{display:flex;justify-content:space-between;align-items:center;gap:16px}
.gallery-dialog-top{margin-bottom:14px;font-size:.82rem;color:#EAE3D6}
.gallery-dialog button{font:inherit;font-size:.85rem;line-height:1.4;min-height:44px;padding:9px 14px;border:1px solid #9C8A70;border-radius:99px;background:#26211B;color:#F3EFE7;cursor:pointer}
.gallery-dialog figure{margin:0}
.gallery-dialog img{display:block;width:100%;height:min(65dvh,850px);object-fit:contain;border-radius:10px}
.gallery-dialog figcaption{color:#F3EFE7;font-size:.92rem;line-height:1.6;max-width:850px;margin:14px auto;max-height:20dvh;overflow:auto;overflow-wrap:anywhere}
.gallery-dialog button:not(:disabled):hover{background:#342C22;border-color:#C89A4C}
.gallery-dialog-bottom button:disabled{opacity:1;color:#B8B0A2;background:#211D18;border-color:#6B6358;cursor:default}

@media(max-width:959px){
 .gallery-grid{grid-template-columns:minmax(0,1fr);max-width:600px;margin-inline:auto;row-gap:32px}
 .gallery-controls{padding:8px 0}.gallery-filters{display:none}.gallery-compact{display:block}
 .gallery-theme-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:46px;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--paper-2);color:var(--ink);font:inherit;font-size:.85rem;line-height:1.4;text-align:left;cursor:pointer}
 .gallery-theme-toggle span:first-child{min-width:0;overflow-wrap:break-word}
 .gallery-theme-options{display:grid;gap:6px;margin-top:8px;padding:4px;max-height:min(48dvh,360px);overflow:auto;overscroll-behavior:contain}
 .gallery-theme-options .gallery-filter{text-align:left;min-height:44px;border-radius:9px;width:100%}
 .gallery-result{align-items:flex-start;gap:12px}.gallery-count{padding-top:2px}
}
@media(max-width:560px){
 .photo-gallery{padding-block:32px 56px}
 .gallery-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px);padding:12px}.gallery-dialog img{height:58dvh}.gallery-dialog figcaption{max-height:19dvh;font-size:.85rem}.gallery-dialog-bottom button{padding-inline:10px}.gallery-dialog-top{gap:8px}

}

/* v9.3.105: wider desktop intro only in DE / IT / FR; typography unchanged. */
@media(min-width:1025px){
 html[lang="de"] .photo-gallery .gallery-intro,
 html[lang="it"] .photo-gallery .gallery-intro,
 html[lang="fr"] .photo-gallery .gallery-intro{max-width:100%}
 html[lang="de"] .photo-gallery .gallery-intro .lede,
 html[lang="it"] .photo-gallery .gallery-intro .lede,
 html[lang="fr"] .photo-gallery .gallery-intro .lede{max-width:none}
}

/* v9.3.107: align the filter strip with the grid; extend only to the right. */
@media(min-width:1280px){
 html[lang="en"] .photo-gallery .gallery-controls,
 html[lang="de"] .photo-gallery .gallery-controls,
 html[lang="fr"] .photo-gallery .gallery-controls{
  width:min(1440px,calc(50vw + 50% - 20px));
  max-width:none;
  margin-inline:0;
 }
}

/* v9.3.109: the desktop divider follows the grid, not the wider filter strip. */
@media(min-width:1280px){
 html[lang="en"] .photo-gallery .gallery-controls,
 html[lang="de"] .photo-gallery .gallery-controls,
 html[lang="fr"] .photo-gallery .gallery-controls{
  border-bottom-color:transparent;
 }
 html[lang="en"] .photo-gallery .gallery-controls::after,
 html[lang="de"] .photo-gallery .gallery-controls::after,
 html[lang="fr"] .photo-gallery .gallery-controls::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-1px;
  width:calc(var(--maxw) - 40px);
  height:1px;
  background:var(--line);
  pointer-events:none;
 }
}
