:root {
  --font-display: 'Great Vibes', cursive;
  --font-primary: 'Quicksand', Arial, sans-serif;
  --c-accent-primary: #c52e41;
  --c-ink-muted: #9DA8B7;
  --c-bg: #0A0D18;
  --c-stroke: #9DA8B7;
  --radius: 12px;
}

.section-title {
  font-family: var(--font-display, serif);
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin: 42px 0 16px 0;
  color: var(--c-accent-primary, #c52e41);
  text-align: center;
}

.grid-desc {
  text-align: center;
  color: var(--c-ink-muted, #9DA8B7);
  margin-bottom: 18px;
  font-size: 1.13em;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto 24px auto;
  padding: 10px 2vw 0 2vw;
}

.gallery__grid a {
  display: block;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  background: var(--c-bg, #0A0D18);
  border: 1.2px solid var(--c-stroke, #9DA8B7);
  box-shadow: 0 4px 30px #0001;
  transition: box-shadow .19s, transform .19s;
}

.gallery__grid a:hover {
  box-shadow: 0 14px 26px #0003;
  transform: translateY(-4px) scale(1.02);
}

.gallery__grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius, 12px) var(--radius, 12px) 0 0;
  background: #191a21;
  display: block;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 44px;
}

.btn-page,
.btn--primary {
  background: var(--c-accent-primary, #c52e41);
  color: #fff;
  padding: 14px 30px;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  font-family: var(--font-primary, sans-serif);
  box-shadow: 0 1px 7px #0002;
  cursor: pointer;
  font-size: 1em;
  transition: background .16s;
  min-width: 110px;
}

.btn-page[disabled] {
  background: #555;
  opacity: .45;
  cursor: not-allowed;
}

.lightbox {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(10,13,24,0.95);
  backdrop-filter: blur(4px);
  z-index: 1111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.27s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox__image {
  max-width: 92vw;
  max-height: 64vh;
  border-radius: var(--radius, 12px);
  box-shadow: 0 4px 32px #000a;
  background: var(--c-bg, #0A0D18);
  display: block;
  margin: 0 auto;
}

.lightbox__close {
  position: absolute;
  top: 22px; right: 30px;
  background: none;
  border: none;
  font-size: 2.6em;
  color: var(--c-ink-muted, #9DA8B7);
  cursor: pointer;
}

.lightbox-nav-btn {
  font-size: 2.2em;
  background: none;
  border: none;
  color: var(--c-ink-muted, #9DA8B7);
  cursor: pointer;
}

.btn--primary.download-btn {
  margin: 22px auto 0 auto;
}

.lightbox-loader {
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
}

body, html {
  overflow-x: hidden;
}

/* Responsive per tablet/mobile */
@media (max-width: 900px) {
  .gallery__grid {
    gap: 14px;
  }
  .gallery__grid img {
    aspect-ratio: 16/11; /* Un po' più quadrato su tablet */
  }
}

/* Responsive per smartphone */
@media (max-width: 600px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 6px 1vw 0 1vw;
  }
  .gallery__grid img {
    aspect-ratio: 1/1;
  }
  .pagination-wrap {
    gap: 8px;
  }
  .btn-page, .btn--primary {
    font-size: 1em;
    padding: 11px 16px;
    min-width: 80px;
  }
  .lightbox__image {
    max-width: 98vw;
    max-height: 44vh;
  }
}
