:root {
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-brd: rgba(255, 255, 255, 0.10);
  --ink-dim: rgba(255, 255, 255, 0.8);
  --accent: #3fa06a;
}

/* Container */
.galeria-publica {
  padding: 24px
}

.galeria-publica h2 {
  margin: 0 0 6px
}

.galeria-publica p {
  margin: 0 0 18px;
  color: var(--ink-dim)
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Card */
.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-brd);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(63, 160, 106, 0.6);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25)
}

/* Thumb */
.thumb {
  height: 180px;
  background: #000;
  display: grid;
  place-items: center;
}

.thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Info */
.info {
  padding: 10px 12px
}

.info h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.info p {
  margin: 0;
  color: var(--ink-dim);
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

/* Paginação */
.paginacao {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap
}

.page-link {
  padding: 6px 10px;
  border: 1px solid var(--card-brd);
  border-radius: 8px;
  text-decoration: none;
  color: inherit
}

.page-link:hover {
  border-color: var(--accent)
}

.page-link.disabled {
  opacity: .5;
  pointer-events: none
}

.page-status {
  opacity: .85
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000
}

.modal[aria-hidden="false"] {
  display: block
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7)
}

.modal-window {
  position: relative;
  margin: 4vh auto;
  width: min(1000px, 94vw);
  background: rgba(20, 20, 20, .98);
  border: 1px solid var(--card-brd);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
  overflow: hidden
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: #222;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer
}

.modal-close:hover {
  background: #333
}

.modal-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  min-height: 60vh
}

@media (max-width:820px) {
  .modal-body {
    grid-template-columns: 1fr;
    min-height: auto
  }
}

.modal-media {
  background: #000;
  display: grid;
  place-items: center;
  padding: 10px
}

.modal-media img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain
}

.modal-details {
  padding: 18px;
  border-left: 1px solid var(--card-brd)
}

@media (max-width:820px) {
  .modal-details {
    border-left: 0;
    border-top: 1px solid var(--card-brd)
  }
}

.modal-details h3 {
  margin: 0 0 10px
}

.scroll-box {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px
}

.scroll-box::-webkit-scrollbar {
  width: 6px
}

.scroll-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .2);
  border-radius: 4px
}

.scroll-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .4)
}

.modal-details dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  row-gap: 6px;
  column-gap: 10px;
  font-size: .95rem
}

.modal-details dt {
  opacity: .7
}

.modal-details dd {
  margin: 0;
  word-break: break-word;
  white-space: pre-wrap
}