/* =====================================================
   0. RESET + NỀN TẢNG CHUNG
===================================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;   /* ❗ diệt tràn ngang mobile */
}

/* Ảnh – video – iframe */
img,
iframe,
video {
  max-width: 100%;
  height: auto;
}

/* =====================================================
   1. HEADER – LOGO – NAVBAR
===================================================== */

/* Mobile & tablet */
@media (max-width: 768px) {

  /* Logo */
  .navbar-brand img {
    width: 60px !important;
    height: auto !important;
  }

  .navbar-brand strong {
    font-size: 20px !important;
    line-height: 1.2;
  }

  .navbar-brand span {
    font-size: 13px !important;
  }

  /* Navbar spacing */
  .navbar {
    padding: 5px 8px !important;
  }
}

/* =====================================================
   2. BANNER QUẢNG CÁO TRÊN HEADER
===================================================== */

@media (max-width: 768px) {
  .banner-ads-img {
    height: 55px !important;
    object-fit: cover;
    border-radius: 6px;
  }
}

/* Tablet ngang */
@media (min-width: 769px) and (max-width: 1024px) {
  .banner-ads-img {
    height: 75px;
  }
}

/* =====================================================
   3. MENU NGANG (CUỘN NGANG MOBILE)
===================================================== */

@media (max-width: 992px) {

  .menu-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .menu-list {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .menu-list li a {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* =====================================================
   4. LAYOUT CHÍNH (CONTENT + SIDEBAR)
===================================================== */

/* Mobile */
@media (max-width: 768px) {

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Ép 1 cột */
  .col-md-9,
  .col-md-3 {
    width: 100% !important;
    max-width: 100% !important;
  }

  .col-md-3 {
    margin-top: 20px;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {

  .col-md-9 {
    width: 100% !important;
  }

  .col-md-3 {
    width: 100% !important;
    margin-top: 20px;
  }
}

/* =====================================================
   5. CARD – DANH SÁCH BÀI VIẾT
===================================================== */

.card {
  border-radius: 10px;
  overflow: hidden;
}

.card img {
  object-fit: cover;
}

@media (max-width: 768px) {

  .card-title {
    font-size: 16px;
  }

  .card-text {
    font-size: 14px;
  }
}

/* =====================================================
   6. TRANG CHI TIẾT BÀI VIẾT
===================================================== */

.post-detail-container {
  padding: 0 5px;
}

.post-detail-container h1 {
  line-height: 1.3;
}

/* Mobile */
@media (max-width: 768px) {

  .post-detail-container h1 {
    font-size: 22px !important;
  }

  .post-summary {
    font-size: 14px;
  }
}

/* Nội dung CKEditor */
.post-content {
  font-size: 16px;
  line-height: 1.5;
}

.post-content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 12px auto;
}

/* Table trong bài viết */
.post-content table {
  width: 100% !important;
  display: block;
  overflow-x: auto;
}

/* =====================================================
   7. SIDEBAR
===================================================== */

@media (max-width: 768px) {

  .card.mb-4 {
    margin-bottom: 16px;
  }

  .card-title {
    font-size: 15px;
  }
}

/* =====================================================
   8. FOOTER
===================================================== */

/* Mobile: không fixed */
@media (max-width: 768px) {

  footer.fixed-bottom {
    position: static !important;
  }

  body {
    padding-bottom: 20px !important;
  }
}

/* Desktop: giữ fixed */
@media (min-width: 769px) {
  footer.fixed-bottom {
    position: fixed;
    left: 0;
    right: 0;
  }
}

/* =====================================================
   9. TỐI ƯU HIỆU ỨNG + TRẢI NGHIỆM
===================================================== */

/* Click mượt mobile */
a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* Giảm rung layout */
img {
  will-change: transform;
}

/* =====================================================
   10. MÀN HÌNH RẤT NHỎ (IPHONE MINI)
===================================================== */

@media (max-width: 360px) {

  .navbar-brand strong {
    font-size: 18px !important;
  }

  .menu-list li a {
    font-size: 13px;
    padding: 8px 12px;
  }
}



/* ==============================
   GRID BÀI VIẾT – RESPONSIVE
============================== */

.post-grid {
  display: grid;
  gap: 25px;
}

/* 🖥 Desktop lớn */
@media (min-width: 1200px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 💻 Laptop / Tablet ngang */
@media (min-width: 768px) and (max-width: 1199px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 📱 Mobile */
@media (max-width: 767px) {
  .post-grid {
    /* grid-template-columns: 1fr; */
        grid-template-columns: repeat(2, 1fr);

  }

  .post-grid .card {
    margin: 0 auto;
  }

  .post-grid .btn {
    width: 100%;
  }
}

.btn-view-detail {
    display: block;
    width: 100%;
    padding: 7px 0;
    margin-top: 12px;

    text-align: center;
    font-weight: 600;
    font-size: 15px;

    color: #fff;
    /* background: linear-gradient(135deg, #0d6efd, #0a58ca); */
        background: linear-gradient(135deg, #0d6efd, #0a58ca);

    border-radius: 100px;

    text-decoration: none;
    transition: all 0.25s ease;
}


