/* ============================================================================
   PLANE — styling for the zoomable evidence board (see src/plane.js).
   Shared by both design pilots; assumes the atelier custom properties.
   ========================================================================== */

.ccm-plane {
  position: absolute;
  /* Both stages have a caption/transport bar along the bottom; the board stops
     above it rather than sliding underneath. */
  inset: 0 0 var(--ccm-plane-bottom, 4.4rem);
  overflow: hidden;
  perspective: 1500px;
  perspective-origin: 50% 42%;
  cursor: grab;
  touch-action: none;
  outline: none;
}

.ccm-plane.is-grabbing { cursor: grabbing; }

.ccm-plane-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* The board itself: a loose grid of captures, sized by importance. The column
   count comes from the card count, so a two-capture board is not laid out on a
   four-column plane with two empty columns of dead space. */
.ccm-board {
  display: grid;
  grid-template-columns: repeat(var(--ccm-cols, 4), 300px);
  gap: 26px;
  padding: 26px;
  align-items: start;
}

.ccm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--atl-card, #fffdf9);
  border: 1px solid var(--atl-line, #e6dccc);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(29, 26, 22, .05), 0 22px 44px -26px rgba(29, 26, 22, .45);
  cursor: zoom-in;
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}

.ccm-card:hover {
  border-color: var(--atl-line-strong, #d8cab4);
  box-shadow: 0 3px 6px rgba(29, 26, 22, .07), 0 30px 60px -28px rgba(29, 26, 22, .5);
}

.ccm-card.is-focused {
  cursor: zoom-out;
  border-color: var(--atl-accent, #c25a32);
  box-shadow: 0 0 0 3px rgba(194, 90, 50, .18), 0 30px 60px -28px rgba(29, 26, 22, .5);
}

/* Spans give the board a designed rhythm instead of a spreadsheet. */
.ccm-card.span-2 { grid-column: span 2; }
.ccm-card.span-2r { grid-row: span 2; }

.ccm-card-kind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--atl-line, #e6dccc);
  background: var(--atl-paper, #f7f2ea);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--atl-ink-faint, #9a9083);
}

.ccm-card-kind b {
  font-weight: 700;
  color: var(--atl-accent, #c25a32);
}

.ccm-card-shot {
  display: block;
  width: 100%;
  height: auto;
  /* One very tall capture would otherwise set the height of the whole board.
     `contain` caps it without cropping — the full image is still there, and the
     source is high-resolution enough to read once you zoom in. */
  max-height: 260px;
  object-fit: contain;
  object-position: center top;
  background: var(--atl-paper-deep, #efe6d9);
}

.ccm-card-body {
  padding: .7rem .8rem .85rem;
}

.ccm-card-body h4 {
  margin: 0 0 .25rem;
  font-family: var(--atl-serif, Georgia, serif);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--atl-ink, #1d1a16);
}

.ccm-card-body p {
  margin: 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--atl-ink-soft, #6d655a);
}

.ccm-card-body a {
  color: var(--atl-accent-deep, #a4441f);
}

/* A pinboard tilt, removed as soon as a card is being read. */
.ccm-plane[data-zoom="out"] .ccm-card:nth-child(3n) { transform: rotate(-.5deg); }
.ccm-plane[data-zoom="out"] .ccm-card:nth-child(4n) { transform: rotate(.55deg); }

.ccm-plane[data-focused] .ccm-card:not(.is-focused) { opacity: .45; }

.ccm-card { transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease, opacity .25s ease; }

/* Empty board — said plainly, never faked. */
.ccm-board-empty {
  max-width: 30rem;
  padding: 2rem;
  text-align: center;
  font-family: var(--atl-serif, Georgia, serif);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--atl-ink-soft, #6d655a);
}

/* Hint, shown until the reader touches the board. */
.ccm-plane-hint {
  position: absolute;
  left: 50%;
  bottom: .9rem;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  background: rgba(255, 253, 249, .92);
  border: 1px solid var(--atl-line, #e6dccc);
  border-radius: 999px;
  font-size: .72rem;
  color: var(--atl-ink-soft, #6d655a);
  pointer-events: none;
  transition: opacity .3s ease;
}

.ccm-plane[data-zoom="in"] .ccm-plane-hint,
.ccm-plane[data-focused] .ccm-plane-hint { opacity: 0; }

/* On the board, the viewer's 3D controls have nothing to act on. */
[data-board="true"] .atl-tools button[data-tool="grid"],
[data-board="true"] .atl-tools button[data-tool="labels"],
[data-board="true"] .atl-tools button[data-tool="front"],
[data-board="true"] .atl-switch {
  display: none;
}

@media (max-width: 720px) {
  .ccm-board { grid-template-columns: repeat(min(var(--ccm-cols, 2), 2), 280px); }
}

@media (prefers-reduced-motion: reduce) {
  .ccm-plane-layer { transition: none !important; }
  .ccm-card { transition: none; }
  .ccm-plane[data-zoom="out"] .ccm-card { transform: none; }
}
