
/* ============================================================
   BE Chained List (front-end)
   ============================================================ */

.be-chained-list {
  --be-chain-color: #444444;
  display: block;
}

/* Desktop/tablet: 2-column grid with title on its own row in the right column */
.be-chain-item {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "media head"
    "media content";
  column-gap: 22px;
  row-gap: 8px;
  align-items: start;
  margin: 0 0 34px 0;
}

.be-chain-media { grid-area: media; position: relative; width: 220px; }
.be-chain-head { grid-area: head; }
.be-chain-content { grid-area: content; }

.be-chain-img,
.be-chain-img--placeholder {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  background: #f4f4f4;
}

.be-chain-img--placeholder {
  background: repeating-linear-gradient(
    45deg,
    #f2f2f2,
    #f2f2f2 10px,
    #fafafa 10px,
    #fafafa 20px
  );
}

.be-chain-title {
  margin: 0 0 6px 0;
  font-weight: 800;
  line-height: 1.15;
}

.be-chain-narrative p { margin: 0 0 10px 0; }
.be-chain-narrative p:empty { display: none; }

.be-chain-sources { margin-top: 10px; }

/* Dotted connector line (Desktop only) */
.be-chain-item:after {
  content: "";
  position: absolute;
  left: 100px;          /* center of 200px image */
  top: 200px;           /* bottom of image */
  bottom: -34px;        /* reach into the item spacing so it touches next image */
  border-left: 2px dotted var(--be-chain-color);
  opacity: 0.85;
  pointer-events: none;
}

.be-chain-item.is-last:after { display: none; }

.be-chained-list.be-chain-disabled .be-chain-item:after,
.be-chain-disabled .be-chain-item:after { display: none; }

/* ============================================================
   Mobile: NO chain lines + card box with hover "mini jerk"
   Layout: title first, then image left with wrapped text
   ============================================================ */
@media (max-width: 640px) {
  .be-chain-item {
    display: block;
    margin: 0 0 18px 0;
    padding: 14px 14px 12px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.10);
    box-shadow: 0 10px 22px rgba(0,0,0,0.07);
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
    overflow: hidden; /* clears float */
  }

  .be-chain-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.10);
  }

  .be-chain-head { margin-bottom: 10px; }

  .be-chain-media {
    float: left;
    width: auto;
    margin: 0 14px 10px 0;
  }

  .be-chain-img,
  .be-chain-img--placeholder {
    width: 120px;
    height: 120px;
    border-radius: 10px;
  }

  /* Always remove chain on mobile even if enabled */
  .be-chain-item:after {
    display: none !important;
  }
}
