/* stellwrk Galerie: Raster, Albumauswahl und Vergrößerungsansicht (<dialog>). */
.g-albums { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.g-albums a {
  display: inline-flex; align-items: center; gap: .5em; padding: .5em 1em; border-radius: 99px; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg-muted); font-weight: 600; font-size: .95rem;
}
.g-albums a span { font: 600 .78rem var(--mono); color: var(--fg-muted); opacity: .8; }
.g-albums a:hover { color: var(--fg); border-color: #35506b; }
.g-albums a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-hi); border-color: var(--accent-hi); }
.g-albums a[aria-current="page"] span { color: var(--accent-ink); }
.g-desc { margin: -.4rem 0 1.4rem; max-width: 62ch; }

.g-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.g-grid > li { min-width: 0; }
.g-item { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-raised); height: 100%; display: flex; flex-direction: column; }
.g-link { display: block; background: var(--bg-sunken); line-height: 0; overflow: hidden; }
.g-link img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .25s ease; }
.g-link:hover img { transform: scale(1.04); }
.g-item figcaption { padding: .65rem .9rem .8rem; display: flex; flex-direction: column; gap: .15rem; font-size: .92rem; line-height: 1.35; }
.g-item figcaption strong { font-weight: 650; }
.g-item figcaption span { color: var(--fg-muted); font-size: .84rem; }

.g-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

/* Vergrößerungsansicht */
html:has(.g-dialog[open]) { overflow: hidden; }
.g-dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--fg); padding: 0;
  width: min(96vw, 1400px); max-width: none; max-height: 96vh; overflow: hidden;
}
.g-dialog::backdrop { background: rgba(4, 9, 14, .88); }
.g-stage { display: flex; flex-direction: column; max-height: 96vh; }
.g-stage img { display: block; width: 100%; height: auto; max-height: calc(96vh - 7.5rem); object-fit: contain; background: var(--bg-sunken); }
.g-text { padding: .8rem 4.2rem .9rem 1.1rem; min-height: 3.2rem; display: flex; flex-direction: column; gap: .1rem; overflow-y: auto; max-height: 7.5rem; }
.g-text p { margin: .3rem 0 0; color: var(--fg-muted); font-size: .95rem; }
.g-text p:empty, .g-text span:empty, .g-text strong:empty { display: none; }
.g-btn {
  position: absolute; width: 2.8rem; height: 2.8rem; border-radius: 99px; border: 1px solid var(--line); cursor: pointer;
  background: rgba(13, 22, 32, .85); color: var(--fg); font: 400 1.9rem/1 var(--font); display: inline-flex; align-items: center; justify-content: center; padding: 0 0 .15em;
}
.g-btn:hover { background: var(--bg-raised); border-color: #35506b; }
.g-close { top: .6rem; right: .6rem; }
.g-prev, .g-next { top: calc(50% - 4rem); }
.g-prev { left: .6rem; }
.g-next { right: .6rem; }
@media (max-width: 560px) { .g-grid { grid-template-columns: 1fr 1fr; gap: .8rem; } .g-item figcaption { padding: .5rem .6rem .6rem; font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { .g-link img { transition: none; } .g-link:hover img { transform: none; } }
