html, body{
  min-height: 100%;
}

body{
  margin: 0;
  font-family: Arial, sans-serif;
  color: #033e5a;
  line-height: 1.6;

  /* ẢNH NỀN CHUNG TOÀN SITE */
    background:
     url("anhnen/bg-1.jpg") center / cover no-repeat fixed;
}

/* ==================================================
   LAYOUT CHUNG TOÀN WEBSITE
   ================================================== */
h1, h2,h3,h4,h5,h6 {
font-size: 16px;
}

:root{
  --max-width: 1200px;
  --header-height: 45px;
  --sub-height: 65px;

  --primary: #0099DA;
  --secondary: #0099DA;
  --bg-main: #fff9fe;
}

/* RESET */
*{ box-sizing: border-box; }

/* ===============================
   KHUNG CHUNG
   =============================== */
.page-wrapper{
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  position: relative;
 }

/* ===============================
   HEADER – FIXED – CÙNG TRỤC
   =============================== */
.page-header{
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  max-width: var(--max-width);
  width: 100%;
  height: var(--header-height);

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    to right,
    var(--primary),
    var(--secondary)
  );
  color: #fff;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(3, 161, 189, 0.15);
}

.page-header h1{
  font-size: 16px;
  margin: 0;
  line-height: 1;
}

.page-header a{
  color: #fff;
  text-decoration: none;
  margin-left: 6px;
}

/* NÚT MENU */
.menu-btn{
  position: absolute;
  left: 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ===============================
   KHỐI CỐ ĐỊNH PHỤ (SEARCH, TOOLBAR)
   =============================== */
.sub-fixed{
  position: fixed;
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%);
  max-width: var(--max-width);
  width: 100%;
  background: #ffffff;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  padding: 10px 0;
}

/* ===============================
   MAIN
   =============================== */
