/* ==========================================================================
   Bổ sung cho WordPress (menu, nội dung soạn thảo, bình luận, phân trang, quảng cáo).
   main.css giữ nguyên design system từ bản demo.
   ========================================================================== */

/* Menu chính (wp_nav_menu xuất <ul><li>) */
.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav li a { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-size: .88rem; font-weight: 500; color: var(--c-text-2); white-space: nowrap; }
.main-nav li a:hover { color: var(--c-text); background: var(--c-surface-2); }
.main-nav .current-menu-item > a, .main-nav .current-category-ancestor > a, .main-nav .current-post-ancestor > a { color: var(--c-primary-strong); background: var(--c-primary-50); }
.search-overlay .search-box, .header-search .search-box { width: 100%; }

/* Đã có ảnh đại diện thật */
.thumb.has-img { background: var(--c-surface-2); }
.thumb.has-img::before { display: none; }
.thumb.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-figure { margin: 0 0 var(--sp-5); }
.hero-figure img { width: 100%; height: auto; border-radius: var(--r); }
.hero-figure figcaption { margin-bottom: 0; }

/* Ô ngày chưa có bài */
.day.is-empty { opacity: .5; cursor: default; }
.day.is-empty:hover { border-color: var(--c-border); }

/* Thanh chia sẻ có cả <a> */
.share-bar a {
  border: 0; background: transparent; padding: 6px 4px; border-radius: var(--r-sm);
  display: grid; justify-items: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--c-text-2);
}
.share-bar a:hover { color: var(--c-text); background: var(--c-surface-2); }
.cat-tag:hover { text-decoration: underline; }

/* Nội dung từ trình soạn thảo */
.entry-content > * + * { margin-top: 0; }
.entry-content img { height: auto; border-radius: var(--r-sm); }
.entry-content figure { margin: 0 0 1.2em; }
.entry-content figcaption, .wp-caption-text { font-size: .8rem; color: var(--c-text-3); text-align: center; margin-top: 6px; }
.entry-content blockquote { margin: 0 0 1em; padding: 4px 0 4px 18px; border-left: 4px solid var(--c-accent); color: var(--c-text-2); font-style: italic; }
.entry-content code { background: var(--c-surface-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.entry-content .wp-block-button__link { background: var(--c-primary); color: #fff; border-radius: var(--r-sm); text-decoration: none; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignwide, .alignfull { width: 100%; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; z-index: 999; background: var(--c-surface); padding: 8px 16px; }
.prose .notice p { color: var(--c-text); }

/* Phân trang */
.pagination { margin: var(--sp-6) 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); border-radius: var(--r-sm); background: var(--c-surface); font-weight: 600; font-size: .9rem;
}
.pagination .page-numbers:hover { border-color: var(--c-border-strong); }
.pagination .page-numbers.current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pagination .dots { border: 0; background: none; }

/* Bình luận */
.comments .comment-form { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.comments .comment-form p { margin: 0; }
.comments .comment-form label { font-weight: 600; font-size: .86rem; display: block; margin-bottom: 4px; }
.comments .comment-form input[type="text"], .comments .comment-form input[type="email"], .comments .comment-form input[type="url"] {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text); font: inherit; font-size: .92rem;
}
.comments .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--c-text-2); }
.comments .comment-form-cookies-consent label { font-weight: 400; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { padding-left: var(--sp-5); border-left: 2px solid var(--c-border); }
.comment-body { padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-border); font-size: .94rem; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; }
.comment-author img { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { font-size: .76rem; color: var(--c-text-3); margin: 2px 0 6px 46px; }
.comment-content { margin-left: 46px; }
.comment-content p { margin: 0 0 .6em; }
.reply { margin-left: 46px; font-size: .8rem; font-weight: 600; }
.reply a { color: var(--c-primary-strong); }
.comment-awaiting-moderation { display: block; font-size: .8rem; color: var(--c-accent-strong); margin-left: 46px; }

/* Quảng cáo thật: giữ chỗ để trang không nhảy */
.ad-unit { position: relative; margin: var(--sp-5) 0; min-height: 280px; display: grid; place-items: center; text-align: center; overflow: hidden; }
.ad-unit--home_banner, .ad-unit--archive { min-height: 100px; }
.ad-label { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-3); }
.sidebar .ad-unit, .sidebar .ad-slot { margin: 0; }

/* Thanh quản trị khi đăng nhập */
.admin-bar .site-header { top: 32px; }
.admin-bar .filter-bar { top: calc(var(--header-h) + 32px); }
.admin-bar .progress { top: calc(var(--header-h) + 32px); }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .admin-bar .filter-bar, .admin-bar .progress { top: calc(var(--header-h) + 46px); }
}
@media (max-width: 600px) {
  .admin-bar .site-header { top: 0; }
  .admin-bar .filter-bar, .admin-bar .progress { top: var(--header-h); }
}

.filter-bar form { flex: 0 0 auto; }

/* Ảnh từng bước (chọn trong hộp "Các bước thực hiện") */
.step .step-img.has-img { aspect-ratio: auto; max-width: 560px; margin: 10px 0 0; padding: 0; border: 0; background: none; display: block; }
.step .step-img.has-img img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(480px, 70vh); border-radius: var(--r-sm); }
.follow-body .f-img { display: block; width: auto; max-width: min(560px, 100%); max-height: 38vh; margin: 0 auto var(--sp-4); border-radius: var(--r); object-fit: contain; }
.follow-body .f-img[hidden] { display: none; }
