/* ══════════════════════════════════════════════════════════════
   BCU Pro — Similar Posts Block
   Inspired by The Verge / Wired / TechCrunch card layouts
   ══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ────────────────────────────────────────── */
.bcu-sp-section {
  margin: 56px 0 24px;
  padding: 0;
  font-family: var(--bcu-font, 'Inter', sans-serif);
  color: var(--bcu-text, #1a1a2e);
  clear: both;
}

/* ── Section heading ────────────────────────────────────────── */
.bcu-sp-heading {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #111;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid #e84424;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bcu-sp-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: #e84424;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Grid ───────────────────────────────────────────────────── */
.bcu-sp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ══ STYLE: cards (default — Verge/Wired-style rich cards) ══ */
.bcu-sp-style-cards .bcu-sp-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.bcu-sp-style-cards .bcu-sp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
}

/* Thumbnail — top position (default) */
.bcu-sp-thumb-top .bcu-sp-card {
  flex-direction: column;
}
.bcu-sp-thumb-top .bcu-sp-thumb {
  width: 100%;
  position: relative;          /* needed for absolute child */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.bcu-sp-thumb-top .bcu-sp-thumb img {
  position: absolute;          /* fills aspect-ratio box fully */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}
.bcu-sp-style-cards .bcu-sp-card:hover .bcu-sp-thumb img {
  transform: scale(1.05);
}

/* Thumbnail — left position */
.bcu-sp-thumb-left .bcu-sp-card {
  flex-direction: row;
  align-items: stretch;
  min-height: 160px;
}
.bcu-sp-thumb-left .bcu-sp-thumb {
  width: 180px;
  min-width: 180px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px 0 0 12px;
  position: relative;          /* needed for absolute img */
  align-self: stretch;
}
.bcu-sp-thumb-left .bcu-sp-thumb img {
  position: absolute;          /* fills full height of card */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}

/* Thumbnail — right position */
.bcu-sp-thumb-right .bcu-sp-card {
  flex-direction: row-reverse;
  align-items: stretch;
  min-height: 160px;
}
.bcu-sp-thumb-right .bcu-sp-thumb {
  width: 180px;
  min-width: 180px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0 12px 12px 0;
  position: relative;          /* needed for absolute img */
  align-self: stretch;
}
.bcu-sp-thumb-right .bcu-sp-thumb img {
  position: absolute;          /* fills full height of card */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}

/* ── Card body ──────────────────────────────────────────────── */
.bcu-sp-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Category badge */
.bcu-sp-cat {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #e84424;
  margin-bottom: 8px;
  line-height: 1;
}

/* Title */
.bcu-sp-title {
  font-size: .97rem;
  font-weight: 700;
  line-height: 1.38;
  margin: 0 0 8px;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bcu-sp-style-cards .bcu-sp-card:hover .bcu-sp-title {
  color: #e84424;
}

/* Excerpt */
.bcu-sp-excerpt {
  font-size: .84rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bcu-sp-thumb-left .bcu-sp-excerpt,
.bcu-sp-thumb-right .bcu-sp-excerpt {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* Meta row */
.bcu-sp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .75rem;
  color: #999;
  margin-top: auto;
  flex-wrap: wrap;
}
.bcu-sp-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bcu-sp-meta svg { opacity: .55; flex-shrink: 0; }

/* Read more link */
.bcu-sp-readmore {
  display: inline-block;
  margin-top: 10px;
  font-size: .78rem;
  font-weight: 700;
  color: #e84424;
  text-decoration: none;
  letter-spacing: .02em;
}
.bcu-sp-readmore:hover { opacity: .75; }

/* ══ STYLE: compact ══════════════════════════════════════════ */
.bcu-sp-style-compact .bcu-sp-grid {
  grid-template-columns: 1fr;
  gap: 0;
}
.bcu-sp-style-compact .bcu-sp-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0;
  border-bottom: 1px solid #f0f0f5;
  padding: 14px 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  transition: background .2s;
}
.bcu-sp-style-compact .bcu-sp-card:first-child { border-top: 1px solid #f0f0f5; }
.bcu-sp-style-compact .bcu-sp-card:hover { background: #fafafa; }
.bcu-sp-style-compact .bcu-sp-thumb {
  width: 100px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
  flex-shrink: 0;
  align-self: flex-start;
}
.bcu-sp-style-compact .bcu-sp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.bcu-sp-style-compact .bcu-sp-card:hover .bcu-sp-thumb img { transform: scale(1.05); }
.bcu-sp-style-compact .bcu-sp-body { padding: 0 0 0 14px; }
.bcu-sp-style-compact .bcu-sp-title {
  font-size: .88rem;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.bcu-sp-style-compact .bcu-sp-excerpt { display: none; }

/* ══ STYLE: minimal (text only) ═════════════════════════════ */
.bcu-sp-style-minimal .bcu-sp-grid {
  grid-template-columns: 1fr;
  gap: 0;
}
.bcu-sp-style-minimal .bcu-sp-card {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f5;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  gap: 12px;
  align-items: flex-start;
}
.bcu-sp-style-minimal .bcu-sp-card:hover .bcu-sp-title { color: #e84424; }
.bcu-sp-style-minimal .bcu-sp-thumb { display: none; }
.bcu-sp-style-minimal .bcu-sp-body { padding: 0; }
.bcu-sp-style-minimal .bcu-sp-meta-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #e8e8ee;
  line-height: 1;
  flex-shrink: 0;
  width: 32px;
}
.bcu-sp-style-minimal .bcu-sp-excerpt { display: none; }
.bcu-sp-style-minimal .bcu-sp-title { font-size: .9rem; -webkit-line-clamp: 2; line-clamp: 2; }

/* ── No posts notice ────────────────────────────────────────── */
.bcu-sp-no-posts {
  text-align: center;
  padding: 32px;
  color: #aaa;
  font-size: .9em;
  border: 1px dashed #ddd;
  border-radius: 8px;
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .bcu-sp-style-cards .bcu-sp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bcu-sp-style-cards .bcu-sp-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Flatten left/right thumb layouts to stacked on mobile */
  .bcu-sp-thumb-left .bcu-sp-card,
  .bcu-sp-thumb-right .bcu-sp-card {
    flex-direction: column;
  }
  .bcu-sp-thumb-left .bcu-sp-thumb,
  .bcu-sp-thumb-right .bcu-sp-thumb {
    width: 100%;
    height: 200px;
    border-radius: 12px 12px 0 0;
  }
  .bcu-sp-thumb-right .bcu-sp-thumb {
    border-radius: 12px 12px 0 0;
  }

  .bcu-sp-style-compact .bcu-sp-grid { gap: 0; }
  .bcu-sp-style-compact .bcu-sp-thumb { width: 80px; height: 60px; }
}
