:root {
  --gap: 1rem;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial;
  background: #f6f6f6;
  color: #111;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-block: 1rem;
}

h1 {
  line-height: 1;
}

.controls select {
  padding: 6px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery {
  column-gap: var(--gap);
  column-fill: balance;
  /* column-width: 320px; */
  column-width: 320px;
}

.gallery-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--gap);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  cursor: zoom-in;
}

.gallery-item img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background: #ddd;
}

.gallery-item figcaption {
  font-size: 0.95rem;
  color: #111;
  text-align: center;
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 9999;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lb-content {
  max-width: 90vw;
  max-height: 80vh;
  text-align: center;
  color: #fff;
}

.lb-content img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  margin: 0 auto 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
}

.lb-close {
  top: 12px;
  right: 18px;
}

.lb-prev {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.info {
  -webkit-user-select: none;
  user-select: none;
  position: absolute;
  top: 15px;
  left: 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  padding-left: 5px;
  border-radius: 15px;
  z-index: 99;
  width: 20px;
}

.info:hover {
  background-color: #ccc;
  padding: 0 15px 0 5px;
  width: auto;
  text-align: left !important;
}

.icon-info-sign {
  font-family: Times New Roman, Times, serif;
  line-height: 2;
  font-size: 16px;
  padding: 3px 10px;
  margin-right: 6px;
  opacity: 1;
  background-color: #000000b3;
  border-radius: 18px;
  color: #fff;
}

.extra-info {
  font-size: 12px;
  line-height: 30px;
  position: relative;
  left: -300px;
  color: transparent;
}

.extra-info a {
  color: #000;
}

.info:hover .extra-info {
  display: inline-block;
  left: 0;
  color: #000;
}
