/* =========================================================================
   SEO TOP 1 Magazine — CSS chính
   Bảng màu/tuỳ chọn font đồng bộ với chính phần mềm SEO TOP 1 (xanh đậm
   #0d4a2e làm màu thương hiệu, cam đất #b45309 làm điểm nhấn) để khách hàng
   thấy blog và phần mềm là cùng 1 hệ sinh thái.
   ========================================================================= */

:root {
  --c-green: #0d4a2e;
  --c-green-dark: #0a3a24;
  --c-green-bg: #e8f5ee;
  --c-amber: #b45309;
  --c-amber-bg: #fdf1e6;
  --c-navy: #1e3a5f;
  --c-navy-bg: #eef2ff;
  --c-teal: #0f766e;
  --c-teal-bg: #f0fdfa;
  --c-purple: #6d28d9;
  --c-purple-bg: #f5f3ff;
  --c-ink: #1f2937;
  --c-muted: #6b7280;
  --c-faint: #9ca3af;
  --c-border: #e5e7eb;
  --c-bg: #f8f9fb;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---- Thanh tiện ích trên cùng ---- */
.s1-topbar {
  background: var(--c-green);
  color: #eafff2;
  font-size: 13px;
  padding: 8px 0;
}
.s1-topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.s1-topbar a { font-weight: 600; color: #fff; }

/* ---- Header / menu chính ---- */
.s1-header { background: #fff; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 40; }
.s1-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 16px; padding-bottom: 16px; }

.s1-logo { display: flex; align-items: center; gap: 10px; }
.s1-logo-mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--c-green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.s1-logo-text { font-weight: 700; font-size: 18px; line-height: 1.1; color: var(--c-ink); }
.s1-logo-text span { color: var(--c-green); }
.s1-logo-tagline { font-size: 11px; color: var(--c-faint); }

.s1-nav-primary { display: none; }
.s1-nav-primary ul { display: flex; gap: 30px; list-style: none; }
.s1-nav-primary a { font-size: 15px; font-weight: 500; color: #374151; }
.s1-nav-primary a:hover, .s1-nav-primary .current-menu-item > a { color: var(--c-green); }

.s1-header-actions { display: flex; align-items: center; gap: 16px; }
.s1-search-icon {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #d1d5db;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s1-btn-cta {
  background: var(--c-green); color: #fff; border: none; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  display: inline-block;
}
.s1-btn-cta:hover { background: var(--c-green-dark); color: #fff; }

.s1-menu-toggle {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; color: var(--c-ink);
}

@media (min-width: 1024px) {
  .s1-nav-primary { display: block; }
  .s1-menu-toggle { display: none; }
}

/* ---- Menu điện thoại/tablet (đúng kiểu 3 gạch xổ ra như chính phần mềm) ---- */
.s1-mobile-menu {
  position: fixed; inset: 0 0 0 auto; width: 300px; max-width: 82vw; background: #fff;
  transform: translateX(100%); transition: transform .2s ease; z-index: 60;
  box-shadow: -10px 0 30px rgba(0,0,0,.12); padding: 20px; overflow-y: auto;
}
.s1-mobile-menu.is-open { transform: translateX(0); }
.s1-mobile-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: none;
}
.s1-mobile-backdrop.is-open { display: block; }
.s1-mobile-menu ul { list-style: none; display: flex; flex-direction: column; }
.s1-mobile-menu a { display: block; padding: 12px 4px; font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--c-border); }
.s1-mobile-close { background: none; border: none; margin-bottom: 12px; cursor: pointer; color: var(--c-ink); }

@media (min-width: 1024px) {
  .s1-mobile-menu, .s1-mobile-backdrop { display: none !important; }
}

/* ---- Hero (bài nổi bật) ---- */
.s1-hero { background: linear-gradient(135deg, var(--c-green), var(--c-green-dark)); padding: 48px 0; }
.s1-hero .container { display: flex; gap: 48px; align-items: center; flex-wrap: wrap; }
.s1-hero-main { flex: 1 1 420px; }
.s1-hero-main h1 { color: #fff; font-size: 40px; line-height: 1.2; max-width: 620px; }
.s1-hero-main p { color: #c9e6d5; font-size: 16px; max-width: 560px; }
.s1-hero-meta { color: #8fc7a8; font-size: 13px; }
.s1-hero-visual { flex: 1 1 320px; background: var(--c-green-dark); border-radius: 16px; padding: 28px; box-shadow: 0 20px 40px rgba(0,0,0,.25); min-height: 180px; }

/* ---- Badge danh mục (5 tông màu luân phiên theo category) ---- */
.s1-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .02em; padding: 5px 12px; border-radius: 999px; text-transform: uppercase; }
.s1-tag--0 { background: var(--c-green-bg); color: var(--c-green); }
.s1-tag--1 { background: var(--c-amber-bg); color: var(--c-amber); }
.s1-tag--2 { background: var(--c-navy-bg); color: var(--c-navy); }
.s1-tag--3 { background: var(--c-teal-bg); color: var(--c-teal); }
.s1-tag--4 { background: var(--c-purple-bg); color: var(--c-purple); }
.s1-tag--hero { background: var(--c-amber); color: #fff; }

/* ---- Bố cục nội dung + sidebar ---- */
.s1-layout { display: flex; gap: 48px; padding: 48px 0; align-items: flex-start; flex-wrap: wrap; }
.s1-main { flex: 2 1 620px; min-width: 0; }
.s1-sidebar { flex: 1 1 300px; display: flex; flex-direction: column; gap: 28px; }

.s1-section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.s1-section-heading h2 { font-size: 24px; }
.s1-section-heading a { color: var(--c-green); font-size: 14px; font-weight: 600; text-decoration: underline; }

.s1-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
@media (max-width: 640px) { .s1-grid { grid-template-columns: 1fr; } }

.s1-card { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.s1-card-thumb { height: 150px; display: flex; align-items: center; justify-content: center; }
.s1-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.s1-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.s1-card-body h3 { font-size: 18px; line-height: 1.35; }
.s1-card-body h3 a:hover { color: var(--c-green); }
.s1-card-excerpt { color: var(--c-muted); font-size: 14px; line-height: 1.5; }
.s1-card-meta { color: var(--c-faint); font-size: 12px; margin-top: auto; }

/* ---- Sidebar: bài phổ biến, danh mục, CTA ---- */
.s1-widget { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 22px; }
.s1-widget h3 { font-size: 16px; margin-bottom: 14px; }
.s1-popular-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.s1-popular-item:last-child { margin-bottom: 0; }
.s1-popular-num { font-family: var(--font-display); font-weight: 600; color: var(--c-green); font-size: 20px; line-height: 1; }
.s1-popular-item a { font-size: 14px; line-height: 1.4; }
.s1-popular-item a:hover { color: var(--c-green); }

.s1-cat-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.s1-cat-list a { font-size: 13px; padding: 6px 12px; border-radius: 999px; display: inline-block; }

.s1-cta-box { background: var(--c-green); border-radius: 12px; padding: 26px; color: #fff; }
.s1-cta-box h3 { font-size: 18px; margin-bottom: 10px; }
.s1-cta-box p { font-size: 13px; color: #c9e6d5; margin-bottom: 18px; }
.s1-cta-box .s1-btn-cta { background: #fff; color: var(--c-green); width: 100%; text-align: center; }
.s1-cta-box .s1-btn-cta:hover { background: #eafff2; }

/* ---- Banner CTA giữa trang ---- */
.s1-cta-banner { margin: 24px 0 48px; background: #123f2b; border-radius: 16px; padding: 36px 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; color: #fff; }
.s1-cta-banner h3 { font-size: 22px; }
.s1-cta-banner p { color: #c9e6d5; font-size: 14px; margin: 6px 0 0; }
.s1-cta-banner .s1-btn-cta { background: var(--c-amber); padding: 14px 26px; font-size: 15px; }
.s1-cta-banner .s1-btn-cta:hover { background: #99460a; }

/* ---- Bài viết đơn (single.php) ---- */
.s1-article-header { max-width: 780px; margin: 0 auto 32px; text-align: left; }
.s1-article-header h1 { font-size: 34px; line-height: 1.25; }
.s1-article-meta { color: var(--c-faint); font-size: 13px; margin-top: 10px; }
.s1-article-content { max-width: 780px; margin: 0 auto; font-size: 17px; line-height: 1.75; color: #1f2937; }
.s1-article-content h2 { font-size: 24px; margin-top: 1.6em; }
.s1-article-content h3 { font-size: 19px; margin-top: 1.4em; }
.s1-article-content img { border-radius: 10px; margin: 1.2em 0; }
.s1-article-content ul, .s1-article-content ol { margin: 0 0 1.2em 1.4em; }
.s1-article-content a { color: var(--c-green); text-decoration: underline; }

/* ---- Trang thường (page.php) ---- */
.s1-page-content { max-width: 820px; margin: 0 auto; padding: 48px 0; font-size: 17px; line-height: 1.75; }
.s1-page-content h1 { font-size: 32px; margin-bottom: 24px; }

/* ---- Trang "Hướng dẫn sử dụng" (page-huongdan.php) ---- */
.s1-guide-hero { text-align: center; padding: 56px 0 32px; }
.s1-guide-hero h1 { font-size: 34px; max-width: 700px; margin: 0 auto 14px; }
.s1-guide-hero p { color: var(--c-muted); max-width: 600px; margin: 0 auto; }
.s1-guide-pdf-btn { margin-top: 22px; }
.s1-guide-group { padding: 12px 0 36px; }
.s1-guide-group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 19px; font-weight: 700; }
.s1-guide-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.s1-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
@media (max-width: 700px) { .s1-guide-grid { grid-template-columns: 1fr; } }
.s1-guide-card { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 20px; display: flex; gap: 14px; }
.s1-guide-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 20px; }
.s1-guide-card h4 { font-size: 16px; margin-bottom: 4px; }
.s1-guide-card p { font-size: 13.5px; color: var(--c-muted); line-height: 1.5; margin-bottom: 8px; }
.s1-guide-card ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.s1-guide-card li { font-size: 13px; color: #4b5563; padding-left: 16px; position: relative; }
.s1-guide-card li::before { content: '✓'; position: absolute; left: 0; color: var(--c-green); font-weight: 700; }

/* ---- Footer ---- */
.s1-footer { background: #101828; color: #d1d5db; padding: 48px 0 24px; margin-top: 24px; }
.s1-footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .s1-footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .s1-footer-cols { grid-template-columns: 1fr; } }
.s1-footer h4 { color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.s1-footer-about { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.s1-footer-about span { color: #fff; font-weight: 700; font-size: 16px; }
.s1-footer p { font-size: 13px; color: #9ca3af; max-width: 320px; }
.s1-footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.s1-footer-bottom { border-top: 1px solid #1f2937; margin-top: 32px; padding-top: 18px; font-size: 12px; color: #6b7280; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- Phân trang ---- */
.s1-pagination { display: flex; justify-content: center; gap: 10px; padding: 12px 0 40px; }
.s1-pagination a, .s1-pagination span { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--c-border); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.s1-pagination .current { background: var(--c-green); color: #fff; border-color: var(--c-green); }

/* ---- Ô tìm kiếm mặc định của WordPress ---- */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: 8px; font-family: var(--font-body); }
.search-form input[type="submit"] { background: var(--c-green); color: #fff; border: none; border-radius: 8px; padding: 0 18px; font-weight: 600; cursor: pointer; }