main{
  margin-top: 12px;
  padding: 6px;
  background: rgba(255,255,255,0.80);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* ===============================
   LOGO TIÊU ĐỀ TRANG
   =============================== */
.page-title{
  position: relative;
  padding-left: 52px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  margin-bottom: 20px;
}

.page-title::before{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Trang chủ */
.page-title.index::before{
  background-image: url("images/logo.png");
}

/* Giới thiệu */
.page-title.gioithieu::before{
  background-image: url("images/logo.png");
}

/* Tin tức */
.page-title.tintuc::before{
  background-image: url("images/hoadao.png");
}

/* Bài viết */
.page-title.baiviet::before{
  background-image: url("images/hoadao.png");
}

/* Tài liệu */
.page-title.tailieu::before{
  background-image: url("images/hoadao.png");
}

/* Văn bản */
.page-title.vanban::before{
  background-image: url("images/hoadao.png");
}

/* Trang anh */
.page-title.anh::before{
  background-image: url("images/vutrong.jpg");
}

/* Khối ảnh đặt giữa nội dung */
.img-giua{
    text-align: center;
    margin: 3px 3px;
}

/* Ảnh trong bài viết */
.img-giua img{
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

/* ===============================
   FOOTER
   =============================== */
footer{
  margin-top: 10px;
  padding: 6px 6px;
  text-align: center;
  font-size: 13px;
  color: #fff;
  background: #0099DA;
  border-top: 1px solid #e5e7eb;
}

/* ===============================
   RESPONSIVE
   =============================== */
/* Desktop */
.page-wrapper{
  padding-top: 34px;
}

/* Mobile */
@media (max-width: 768px){
  .page-wrapper{
    padding-top: 34px;
  }
}

@media (max-width: 768px){
  .page-title{
    padding-left: 44px;
    font-size: 22px;
  }
  .page-title::before{
    width: 32px;
    height: 32px;
  }
}
/* ===============================
   TRANG ẢNH
   =============================== */

.photo-grid{
  display: grid;
  grid-template-columns: 1fr; /* CHỈ 1 CỘT */
  gap: 16px;
}

.photo-item{
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.photo-item img{
  width: 100%;
  height: auto;
  display: block;
}

.photo-note{
  padding: 10px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}
/* ===============================
   TIN TỨC MỚI NHẤT (INDEX)
   =============================== */

.news-title{
  font-size: 16px;
  font-weight: bold;
  color: #b30000;
  border-bottom: 3px solid #b30000;
  padding-bottom: 3px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* BỎ GRID – CHUYỂN SANG LIST */
.news-list{
  display: block;
}

/* MỖI DÒNG TIN */
.news-item{
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

/* ẢNH */
.news-item img{
  width: 110px;
  height: 75px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

/* TIÊU ĐỀ */
.news-item a{
  font-size: 14px;
  font-weight: 600;
  color: #222;
  text-decoration: none;
  line-height: 1.2;
}

.news-item a:hover{
  color: #0940d9;
  text-decoration: underline;
}

/* MOBILE */
@media (max-width: 600px){
  .news-item img{
    width: 90px;
    height: 65px;
  }
}
/* ===============================
   SIDEBAR – DÙNG CHUNG TOÀN SITE
   =============================== */

.sidebar{
  position: sticky;
  top: 120px;
}

.sidebar-box{
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sidebar-box h3{
  font-size: 16px;
  margin: 0 0 10px;
  padding-left: 8px;
  border-left: 4px solid #0e047d;
  color: #051836;
}

.sidebar-box ul{
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-box ul li{
  margin-bottom: 8px;
}

.sidebar-box a{
  text-decoration: none;
  color: #063687;
}

.sidebar-box a:hover{
  color: #a2072e;
}

/* SIDEBAR ẢNH */
.sidebar-images img{
  width: 100%;
  border-radius: 6px;
  margin-bottom: 4px;
}

.sidebar-images span{
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

/* MOBILE */
@media (max-width: 768px){
  .sidebar{
    position: static;
    margin-top: 20px;
  }
}
.content-wrapper{
  display: grid;
  grid-template-columns: 1fr 320px;
}
/* ===============================
   TỐI ƯU KHOẢNG CÁCH HEADER - MAIN
   =============================== */

.page-header{
  margin-bottom: 3px !important;
  padding-bottom: 6px;
}

.content-wrapper{
  margin-top: 3px !important;
}

.main-content{
  padding-top: 3px;
}

/* ===============================
   MAIN 2 CỘT TRONG CÙNG MAIN
   =============================== */

.main-content{
  padding: 8px;
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
}

/* GRID 2 CỘT */
.main-grid{
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* MOBILE */
@media (max-width: 768px){
  .main-grid{
    grid-template-columns: 1fr;
  }

  .content-right{
    margin-top: 12px;
  }
}
/* ===============================
   ÉP GỌN KHOẢNG CÁCH TRANG INDEX (MOBILE)
   =============================== */
@media (max-width: 768px){

  /* Chữ chạy */
  #running-text-wrapper{
    margin: 0px 0;
    padding: 0;
  }

  /* Dòng thời gian */
  .current-time{
    margin: 3px 0;
    padding: 0;
    line-height: 1.3;
    font-weight: 600;
  }

  /* Banner chúc mừng */
  .img-giua{
    margin: 6px 0 12px;
    padding: 0;
    line-height: 0;
  }

  .img-giua img{
    display: block;
    margin: 0 auto;
  }

  /* Khối tiêu đề + mô tả */
  .intro-box,
  .intro-box h2,
  .intro-box p{
    margin-top: 3px !important;
    margin-bottom: 3px !important;
  }

}

.video-sidebar {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* tỷ lệ 16:9 */
  height: 0;
  overflow: hidden;
}

.video-sidebar iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  border: none;
}
.video-section {
  margin: 25px auto;
  max-width: 900px;
  padding: 0 15px;
}

.video-section h2 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 20px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}
a{
  text-decoration: none;
}
/* ===== SLIDER ẢNH ===== */
.photo-slider img{
  display:block;
  width:100%;
  height:260px;
  object-fit:cover;
}

.slider-note{
  position:absolute;
  bottom:0;
  left:0;
  right:0;

  background:rgba(0,0,0,0.55);
  color:#fff;
  font-size:14px;
  padding:6px 10px;

  z-index:2;
}

/* MOBILE */
@media(max-width:768px){
  .photo-slider img{
    height:200px;
  }
}

.photo-slider-box{
  background:#ffffff;
  border:1px solid #d9d9d9;      /* Viền xám nhạt – chuẩn hành chính */
  border-radius:8px;
  padding:12px;
  display:flex;
  flex-direction:column;
  height:100%;
 }

.photo-slider{
  position:relative;      /* BẮT BUỘC */
  border:2px solid #0a3a5a;
  border-radius:6px;
  overflow:hidden;
  flex:1;                /* kéo ảnh cao bằng khối bài viết */
}

/* Tiêu đề khung */
.photo-slider-box h3{
  font-size:15px;
  font-weight:600;
  color:#0a3a5a;
  border-bottom:1px solid #e0e0e0;
  padding-bottom:6px;
  margin-bottom:10px;
}
.photo-slider:hover{
  border-color:#c40000;          /* Đỏ sẫm – màu chính trị trang trọng */
  transition:0.3s ease;
}
.half-box{
  width:100%;
  margin:0 auto;
}

/* ===== BỐ CỤC 2 KHỐI CAO BẰNG NHAU ===== */
.half-box{
  display:flex;
  gap:16px;
  align-items:stretch;   /* QUAN TRỌNG: kéo cao bằng nhau */
  margin:16px 0;
}

.half-item{
  width:50%;
  display:flex;
  flex-direction:column; /* để nội dung xếp dọc */
}

#recent-posts .container{
  display:flex;
  flex-direction:column;
  height:100%;
}

#recent-posts .news-box{
  flex:1;                /* chiếm hết phần còn lại */
}

@media(max-width:768px){
  .half-box{
    flex-direction:column;
  }

  .half-item{
    width:100%;
  }

}

