/* Galleria e ingrandimento con logo sovrapposto alle fotografie. */
.astro-gallery { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); grid-auto-rows: 145px; grid-auto-flow: row dense; gap: 8px; margin-top: 20px; }
.astro-item:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
.astro-item:nth-child(7n + 4) { grid-column: span 2; }
.astro-item { margin: 0; min-width: 0; position: relative; overflow: hidden; border-radius: 8px; }
.astro-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.astro-photo { display: block; position: relative; width: 100%; height: 100%; overflow: hidden; }
.astro-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.astro-photo .astro-logo, .astro-large .astro-logo { position: absolute; right: 8px; bottom: 8px; width: clamp(20px, 8%, 32px); height: auto; border-radius: 50%; pointer-events: none; }
.astro-item figcaption { position: absolute; left: 0; bottom: 0; right: 0; margin: 0; padding: 22px 46px 8px 9px; font-size: 12px; color: white; background: linear-gradient(transparent, rgba(0,0,0,.7)); pointer-events: none; }
.astro-photo .astro-logo { z-index: 1; }
.astro-open:focus-visible, .astro-gallery:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 4px; }
.astro-dialog { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 60px 64px; box-sizing: border-box; border: 0; background: transparent; color: white; }
.astro-dialog[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.astro-dialog::backdrop { background: rgba(0,0,0,.97); }
.astro-close, .astro-prev, .astro-next { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: white; cursor: pointer; font-size: 28px; text-shadow: 0 2px 6px #000; }
.astro-close { top: 12px; right: 16px; font-size: 36px; }
.astro-prev, .astro-next { top: 50%; transform: translateY(-50%); }
.astro-prev { left: 10px; }
.astro-next { right: 10px; }
.astro-dialog button:focus-visible { outline: 2px solid white; outline-offset: 2px; border-radius: 4px; }
.astro-large { position: relative; width: fit-content; max-width: 100%; margin: 0; }
.astro-large-image { display: block; max-width: 100%; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); width: auto; height: auto; object-fit: contain; }
.astro-caption { text-align: center; margin: 0; font-size: 16px; line-height: 1.4; text-shadow: 0 2px 6px #000; }
html.astro-viewing { overflow: hidden; }
@media (max-width: 700px) {
 .astro-dialog { padding: 60px 44px; }
 .astro-prev { left: 0; }
 .astro-next { right: 0; }
 .astro-caption { font-size: 14px; }
}
@media (min-width: 701px) and (max-width: 1000px) { .astro-gallery { grid-auto-rows: 115px; } }
@media (max-width: 700px) {
 .astro-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: 110px; gap: 6px; }
 .astro-item:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
 .astro-item:nth-child(7n + 4) { grid-column: span 2; }
 .astro-item figcaption { font-size: 11px; }
}
