/* Gallery page additions (keeps site galaxy background) */

/* This page should behave like a scrollable wall (not a centered "section") */
.section--gallery{
  min-height: auto;
  padding: 110px 0 90px;
  display: block;
}

.galleryHead{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin: 6px 0 14px;
}

.galleryKicker{
  font-size: 12px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}

.galleryGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.galleryItem{
  position:relative;
  border-radius: 18px;
  overflow:hidden;
  cursor:pointer;
  background: transparent; /* no dark card behind images */
  border: none;
  box-shadow: none;
  transform: translateZ(0);
  transition: transform .18s ease, outline-color .18s ease;
}

.galleryItem:hover{
  transform: translateY(-2px);
  outline: 1px solid rgba(77,225,255,.30);
}

.galleryItem img{
  width:100%;
  height:100%;
  display:block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Modal */
.gmodal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.gmodal.is-open{ display:flex; }

.gmodal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.72);
}

.gmodal__card{
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px); /* fit 100% viewport without zoom */
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: rgba(10,12,18,.72);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 110px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.gmodal__close{
  position:absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.9);
  font-size: 20px;
  line-height: 30px;
  cursor: pointer;
}

.gmodal__media{
  flex: 0 0 auto;
  border-radius: 16px;
  overflow:hidden;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.10);
}

.gmodal__media img{
  width: 100%;
  height: auto;
  max-height: 48vh; /* leave room for prompt on most screens */
  object-fit: contain;
  display:block;
}

.gmodal__prompt{
  flex: 1 1 auto;
  min-height: 0; /* allow inner scroll */
  border-radius: 16px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.10);
  padding: 12px;
  overflow: hidden;
}

.gmodal__label{
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,.74);
  margin-bottom: 8px;
}

#gmodalText{
  margin: 0;
  max-height: 26vh;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,.86);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 880px){
  .galleryGrid{ gap: 12px; }
  .gmodal{ padding: 14px; }
  .gmodal__media img{ max-height: 44vh; }
  #gmodalText{ max-height: 30vh; }
}

@media (max-width: 640px){
  .galleryGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gmodal{ padding: 12px; }
  .gmodal__card{ width: 100%; }
  .gmodal__media img{ max-height: 40vh; }
  #gmodalText{ max-height: 34vh; }
}

@media (max-width: 420px){
  .galleryGrid{ grid-template-columns: 1fr; }
}
