/* SquareShift blog: article media sizing + lightbox.
   Works without JS (sizing only). JS adds the expand button and the overlay.
   Brand: sharp corners, no gradients, no red family, no Deep Green fills. */

/* ---------- 1. Article media sizing (no JS needed) ---------- */
/* Images and videos use the full article column at natural height.
   Very tall images (taller than 1.6x their width) are capped at 1.6x the column width;
   the lightbox is the way to read them in full. */
html .article-hero-media,
html .article-figure {
  container-type: inline-size;
}
html .article-hero-media img,
html .article-figure img,
html .article-figure video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 1500px;          /* fallback for browsers without container units */
  max-height: 160cqi;          /* 1.6 x column width */
  object-fit: contain;
  object-position: center top;
  margin: 0 auto;
  box-sizing: border-box;
}
html .article-figure video { background: #181818; }

/* ---------- 2. Expand affordance (added by JS) ---------- */
.sq-lb-wrap {
  position: relative;
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
.sq-lb-ready .sq-lb-wrap > img,
.sq-lb-ready .sq-lb-wrap > video { cursor: zoom-in; }
.sq-lb-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0;
  background: rgba(24, 24, 24, 0.82);
  color: #FFFFFF;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.sq-lb-wrap:hover .sq-lb-btn,
.sq-lb-btn:focus-visible { opacity: 1; }
.sq-lb-btn:hover { background: #181818; border-color: #D4AF37; }
.sq-lb-btn:focus-visible { outline: 2px solid #D4AF37; outline-offset: 2px; }
@media (hover: none) {
  .sq-lb-btn { opacity: 0.92; }
}

/* ---------- 3. Overlay ---------- */
html.sq-lb-open, html.sq-lb-open body { overflow: hidden !important; }
.sq-lb {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(10, 10, 10, 0.97);
  color: #FFFFFF;
  font-family: 'Roboto Condensed', Arial, sans-serif;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}
.sq-lb[hidden] { display: none; }
.sq-lb:focus { outline: none; }
.sq-lb__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: default;
}
.sq-lb__stage.is-zoomable { cursor: zoom-in; }
.sq-lb__stage.is-pannable { cursor: grab; }
.sq-lb__stage.is-dragging { cursor: grabbing; }
.sq-lb__img,
.sq-lb__video {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none !important;
  max-height: none !important;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  background: #FFFFFF;
}
.sq-lb__video { background: #000000; touch-action: auto; }
.sq-lb__stage.is-animating .sq-lb__img { transition: transform 0.18s ease; }

.sq-lb__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 16px;
  background: rgba(10, 10, 10, 0.72);
  z-index: 3;
}
.sq-lb__count { font-size: 14px; letter-spacing: 0.04em; color: #E6DFD4; }
.sq-lb__tools { display: flex; align-items: center; gap: 2px; }
.sq-lb__b {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #FFFFFF;
  font: 600 13px/1 'Roboto Condensed', Arial, sans-serif;
  cursor: pointer;
}
.sq-lb__b:hover { border-color: rgba(255, 255, 255, 0.45); }
.sq-lb__b:focus-visible { outline: 2px solid #D4AF37; outline-offset: -2px; }
.sq-lb__b[disabled] { opacity: 0.3; cursor: default; border-color: transparent; }
.sq-lb__b[hidden] { display: none; }
.sq-lb__b svg { display: block; }

.sq-lb__nav {
  position: absolute;
  top: 50%;
  margin-top: -24px;
  width: 48px;
  height: 48px;
  background: rgba(24, 24, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 3;
}
.sq-lb__nav--prev { left: 8px; }
.sq-lb__nav--next { right: 8px; }

.sq-lb__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 12px 64px;
  text-align: center;
  font-size: 15px;
  line-height: 1.35;
  color: #E6DFD4;
  background: rgba(10, 10, 10, 0.72);
  z-index: 3;
  pointer-events: none;
}
.sq-lb__cap.is-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sq-lb__hint {
  position: absolute;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  padding: 6px 10px;
  font-size: 13px;
  color: #E6DFD4;
  background: rgba(24, 24, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.4s ease;
}
.sq-lb__hint.is-gone { opacity: 0; }

@media (max-width: 600px) {
  .sq-lb__bar { height: 48px; padding-left: 12px; }
  .sq-lb__b { width: 42px; height: 42px; }
  .sq-lb__nav { top: auto; bottom: 8px; margin-top: 0; width: 44px; height: 44px; }
  .sq-lb__cap { padding: 10px 60px; font-size: 14px; }
  .sq-lb__hint { bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .sq-lb-btn, .sq-lb__hint { transition: none; }
  .sq-lb__stage.is-animating .sq-lb__img { transition: none; }
}
