/* Container umum */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text-color);
  font-family: sans-serif;
}

/* 1) Layout 2 kolom: kiri = featured+small, kanan = widget */
.layout-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;   /* keduanya selalu nempel atas */
}

/* 2) Wrapper kiri: stack vertikal featured + small cards */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;            /* jarak antara featured dan small-cards */
}

/* 3) Small cards agar sebar 2 kolom dalam lebar wrapper kiri */
.small-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  /* hilangkan margin-top jika ada */
}


/* FEATURED CARD */
.featured-card {
  position: relative;


}
/* 2) Buat gradient overlay dengan pseudo-element */
.featured-card::before {
  content: "";
  position: absolute;
  inset: 0;  /* sama dengan top:0; right:0; bottom:0; left:0; */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,     /* ujung bawah gelap (alpha 0.8) */
    rgba(0, 0, 0, 0) 60%       /* transparan menuju 60% dari tinggi */
  );
  z-index: 1;  /* di atas gambar, tapi di bawah konten */
}

/* 3) Pastikan konten featured di atas gradient */
.featured-content {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 2;       /* agar teks selalu di atas gradient */
  /* hilangkan background: rgba(0,0,0,0.45) jika perlu */
  /* atau bisa digabung dengan gradient:
     background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  */
}
.featured-card img {
  width: 100%;
  display: block;
}
.featured-content {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  color: #fff;
  padding: 1rem;
}
.category-label {
  background: var(--primary-color);
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: #fff;
}
.featured-content .category-label {
  background: var(--primary-color);
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.featured-content .featured-date {
  font-size: 0.75rem;
  margin-left: 0.5rem;
  color: #ddd;
}
.featured-content .featured-title {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}
.featured-content .featured-excerpt {
  font-size: 1rem;
  line-height: 1.4;
}
.featured-content .featured-author {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  color: #ccc;
}

.featured-excerpt {
  font-size: 1rem;
  line-height: 1.4;
}
/* TRENDING WIDGET */
.trending-widget {
  background: var(--background-muted);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  margin-bottom: 10px;
}
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0;
  border-radius: 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  background: var(--background-color);
  color: var(--text-muted);
}
.tab.active {
  background: var(--primary-color);
  color: #fff;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
.trending-item {
  display: flex;
  margin-bottom: 0.75rem;
}
.trending-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 0.25rem;
  margin-right: 0.75rem;
}
.trending-item .item-info {
  flex: 1;
}
.trending-item .item-info h4 {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-color);
}
.trending-item .item-info .item-author {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ROW 2: Dua Kartu Menengah */

.small-card {
  background: var(--background-muted);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.small-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.small-card .small-body {
  padding: 1rem;
}
.small-card .small-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.small-card .small-title {
  font-size: 1.125rem;
  color: var(--text-color);
  margin: 0.25rem 0;
}
.small-card .small-author {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ROW 3: Tiga Kartu Kecil */
.three-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.three-card {
  background: var(--background-color);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.three-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}
.three-card .three-body {
  padding: 1rem;
}
.three-card .three-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.three-card .three-title {
  font-size: 1rem;
  color: var(--text-color);
  margin: 0.25rem 0;
}
.three-card .three-author {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}
.three-card .three-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.5rem;
}
.three-card .three-author .author-name {
  font-size: 0.875rem;
  color: var(--text-color);
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}
.page-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  background: var(--background-color);
  color: var(--text-color);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.page-link:hover {
  background: var(--hover-color);
  color: #fff;
}
.page-link.active {
  background: var(--primary-color);
  color: #fff;
}
.page-ellipsis {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Page header & breadcrumb */
.page-header {
  background: var(--background-muted);
  padding: 1rem 0;
}

.page-header .inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem;
  background: #7fc8c52c;
}

.page-header .inner h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.page-header .breadcrumb {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

.page-header .breadcrumb a {
  color: var(--link-color);
  text-decoration: none;
}

.page-header .breadcrumb a:hover {
  color: var(--hover-color);
}

.page-header .breadcrumb .separator {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* Responsive: kecilkan font di mobile */
@media (max-width: 640px) {
  .page-header .inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Highlight kata pertama (News) di judul page-header */
.page-header .inner h1 .text-primary {
  color: var(--primary-color);
}

.page-header .breadcrumb a,
.page-header .breadcrumb .separator {
  color: var(--primary-color);
}

.pagination ul {
  list-style: none;        /* hilangkan bullet */
  margin: 0;
  padding: 0;
  display: flex;           /* agar items berjajar */
  gap: 0.5rem;             /* atur jarak antar item */
}

.pagination li {
  list-style: none;        /* pastikan tiap li tanpa bullet */
}

.pagination a,
.pagination span {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  background: var(--background-color);
  color: var(--text-color);
  text-decoration: none;
}

.pagination .active span {
  background: var(--primary-color);
  color: #fff;
}

.meta {
  display: flex;
  align-items: center;
  gap: 0;                     /* gap dinonaktifkan karena kita pakai separator */
  margin-bottom: 0.5em;
}

.meta-item + .meta-item::before {
  content: "|";
  margin: 0 0.75em;
  color: var(--text-muted);
}
.meta-item i {
  margin-right: 0.25em;
  color: var(--primary-color);
}

.meta-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}


/* wrapper header di atas three-cards */
.three-cards-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}


.card-separator {
  border: none;
  border-top: 1px solid #00a99e54;
  margin: 0rem auto;   
  margin-bottom: 1rem ; /* jarak atas-bawah */
  width: 70%;
  align-items: center;
}

.font-bold {
  font-weight: bold;
  color: var(--primary-color);
}


/* Wrapper header */
.three-cards-header {
  margin: 2rem 0;
  display: flex;
  justify-content: flex-end;
  background: var(--background-muted);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

/* Layout form */
.filter-form {
  display: flex;
  gap: 1rem;
}

/* Custom dropdown container */
.custom-dropdown {
  position: relative;
  width: 200px; /* sesuaikan jika perlu */
}

/* Tombol trigger */
.dropdown-trigger {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  border: 1px solid var(--secondary-color);
  border-radius: 0.375rem;
  background: var(--background-color);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Panah di button */
.dropdown-trigger::after {
  content: "";
  border: solid var(--text-muted);
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 4px;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

/* Rotate panah saat open */
.custom-dropdown.open .dropdown-trigger::after {
  transform: rotate(-135deg);
}

/* Daftar opsi */
.dropdown-options {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--background-color);
  border: 1px solid var(--secondary-color);
  border-radius: 0.375rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, box-shadow 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
/* hide scrollbar cross-browser */
.dropdown-options {
  /* tetap pakai overflow-y:auto agar opsi banyak masih bisa di-scroll */
  overflow-y: auto;
  
  /* Firefox */
  scrollbar-width: none;
  /* IE 10+ */
  -ms-overflow-style: none;
}

/* Webkit (Chrome, Safari, Edge) */
.dropdown-options::-webkit-scrollbar {
  width: 0;
  height: 0;
}


/* Tampilkan opsi saat open */
.custom-dropdown.open .dropdown-options {
  max-height: 200px; /* cukup untuk menampung opsi */
  overflow-y: auto;
}

/* Item list */
.dropdown-options li {
  list-style: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

/* Hover item */
.dropdown-options li:hover {
  background-color: var(--primary-color);
  color: #fff;

}

/* styling link pada judul kartu */

.small-title a,
.three-title a,
.trending-item h4 a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* hover state */
.featured-title a:hover,
.small-title a:hover,
.three-title a:hover,
.trending-item h4 a:hover {
  color: var(--primary-color);
}

.featured-title a{
  color: white;
}

/* Hover effect untuk Featured, Small Card, dan Three Card */
.featured-card,
.small-card,
.three-card {
  position: relative;
  overflow: hidden; /* agar zoom gambar tidak keluar batas */
  border-radius: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Saat hover: terangkat dan shadow */
.featured-card:hover,
.small-card:hover,
.three-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Zoom-in gambar di dalam card */
.featured-card img,
.small-card img,
.three-card img {
  width: 100%;
  transition: transform 1.3s ease;
}

.featured-card:hover img,
.small-card:hover img,
.three-card:hover img {
  transform: scale(1.05);
}

/* Hover-zoom untuk gambar di Trending Widget */
.trending-widget .trending-item {
  position: relative;
  overflow: hidden; /* mencegah gambar keluar batas */
  border-radius: 0.5rem;
}

.trending-widget .trending-item img {

  transition: transform 1s ease;
}

.trending-widget .trending-item:hover img {
  transform: scale(1.05);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes zoomOut {
  from { opacity: 0; transform: scale(1.2);}
  to   { opacity: 1; transform: scale(1);}
}
@keyframes flipInY {
  from { opacity: 0; transform: perspective(400px) rotateY(60deg);}
  to   { opacity: 1; transform: perspective(400px) rotateY(0);}
}
@keyframes flipInX {
  from { opacity: 0; transform: perspective(400px) rotateX(60deg);}
  to   { opacity: 1; transform: perspective(400px) rotateX(0);}
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(.3);}
  50%  { opacity: 1; transform: scale(1.05);}
  70%  { transform: scale(.9);}
  100% { transform: scale(1);}
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes blurIn {
  from { opacity:0; filter: blur(10px);}
  to   { opacity:1; filter: blur(0);}
}
@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-360deg) scale(0.7);}
  to   { opacity: 1; transform: none;}
}

/* Default: hide dulu */
.animate-fadein,
.animate-fadeout,
.animate-zoomin,
.animate-zoomout,
.animate-flipiny,
.animate-flipinx,
.animate-bouncein,
.animate-slideinleft,
.animate-slideinright,
.animate-slideinup,
.animate-slideindown,
.animate-blurin,
.animate-rotatein
{
  opacity: 0;
}

.animate-fadein.active      { animation: fadeIn 1.2s both; opacity: 1;}
.animate-fadeout.active     { animation: fadeOut 1.2s both;}
.animate-zoomin.active      { animation: zoomIn 1.3s both; opacity: 1;}
.animate-zoomout.active     { animation: zoomOut 1.3s both; opacity: 1;}
.animate-flipiny.active     { animation: flipInY 1.3s both; opacity: 1;}
.animate-flipinx.active     { animation: flipInX 1.3s both; opacity: 1;}
.animate-bouncein.active    { animation: bounceIn 1.4s both; opacity: 1;}
.animate-slideinleft.active { animation: slideInLeft 1.2s both; opacity: 1;}
.animate-slideinright.active{ animation: slideInRight 1.2s both; opacity: 1;}
.animate-slideinup.active   { animation: slideInUp 1.2s both; opacity: 1;}
.animate-slideindown.active { animation: slideInDown 1.2s both; opacity: 1;}
.animate-blurin.active      { animation: blurIn 1.1s both; opacity: 1;}
.animate-rotatein.active    { animation: rotateIn 1.3s both; opacity: 1;}

/* -------------------------------
   BREAKPOINT: Tablet ke bawah
   (max-width: 1024px)
   ------------------------------- */
@media (max-width: 1024px) {
  /* Ubah 2 kolom jadi 1 kolom */
  .layout-main {
    grid-template-columns: 1fr;
  }

  /* Trending widget supaya full width */
  .trending-widget {
    grid-column: 1 / -1;
  }
}

/* -------------------------------
   BREAKPOINT: Smartphone besar
   (max-width: 768px)
   ------------------------------- */
@media (max-width: 768px) {
  /* Small-cards dari 2 kolom jadi 1 kolom */
  .small-cards {
    grid-template-columns: 1fr;
  }

  /* Three-cards juga jadi satu kolom */
  .three-cards {
    grid-template-columns: 1fr;
  }

  /* Form filter vertikal */
  .filter-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Dropdown full-width */
  .custom-dropdown {
    width: 100%;
  }
}

/* -------------------------------
   BREAKPOINT: Smartphone kecil
   (max-width: 640px)
   ------------------------------- */
@media (max-width: 640px) {
  /* Kecilkan font judul featured */
  .featured-content .featured-title {
    font-size: 1.25rem;
  }

  /* Tabs dalam trending wrap agar tidak overflow */
  .tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  /* Sesuaikan ukuran gambar di trending */
  .trending-item img {
    width: 80px;
    height: 80px;
  }
}

/* 1) Kurangi jarak page-header atas-bawah saat responsive */
@media (max-width: 768px) {
  .page-header {
    margin-top: -60px;      /* sebelumnya 1rem 0, jadi dikurangi */
  }
}

@media (max-width: 640px) {
  .page-header {
    padding: 0.25rem 0;     /* makin tipis di smartphone kecil */
  }
  .page-header .inner {
    padding: 0.25rem 0.75rem;
  }
}
@media (max-width: 640px) {
  .featured-content .featured-excerpt {
    display: none;
  }
}
/* Tablet ke bawah: ≤1024px */
@media (max-width: 1024px) {
  .page-header .inner h1 {
    font-size: 1.25rem;  /* dari 1.5rem → 1.25rem */
  }
  .page-header .breadcrumb {
    font-size: 0.875rem; /* sedikit lebih kecil */
  }
}

/* Smartphone besar: ≤768px */
@media (max-width: 768px) {
  .page-header .inner h1 {
    font-size: 1rem;     /* lebih ringkas di layar sedang */
  }
  .page-header .breadcrumb {
    font-size: 0.75rem;  /* agar breadcrumb muat rata */
  }
}

/* Smartphone kecil: ≤640px */
@media (max-width: 640px) {
  .page-header .inner h1 {
    font-size: 0.875rem; /* muat layar kecil */
    text-align: center;  /* tambahan: centering teks */
  }
  .page-header .breadcrumb {
    font-size: 0.75rem;
    justify-content: center; /* letakkan breadcrumb di tengah */
  }
}

@media (max-width: 768px) {
  .featured-card {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    height: 100vw;
    border-radius: 0;   /* hapus sudut melengkung */
    overflow: hidden;   /* tetap sembunyikan overflow */
  }
  /* Pastikan <img> mengisi 100% kontainer dan ter‐crop rapi */
  .featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* skala dan crop agar wadah selalu terisi */
    display: block;
  }
}
