/* =========================================================
   Catrawarta v5.4.5 — Homepage Populer Showcase
   - maksimal 8 artikel (4x2 desktop)
   - full-bleed navy band, content tetap mengikuti container
   - overlay cards sebagai bahasa visual khusus section Populer
   - switcher sumber: Clap / Scroll Threshold
   ========================================================= */

.catra-home-editorial .catra-popular-showcase{
  --catra-popular-navy:var(--catra-header-bg,#00293e);
  --catra-popular-navy-deep:#001f30;
  --catra-popular-text:#ffffff;
  --catra-popular-muted:rgba(255,255,255,.72);
  --catra-popular-soft:rgba(255,255,255,.12);
  --catra-popular-gold:#dfbb6f;
  position:relative;
  z-index:0;
  width:100%;
  margin:40px auto 0;
  padding:20px 0 32px;
  overflow:visible;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--catra-popular-text);
}

/* Full-bleed = warna section membentang sampai sisi viewport,
   sedangkan isi tetap mengikuti lebar container homepage. */
.catra-home-editorial .catra-popular-showcase::before{
  content:"";
  position:absolute;
  z-index:-1;
  top:0;
  bottom:0;
  left:50%;
  width:100vw;
  transform:translateX(-50%);
  background:var(--catra-popular-navy);
  pointer-events:none;
}

.catra-home-editorial .catra-popular-showcase-head{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:10px;
  min-width:0;
  margin:0 0 22px;
  text-align:center;
}

/* Title Populer khusus: centered, tanpa ornament uploader. */
.catra-home-editorial .catra-popular-showcase-title{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  min-width:0;
  min-height:66px;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  font-family:"Reddit Sans",Arial,Helvetica,sans-serif!important;
  text-align:center;
}
.catra-home-editorial .catra-popular-showcase-title::before,
.catra-home-editorial .catra-popular-showcase-title::after{
  display:none!important;
  content:none!important;
}
.catra-home-editorial .catra-popular-showcase-title-ghost{
  display:block;
  margin:0 0 -18px;
  color:rgba(255,255,255,.10);
  font-size:48px;
  line-height:.9;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
  user-select:none;
  pointer-events:none;
}
.catra-home-editorial .catra-popular-showcase-title-main{
  position:relative;
  z-index:1;
  display:block;
  color:#fff;
  font-size:23px;
  line-height:1.05;
  font-weight:700;
  letter-spacing:-.01em;
}

/* Source switcher: hanya Likes / Views, centered. */
.catra-home-editorial .catra-popular-source-switch{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-width:0;
  margin:0 auto;
  padding:3px;
  border:0;
  border-radius:3px;
  background:rgba(255,255,255,.04);
}
.catra-home-editorial .catra-popular-source-label{display:none!important;}
.catra-home-editorial .catra-popular-source-btn{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  min-height:26px;
  padding:0 10px;
  border:1px solid transparent;
  border-radius:3px;
  background:transparent;
  color:rgba(255,255,255,.82);
  font-family:"Reddit Sans",Arial,Helvetica,sans-serif;
  font-size:10px;
  line-height:1;
  font-weight:650;
  cursor:pointer;
  transition:background-color .18s ease,color .18s ease,border-color .18s ease;
}
.catra-home-editorial .catra-popular-source-btn:hover,
.catra-home-editorial .catra-popular-source-btn:focus-visible{
  border-color:rgba(255,255,255,.20);
  color:#fff;
  outline:none;
}
.catra-home-editorial .catra-popular-source-btn.is-active,
.catra-home-editorial .catra-popular-source-btn[aria-selected="true"]{
  border-color:#fff;
  background:#fff;
  color:var(--catra-popular-navy);
}

.catra-home-editorial .catra-popular-source-pane[hidden]{display:none!important;}

/* 8 artikel = 4 kolom x 2 baris desktop */
.catra-home-editorial .catra-popular-showcase-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}

