/*
Theme Name: SEOATP
Theme URI: https://seoatp.com
Author: SEOATP Team
Author URI: https://seoatp.com
Description: Child theme tùy chỉnh cho Flatsome, tối ưu hiển thị bài viết dạng báo điện tử.
Template: flatsome
Version: 1.0.1
Text Domain: seoatp
*/

/* =========================================================
   1️⃣ HEADER (ĐẦU TRANG)
   ========================================================= */

/* === FIX VIỀN XANH DƯ QUANH HEADER === */
.header-wrapper,
.header-container,
.header-main,
.header-nav,
#header,
#masthead {
  border: none !important;
  box-shadow: none !important;
  background: #fff !important;
}

/* === NGĂN STYLE TRONG .single-post ẢNH HƯỞNG RA HEADER === */
.single-post #header .container,
.single-post header .container,
.single-post .header-wrapper .container {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* =========================================================
   2️⃣ BODY & FONT CHUNG
   ========================================================= */

/* ==== FONT MẶC ĐỊNH ==== */
body {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
}

/* === ẨN SIDEBAR === */
.sidebar,
.right-sidebar,
#secondary,
.widget-area,
.blog-sidebar {
  display: none !important;
  visibility: hidden !important;
}

/* =========================================================
   3️⃣ POST (NỘI DUNG BÀI VIẾT)
   ========================================================= */

/* === GIỚI HẠN BÀI VIẾT, KHÔNG TRÀN MÀN HÌNH === */
.single-post #main,
.single-post #content {
  background-color: #f7f7f7 !important;
  padding: 50px 0 !important;
}

/* ✅ KHUNG CHÍNH BÀI VIẾT — có viền xanh nước biển */
.single-post .container,
.single-post .page-wrapper,
.single-post #content,
.single-post #main-content,
.single-post .content-area {
  max-width: 1280px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 40px 40px !important;
  background: #fff !important;
  border: 0.5px solid #0066cc !important; /* 💠 viền xanh nước biển */
  border-radius: 10px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  box-sizing: border-box !important;
}

/* Giữ cấu trúc bên trong full nội dung */
.single-post .row,
.single-post .col,
.single-post .col-inner,
.single-post #primary {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* === TIÊU ĐỀ BÀI VIẾT === */
.single-post h1.entry-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
  width: 100%;
}
.single-post h1.entry-title::after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background: #ff7b00;
  margin: 12px auto 0;
  border-radius: 3px;
}

/* === LINK TRONG BÀI === */
.single-post a {
  color: #0066cc;
  text-decoration: none;
  transition: all 0.2s ease;
}
.single-post a:hover {
  color: #ff7b00;
  text-decoration: underline;
}

/* ===============================
   COMMENT FORM
=============================== */
.single-post #comments,
.single-post #respond {
  background: #fff !important;
  border-radius: 10px;
  padding: 40px;
  border: 1px solid #0066cc !important;
  max-width: 100% !important;
  margin-top: 50px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* =========================================================
   5️⃣ RELATED POSTS (BÀI VIẾT LIÊN QUAN)
   ========================================================= */

.related-posts-wrapper {
  max-width: 1280px;
  margin: 60px auto;
  background: #fff;
  border-radius: 10px;
  border: 0.5px solid #ff7b00;
  padding: 40px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.related-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  position: relative;
}
.related-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #ff7b00;
  margin: 10px auto 0;
  border-radius: 3px;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}
.related-post-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 0.5px solid #ddd;
  transition: all 0.3s ease;
}
.related-post-item:hover {
  transform: translateY(-5px);
  border-color: #ff7b00;
  box-shadow: 0 4px 10px rgba(255, 124, 0, 0.15);
}
.related-thumb {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border-bottom: 0.5px solid #eee;
}
.related-post-title {
  font-size: 1rem;
  color: #333;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  min-height: 60px;
  transition: color 0.2s ease;
}
.related-post-item:hover .related-post-title {
  color: #ff7b00;
}

