/* ===== FORENSICS PAGE - Evidence Board Theme ===== */

.ev-board-section {
  padding: 2rem 0 6rem;
  background: var(--color-bg);
}

/* Evidence board container */
.ev-board {
  background: #f5f0e8;
  padding: 2.5rem 2rem 2rem;
  position: relative;
}
.ev-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 39px,
    rgba(0, 0, 0, 0.03) 39px,
    rgba(0, 0, 0, 0.03) 40px
  );
  pointer-events: none;
}

/* Card grid */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  position: relative;
  z-index: 2;
}

/* Cards */
.ev-card {
  background: #ffffff;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 1.75rem 1rem 1.25rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.35s var(--ease-out);
}

/* Top pin */
.ev-pin-top {
  display: block;
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c62828;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

/* Card rotation */
.ev-card:nth-child(2) {
  transform: rotate(0.8deg);
}
.ev-card:nth-child(4) {
  transform: rotate(-0.6deg);
}
.ev-card:nth-child(2):hover,
.ev-card:nth-child(2).is-active {
  transform: rotate(0.8deg) translateY(-3px);
}
.ev-card:nth-child(4):hover,
.ev-card:nth-child(4).is-active {
  transform: rotate(-0.6deg) translateY(-3px);
}
.ev-card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.08);
}
.ev-card.is-active {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(198, 40, 40, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.08);
  border-left: 3px solid #c62828;
}

/* Card content */
.ev-card-icon {
  color: #c62828;
  opacity: 0.4;
  margin-bottom: 0.75rem;
  transition: opacity 0.3s ease;
}
.ev-card:hover .ev-card-icon,
.ev-card.is-active .ev-card-icon {
  opacity: 0.85;
}

.ev-card-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #1a1a1a;
  margin-bottom: 0.35rem;
}
.ev-card-ref {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}

/* ===== THREAD GAP ===== */
/* This is the space between cards and detail panel.        */
/* JS places: top pin, vertical red line, bottom pin inside */
.ev-thread-gap {
    position: relative;
    height: 0;
    z-index: 2;
    transition: height 0.4s var(--ease-smooth);
  }
  .ev-thread-gap.is-active {
    height: 50px;
  }
}

/* Pin dots inside the gap (created by JS) */
.ev-thread-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c62828;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  transition: left 0.35s var(--ease-smooth);
}
.ev-thread-pin-top {
  top: 0;
}
.ev-thread-pin-bottom {
  bottom: 0;
}

/* The red line between them (created by JS) */
.ev-thread-line {
  position: absolute;
  width: 2px;
  background: #c62828;
  opacity: 0.6;
  top: 12px;
  bottom: 12px;
  transform: translateX(-50%);
  transition: left 0.35s var(--ease-smooth);
}

/* Hidden when no card active */
.ev-thread-pin,
.ev-thread-line {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ev-thread-gap.is-active .ev-thread-pin,
.ev-thread-gap.is-active .ev-thread-line {
  opacity: 1;
}

/* ===== DETAIL PANEL ===== */
.ev-detail {
  position: relative;
  z-index: 2;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-smooth);
}
.ev-detail.is-open {
  max-height: 300px;
}
.ev-detail-inner {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.75rem 2rem;
}
.ev-detail-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-heading);
  margin-bottom: 0.75rem;
}
.ev-detail-text {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text);
}

/* ===== ADDITIONAL SERVICES ===== */
.ev-additional {
  border-top: 1px solid var(--color-border);
  padding-top: 3rem;
  margin-top: 4rem;
}
.ev-additional-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-heading);
  margin-bottom: 2rem;
  text-align: center;
}
.ev-additional-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.ev-additional-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  transition: background 0.3s ease;
}
.ev-additional-item:nth-child(2n) {
  border-right: none;
}
.ev-additional-item:nth-last-child(-n + 2) {
  border-bottom: none;
}
.ev-additional-item:hover {
  background: var(--color-bg-alt);
}
.ev-additional-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  opacity: 0.5;
  margin-top: 0.15rem;
}
.ev-additional-item:hover .ev-additional-icon {
  opacity: 1;
}
.ev-additional-name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-heading);
  margin-bottom: 0.25rem;
}
.ev-additional-desc {
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  .ev-board {
    padding: 2rem 1rem;
  }
  .ev-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .ev-card:nth-child(2),
  .ev-card:nth-child(4) {
    transform: none;
  }
  .ev-card:nth-child(2):hover,
  .ev-card:nth-child(4):hover,
  .ev-card:nth-child(2).is-active,
  .ev-card:nth-child(4).is-active {
    transform: translateY(-2px);
  }
  .ev-detail-inner {
    padding: 1.25rem 1.5rem;
  }
  .ev-additional-grid {
    grid-template-columns: 1fr;
  }
  .ev-additional-item {
    border-right: none;
  }
  .ev-additional-item:last-child {
    border-bottom: none;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .ev-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .ev-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }
  .ev-pin-panel {
    display: none;
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #c62828;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 5;
    transition: left 0.4s var(--ease-smooth);
  }
  .ev-detail.is-open .ev-pin-panel {
    display: block;
  }

  .ev-connector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
  }
  .ev-connector line {
    stroke: #c62828;
    stroke-width: 1.5;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .ev-connector.is-visible line {
    opacity: 0.6;
  }
}