/* Overlay card: image menjadi canvas, navy gradient menjaga keterbacaan. */
.catra-home-editorial .catra-popular-showcase-card{
  position:relative;
  min-width:0;
  min-height:238px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.13);
  border-radius:var(--catra-home-card-radius,4px);
  background:var(--catra-popular-navy-deep);
  box-shadow:0 10px 24px rgba(0,0,0,.13);
  isolation:isolate;
}
.catra-home-editorial .catra-popular-showcase-card::after{
  content:"";
  position:absolute;
  z-index:1;
  inset:0;
  background:linear-gradient(
    180deg,
    rgba(0,41,62,.02) 0%,
    rgba(0,41,62,.12) 28%,
    rgba(0,41,62,.72) 62%,
    rgba(0,31,48,.97) 100%
  );
  pointer-events:none;
}
.catra-home-editorial .catra-popular-showcase-media{
  position:absolute;
  z-index:0;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  overflow:hidden;
  background:var(--catra-popular-navy-deep);
}
.catra-home-editorial .catra-popular-showcase-media img,
.catra-home-editorial .catra-popular-showcase-media .catra-image-placeholder{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  background:var(--catra-popular-navy-deep);
  transition:transform .28s ease,filter .28s ease;
}
.catra-home-editorial .catra-popular-showcase-card:hover .catra-popular-showcase-media img,
.catra-home-editorial .catra-popular-showcase-card:focus-within .catra-popular-showcase-media img{
  transform:scale(1.025);
  filter:saturate(.92);
}
.catra-home-editorial .catra-popular-showcase-copy{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  min-height:238px;
  padding:18px 16px 15px;
  color:#fff;
}
.catra-home-editorial .catra-popular-showcase-category{
  display:block;
  max-width:100%;
  margin:0 0 8px;
  overflow:hidden;
  color:var(--catra-popular-gold);
  font-family:"Reddit Sans",Arial,Helvetica,sans-serif;
  font-size:9.5px;
  line-height:1.15;
  font-weight:700;
  letter-spacing:.075em;
  text-transform:uppercase;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.catra-home-editorial .catra-popular-showcase-card-title{
  display:-webkit-box;
  margin:0;
  overflow:hidden;
  color:#fff;
  font-family:"Reddit Sans",Arial,Helvetica,sans-serif;
  font-size:15.5px;
  line-height:1.28;
  font-weight:650;
  letter-spacing:-.014em;
  text-shadow:0 1px 2px rgba(0,0,0,.16);
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
}
.catra-home-editorial .catra-popular-showcase-card-title a{
  color:inherit!important;
  text-decoration:none!important;
  background:none!important;
}
.catra-home-editorial .catra-popular-showcase-card-title a:hover,
.catra-home-editorial .catra-popular-showcase-card-title a:focus-visible{
  color:var(--catra-popular-gold)!important;
  outline:none;
}
.catra-home-editorial .catra-popular-showcase-meta{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
  margin-top:10px;
  padding-top:0;
  color:var(--catra-popular-muted);
  font-family:"Reddit Sans",Arial,Helvetica,sans-serif;
  font-size:9.5px;
  line-height:1.2;
}
.catra-home-editorial .catra-popular-showcase-author{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.catra-home-editorial .catra-popular-showcase-meta time{
  flex:0 0 auto;
  white-space:nowrap;
}

@media (max-width:991px){
  .catra-home-editorial .catra-popular-showcase{
    margin-top:34px;
    padding:18px 0 28px;
  }
  .catra-home-editorial .catra-popular-showcase-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }
  .catra-home-editorial .catra-popular-showcase-card,
  .catra-home-editorial .catra-popular-showcase-copy{
    min-height:250px;
  }
}

@media (max-width:767px){
  .catra-home-editorial .catra-popular-showcase{
    margin-top:30px;
    padding:17px 0 24px;
  }
  .catra-home-editorial .catra-popular-showcase-head{
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:9px;
    margin-bottom:18px;
    text-align:center;
  }
  .catra-home-editorial .catra-popular-showcase-title{
    min-height:58px;
    width:100%;
  }
  .catra-home-editorial .catra-popular-showcase-title-ghost{
    margin-bottom:-15px;
    font-size:38px;
  }
  .catra-home-editorial .catra-popular-showcase-title-main{font-size:20px;}
  .catra-home-editorial .catra-popular-source-switch{
    width:auto;
    max-width:100%;
    justify-content:center;
    margin:0 auto;
    overflow:visible;
  }
  .catra-home-editorial .catra-popular-source-btn{
    flex:0 0 auto;
    min-width:54px;
    min-height:25px;
    padding:0 9px;
    font-size:9.5px;
  }

  /* Mobile tetap 2 kolom agar 8 artikel tidak membuat section terlalu panjang. */
  .catra-home-editorial .catra-popular-showcase-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .catra-home-editorial .catra-popular-showcase-card,
  .catra-home-editorial .catra-popular-showcase-copy{
    min-height:210px;
  }
  .catra-home-editorial .catra-popular-showcase-copy{
    padding:14px 12px 12px;
  }
  .catra-home-editorial .catra-popular-showcase-category{
    margin-bottom:6px;
    font-size:8.5px;
  }
  .catra-home-editorial .catra-popular-showcase-card-title{
    font-size:13.5px;
    line-height:1.28;
    -webkit-line-clamp:3;
  }
  .catra-home-editorial .catra-popular-showcase-meta{
    margin-top:8px;
    font-size:8.5px;
  }
}

@media (max-width:420px){
  .catra-home-editorial .catra-popular-showcase-grid{gap:8px;}
  .catra-home-editorial .catra-popular-showcase-card,
  .catra-home-editorial .catra-popular-showcase-copy{
    min-height:196px;
  }
  .catra-home-editorial .catra-popular-showcase-copy{
    padding:12px 10px 10px;
  }
  .catra-home-editorial .catra-popular-showcase-card-title{
    font-size:12.75px;
    line-height:1.26;
  }
  .catra-home-editorial .catra-popular-showcase-author{
    max-width:72px;
  }
}

@media (prefers-reduced-motion:reduce){
  .catra-home-editorial .catra-popular-showcase-media img,
  .catra-home-editorial .catra-popular-source-btn{
    transition:none!important;
  }
}

@media (max-width:767px){
  body.catra-mobile-hide-popular .catra-popular-showcase{display:none!important;}
}
