body {
  font-family: Arial;
  margin: 0;
  background: #f5f5f5;
}

.header {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #fff;
}

.logo {
  width: 60px;
}

.nav {
  background: #d60000;
  padding: 10px;
}

.nav a {
  color: #fff;
  margin-right: 15px;
  text-decoration: none;
}

.container {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  gap: 20px;
}

.left { flex: 3; }
.sidebar { flex: 1; }

/* SLIDER FIX */
.slider {
  overflow: hidden;
  margin-bottom: 20px;
}

.slides {
  display: flex;
  transition: 0.5s;
}

.slide {
  min-width: 100%;
  position: relative;
}

.slide img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

/* JUDUL DI GAMBAR */
.caption {
  position: absolute;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 100%;
  padding: 10px;
}

/* GRID */
/* FORCE GRID */
.grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 15px;
}

.card {
  background: #fff;
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.card b {
  display: block;
  font-size: 14px;
  margin-top: 5px;
}
<?php get_header(); ?>

<div class="container">

  <!-- LEFT -->
  <div class="left">

    <h2>Kategori: <?php single_cat_title(); ?></h2>

    <div class="grid">
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <div class="card">
          <a href="<?php the_permalink(); ?>">
            <?php the_post_thumbnail('medium'); ?>
            <b><?php the_title(); ?></b>
          </a>
        </div>

      <?php endwhile; endif; ?>
    </div>

    <!-- PAGINATION -->
    <div class="pagination">
      <?php
      echo paginate_links(array(
        'prev_text' => '«',
        'next_text' => '»'
      ));
      ?>
    </div>

  </div>

  <!-- SIDEBAR -->
  <div class="sidebar">
    <?php get_sidebar(); ?>
  </div>

</div>

<?php get_footer(); ?>
.nav a.active {
  font-weight: bold;
  border-bottom: 2px solid #fff;
}
/* SIDEBAR WRAPPER */
.sidebar {
  padding: 10px;
}

/* JUDUL SIDEBAR */
.sidebar h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ITEM LIST */
.side-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

/* GAMBAR */
.side-item img {
  width: 90px;
  height: 65px;
  object-fit: cover;
  border-radius: 4px;
}

/* JUDUL BERITA */
.side-item a {
  font-size: 15px;
  font-weight: 500;
  color: #222;
  text-decoration: none;
  line-height: 1.4;
}

/* HOVER BIAR LEBIH HIDUP */
.side-item a:hover {
  color: #d60000;
}
/* POTONG TEKS PANJANG */
.side-item a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.container {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
}

.left {
  flex: 3;
}

.sidebar {
  flex: 1;
}

.content {
  line-height: 1.7;
}

.content img {
  max-width: 100%;
  height: auto;
}
/* =========================
   FIX SINGLE POST LAYOUT
========================= */

/* BATASI LEBAR KONTEN */
.container {
  max-width: 1100px;
}

/* JUDUL ARTIKEL */
.left h1 {
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 15px;
}

/* GAMBAR UTAMA */
.left img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}

/* ISI ARTIKEL */
.content {
  font-size: 15px;
  line-height: 1.8;
}

/* GAMBAR DI DALAM ARTIKEL */
.content img {
  max-width: 100%;
  height: auto;
  margin: 10px 0;
}

/* SIDEBAR */
.sidebar {
  font-size: 13px;
}

/* ITEM SIDEBAR */
.side-item {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

/* GAMBAR SIDEBAR */
.side-item img {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

/* JUDUL SIDEBAR */
.side-item a {
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  color: #333;
}

/* HOVER */
.side-item a:hover {
  color: #d60000;
}

/* BERITA TERKAIT */
.grid {
  margin-top: 15px;
}

.card img {
  height: 120px;
}

/* RESPONSIVE (HP) */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 10px;
  }

  .left img {
    max-height: 220px;
  }
}

/* RESPONSIVE FIX */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.slider img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: 50% 30%;
}