/* Responsive */
@media (max-width: 1024px) {
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   6️⃣ FOOTER (CHÂN TRANG)
   ========================================================= */

/* === FIX FOOTER MÀU XANH NƯỚC BIỂN === */
#footer,
.footer-wrapper,
.footer,
.site-footer {
  background-color: #0066cc !important; /* 💠 Nền xanh nước biển */
  color: #fff !important;               /* Màu chữ trắng cho dễ đọc */
}

/* === MÀU LINK TRONG FOOTER === */
#footer a,
.footer a {
  color: #ffffff !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}
#footer a:hover,
.footer a:hover {
  color: #ffcc00 !important; /* vàng cam hover */
}

/* === CĂN GIỮA BẢN QUYỀN + CHỮ NHỎ === */
#footer .copyright,
.footer .copyright {
  text-align: center !important;
  font-size: 14px !important;
  opacity: 0.9;
}

/* === ẨN VIỀN NGOÀI / GIỚI HẠN KHUNG === */
#footer .container,
.footer-wrapper .container {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
/* === FIX ICON TRƯỚC TIÊU ĐỀ Ở MOBILE ("Có Lẽ Bạn Sẽ Quan Tâm") === */
@media(max-width:768px){
  .maybe-interested .maybe-grid {
    display: block !important;
  }

  .maybe-interested .maybe-item {
    display: block !important;
    border: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #eee;
  }

  .maybe-interested .maybe-item:last-child {
    border-bottom: none;
  }

  .maybe-interested .maybe-thumb {
    display: none !important;
  }

  .maybe-interested .maybe-title {
    font-size: 16px !important;
    line-height: 1.6 !important;
    font-weight: 500 !important;
    color: #222 !important;
    position: relative !important;
    padding-left: 24px !important;
    display: flex;
    align-items: center; /* ✅ canh icon và chữ cùng hàng */
  }

  .maybe-interested .maybe-title::before {
    content: "✔";
    color: #8b4513;
    font-size: 15px;
    display: inline-block; /* ✅ giúp icon nằm trong dòng */
    margin-right: 8px;     /* ✅ tạo khoảng cách hợp lý */
    vertical-align: middle; /* ✅ canh giữa với chữ */
    transform: none !important;
    position: static !important;
  }

  .maybe-interested .maybe-item:hover .maybe-title {
    color: #a36a2b;
  }
}
/* =========================================================
   🧩 BỔ SUNG PHẦN "CÓ LẼ BẠN SẼ QUAN TÂM" - HIỂN THỊ TIÊU ĐỀ DƯỚI HÌNH
   ✅ KHÔNG ĐỤNG GÌ TỚI CÁC PHẦN KHÁC
========================================================= */

/* --- KHUNG MỖI ITEM --- 
   (Giữ ảnh ở trên, text nằm bên dưới) */
.maybe-interested .maybe-item {
  display: flex !important;              /* bật chế độ flex */
  flex-direction: column !important;     /* xếp dọc: ảnh trên - text dưới */
  align-items: center !important;        /* căn giữa ngang */
  text-align: center !important;         /* chữ căn giữa */
  background: #fff !important;
  border: 1px solid #eee !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  transition: all 0.3s ease;
}

/* --- HIỆU ỨNG KHI HOVER --- */
.maybe-interested .maybe-item:hover {
  transform: translateY(-4px);
  border-color: #d0b49c !important;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* --- ẢNH HIỂN THỊ Ở TRÊN --- */
.maybe-interested .maybe-thumb {
  width: 100% !important;
  height: 160px !important;
  overflow: hidden !important;
}

.maybe-interested .maybe-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;          /* ảnh fill đều */
  transition: transform 0.3s ease;
}

.maybe-interested .maybe-item:hover img {
  transform: scale(1.05);
}

/* --- TIÊU ĐỀ NẰM DƯỚI HÌNH --- */
.maybe-interested .maybe-title {
  display: block !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  font-weight: 500 !important;
  color: #222 !important;
  text-align: center !important;
  padding: 10px 12px 15px !important;
  background: #fff !important;
}

/* --- Khi hover đổi nhẹ màu chữ --- */
.maybe-interested .maybe-item:hover .maybe-title {
  color: #a36a2b !important; /* nâu vàng nhẹ */
}

/* =========================================================
   📱 MOBILE VIEW - HIỂN THỊ 2 CỘT HOẶC 1 CỘT, TEXT DƯỚI ẢNH
========================================================= */
@media (max-width: 768px) {
  /* Lưới 2 cột */
  .maybe-interested .maybe-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }

  /* Căn trái để đọc dễ hơn trên mobile */
  .maybe-interested .maybe-item {
    align-items: flex-start !important;
    text-align: left !important;
    border-radius: 6px !important;
    background: #fff !important;
  }

  .maybe-interested .maybe-title {
    font-size: 16px !important;
    text-align: left !important;
    padding: 8px 10px 12px !important;
  }
}
/* ===============================
   FIX H1 KHÔNG XUỐNG DÒNG (CHỈ TRONG POST)
=============================== */
.single-post h1.entry-title {
  white-space: normal !important;       /* Cho phép xuống dòng */
  word-break: break-word !important;    /* Ngắt từ khi quá dài */
  overflow-wrap: break-word !important; /* Bọc từ hợp lý */
  line-height: 1.3em !important;        /* Cân đối khoảng cách dòng */
  text-align: center !important;        /* (Tùy chọn) căn giữa */
}
/* Ẩn category dài ở đầu bài viết – giữ lại category cuối bài */
.entry-header .entry-category,
.entry-header .entry-category.is-xsmall,
.entry-header-text .entry-category {
    display: none !important;
}
