/*
Theme Name: Hội nhập thời đại
Author: Hội nhập thời đại
Description: Giao diện tin tức điện tử tổng hợp "Hội nhập thời đại", dựng theo bản thiết kế mẫu: trang chủ 6 hàng, trang chuyên mục dạng lưới 2 cột và trang bài viết chi tiết.
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hoinhapthoidai
*/

/* ==============================================================
   Toàn bộ thiết kế gốc nằm ở assets/css/main.css (giữ nguyên bản
   của designer). File này chỉ chứa phần bổ sung riêng cho WordPress.
   ============================================================== */

/* Trợ năng */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link:focus {
  clip: auto;
  clip-path: none;
  height: auto;
  width: auto;
  margin: 0;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  background: #ffffff;
  color: var(--primary-color);
  font-weight: 700;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 100000;
}

/* ==============================================================
   MENU CHÍNH: trạng thái đang xem & menu con do WordPress sinh ra
   ============================================================== */
.main-menu li.current-menu-item > a,
.main-menu li.current-menu-parent > a,
.main-menu li.current-menu-ancestor > a,
.main-menu li.current-post-ancestor > a,
.main-menu li.current-category-ancestor > a,
.main-menu li.current-cat > a,
.main-menu li.current-cat-parent > a,
.main-menu li.current-cat-ancestor > a {
  background-color: var(--primary-hover);
}

.main-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  list-style: none;
  background-color: var(--primary-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: none;
  z-index: 999;
}

.main-menu li:hover > .sub-menu,
.main-menu li:focus-within > .sub-menu {
  display: block;
}

.main-menu .sub-menu li a {
  padding: 10px 14px;
  white-space: normal;
}

/* Tiêu đề dải chuyên mục có gắn link về trang chuyên mục */
.section-heading a,
.section-heading a:hover {
  color: #ffffff;
}

/* ==============================================================
   QUẢNG CÁO: ô chứa mã nhúng (AdSense, iframe...)
   ============================================================== */
.ad-code {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.ad-code iframe,
.ad-code ins {
  max-width: 100%;
}

/* ==============================================================
   NỘI DUNG BÀI VIẾT / TRANG do trình soạn thảo WordPress sinh ra
   ============================================================== */
/* Ảnh căn trái/phải trong bài không được tràn xuống các khối phía dưới.
   (Không dùng clearfix trên .entry-content vì sẽ làm lệch khoảng cách so với thiết kế.) */
.article-signature,
.article-source-box,
.article-tags-box,
.article-content .social-share-bar,
.related-posts-section,
.page-links {
  clear: both;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #1a202c;
  margin: 22px 0 12px;
}

.entry-content h2 { font-size: 20px; }
.entry-content h3 { font-size: 18px; }
.entry-content h4 { font-size: 16px; }
.entry-content h5,
.entry-content h6 { font-size: 15px; }

.entry-content ul,
.entry-content ol {
  margin: 0 0 16px 24px;
  line-height: 1.8;
  color: #2d3748;
}

.entry-content li > ul,
.entry-content li > ol {
  margin-bottom: 0;
}

.entry-content a {
  color: var(--primary-color);
}

.entry-content a:hover {
  text-decoration: underline;
}

.entry-content img {
  border-radius: 4px;
}

.entry-content figure,
.entry-content .wp-caption {
  max-width: 100%;
  margin: 22px 0;
  text-align: center;
}

.entry-content figure img,
.entry-content .wp-caption img,
.entry-content img.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.entry-content figcaption,
.entry-content .wp-caption-text {
  font-size: 13px;
  font-style: italic;
  color: #64748b;
  margin-top: 8px;
  margin-bottom: 16px;
  text-align: center;
}

.entry-content .aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.entry-content .alignleft {
  float: left;
  max-width: 50%;
  margin: 6px 20px 12px 0;
}

.entry-content .alignright {
  float: right;
  max-width: 50%;
  margin: 6px 0 12px 20px;
}

.entry-content blockquote {
  margin: 0 0 16px;
  padding: 12px 18px;
  background: #f8fafc;
  border-left: 3px solid var(--primary-color);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: #334155;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  text-align: left;
}

.entry-content th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content object {
  max-width: 100%;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 22px 0;
}

.entry-content pre {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  overflow-x: auto;
}

.page-links {
  margin: 16px 0;
  font-family: var(--font-heading);
  font-weight: 600;
  color: #334155;
}

.page-links a,
.page-links > span {
  margin-left: 6px;
}

/* Thanh chia sẻ lặp lại ở cuối bài */
.social-share-bar.is-bottom {
  margin-top: 20px;
  border-bottom: none;
  padding-bottom: 0;
}

/* ==============================================================
   PHÂN TRANG: dùng lại kiểu .pagination-item của bản thiết kế
   ============================================================== */
.pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  transition: all 0.2s ease;
}

.pagination-wrapper a.page-numbers:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination-wrapper .page-numbers.current {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

.pagination-wrapper .page-numbers.dots {
  border-color: transparent;
  min-width: 0;
  padding: 0 2px;
}

/* ==============================================================
   TRẠNG THÁI RỖNG, TRANG 404, Ô TÌM KIẾM TRONG TRANG
   ============================================================== */
.no-results {
  padding: 30px 0;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
}

.error-404 {
  padding: 50px 0 60px;
  text-align: center;
}

.error-404 .error-code {
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.error-404 .article-title {
  margin-bottom: 8px;
}

.error-404 .error-home-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--primary-color);
}

.inline-search-form {
  display: flex;
  gap: 6px;
  max-width: 420px;
  margin: 20px auto 0;
}

.inline-search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13.5px;
  outline: none;
}

.inline-search-form input[type="search"]:focus {
  border-color: var(--primary-color);
}

.inline-search-form button {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
}

/* ==============================================================
   CHÂN TRANG
   ============================================================== */
.footer-content-block a:hover {
  color: var(--primary-color);
}

.footer-bottom-copy {
  border-top: 1px solid var(--border-color);
}

/* ==============================================================
   MOBILE
   ============================================================== */
@media (max-width: 768px) {
  .main-menu .sub-menu {
    position: static;
    display: block;
    min-width: 0;
    box-shadow: none;
    background-color: rgba(0,0,0,0.12);
  }

  .main-menu .sub-menu li a {
    padding: 10px 16px 10px 30px;
  }

  .entry-content .alignleft,
  .entry-content .alignright {
    float: none;
    max-width: 100%;
    margin: 16px auto;
  }
}
