/**
 * @file        sg-lens.css
 * @description SynthGlobe lens module styles: photo check and compare in the holding area, highlights, recap, 360-degree viewer, audio clips, blur proposals, fog of war and heatmap (mobile first, light and dark through sg.css variables)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         17c4e9bb-4a07-4cfa-b31f-816c3d5a77aa
 * @version     0.1.0.1
 * @created     2026-12-01
 * @updated     2026-12-01
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* Marks: small chips, never orange (the orange focal point stays on the primary action). */
.sg-lens-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.sg-lens-mark {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.4;
}
.sg-lens-mark--best {
  border-color: var(--accent);
  color: var(--accent);
}

/* Near-identical groups as stacks: two columns at 360 px, more on wider screens. */
.sg-lens-stacks,
.sg-lens-compare,
.sg-lens-hl,
.sg-lens-clips,
.sg-lens-clip-rows,
.sg-lens-pano-links,
.sg-lens-faces__list,
.sg-lens-recap__stills {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}
.sg-lens-stacks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.sg-lens-stack {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--border-strong), 8px 8px 0 var(--border);
  color: var(--ink);
  text-decoration: none;
}
.sg-lens-stack img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.sg-lens-stack__count,
.sg-lens-stack__best {
  position: absolute;
  top: 0.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #F2F4F6;
  font-size: 0.75rem;
}
.sg-lens-stack__count { left: 0.4rem; }
.sg-lens-stack__best { right: 0.4rem; }
.sg-lens-stack__label {
  display: block;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  font-size: 0.875rem;
}

/* Compare: 2 side by side on phones, up to 4 on desktop. */
.sg-lens-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.sg-lens-compare__item img,
.sg-lens-hl__item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.sg-lens-compare__item--best img {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sg-lens-grid img {
  max-width: 100%;
}

/* Highlights grid with its tools below each photo. */
.sg-lens-hl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.sg-lens-hl__item--replacing img {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}
.sg-lens-hl__step {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}
.sg-lens-hl__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.sg-lens-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  max-width: 100%;
}

/* Recap: the canvas scales to the column, the stills replace it with reduced motion. */
.sg-lens-recap__stage canvas {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  background: var(--navy);
}
.sg-lens-recap__stills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.sg-lens-recap__stills img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.sg-lens-recap progress {
  width: 100%;
}

/* 360-degree viewer: the flat image first, the turning view after the script took over. */
.sg-lens-pano {
  position: relative;
  margin: 0;
}
.sg-lens-pano__flat {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.sg-lens-pano__view {
  width: 100%;
  height: min(60vh, 28rem);
  border-radius: var(--radius);
  background-color: var(--navy);
  cursor: grab;
  touch-action: pan-y;
}
.sg-lens-pano__view:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sg-lens-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #F2F4F6;
  font-size: 0.75rem;
}
.sg-lens-pano-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sg-lens-pano-link {
  position: relative;
  display: block;
  width: 6rem;
}
.sg-lens-pano-link img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Audio clips: one per row, the player takes the full width on phones. */
.sg-lens-clip,
.sg-lens-clip-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.sg-lens-clip audio,
.sg-lens-clip-row audio {
  display: block;
  width: 100%;
  max-width: 28rem;
  margin: 0.35rem 0;
}
.sg-lens-clip-row input[type="text"] {
  min-width: 0;
  max-width: 14rem;
}

/* Blur proposals: outlines over the brush stage. */
.sg-lens-faces__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sg-lens-faces__box {
  position: absolute;
  border: 2px dashed #F2F4F6;
  box-shadow: 0 0 0 1px var(--navy);
  border-radius: var(--radius-sm);
}
.sg-lens-faces__box.is-accepted {
  border-style: solid;
  border-color: var(--accent);
}
.sg-lens-faces__box.is-left {
  opacity: 0.4;
}
.sg-lens-faces__list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

/* Fog of war: dark everywhere but the revealed spots. */
.sg-lens-fog__dark {
  fill: #0E161C;
  fill-opacity: 0.92;
}
.sg-lens-fog__spot {
  fill: #EADDD3;
  fill-opacity: 0.35;
  animation: sg-lens-reveal 0.8s ease-out both;
}
@keyframes sg-lens-reveal {
  from { fill-opacity: 0; }
  to { fill-opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-lens-fog__spot { animation: none; }
}
:root[data-reduce-motion="1"] .sg-lens-fog__spot {
  animation: none;
}

/* Heatmap: mahogany to orange spots and a legend ramp. */
.sg-lens-heat circle {
  fill: var(--mahogany);
}
.sg-lens-heat-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sg-lens-heat-legend__ramp {
  display: inline-block;
  width: 6rem;
  height: 0.5rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(107, 45, 25, 0.25), var(--mahogany));
}
.sg-lens-heat-map {
  height: min(60vh, 28rem);
  margin-top: 1rem;
  border-radius: var(--radius);
}
.sg-lens-map-links {
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .sg-lens-stacks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sg-lens-compare { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sg-lens-hl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sg-lens-recap__stills { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
