/* ============================================================
   NEWS.CSS — Giặt Ủi Nhanh
   Dùng cho: cam-nang.html, noi-dung-cam-nang.html
   Responsive Chuẩn:
     Mobile:  width < 740px
     Tablet:  740px – 1023px
     PC:      width >= 1024px
   ============================================================ */

/* ============================================================
   BASE: HERO (ghi đè cho trang tin tức)
   ============================================================ */
.hero {
  min-height: 0 !important;
  padding: 100px 0 40px !important;
}

.hero-content {
  display: block !important;
}

.hero-text {
  text-align: center !important;
}

.hero h1 span {
  font-size: 20px;
}

.hero h1 span a {
  text-decoration: none;
  color: #fff;
  transition: ease-in-out 0.3s;
}

.hero h1 span a:hover {
  background: linear-gradient(to right, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   BASE: CAM NANG SECTION (cam-nang.html)
   ============================================================ */
.news-section {
  max-width: 1300px;
  margin: auto;
  padding: 60px 20px;
}

.news-title {
  text-align: center;
  font-size: 38px;
  color: #1565c0;
  margin-bottom: 60px;
}

/* Blog layout: sidebar + main */
.blog-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.sidebar {
  flex: 0 0 300px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 30px;
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  margin-bottom: 40px;
}

.sidebar-widget h3 {
  font-size: 20px;
  color: #1565c0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e3f2fd;
  padding-bottom: 10px;
}

.category-list {
  list-style: none;
  padding: 0;
}

.category-list li {
  margin-bottom: 10px;
}

.category-list a {
  text-decoration: none;
  color: #555;
  font-weight: 500;
  transition: all 0.3s;
  display: block;
  padding: 8px 15px;
  border-radius: 5px;
}

.category-list a:hover,
.category-list li.active a {
  color: #1565c0;
  background: #e3f2fd;
}

.category-list li.active a {
  font-weight: bold;
}

.latest-posts {
  list-style: none;
  padding: 0;
}

.latest-posts li {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.latest-posts li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.latest-posts a {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 15px;
  align-items: center;
}

.latest-posts img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
}

.post-info h4 {
  font-size: 14px;
  margin: 0 0 5px;
  color: #1565c0;
  line-height: 1.3;
}

.post-date {
  font-size: 12px;
  color: #888;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* News grid & cards */
.news-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: flex-start;
}

.news-card {
  flex: 0 0 calc(50% - 15px);
  max-width: calc(50% - 15px);
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: 0.3s ease;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.news-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-content {
  padding: 20px;
}

.news-content h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.4;
}

.news-content h3 a {
  text-decoration: none;
  color: #1565c0;
}

.news-content h3 a:hover {
  color: #0d47a1;
}

.news-date {
  font-size: 13px;
  color: #888;
  margin-bottom: 10px;
}

.read-more {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: #1565c0;
  text-decoration: none;
  font-size: 14px;
}

/* Pagination */
#pagination {
  margin-top: 40px;
}

#pagination .btn {
  margin: 0 5px;
}

#pagination .btn.active {
  background-color: #1565c0;
  border-color: #1565c0;
  color: white;
}

.pagination .page-link {
  border-radius: 8px;
  margin: 0 3px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
  background-color: #1565c0;
  border-color: #1565c0;
  color: white;
}

.pagination .page-link:hover {
  background-color: #e3f2fd;
  border-color: #1565c0;
  color: #1565c0;
}

/* ============================================================
   BASE: ARTICLE PAGE (noi-dung-cam-nang.html)
   ============================================================ */
.article-section {
  padding: 60px 0;
}

/* TOC (table of contents) */
.toc {
  background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.toc h3 {
  margin-top: 0;
  font-size: 17px;
  color: #fff;
  margin-bottom: 12px;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 8px;
}

.toc a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  display: block;
}

.toc a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Sidebar blog (article page aside) */
.sidebar-blog {
  position: relative;
  z-index: 1;
}

/* Related articles */
.related-sidebar {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
}

.related-sidebar h3 {
  color: #1565c0;
  margin-bottom: 16px;
  font-size: 18px;
}

.related-sidebar .news-grid {
  display: block;
  gap: 0;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-item {
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  transition: background 0.2s;
}

.related-item:hover {
  background: #f0f0f0;
}

.related-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
}

