/* ============================================================
   chart-lightbox.css — drop-in zoomable chart cards
   Author: SMU CGI tracker
   Usage: see chart-lightbox.js for opt-in markup.
   ============================================================ */

/* The host card (any element with [data-zoomable]) gets a hover affordance */
[data-zoomable] {
  position: relative;
  cursor: zoom-in;
  transition: box-shadow 180ms ease, transform 180ms ease;
}
[data-zoomable]:hover {
  box-shadow: 0 4px 18px rgba(10, 30, 58, 0.10);
}
[data-zoomable]:focus-visible {
  outline: 2px solid #16315a;
  outline-offset: 3px;
}

/* The expand affordance — pinned to the top-right of any zoomable card */
.cl-expand-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d8dde4;
  color: #16315a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 5px 9px 5px 7px;
  border-radius: 14px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 4;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.cl-expand-btn:hover {
  background: #16315a;
  color: #fff;
  border-color: #16315a;
}
.cl-expand-btn:focus-visible {
  outline: 2px solid #16315a;
  outline-offset: 2px;
}
.cl-expand-btn > svg,
button.cl-expand-btn svg {
  width: 11px !important;
  height: 11px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  max-width: 11px !important;
  max-height: 11px !important;
}

/* ============================================================
   Lightbox overlay
   ============================================================ */
.cl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 30, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.cl-overlay.cl-open {
  opacity: 1;
  pointer-events: auto;
}

/* Container that holds the cloned card */
.cl-stage {
  position: relative;
  width: 92vw;
  height: 92vh;
  max-width: 1600px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.97);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.cl-overlay.cl-open .cl-stage {
  transform: scale(1);
}

/* Top action bar inside the lightbox */
.cl-actions {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
.cl-action {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d8dde4;
  color: #16315a;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.cl-action:hover {
  background: #16315a;
  color: #fff;
  border-color: #16315a;
}
.cl-action:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.cl-action > svg,
button.cl-action svg {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  display: inline-block !important;
}
.cl-action.cl-close {
  width: 32px;
  padding: 0;
  justify-content: center;
}
.cl-action.cl-close > svg,
button.cl-action.cl-close svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

/* The scrollable body holding the cloned card */
.cl-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 28px 36px;
}

/* Scaling rules for the cloned content — let inline SVGs expand */
.cl-body > * {
  margin: 0 auto;
  max-width: 1320px;
  width: 100%;
}
.cl-body svg {
  width: 100%;
  height: auto;
}
.cl-body img {
  max-width: 100%;
  height: auto;
}

/* When the host card had a border-left accent strip, preserve it */
.cl-body .cl-clone {
  background: inherit;
}

/* True-fullscreen mode (Fullscreen API) */
.cl-overlay:fullscreen,
.cl-overlay:-webkit-full-screen {
  padding: 0;
  background: rgba(10, 18, 30, 0.95);
}
.cl-overlay:fullscreen .cl-stage,
.cl-overlay:-webkit-full-screen .cl-stage {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
}

/* Caption / hint at the bottom */
.cl-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-style: italic;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.cl-hint kbd {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-style: normal;
}

/* Suppress body scroll when lightbox is open */
body.cl-locked {
  overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cl-overlay,
  .cl-overlay .cl-stage {
    transition: none;
  }
}
