:is(.gi-case-gallery, .gi-cube-gallery, .gi-about-gallery) .gallery-icon a { position: relative; border-radius: 9px; }
:is(.gi-case-gallery, .gi-cube-gallery, .gi-about-gallery) [aria-haspopup="dialog"]::after {
  content: '+' / '';
  position: absolute;
  inset: auto 11px 11px auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #fff6;
  border-radius: 50%;
  background: #151210e8;
  color: #fff;
  font-size: 1.25rem;
}

.gi-project-viewer:not([open]) { display: none; }
.gi-project-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  inline-size: min(68rem, calc(100% - 28px));
  block-size: min(54rem, calc(100% - 28px));
  margin: auto;
  padding: clamp(12px, 2vw, 22px);
  overflow: hidden;
  border: 1px solid #6e594b;
  border-radius: 12px;
  background: #151210;
  color: #fff7ef;
}
.gi-project-viewer::backdrop { background: #120e0be8; }
html:has(.gi-project-viewer[open]) { overflow: hidden; }
.gi-project-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; }
.gi-project-viewer-bar h2 { margin: 0; color: inherit; font-size: 1.05rem; }
.gi-project-viewer-bar form { margin: 0; }
.gi-project-viewer-bar button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #8a6f5f;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 1.35rem;
  cursor: pointer;
}
.gi-project-viewer-bar button:hover { background: #4b3325; }
.gi-project-viewer-controls { justify-content: center; }
.gi-project-viewer-figure { min-height: 0; min-width: 0; margin: 0; }
.gi-project-viewer-figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gi-viewer-caption { margin: 0; color: #e9d9cb; text-align: center; font-size: .85rem; overflow-wrap: anywhere; }
.gi-viewer-caption span { display: block; }
.gi-viewer-position { font-variant-numeric: tabular-nums; color: #ffa16b; }

@media (max-width: 767px) {
  .gi-project-viewer[open] { inset: 0; max-block-size: none; height: calc(100% - 20px); }
}

@media (prefers-reduced-motion: no-preference) {
  .gi-project-viewer[open] { animation: gi-media-viewer-in .2s ease-out both; }
  @keyframes gi-media-viewer-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
