/* ============================================================
   sosmed.css — DPP PRI Social Media Section
   Layout: HORIZONTAL SCROLL — identik dengan section Berita
   Warna : Merah #C8151A + Putih, sesuai logo PRI
   ============================================================ */

/* ─── Section: padding IDENTIK dengan section-berita ─── */
.sm2-section {
  padding: 80px;
  background: #ffffff;
  border-bottom: 1px solid #ede8e5;
  position: relative;
}
/* Garis pemisah halus di atas */
.sm2-section::before {
  content: '';
  position: absolute; top: 0; left: 80px; right: 80px; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(200,21,26,.15) 30%,
    rgba(200,21,26,.3) 50%,
    rgba(200,21,26,.15) 70%, transparent 100%
  );
}

/* ─── Header: identik dengan berita-top ─── */
.sm2-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.sm2-hd-left { flex: 1; min-width: 200px; }

.sm2-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(200,21,26,.07); border: 1.5px solid rgba(200,21,26,.18);
  border-radius: 50px; padding: 4px 13px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: #C8151A; margin-bottom: 10px;
}
.sm2-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #C8151A;
  animation: sm2live 2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes sm2live {
  0%,100% { box-shadow: 0 0 0 0 rgba(200,21,26,.5); }
  60%      { box-shadow: 0 0 0 7px rgba(200,21,26,0); }
}

