/* Fixed canvas layers — JS controls display */
#memorial-canvas,
#water-canvas {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
}

#memorial-canvas { z-index: 36; }
#water-canvas    { z-index: 37; }

/* ===========================================
   MEMORIAL SECTION
   =========================================== */

#memorial {
  position: relative;
  /* INT-7 — the memorial spacers sit over the fixed map in document flow;
     without this they swallow every mouse event and the death-dot hover
     tooltip can never fire. Only real content re-enables pointer events. */
  pointer-events: none;
}

/* Wave grid canvas (inserted by WaveGrid, normal document flow) */
#memorial-grid-canvas {
  display: block;
}

#memorial-grid-canvas:focus-visible {
  outline: none;
}

#memorial-grid-canvas.keyboard-active {
  box-shadow: inset 2px 0 rgba(192, 57, 43, 0.52);
}

/* Record wall header: a document band, not a floating panel. */
#memorial-record-header {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(360px, 1.25fr) minmax(390px, 1fr);
  align-items: end;
  gap: clamp(28px, 5vw, 80px);
  min-height: 250px;
  padding: 48px clamp(36px, 6vw, 88px);
  border-top: 1px solid rgba(192, 192, 192, 0.12);
  border-bottom: 1px solid rgba(192, 192, 192, 0.12);
  background: #000;
  pointer-events: none;
}

.memorial-record-kicker,
.memorial-legend-title {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.26em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--text-quiet);
}

.memorial-record-intro h2 {
  max-width: 15em;
  font-family: var(--font-record);
  font-size: clamp(30px, 3.2vw, 48px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.08;
  color: var(--accent);
}

.memorial-record-intro p {
  max-width: 52em;
  margin-top: 16px;
  font-family: var(--font-data);
  font-size: 11px;
  line-height: 1.75;
  color: rgba(192, 192, 192, 0.46);
}

.memorial-record-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.memorial-legend-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-data);
  font-size: 11px;
  line-height: 1.45;
  color: rgba(192, 192, 192, 0.58);
}

.memorial-legend-group > span:not(.memorial-legend-title) {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  gap: 8px;
}

.memorial-route-mark,
.memorial-cause-mark,
.memorial-size-key i {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(192, 57, 43, 0.8);
}

.memorial-route-mark.central { border-radius: 50%; background: rgba(139, 26, 26, 0.8); }
.memorial-route-mark.western { background: rgba(139, 26, 26, 0.8); }
.memorial-route-mark.eastern { background: rgba(139, 26, 26, 0.8); transform: rotate(45deg); }
.memorial-cause-mark.filled { border-radius: 50%; background: rgba(139, 26, 26, 0.9); }
.memorial-cause-mark.open { border-radius: 50%; background: transparent; }
.memorial-cause-mark.split {
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(139, 26, 26, 0.9) 50%, transparent 50%);
}

.memorial-size-key i {
  width: var(--size);
  height: var(--size);
  border: none;
  border-radius: 50%;
  background: rgba(139, 26, 26, 0.9);
}

.memorial-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#tooltip.memorial-tooltip {
  width: min(340px, calc(100vw - 44px));
  max-height: min(70vh, 430px);
  overflow: hidden;
}

#tooltip.memorial-tooltip.touch-mode {
  width: auto;
  max-height: 44vh;
  padding-right: 18px;
  background: rgba(8, 8, 8, 0.96);
}

/* ===========================================
   REGION 2: Text overlay
   =========================================== */

#memorial-text-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  gap: 16px;
}

.memorial-text-line {
  font-family: var(--font-record);
  font-weight: 400;
  font-size: 28px;
  opacity: 0;
  transition: opacity 1s ease;
}

.memorial-text-line.line1 { color: #e0e0e0; }
.memorial-text-line.line2 {
  color: #c0392b;
  font-family: var(--font-record);
}

/* ===========================================
   REGION 4: Moment text
   =========================================== */

#mem-r4 {
  position: relative;
}

.memorial-moment-text {
  text-align: center;
}

.memorial-moment-text span {
  display: block;
  font-family: var(--font-record);
  font-weight: 400;
  font-size: 28px;
  opacity: 0;
  transition: opacity 1s ease;
  line-height: 1.6;
}

.memorial-moment-text span:first-child { color: #e0e0e0; }
.memorial-moment-text span:last-child  { color: #c0392b; }

/* Tooltip base styles — see main.css #tooltip.
   WaveGrid generates tooltip content with inline styles,
   so no additional CSS classes needed here. */

/* ===========================================
   CUSTOM CURSOR (region 2)
   =========================================== */

body.memorial-active,
body.memorial-active * {
  cursor: none !important;
}

body.memorial-active {
  touch-action: none;
}

#memorial-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: left 0.12s ease, top 0.12s ease;
}

@media (hover: none), (pointer: coarse) {
  #memorial-cursor { display: none; }
}

@media (max-width: 760px) {
  #memorial-record-header {
    display: block;
    min-height: 0;
    padding: 42px 24px 48px;
  }

  .memorial-record-kicker {
    margin-bottom: 24px;
  }

  .memorial-record-intro h2 {
    font-size: 34px;
  }

  .memorial-record-intro p {
    font-size: 11px;
  }

  .memorial-record-legend {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(192, 192, 192, 0.12);
  }

  .memorial-legend-group {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 8px 10px;
  }

  .memorial-legend-group > span:not(.memorial-legend-title) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}
