/*
Theme Name: Kế Toán Biên Hòa
Theme URI: http://ketoanbienhoa.local/
Author: Vibe code (from Claude Design handoff)
Description: Theme dịch vụ kế toán – pháp lý doanh nghiệp tại Biên Hòa, Đồng Nai. Trang chủ + 27 trang dịch vụ 5W1H, dựng từ bộ thiết kế Claude Design (high-fidelity).
Version: 1.3.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: ketoanbienhoa
*/

/* ============================================================
   Base / reset  (giữ đúng token thiết kế)
   ============================================================ */
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', sans-serif;
  background: #fdfdfc;
  color: #15243b;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
a { color: #1d4e89; text-decoration: none; }
a:hover { color: #0d2c54; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes kbFaqIn { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
@keyframes kbMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes kbPulse {
  0%   { box-shadow: 0 6px 18px rgba(245,185,66,0.45), 0 0 0 0 rgba(245,185,66,0.5); }
  70%  { box-shadow: 0 6px 18px rgba(245,185,66,0.45), 0 0 0 16px rgba(245,185,66,0); }
  100% { box-shadow: 0 6px 18px rgba(245,185,66,0.45), 0 0 0 0 rgba(245,185,66,0); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================================================
   Mega menu (desktop hover)
   ============================================================ */
.nav-group { position: relative; }
.nav-dropdown {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: #ffffff; border: 1px solid #e4e9f0; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(13,44,84,0.12); padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 60;
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

/* Marquee pause on hover */
.marquee-track:hover { animation-play-state: paused; }

/* Service cards (home) – navy overlay reveal on hover */
.service-card { transition: border-color .3s ease; }
.service-card:hover { border-color: #0d2c54; }
.service-overlay {
  clip-path: inset(30px calc(100% - 72px) calc(100% - 74px) 28px round 10px);
  transition: clip-path 0.8s cubic-bezier(0.87, 0, 0.13, 1);
}
.service-card:hover .service-overlay { clip-path: inset(0px 0px 0px 0px round 14px); }

/* Mobile nav toggle hidden on desktop */
.nav-toggle { display: none; }
.mobile-nav { display: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .desktop-nav { display: none !important; }
  .header-cta { display: none !important; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: auto; border: 1px solid #e4e9f0;
    border-radius: 9px; background: #fff; cursor: pointer; color: #0d2c54;
  }
  .mobile-nav {
    display: block; position: fixed; inset: 0; z-index: 200;
    background: rgba(9,31,61,0.55); opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
  }
  .mobile-nav.open { opacity: 1; visibility: visible; }
  .mobile-nav__panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(340px, 86vw);
    background: #fff; padding: 20px; overflow-y: auto;
    transform: translateX(100%); transition: transform .28s ease;
    display: flex; flex-direction: column; gap: 4px;
  }
  .mobile-nav.open .mobile-nav__panel { transform: translateX(0); }
  .mobile-nav__group > a { font-weight: 700; color: #0d2c54; padding: 12px 8px; display: block; }
  .mobile-nav__sub a { display: block; padding: 8px 18px; font-size: 14px; color: #3a4a61; }

  /* Hero: reduce sizes */
  .home-hero h1 { font-size: 32px !important; }
  .svc-hero h1 { font-size: 30px !important; }

  /* Why-us pinned section → static stacking on mobile */
  .why-wrap { height: auto !important; background: #f2f5fa; }
  .why-sticky { position: static !important; height: auto !important; padding: 64px 0; }
  .why-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .why-track { flex-wrap: wrap !important; transform: none !important; }
  .why-track > div { flex: 1 1 100% !important; height: auto !important; min-height: 300px; }
  .why-progress { display: none !important; }
}

@media (max-width: 900px) {
  /* Trang báo giá: timeline 8 bước → 2 cột */
  .svc-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 760px) {
  /* Bảng giá: bỏ header, xếp dọc từng dòng và tự gắn nhãn cột */
  .bg-price-head { display: none !important; }
  .bg-price-row { grid-template-columns: 1fr !important; gap: 10px; padding: 18px 20px; }
  .bg-price-row > div { padding: 0 !important; text-align: left !important; }
  .bg-price-row > div[data-lbl]::before {
    content: attr(data-lbl); display: block; margin-bottom: 3px;
    font-size: 11px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: #8a99ad;
  }
  .bg-price-row > div[data-lbl="Giá"] span { display: inline-block !important; }
}

@media (max-width: 620px) {
  .grid-2-mobile-1 { grid-template-columns: 1fr !important; }
  .svc-section-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .svc-grid-3, .svc-grid-4 { grid-template-columns: 1fr !important; }
  .comparison-table { font-size: 12px; }
}

/* ============================================================
   Blog / Tin tức
   ============================================================ */

/* --- Nội dung bài viết --- */
/* min-width:0 để cột grid không bị bảng (min-width 520px) đẩy phình trên mobile. */
.post-body { max-width: 780px; min-width: 0; font-size: 16.5px; line-height: 1.78; color: #2c3a4f; }
.post-body > p { margin: 0 0 20px; }
.post-body .lead {
  font-size: 18px; line-height: 1.7; color: #3a4a61;
  padding: 18px 22px; background: #f2f5fa; border-left: 4px solid #f5b942;
  border-radius: 0 10px 10px 0; margin: 0 0 30px;
}
.post-body h2 {
  font-size: 26px; font-weight: 800; color: #0d2c54; letter-spacing: -0.3px;
  line-height: 1.3; margin: 44px 0 16px; scroll-margin-top: 100px; text-wrap: pretty;
}
.post-body h3 {
  font-size: 19.5px; font-weight: 700; color: #15243b;
  line-height: 1.4; margin: 30px 0 12px; text-wrap: pretty;
}
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 22px; }
.post-body li { margin-bottom: 10px; }
.post-body ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.post-body ol.steps > li { position: relative; padding: 0 0 0 46px; margin-bottom: 16px; }
.post-body ol.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 8px;
  background: #0d2c54; color: #f5b942;
  font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.post-body a { color: #1d4e89; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(29,78,137,.32); text-underline-offset: 2px; }
.post-body a:hover { color: #0d2c54; text-decoration-color: #0d2c54; }
.post-body strong { color: #15243b; }
.post-body img { border-radius: 12px; }

/* Bảng */
.post-body .tbl-wrap { overflow-x: auto; margin: 0 0 26px; border-radius: 12px; border: 1px solid #e4e9f0; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; min-width: 520px; }
.post-body thead th { background: #0d2c54; color: #fff; text-align: left; font-weight: 700; padding: 13px 16px; font-size: 14px; }
.post-body tbody td { padding: 13px 16px; border-top: 1px solid #e9edf3; vertical-align: top; color: #3a4a61; }
.post-body tbody tr:nth-child(even) td { background: #f8fafc; }

/* Khung ghi chú + CTA trong bài */
.post-body .callout { background: #fff8e8; border: 1px solid #f3ddaa; border-radius: 12px; padding: 18px 22px; margin: 0 0 26px; }
.post-body .callout p { margin: 0; font-size: 15.5px; color: #5c4a1c; }
.post-body .cta-box {
  background: linear-gradient(135deg, #0d2c54 0%, #1d4e89 100%);
  border-radius: 14px; padding: 28px 30px; margin: 36px 0 30px; color: #e6edf6;
}
.post-body .cta-box p { margin: 0 0 16px; font-size: 15.5px; line-height: 1.7; }
.post-body .cta-box p:last-child { margin: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.post-body .cta-box strong { color: #fff; }
.post-body .btn {
  display: inline-block; background: #f5b942; color: #0d2c54;
  padding: 12px 22px; border-radius: 9px; font-size: 14.5px; font-weight: 700;
  text-decoration: none; transition: background .25s ease;
}
.post-body .btn:hover { background: #ffca55; color: #0d2c54; }
.post-body .btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.45); }
.post-body .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Khối thông tin liên hệ cuối bài (shortcode ktbh_lienhe) */
.ktbh-contact-card {
  border: 1px solid #e4e9f0; border-radius: 14px; background: #fff;
  padding: 26px 28px; margin: 0 0 12px; box-shadow: 0 8px 24px rgba(13,44,84,.06);
}
.ktbh-contact-card__head { border-bottom: 1px solid #eef1f6; padding-bottom: 14px; margin-bottom: 16px; }
.ktbh-contact-card__brand { display: block; font-size: 19px; font-weight: 800; color: #0d2c54; }
.ktbh-contact-card__tag { display: block; font-size: 14px; color: #8a99ad; margin-top: 3px; }
.ktbh-contact-card__list { list-style: none; margin: 0 0 18px !important; padding: 0 !important; }
.ktbh-contact-card__list li { margin-bottom: 9px; font-size: 15.5px; color: #3a4a61; }
.ktbh-contact-card__list strong { color: #0d2c54; }
.ktbh-contact-card__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.ktbh-contact-card__cta .btn-ghost { color: #0d2c54; border-color: #d7dfe9; }
.ktbh-contact-card__cta .btn-ghost:hover { background: #f0f4f9; color: #0d2c54; }

/* --- Mục lục --- */
.post-toc { background: #f2f5fa; border: 1px solid #e4e9f0; border-radius: 14px; padding: 22px 26px; margin: 0 0 34px; }
.post-toc__title { font-size: 13px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #1d4e89; margin-bottom: 12px; }
.post-toc ol { margin: 0; padding-left: 20px; font-size: 15px; }
.post-toc li { margin-bottom: 8px; }
.post-toc a { color: #3a4a61; text-decoration: none; }
.post-toc a:hover { color: #0d2c54; text-decoration: underline; }

/* --- Sidebar bài viết --- */
.post-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
.post-side__box { background: #fff; border: 1px solid #e4e9f0; border-radius: 14px; padding: 22px 24px; }
.post-side__box--dark { background: #0d2c54; border-color: #0d2c54; }
.post-side__title { font-size: 16px; font-weight: 800; color: #0d2c54; margin-bottom: 14px; }
.post-side__links { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.post-side__links a { font-size: 14.5px; color: #3a4a61; }
.post-side__links a:hover { color: #0d2c54; }
.post-side__cta { display: block; text-align: center; background: #f5b942; color: #0d2c54; padding: 12px; border-radius: 9px; font-size: 14.5px; font-weight: 700; }
.post-side__cta:hover { background: #ffca55; color: #0d2c54; }
.post-side__phone { display: block; text-align: center; background: #f5b942; color: #0d2c54; padding: 12px; border-radius: 9px; font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.post-side__phone:hover { background: #ffca55; color: #0d2c54; }
.post-side__zalo { display: block; text-align: center; border: 1.5px solid rgba(255,255,255,.45); color: #fff; padding: 11px; border-radius: 9px; font-size: 14.5px; font-weight: 600; }
.post-side__zalo:hover { background: rgba(255,255,255,.1); color: #fff; }

/* --- Danh sách bài viết --- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }
.post-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid #e4e9f0;
  border-radius: 14px; overflow: hidden; text-decoration: none;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(13,44,84,.12); border-color: #0d2c54; }
.post-card img { width: 100%; height: auto; display: block; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.post-card__date { font-size: 12.5px; color: #8a99ad; font-weight: 600; letter-spacing: .4px; }
.post-card__title { font-size: 17px; font-weight: 700; color: #0d2c54; line-height: 1.4; text-wrap: pretty; }
.post-card__excerpt { font-size: 14.5px; color: #5a6b82; line-height: 1.6; }
.post-card__more { font-size: 14px; font-weight: 700; color: #1d4e89; margin-top: 4px; }

.post-pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.post-pager__item {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 9px;
  border: 1px solid #e4e9f0; background: #fff; color: #3a4a61;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14.5px; font-weight: 600;
}
.post-pager__item:hover { border-color: #0d2c54; color: #0d2c54; }
.post-pager__item.is-current { background: #0d2c54; border-color: #0d2c54; color: #fff; }

@media (max-width: 980px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 36px !important; }
  .post-side { position: static; }
}
@media (max-width: 620px) {
  .post-body { font-size: 16px; }
  .post-body table { min-width: 460px; font-size: 14px; }
  .post-body thead th, .post-body tbody td { padding: 11px 13px; }
  .post-body h2 { font-size: 22px; margin-top: 36px; }
  .post-body h3 { font-size: 18px; }
  .post-body .cta-box { padding: 22px 20px; }
  .ktbh-contact-card { padding: 22px 20px; }
}

/* Ảnh minh hoạ trong bài viết */
.post-body .post-fig { margin: 0 0 30px; }
.post-body .post-fig img { display: block; width: 100%; height: auto; border-radius: 12px; }
.post-body .post-fig figcaption {
  margin-top: 10px; padding-left: 12px; border-left: 3px solid #f5b942;
  font-size: 13.5px; line-height: 1.6; color: #7c8ba1; font-style: italic;
}
