/* File: public/assets/css/gallery.css */

#gallery.gal-wrap{
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 1.25rem 0;
}

#gallery .gal-top{
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
}

#gallery .gal-top h1{ margin: 0; }
#gallery .gal-back a{ text-decoration: none; }

#gallery .gal-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

#gallery .gal-thumb{
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
  aspect-ratio: 4/3;
  color: inherit;
  text-decoration: none;
}

#gallery .gal-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#gallery .gmodal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(0,0,0,.72);
  z-index: 9999;
}
#gallery .gmodal:target{ display: flex; }

#gallery .gmodal .gmodal__overlayClose{
  position: fixed;
  inset: 0;
  display: block;
  z-index: 0;
  text-decoration: none;
}

#gallery .gmodal__box{
  position: relative;
  z-index: 1;
  width: min(980px, 96vw);
  max-height: 92vh;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.25);
  display: flex;
  flex-direction: column;
}

#gallery .gmodal__nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

#gallery .gmodal__nav--top{
  border-top: 1px solid rgba(0,0,0,.08);
  border-bottom: none;
}

#gallery .gmodal__nav a{
  text-decoration: none;
  padding: .45rem .7rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.18);
  background: transparent;
  color: inherit;
  white-space: nowrap;
}

#gallery .gmodal__nav .gmodal__title{
  flex: 1;
  text-align: center;
  opacity: .75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#gallery .gmodal__imgwrap{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
  background: rgba(0,0,0,.03);
}

#gallery .gmodal__imgwrap img{
  max-width: 100%;
  height: auto;
  max-height: 66vh;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
}
/* ======================================================
   CATEGORY CARDS (gallery index page)
   ====================================================== */

#gallery .gcat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

#gallery .gcat-card{
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  text-decoration: none;
  color: inherit;
}

#gallery .gcat-cover{
  aspect-ratio: 4/3;
  background: rgba(0,0,0,.04);
  overflow: hidden;
}

#gallery .gcat-cover img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#gallery .gcat-meta{
  padding: .7rem .85rem;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
}

#gallery .gcat-name{
  font-weight: 700;
}

#gallery .gcat-count{
  opacity: .75;
  white-space: nowrap;
}