/* Galerie: festes Spaltenraster, Bilder belegen 1 bis 3 Spalten */
.gallery{display:grid;--cols:3;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:14px;align-items:start}
.gallery figure{margin:0;border-radius:10px;overflow:hidden;background:#dfe6ee}
.gallery img{width:100%;height:auto;display:block}
.gallery .w2{grid-column:span 2}
.gallery .w3{grid-column:span 3}
@media (max-width:760px){.gallery{--cols:2}.gallery .w3{grid-column:span 2}}
@media (max-width:560px){.gallery{--cols:1}.gallery .w2,.gallery .w3{grid-column:auto}}

/* Galerie im Bearbeitungsmodus */
.gallery.editing figure{position:relative;cursor:grab;outline:2px dashed transparent;outline-offset:3px;overflow:visible;user-select:none;-webkit-user-select:none}
.gallery.editing figure img{border-radius:10px;pointer-events:none}
.gallery.editing figure:hover{outline-color:#9fb3c8}
.gallery.editing figure.dragging{opacity:.45;outline-color:var(--blue);cursor:grabbing}
.gallery.editing figure.resizing{outline:3px solid var(--blue)}
.gallery.editing figure.aus img{opacity:.35;filter:grayscale(1)}
.g-handle{position:absolute;right:0;bottom:0;width:36px;height:36px;cursor:nwse-resize;touch-action:none;border-bottom-right-radius:10px;
  background:linear-gradient(135deg,transparent 50%,rgba(15,42,74,.88) 50%)}
.g-handle::after{content:"";position:absolute;right:6px;bottom:6px;width:12px;height:12px;border-right:2.5px solid #fff;border-bottom:2.5px solid #fff}
.g-grip{position:absolute;left:8px;top:8px;width:38px;height:38px;border-radius:8px;background:rgba(15,42,74,.85);color:#fff;
  display:grid;place-items:center;font-size:1.15rem;touch-action:none;cursor:grab}
.g-tools{position:absolute;right:8px;top:8px;display:flex;gap:4px;opacity:0;transition:opacity .15s}
.gallery.editing figure:hover .g-tools,.gallery.editing figure:focus-within .g-tools{opacity:1}
@media (hover:none){.g-tools{opacity:1}}
.g-tools .tb{width:34px;height:34px;background:#fff;font-size:.9rem}
.g-badge{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:none;pointer-events:none;white-space:nowrap;
  background:rgba(15,42,74,.92);color:#fff;font-weight:700;padding:.4rem .9rem;border-radius:8px}
.resizing .g-badge{display:block}
.g-off{position:absolute;left:0;right:0;bottom:0;display:none;padding:.3rem 42px .3rem .6rem;background:rgba(180,35,24,.92);color:#fff;
  font-size:.85rem;text-align:center;border-radius:0 0 10px 10px}
.aus .g-off{display:block}

.gallery figure{position:relative}
.gallery.editing figure.versteckt img{opacity:.3;filter:grayscale(1)}
.gallery.editing figure.versteckt .g-off{display:block}
.gallery figure img{cursor:zoom-in}
.lightbox{position:fixed;inset:0;z-index:100;background:rgba(5,15,25,.92);display:flex;align-items:center;justify-content:center;padding:16px}
.lightbox[hidden]{display:none}
.lightbox img{max-width:100%;max-height:100%;border-radius:6px;box-shadow:0 8px 40px rgba(0,0,0,.6)}
.lightbox button{position:absolute;top:12px;right:12px;width:48px;height:48px;border:0;border-radius:50%;background:#fff;color:var(--navy);font-size:1.4rem;cursor:pointer}
@media print{.gallery figure{break-inside:avoid}.gallery.editing .g-tools{display:none}}
