:root {
  --navy: #1E293B;
  --navy-light: #334155;
  --blue: #D97757;
  --bg: #FBF9F5;
  --border: #E8E3D9;
  --text: #2B2A27;
  --muted: #78766D;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', -apple-system, sans-serif; font-weight: 700; }
a { color: var(--blue); }
img { max-width: 100%; height: auto; display: block; }

.container-xl { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top utility bar ---------- */
.topbar { background: var(--navy); color: rgba(255,255,255,.85); font-size: .8rem; padding: 6px 0; }
.topbar a { color: rgba(255,255,255,.85); text-decoration: none; margin-left: 14px; }
.topbar .social a { margin-left: 10px; font-size: .95rem; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 800; font-size: 1.35rem; }
.brand i { font-size: 1.6rem; color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-actions .btn-search { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }

/* ---------- Main nav ---------- */
.main-nav { background: linear-gradient(90deg, var(--navy), var(--navy-light)); }
.main-nav .nav-link { color: rgba(255,255,255,.9) !important; font-weight: 600; font-size: .92rem; padding: 13px 16px !important; }
.main-nav .nav-link:hover { background: rgba(255,255,255,.08); }
.main-nav .dropdown-menu { border: none; box-shadow: 0 12px 30px rgba(0,0,0,.15); }

/* ---------- Hero ---------- */
.hero-slide { position: relative; border-radius: 16px; overflow: hidden; min-height: 420px; display: flex; align-items: flex-end; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11,37,69,.92) 0%, rgba(11,37,69,.35) 55%, rgba(11,37,69,.05) 100%); z-index: 1; }
.hero-slide-body { position: relative; z-index: 2; padding: 32px; color: #fff; }
.badge-featured { background: var(--blue); color: #fff; font-weight: 700; letter-spacing: .03em; }
.hero-side-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; gap: 12px; }
.hero-side-card img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

/* ---------- Cards ---------- */
.card-article { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; height: 100%; transition: transform .15s ease, box-shadow .15s ease; }
.card-article:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(11,37,69,.10); }
.card-article .thumb { aspect-ratio: 16/10; overflow: hidden; }
.card-article .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-article .body { padding: 14px 16px; }
.card-article .cat-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--blue); letter-spacing: .04em; }
.card-article .title { font-weight: 700; color: var(--navy); margin: 6px 0; font-size: 1rem; line-height: 1.35; }
.card-article .meta { font-size: .78rem; color: var(--muted); }

.category-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-align: center; text-decoration: none; color: var(--navy); display: block; }
.category-card:hover { box-shadow: 0 10px 24px rgba(11,37,69,.10); }
.category-card i { font-size: 1.8rem; color: var(--blue); margin-bottom: 8px; }
.category-card .count { color: var(--muted); font-size: .78rem; }

/* ---------- Article page ---------- */
.article-hero-img { width: 100%; aspect-ratio: 21/9; object-fit: cover; border-radius: 14px; }
.article-body { font-size: 1.08rem; line-height: 1.85; max-width: 100%; }
.article-body h2 { color: var(--navy); font-weight: 800; margin-top: 2em; }
.article-body h3 { color: var(--navy); font-weight: 700; margin-top: 1.6em; }
.article-body h4 { color: var(--navy); font-weight: 700; font-size: 1.12rem; margin-top: 1.4em; }
.article-body ul, .article-body ol { margin: 0 0 1.2em 0; padding-left: 1.5em; }
.article-body li { margin-bottom: .5em; }
.article-body iframe { max-width: 100%; aspect-ratio: 16/9; height: auto; width: 100%; border-radius: 10px; margin: 1.2em 0; border: 0; }
.article-body p { margin-bottom: 1.2em; }
.article-body img { border-radius: 10px; margin: 1.2em 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.article-body table th, .article-body table td { border: 1px solid var(--border); padding: 8px 12px; }
.article-body blockquote { border-left: 4px solid var(--blue); padding: 10px 18px; background: var(--bg); border-radius: 0 8px 8px 0; color: var(--navy); font-style: italic; }

.toc-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin: 1.6em 0; }
.toc-box a { display: block; padding: 3px 0; color: var(--navy); text-decoration: none; font-size: .93rem; }
.toc-box a:hover { color: var(--blue); }

.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--blue); z-index: 2000; width: 0%; }

/* ---------- Sidebar ---------- */
.sidebar-widget { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 20px; }
.sidebar-widget h6 { color: var(--navy); font-weight: 800; margin-bottom: 14px; text-transform: uppercase; font-size: .8rem; letter-spacing: .04em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); padding: 64px 0 24px; margin-top: 40px; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: 18px; font-family: 'Poppins', -apple-system, sans-serif; letter-spacing: .02em; }
.site-footer a { color: rgba(255,255,255,.65); text-decoration: none; transition: color .2s ease; }
.site-footer a:hover { color: var(--blue); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; font-size: .82rem; color: rgba(255,255,255,.5); }

/* ---------- Tables (rankings, etc.) ---------- */
.table thead { background: var(--bg); }
.table td, .table th { vertical-align: middle; }

/* ---------- Mobile bottom nav ---------- */
.bottom-nav { display: none; }
@media (max-width: 991.98px) {
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
    border-top: 1px solid var(--border); z-index: 1030; padding: 6px 0;
  }
  .bottom-nav a { flex: 1; text-align: center; color: var(--muted); text-decoration: none; font-size: .68rem; padding: 6px 0; }
  .bottom-nav a i { display: block; font-size: 1.2rem; margin-bottom: 2px; }
  .bottom-nav a.active { color: var(--blue); }
  body { padding-bottom: 60px; }
  .hero-slide { min-height: 300px; }
}

/* Prevent horizontal overflow anywhere */
html, body { overflow-x: hidden; }
.table-responsive { -webkit-overflow-scrolling: touch; }