.related-item img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.related-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.related-title {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
  color: #333;
  font-weight: 500;
}

.related-date {
  font-size: 12px;
  color: #666;
  margin: 0;
}

/* Article content body */
.article-content {
  min-width: 0;
  word-break: break-word;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 20px;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1565c0;
  margin: 32px 0 14px;
  padding-top: 4px;
}

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0d47a1;
  margin: 22px 0 10px;
}

.article-content p {
  font-size: 1rem;
  line-height: 1.85;
  color: #374151;
  margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 16px;
}

.article-content li {
  line-height: 1.8;
  color: #374151;
  margin-bottom: 6px;
}

.article-content blockquote {
  border-left: 4px solid #3b82f6;
  background: #eff6ff;
  padding: 14px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
  color: #1e3a8a;
  font-style: italic;
}

/* Tables */
html {
  scroll-behavior: smooth;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

table th,
table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

table th {
  background-color: #f2f2f2;
}

/* Tag buttons */
.tag-button {
  display: inline-block;
  background: #1565c0;
  color: white;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.3s;
}

.tag-button:hover {
  background: #0d47a1;
  color: white;
}

/* ============================================================
   RESPONSIVE — PC (>= 1024px)
   ============================================================ */
@media only screen and (min-width: 1024px) {
  /* Sticky sidebar on article page */
  .sidebar-blog {
    position: sticky;
    top: 90px;
    height: fit-content;
    align-self: flex-start;
  }

  /* Sticky sidebar on listing page */
  aside {
    position: sticky;
    top: 100px;
    height: fit-content;
  }
}

/* ============================================================
   RESPONSIVE — TABLET (740px – 1023px)
   ============================================================ */
@media only screen and (min-width: 740px) and (max-width: 1023px) {
  /* Hero */
  .hero .hero-text h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }

  .hero h1 span {
    font-size: 15px;
  }

  /* Cam nang listing page */
  .news-section {
    padding: 40px 16px;
  }

  .blog-container {
    flex-direction: column;
    gap: 32px;
  }

  .sidebar {
    position: static;
    order: 2;
    flex: none;
    width: 100%;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  }

  .main-content {
    order: 1;
    width: 100%;
  }

  .sidebar-widget {
    margin-bottom: 30px;
  }

  .news-grid {
    gap: 20px;
  }

  .news-card {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }

  /* Article page: stack sidebar below content */
  .article-section {
    padding: 40px 0;
  }

  .article-section .row {
    flex-direction: column;
  }

  .article-section .col-md-3,
  .article-section .col-md-9 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .sidebar-blog {
    position: static;
    order: 2;
    width: 100%;
    margin-top: 32px;
  }

  .article-content {
    order: 1;
    width: 100%;
  }

  /* Scrollable table */
  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (< 740px)
   ============================================================ */
@media only screen and (max-width: 739px) {
  /* Hero */
  .hero {
    padding: 84px 0 30px !important;
  }

  .hero h1 {
    font-size: 1.4rem !important;
  }

  .hero .hero-text h1 {
    font-size: 1.3rem;
    line-height: 1.35;
  }

  .hero .hero-text h1 span {
    font-size: 0.8rem;
  }

  .hero-content {
    padding: 0 !important;
    padding-top: 20px !important;
  }

  /* Cam nang listing page */
  .news-section {
    padding: 24px 12px;
  }

  .news-title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .blog-container {
    flex-direction: column;
    gap: 0;
  }

  .sidebar {
    position: static;
    order: 2;
    flex: unset;
    width: 100%;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .main-content {
    order: 1;
    width: 100%;
  }

  .news-grid {
    gap: 16px;
    justify-content: center;
  }

  .news-card {
    flex: 0 0 100%;
    max-width: 100%;
    border-radius: 10px;
  }

  .news-card img {
    height: 180px;
  }

  /* Article page */
  .article-section {
    padding: 16px 0;
  }

  .article-section .col-md-3,
  .article-section .col-md-9 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .sidebar-blog {
    position: static;
    order: 2;
    width: 100%;
    margin-top: 24px;
  }

  .article-content {
    order: 1;
    width: 100%;
  }

  .article-content h2 {
    font-size: 1.25rem;
  }

  .article-content h3 {
    font-size: 1.05rem;
  }

  .article-content p {
    font-size: 0.97rem;
  }

  /* Scrollable table */
  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
