* {
  box-sizing: border-box; /*tránh lỗi tràn layout*/
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background: #f5f5f5; /*màu xám nhẹ*/
}

.container {
  /* Website không full màn hình, luôn căn giữa */
  width: 90%;
  margin: auto;
}

/* Banner */
.banner img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

/* Menu */
.menu {
  background: #c62828;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center; /* thêm dòng này */
  margin: 0;
  padding: 0;
}

.menu li {
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 50px;
  position: relative; /* QUAN TRỌNG để dropdown không bị lệch */
}

.menu a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: 0.3s;
}

.menu a:hover {
  color: #ffc107;
}

/* Dropdown menu */
.menu ul ul {
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  background: #eee;
  min-width: 250px; /* QUAN TRỌNG */
  z-index: 1000;

  padding: 10px 0;
}

/* Hiện menu */
.menu ul li:hover ul {
  opacity: 1;
  visibility: visible;
}

/* Menu con */
.menu ul ul li {
  display: block;
  width: 100%;
}

/* Link menu con */
.menu ul ul li a {
  display: block;
  padding: 10px 15px;
  color: black;

  white-space: nowrap; /* QUAN TRỌNG: không xuống dòng */
}

/* Hover */
.menu ul ul li a:hover {
  background: #ddd;
}
.menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.menu ul {
  display: flex;
}

.menu .search {
  display: flex;
  align-items: center;
  height: 50px; /* QUAN TRỌNG: khớp menu */
}

.menu .search input {
  height: 30px;
  border: none;
  padding: 0 10px;
  outline: none;
  border-radius: 15px 0 0 15px;
}

.menu .search button {
  height: 30px;
  border: none;
  padding: 0 12px;
  background: #ff9800;
  color: white;
  border-radius: 0 15px 15px 0;
  cursor: pointer;
}

.menu .search button:hover {
  background: #e68900;
}
/* MARQUEE */
.marquee {
  width: 100%;
  overflow: hidden;
  background: #fffacd;
  height: 40px;
  line-height: 40px;
  position: relative;
}

.marquee-text {
  position: absolute;
  white-space: nowrap;
  animation: chaychu 20s linear infinite;
  font-weight: bold;
  color: #d71920;
}

@keyframes chaychu {
  0% {
    left: 100%;
  }
  100% {
    left: -100%;
  }
}

/* Main layout */
.main {
  display: flex;
  gap: 20px;
  margin: 20px auto;
}
/* Container chung cho layout mới */
.news-layout {
  display: flex;
  gap: 15px;
  background: #fff;
  padding: 15px;
  border-radius: 5px;
}

/* Cột 1: Tin chính (Chiếm 45%) */
.featured-news {
  flex: 45%;
}
.main-post img {
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
}
.main-post h3 {
  color: #000;
  font-size: 16px;
  margin: 10px 0;
  font-weight: bold;
  line-height: 1.4;
}
.main-post p {
  font-size: 14px;
  color: #444;
}

/* Cột 2: Danh sách tin (Chiếm 30%) */
.news-list-small {
  flex: 30%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.small-item {
  display: flex;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #ccc;
}
.small-item img {
  width: 80px;
  height: 50px;
  object-fit: cover;
}
.small-item a {
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
  line-height: 1.3;
}
.small-item a:hover {
  color: #c62828;
}

/* Cột 3: Banners (Chiếm 25%) */
.side-banners {
  flex: 25%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-banners img {
  width: 100%;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}
.a {
  text-decoration: none;
  color: black;
}
/* Responsive cho điện thoại */
@media (max-width: 992px) {
  .news-layout {
    flex-direction: column;
  }
}
/* Footer */
.footer {
  background: #fff8dc;
  margin-top: 30px;
}

.menu-footer {
  background: #c62828;
}

.menu-footer ul {
  display: flex;
  justify-content: center;
  list-style: none;
}

.menu-footer li {
  padding: 0 20px;
  line-height: 40px;
}

.menu-footer a {
  color: white;
  text-decoration: none;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  color: #c62828;
  font-size: 14px;
}

.right-text {
  text-align: right;
}

/* Responsive */

@media (max-width: 768px) {
  /* Layout chuyển 1 cột */
  .main {
    flex-direction: column;
  }

  .left,
  .right {
    width: 100%;
  }

  /* Menu dọc */
  .menu ul {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu li {
    width: 100%;
    padding: 10px;
  }

  /* News co lại */
  .news {
    flex-direction: column;
  }

  .news img {
    width: 100%;
    height: auto;
  }

  /* Ảnh toàn site */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Footer xuống dòng */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .right-text {
    text-align: center;
    margin-top: 10px;
  }
}
