.lightbox-modal {
  z-index: 200;
  /* Remove the shared .modal wrapper padding so the panel can run edge
     to edge on every viewport. */
  padding: 0;
}

.lightbox-modal .modal-panel {
  /* Full-bleed: cancel the shared .modal-panel max-width + side
     padding so the image area spans the whole screen width, and
     stretch to the full viewport height so .lightbox-body (and the
     capture-lightbox image area inside it) can grow to fill the
     window. The shared overflow-y:auto stays so the info block can
     still scroll on the rare overflow. */
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.lightbox-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lightbox-modal .modal-close {
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 120ms;
}

.lightbox-modal .modal-close:hover,
.lightbox-modal .modal-close:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

.lightbox-modal .modal-close svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}

.vote-btn:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.06);
}

.vote-btn:focus-visible {
  outline: 2px solid var(--accent, #6ea8ff);
  outline-offset: 2px;
}

.vote-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.vote-btn.is-active.vote-up {
  background: rgba(64, 180, 110, 0.18);
  border-color: rgba(64, 180, 110, 0.6);
  color: #7fd39a;
}

.vote-btn.is-active.vote-down {
  background: rgba(220, 84, 84, 0.18);
  border-color: rgba(220, 84, 84, 0.6);
  color: #f29090;
}

.vote-btn .vote-icon {
  font-size: 16px;
  line-height: 1;
}

.vote-btn .vote-count {
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
  text-align: left;
}

.vote-hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

.capture-lightbox {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 0;
  min-height: 0;
}

/* Full-bleed image area: the panel runs edge to edge and the
   .lightbox-body fills the window, so the image area grows (flex:1)
   to take whatever vertical space is left after the info block, on
   both desktop and mobile. */
.capture-lightbox-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  flex: 1 1 0;
  min-height: 0;
}

.capture-lightbox-image img,
.capture-lightbox-image video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.capture-lightbox-info,
.capture-caption {
  padding-left: 20px;
  padding-right: 20px;
}

.capture-lightbox-info {
  padding-bottom: 20px;
}

.capture-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 120ms, opacity 120ms;
  z-index: 1;
}

.capture-nav svg {
  width: 22px;
  height: 22px;
  display: block;
}

.capture-nav:hover:not([disabled]) {
  background: rgba(0, 0, 0, 0.8);
}

.capture-nav:focus-visible {
  outline: 2px solid var(--accent, #6ea8ff);
  outline-offset: 2px;
}

.capture-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

.capture-nav-prev { left: 10px; }
.capture-nav-next { right: 10px; }

.capture-lightbox-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capture-lightbox-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.capture-lightbox-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.lightbox-vote-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.capture-lightbox-info .make {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.capture-lightbox-info h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.capture-lightbox-info .meta {
  color: var(--muted);
  font-size: 13px;
}

.capture-lightbox-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
  margin: 4px 0 0;
}

.capture-lightbox-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.capture-lightbox-meta dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.capture-lightbox-meta dd {
  margin: 0;
  font-size: 14px;
}

.capture-caption {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}

/* Phones: tighten the inner side padding on the info block, bump the
   close + nav buttons to a touch-friendly size, and pack the metadata
   grid tighter. The image area's height is driven by the flex layout
   above, so no min/max-height override is needed here. */
@media (max-width: 700px) {
  .capture-lightbox {
    gap: 10px;
  }

  .capture-lightbox-info,
  .capture-caption {
    padding-left: 12px;
    padding-right: 12px;
  }

  .capture-lightbox-info {
    padding-bottom: 14px;
  }

  .lightbox-modal .modal-close {
    width: 48px;
    height: 48px;
    top: 8px;
    right: 8px;
  }

  .capture-nav {
    width: 48px;
    height: 48px;
  }

  .capture-nav-prev { left: 6px; }
  .capture-nav-next { right: 6px; }

  .capture-lightbox-info h2 {
    font-size: 18px;
  }

  .capture-lightbox-meta {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px 12px;
  }
}
