.portfolio-section .gallery-item::after,
.signed-photo::after {
  content: "SB";
  content: "SB" / "";
  position: absolute;
  right: 2.5%;
  bottom: 3%;
  border-left: .21em solid var(--accent);
  padding-left: .16em;
  color: #fff;
  font: 700 clamp(14px, 1.8vw, 22px)/1 "Portfolio Display", sans-serif;
  letter-spacing: -.025em;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 60%));
  opacity: .76;
  pointer-events: none;
}

.lightbox-main {
  touch-action: pan-y pinch-zoom;
  container-type: size;
  width: calc(100% - 172px);
}

@media (max-width: 700px) {
  .lightbox-main {
    width: calc(100% - 64px);
  }
}

.photo-mat {
  --edge: 3.5vmin;
  --foot: calc(2.4 * var(--edge));
  flex: none;
  display: flex;
  padding: var(--edge) var(--edge) var(--foot);
  background: var(--mat-color);
}

.lightbox[data-format="paysage"] .photo-mat {
  --foot: calc(3.3 * var(--edge));
}

.signed-photo {
  position: relative;
  display: inline-flex;
  flex: none;
}

.lightbox:not([data-fond="sombre"]) .signed-photo {
  outline: 1px solid #787878;
}

.lightbox-main .signed-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100cqw - 2 * var(--edge));
  max-height: calc(100cqh - var(--edge) - var(--foot));
}

.lightbox {
  --viewer-bg: #fff;
  --viewer-charcoal: #2e2e2e;
  --mat-color: var(--viewer-charcoal);
  --viewer-ink: #444;
  --switch-border: #d1d1d1;
  --switch-selected: #ededed;
  background: var(--viewer-bg);
  color: var(--viewer-ink);
}

.lightbox[data-fond="sombre"] {
  --viewer-bg: var(--viewer-charcoal);
  --mat-color: #fff;
  --viewer-ink: #d5d5d5;
  --switch-border: #626262;
  --switch-selected: #505050;
}

.viewer-actions {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 14px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.viewer-actions .lightbox-close {
  position: static;
  width: 34px;
  height: 38px;
  padding: 0;
  color: inherit;
  font: 27px/1 Arial, sans-serif;
}

.viewer-background {
  display: flex;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--switch-border);
  border-radius: 30px;
  background: var(--viewer-bg);
  font: 12px/20px system-ui, sans-serif;
}

.viewer-background label {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 45px;
  min-height: 26px;
  cursor: pointer;
}

.viewer-background input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.viewer-background span {
  padding: 2px 9px;
  border-radius: 24px;
}

.viewer-background input:checked + span {
  background: var(--switch-selected);
  font-weight: 600;
}

.viewer-background input:focus-visible + span {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.viewer-gesture {
  position: absolute;
  bottom: max(8px, env(safe-area-inset-bottom));
  margin: 0;
  color: var(--viewer-ink);
}

.viewer-gesture svg {
  display: block;
  width: 60px;
  height: 34px;
}

.viewer-gesture-touch { display: none; }

@media (pointer: coarse) {
  .viewer-gesture-desktop { display: none; }
  .viewer-gesture-touch { display: inline; }
}

@media (prefers-reduced-motion: no-preference) {
  .viewer-gesture .viewer-gesture-hand,
  .series-gesture.gesture-visible .viewer-gesture-hand {
    animation: gesture-swipe 10s ease-in-out infinite;
  }
}

/* Two swipes in four seconds, then six seconds at rest. */
@keyframes gesture-swipe {
  0%, 20%, 40%, 100% { transform: translateX(0); }
  5%, 25% { transform: translateX(-5px); }
  15%, 35% { transform: translateX(5px); }
}

.portfolio-section .section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.series-gesture {
  flex: none;
  width: 40px;
  height: 24px;
}