/* Tombol "Semua Platform" — identik dengan berita-link-all */
.sm2-all-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #C8151A;
  text-decoration: none;
  border: 2px solid rgba(200,21,26,.25);
  border-radius: 20px; padding: 7px 20px;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
}
.sm2-all-link:hover { background: #C8151A; color: #fff; border-color: #C8151A; }
.sm2-all-link svg { transition: transform .2s; }
.sm2-all-link:hover svg { transform: translateX(3px); }

/* Icon platform kecil di header */
.sm2-hd-icons { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.sm2-ico {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px;
  border-radius: 50px; font-size: 11px; font-weight: 700;
  text-decoration: none; border: 1.5px solid; transition: all .18s; white-space: nowrap;
}
.sm2-ico svg { width: 11px; height: 11px; flex-shrink: 0; }
.sm2-ico:hover { transform: translateY(-1px); }
.sm2-ico-yt  { color: #cc0000; border-color: rgba(204,0,0,.22);  background: rgba(204,0,0,.04); }
.sm2-ico-yt:hover  { background: #cc0000; color: #fff; border-color: #cc0000; }
.sm2-ico-tt  { color: #333; border-color: rgba(0,0,0,.12); background: rgba(0,0,0,.02); }
.sm2-ico-tt:hover  { background: #111; color: #fff; border-color: #111; }
.sm2-ico-fb  { color: #1877F2; border-color: rgba(24,119,242,.22); background: rgba(24,119,242,.04); }
.sm2-ico-fb:hover  { background: #1877F2; color: #fff; border-color: #1877F2; }
.sm2-ico-ig  { color: #C13584; border-color: rgba(193,53,132,.22); background: rgba(193,53,132,.04); }
.sm2-ico-ig:hover  { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; border-color: transparent; }
.sm2-ico-x   { color: #333; border-color: rgba(0,0,0,.12); background: rgba(0,0,0,.02); }
.sm2-ico-x:hover   { background: #111; color: #fff; border-color: #111; }

/* ═══════════════════════════════════════════════════════════
   HORIZONTAL SCROLL TRACK — sama persis dengan berita-ticker
   ═══════════════════════════════════════════════════════════ */
.sm2-scroll-wrap {
  overflow: hidden;
  width: 100%;
  position: relative;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x;
  mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
}
.sm2-scroll-wrap:active { cursor: grabbing; }

.sm2-scroll-track {
  display: flex;
  gap: 16px;
  /* min-content agar tidak stretch, tapi kalau muat di layar → center */
  width: fit-content;
  min-width: 100%;           /* selebar wrapper kalau 5 kartu muat */
  will-change: transform;
  transition: none;
  transform: translateX(0);
  align-items: stretch;
  justify-content: center;   /* center kartu kalau total < lebar wrap */
}

/* ─── Kartu platform — lebar adaptif ─── */
/* Tampilkan tepat 5 kartu dengan sedikit jarak napas di kanan
   Rumus: (100vw - padding 160px - 4 gap 64px) / 5.3 kartu         */
.sm2-card {
  flex: 0 0 calc((100vw - 224px) / 5.3);
  width: calc((100vw - 224px) / 5.3);
  min-width: 220px;
  max-width: 300px;
  height: 550px;          /* header 40px + body 420px + meta 52px + footer 38px */
  background: #F9F7F5;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #ede8e5;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.sm2-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(200,21,26,.1);
  border-color: rgba(200,21,26,.25);
}

/* Platform header strip */
.sm2-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 9px;
  border-bottom: 1px solid #ede8e5;
  flex-shrink: 0;
  background: #fff;
}
.sm2-card-plat {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800;
}
.sm2-card-plat svg { width: 14px; height: 14px; flex-shrink: 0; }
.sm2-card-handle {
  font-size: 10px; font-weight: 700; color: #C8151A; text-decoration: none;
}
.sm2-card-handle:hover { color: #9E0F13; }

/* Platform accent colors */
.sm2-plat-yt  { color: #cc0000; }
.sm2-plat-tt  { color: #111; }
.sm2-plat-ig  { color: #C13584; }
.sm2-plat-fb  { color: #1877F2; }
.sm2-plat-x   { color: #333; }

.sm2-card-top-yt { border-top: 3px solid #FF0000; }
.sm2-card-top-tt { border-top: 3px solid #111; }
.sm2-card-top-ig { border-top: 3px solid #C13584; }
.sm2-card-top-fb { border-top: 3px solid #1877F2; }
.sm2-card-top-x  { border-top: 3px solid #555; }

/* Embed/content area — tinggi fixed agar semua kartu sama */
.sm2-card-body {
  flex: 0 0 420px;
  height: 420px;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.sm2-card-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}
/* YouTube — isi penuh area 420px */
.sm2-yt-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  object-fit: cover;
}
/* TikTok portrait */
.sm2-tt-frame { width: 100%; height: 100%; }
/* Instagram reel */
.sm2-ig-frame { width: 100%; height: 100%; }
/* Facebook — scrollable di dalam */
.sm2-fb-frame { height: 100%; background: #f0f2f5; overflow-y: auto; }

/* Meta bawah kartu */
.sm2-card-meta {
  padding: 10px 14px 12px;
  border-top: 1px solid #ede8e5;
  background: #fff;
  flex-shrink: 0;
}
.sm2-card-title {
  font-size: 12px; font-weight: 700; color: #1a0203;
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.sm2-card-date { font-size: 10px; color: #9a7070; margin-top: 3px; }

/* "Lihat di platform" footer */
.sm2-card-foot {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 14px;
  border-top: 1px solid #ede8e5;
  background: #fdf8f8;
  font-size: 10.5px; font-weight: 800; color: #C8151A;
  text-decoration: none; flex-shrink: 0;
  transition: background .15s;
}
.sm2-card-foot:hover { background: #fceaea; }
.sm2-card-foot svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ─── Empty state ─── */
.sm2-card-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%;   /* isi penuh .sm2-card-body */
  padding: 24px 16px; text-align: center;
  background: #fdf8f8;
}
.sm2-empty-icon  { font-size: 2rem; margin-bottom: 10px; opacity: .55; }
.sm2-empty-title { font-size: 12px; font-weight: 800; color: #7a4040; margin-bottom: 5px; }
.sm2-empty-hint  { font-size: 11px; color: #a87070; line-height: 1.6; }
.sm2-empty-hint strong { color: #C8151A; }

/* ─── Auto badge ─── */
.sm2-auto-badge {
  background: rgba(200,21,26,.07); color: #C8151A;
  font-size: 7.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; padding: 1px 5px;
  border-radius: 50px; border: 1px solid rgba(200,21,26,.15);
  margin-left: 3px; flex-shrink: 0;
}

/* ─── Dots indicator (sama dengan berita) ─── */
.sm2-dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 20px;
}
.sm2-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ddd; transition: background .2s, transform .2s; cursor: pointer;
}
.sm2-dot.active { background: #C8151A; transform: scale(1.2); }


/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .sm2-section { padding: 64px 40px; }
  .sm2-section::before { left: 40px; right: 40px; }
  .sm2-card {
    flex: 0 0 calc((100vw - 144px) / 4.3);
    width: calc((100vw - 144px) / 4.3);
  }
}

@media (max-width: 900px) {
  .sm2-section { padding: 48px 24px; }
  .sm2-section::before { left: 24px; right: 24px; }
  .sm2-card {
    flex: 0 0 calc((100vw - 64px) / 2.5);
    width: calc((100vw - 64px) / 2.5);
    min-width: 220px;
    height: 480px;
  }
  .sm2-card-body { flex: 0 0 350px; height: 350px; }
}

@media (max-width: 600px) {
  .sm2-section { padding: 36px 16px; }
  .sm2-section::before { left: 16px; right: 16px; }

  .sm2-hd { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sm2-hd-icons { display: none; }
  .sm2-all-link { font-size: 12px; padding: 6px 14px; }

  .sm2-scroll-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    cursor: default;
    mask-image: none;
    -webkit-mask-image: none;
    padding-bottom: 4px;
  }

  .sm2-scroll-track {
    gap: 12px;
    padding: 0 4px 8px;
    justify-content: flex-start;
    transform: none !important;
    transition: none !important;
    width: max-content;
    min-width: unset;
  }

  .sm2-card {
    flex: 0 0 calc(100vw - 48px);
    width: calc(100vw - 48px);
    min-width: unset;
    max-width: unset;
    height: auto;
    scroll-snap-align: start;
  }

  .sm2-card-body {
    flex: none;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    overflow: hidden;
  }

  .sm2-card-body iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
  }

  .sm2-dots { display: none; }
}

@media (max-width: 400px) {
  .sm2-section { padding: 32px 12px; }
  .sm2-card {
    flex: 0 0 calc(100vw - 32px);
    width: calc(100vw - 32px);
  }
}