/* ==========================================================================
   CTE Related (v1.5) — Archive-card look
   - Match cte-archives card rhythm (140x100 thumb, meta row, title, excerpt)
   - Kadence-proof (anchor is the layout container)
   - 1 column always (cleanest)
   ========================================================================== */

.cte-related{ margin-top:18px; }

.cte-related__title{
  margin:0 0 12px;
  font:900 18px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:rgba(0,0,0,.92);
}

/* Always one column */
.cte-related__grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

/* Card shell */
.cte-related__card{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  overflow:hidden;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.cte-related__card:hover{
  border-color:rgba(0,0,0,.16);
  box-shadow:0 10px 26px rgba(0,0,0,.08);
  transform:translateY(-1px);
}

/* Force anchor to behave like a layout container (Kadence-proof) */
.cte-related__link{
  display:grid !important;
  grid-template-columns: 140px 1fr;
  gap:14px !important;
  align-items:start !important;

  padding:14px !important;
  text-align:left !important;

  text-decoration:none !important;
  color:inherit !important;

  width:100%;
  box-sizing:border-box;
}

/* Thumb */
.cte-related__thumb{ display:block; }

.cte-related__thumbImg{
  width:140px;
  height:100px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  display:block;
}

/* Body stack */
.cte-related__body{
  min-width:0;
  display:block;
}
.cte-related__headline,
.cte-related__pills,
.cte-related__excerpt{ display:block; }

/* Meta row (like archive cards) */
.cte-related__pills{
  display:flex;
  width:100%;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:0 0 6px 0; /* meta above title */
  color: rgba(0,0,0,.60);
  font: 800 12px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* Turn the old "pill chips" into clean meta text with separators */
.cte-related__pill{
  display:inline-flex;
  align-items:center;
  padding:0;
  border:0;
  background:transparent;
  border-radius:0;
  font: inherit;
  color: inherit;
}
.cte-related__pill + .cte-related__pill::before{
  content:"•";
  margin:0 8px 0 0;
  color: rgba(0,0,0,.45);
}

/* Title */
.cte-related__headline{
  font:900 18px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:rgba(0,0,0,.92);
  margin:0;
}
.cte-related__card:hover .cte-related__headline{
  text-decoration: underline;
}

/* Excerpt */
.cte-related__excerpt{
  margin-top:8px;
  font:600 14px/1.55 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:rgba(0,0,0,.70);
  max-width:88ch;
}

/* No-image cards: collapse to one column */
.cte-related__card--noimg .cte-related__link{
  grid-template-columns: 1fr;
}

/* Mobile: stack + image full width */
@media (max-width: 820px){
  .cte-related__link{
    grid-template-columns: 1fr;
  }
  .cte-related__thumbImg{
    width: 100%;
    height: auto;
    max-width: 520px;
  }
}

/* Mobile tighten */
@media (max-width:520px){
  .cte-related__link{ padding:14px !important; gap:12px !important; }
  .cte-related__headline{ font-size:17px; }
}

/* ============================================================
   AUTOP-PROOFING (wpautop can inject p/br into anchors)
   ============================================================ */
.cte-related__link br{ display:none !important; }
.cte-related__link p{
  margin:0 !important;
  padding:0 !important;
  display: contents !important; /* prevents p from becoming a grid child */
}
