/* ==========================================================================
   Gallery grid – Win98 retro theme
   ========================================================================== */

.gallery-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 960px;
  justify-items: center;
  padding: 8px;
}

/* Each thumbnail styled like a desktop icon / mini Win98 frame */
.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 170px;
  padding: 6px;
  background-color: #d4d0c8;
  border: 2px outset #fff;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s;
}

.gallery-item:hover {
  background-color: #b0b0b0;
}

.gallery-item:active {
  border: 2px inset #808080;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px inset #808080;
  display: block;
  background-color: #fff;
  image-rendering: auto;
}

/* Filename label under each thumbnail */
.gallery-item .gallery-label {
  margin-top: 4px;
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 11px;
  color: #000;
  text-align: center;
  word-break: break-all;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   lightGallery overrides – Windows 95 style lightbox
   ========================================================================== */

/* Backdrop – dark, no colored fade */
.lg-backdrop {
  background-color: #000 !important;
  opacity: 0.92 !important;
  transition: none !important;
}

/* Kill open/close transition so there's no teal flash */
.lg-css3 .lg-item.lg-current {
  transition: none !important;
}

.lg-css3.lg-fade .lg-item {
  transition: none !important;
}

.lg-outer.lg-visible {
  transition: none !important;
}

.lg-outer {
  transition: none !important;
}

/* Outer container – wrap the whole lightbox in a Win95 window frame */
.lg-outer {
  font-family: "MS Sans Serif", Tahoma, Verdana, sans-serif !important;
}

.lg-outer .lg-inner {
  background-color: #c0c0c0 !important;
  border: 2px solid #000;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #808080 !important;
}

/* Toolbar – classic Win95 blue title bar */
.lg-toolbar {
  background: #000080 !important;
  border-bottom: none !important;
  height: 48px !important;
  padding: 0 6px !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
}

/* Title bar buttons – classic gray beveled squares */
.lg-toolbar .lg-icon {
  color: #000 !important;
  background-color: #c0c0c0 !important;
  border-top: 2px solid #fff !important;
  border-left: 2px solid #fff !important;
  border-right: 2px solid #404040 !important;
  border-bottom: 2px solid #404040 !important;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf !important;
  width: 36px !important;
  height: 36px !important;
  font-size: 24px !important;
  margin: 0 3px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  opacity: 1;
  transition: none;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* Close button – keep in top right */
.lg-toolbar .lg-close {
  position: absolute !important;
  right: 6px !important;
  top: 6px !important;
}

.lg-toolbar .lg-icon:hover {
  background-color: #d4d0c8 !important;
}

.lg-toolbar .lg-icon:active {
  border-top: 2px solid #404040 !important;
  border-left: 2px solid #404040 !important;
  border-right: 2px solid #fff !important;
  border-bottom: 2px solid #fff !important;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf !important;
}

/* Navigation arrows – large beveled Win95 buttons */
.lg-prev,
.lg-next {
  background-color: #c0c0c0 !important;
  border-top: 2px solid #fff !important;
  border-left: 2px solid #fff !important;
  border-right: 2px solid #404040 !important;
  border-bottom: 2px solid #404040 !important;
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf !important;
  color: #000 !important;
  width: 60px !important;
  height: 60px !important;
  top: 50% !important;
  margin-top: -30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0 !important;
  transition: none;
  font-size: 0 !important; /* hide default icon font */
}

/* Replace icon font with < > text */
.lg-prev::after,
.lg-next::after {
  font-family: "MS Sans Serif", Tahoma, Verdana, sans-serif !important;
  font-size: 32px !important;
  font-weight: bold;
  color: #000 !important;
  line-height: 1;
}

.lg-prev::after {
  content: "<" !important;
}

.lg-next::after {
  content: ">" !important;
}

.lg-prev:hover,
.lg-next:hover {
  background-color: #d4d0c8 !important;
}

.lg-prev:active,
.lg-next:active {
  border-top: 2px solid #404040 !important;
  border-left: 2px solid #404040 !important;
  border-right: 2px solid #fff !important;
  border-bottom: 2px solid #fff !important;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf !important;
}

/* Image counter – sunken status-bar style field */
.lg-counter {
  font-family: "MS Sans Serif", Tahoma, Verdana, sans-serif !important;
  font-size: 14px !important;
  color: #fff !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 10px !important;
  margin: 0 4px !important;
  line-height: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
}

/* Sub-html caption – Win95 status bar at the bottom */
.lg-sub-html {
  background-color: #c0c0c0 !important;
  border-top: 2px solid #fff !important;
  font-family: "MS Sans Serif", Tahoma, Verdana, sans-serif !important;
  font-size: 16px !important;
  color: #000 !important;
  padding: 8px 12px !important;
  text-shadow: none;
  text-align: center !important;
  box-shadow: inset 0 1px 0 #dfdfdf !important;
}

.lg-sub-html p {
  /* Sunken text field inside the status bar */
  background-color: #c0c0c0 !important;
  border-top: 2px solid #808080 !important;
  border-left: 2px solid #808080 !important;
  border-right: 2px solid #fff !important;
  border-bottom: 2px solid #fff !important;
  padding: 6px 16px !important;
  margin: 0 auto !important;
  display: inline-block;
  color: #000 !important;
  font-size: 18px !important;
  font-weight: bold !important;
  letter-spacing: 0.5px !important;
}

/* Thumbnail strip – gray menu bar style */
.lg-thumb-outer {
  background-color: #c0c0c0 !important;
  border-top: 2px solid #fff !important;
  box-shadow: inset 0 -1px 0 #808080 !important;
}

.lg-thumb-item {
  border-top: 1px solid #808080 !important;
  border-left: 1px solid #808080 !important;
  border-right: 1px solid #fff !important;
  border-bottom: 1px solid #fff !important;
  border-radius: 0 !important;
  opacity: 0.65;
  transition: opacity 0.15s;
  background-color: #c0c0c0 !important;
  padding: 1px !important;
}

.lg-thumb-item.active {
  border-top: 2px solid #000080 !important;
  border-left: 2px solid #000080 !important;
  border-right: 2px solid #000080 !important;
  border-bottom: 2px solid #000080 !important;
  opacity: 1;
}

.lg-thumb-item:hover {
  opacity: 1;
}

/* Loading spinner area */
.lg-loading::after {
  border-color: #c0c0c0 #c0c0c0 #000080 #000080 !important;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .gallery-item {
    max-width: 140px;
    padding: 4px;
  }

  .gallery-item .gallery-label {
    font-size: 10px;
  }
}
