/*
 * lightbox.css — pastel/rounded styling for the dependency-free lightbox (D-05, D-19).
 *
 * Phase-10 refresh: restyled in place to the soft pastel/rounded chrome (12–16px
 * radius, accent on controls via var(--accent)). Selectors are UNCHANGED — the
 * JS-bound state classes (.lb-open / .lb-locked / .lb-bound) keep their exact
 * names because lightbox.js depends on them (RESEARCH Pitfall 6). Behavior is
 * fully preserved: placeholder exclusion (by .lb-bound binding in JS), the mobile
 * @media block, and ≥44px tap targets on every control.
 *
 * Intentionally low-specificity (no !important, no deep selectors) so the rest of
 * the design refresh composes cleanly. No external font/icon deps; the nav/close
 * glyphs are unicode characters set in lightbox.js.
 *
 * --accent / --accent-tint are emitted per-domain by extend_head.html (10-03);
 * the overlay backdrop + image well stay neutral dark for photo contrast.
 */

/* Bound real photos get a subtle affordance that they are clickable.
 * (Placeholder images are never given .lb-bound by lightbox.js — exclusion preserved.) */
.post-content img.lb-bound,
article img.lb-bound {
  cursor: zoom-in;
}

/* Prevent the page from scrolling behind an open overlay. */
.lb-locked {
  overflow: hidden;
}

/* Full-viewport semi-opaque backdrop, hidden until opened. */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 16, 0.88);
  backdrop-filter: blur(2px);
  padding: 2rem;
  box-sizing: border-box;
}

.lb-overlay.lb-open {
  display: flex;
}

.lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Centered, fits the viewport; never upscaled beyond the image's natural size.
 * Rounded corners + soft elevation give the refreshed framed-photo look. */
.lb-image {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #14110f;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* Caption strip drawn from the image alt text. */
.lb-caption {
  color: #f4f1ee;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  max-width: 90vw;
  text-wrap: balance;
}

.lb-caption:empty {
  display: none;
}

/* Close + prev/next affordances — rounded pastel glyph buttons.
 * ≥44px tap targets; accent ring on focus/hover via var(--accent). */
.lb-close,
.lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  cursor: pointer;
  line-height: 1;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lb-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.75rem;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.lb-prev {
  left: 1rem;
}

.lb-next {
  right: 1rem;
}

.lb-close:hover,
.lb-nav:hover {
  background: var(--accent);
}

.lb-close:focus-visible,
.lb-nav:focus-visible {
  background: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .lb-overlay {
    padding: 0.5rem;
  }
  /* Keep ≥44px tap targets even on the smallest viewports. */
  .lb-nav {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}
