/* ===========================
   CSS Variables
=========================== */
:root {
  --primary: #1a4fba;
  --primary-dark: #133a8a;
  --primary-light: #e8effe;
  --accent: #f59e0b;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(26,79,186,0.08);
  --shadow-hover: 0 8px 32px rgba(26,79,186,0.15);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --max-width: 1100px;
}

/* ===========================
   Reset & Base
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

/* ===========================
   Header & Nav
=========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.site-nav { display: flex; align-items: center; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links > li > a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-links > li > a:hover,
.nav-links > li > a.nav-active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.dropdown-menu li a.nav-active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Dropdown */
.dropdown { position: relative; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  min-width: 220px;
  list-style: none;
  padding: 8px;
  z-index: 200;
}

.dropdown.active .dropdown-menu { display: block; }

.dropdown-menu li a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.15s;
}

.dropdown-menu li a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ===========================
   Footer
=========================== */
.site-footer {
  background: var(--text);
  color: #cbd5e1;
  padding: 56px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.site-footer .logo { color: #fff; font-size: 1.2rem; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; color: #94a3b8; }

.footer-links h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 8px; }
.footer-links ul li a { color: #94a3b8; font-size: 0.9rem; transition: color 0.2s; }
.footer-links ul li a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-bottom p { font-size: 0.85rem; color: #64748b; }
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #fff; }
.disclaimer { font-size: 0.78rem !important; font-style: italic; }

/* ===========================
   Hero Section
=========================== */
.hero {
  background: linear-gradient(135deg, #1a4fba 0%, #1e3a8a 100%);
  color: #fff;
  padding: 72px 0 64px;
  text-align: center;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero h1 em { font-style: italic; opacity: 0.85; }

.hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-number { font-family: var(--font-display); font-size: 2rem; font-weight: 700; display: block; }
.stat-label { font-size: 0.82rem; opacity: 0.7; }

/* ===========================
   Tool Cards Grid
=========================== */
.tools-section { padding: 64px 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text);
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary);
  text-decoration: none;
}

.tool-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-icon { font-size: 2rem; margin-bottom: 16px; }

.tool-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tool-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

/* ===========================
   Why Section
=========================== */
.why-section {
  background: var(--bg-alt);
  padding: 64px 0;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.why-item { display: flex; flex-direction: column; gap: 8px; }
.why-icon { font-size: 1.5rem; }
.why-item h4 { font-size: 0.95rem; font-weight: 600; }
.why-item p { font-size: 0.88rem; color: var(--text-muted); }

/* ===========================
   Blog Cards
=========================== */
.blog-section { padding: 64px 0; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.blog-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 10px;
}

.blog-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.blog-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 12px; }
.blog-meta { font-size: 0.8rem; color: var(--text-muted); }

/* ===========================
   Tool Page Layout
=========================== */
.tool-page { padding: 48px 0 80px; }

.tool-page-header { margin-bottom: 40px; }
.tool-page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  margin-bottom: 8px;
}
.tool-page-header p { color: var(--text-muted); font-size: 1rem; }

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

.calc-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.calc-box h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 24px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-calc {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-calc:hover { background: var(--primary-dark); }

.result-box {
  margin-top: 24px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  display: none;
}

.result-box.visible { display: block; }

.result-box h3 { font-size: 0.85rem; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.result-amount { font-family: var(--font-display); font-size: 2rem; color: var(--primary-dark); }
.result-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

.sidebar-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar-box h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.sidebar-box ul { list-style: none; }
.sidebar-box ul li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.sidebar-box ul li:last-child { border-bottom: none; }
.sidebar-box ul li a { color: var(--primary); }

/* ===========================
   Blog Page
=========================== */
.blog-page { padding: 48px 0 80px; }
.blog-page-header { margin-bottom: 48px; }
.blog-page-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 8px;
}
.blog-page-header p { color: var(--text-muted); }

/* Article */
.article-page { padding: 48px 0 80px; }
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; }
.article-header { margin-bottom: 32px; }
.article-tag { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); margin-bottom: 12px; display: block; }
.article-header h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 400; line-height: 1.25; margin-bottom: 16px; }
.article-meta { font-size: 0.85rem; color: var(--text-muted); }
.article-body { font-size: 1rem; line-height: 1.8; color: var(--text); }
.article-body h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; margin: 40px 0 16px; }
.article-body h3 { font-size: 1.1rem; font-weight: 600; margin: 28px 0 12px; }
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 8px; }

/* ===========================
   Utility
=========================== */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 32px;
}

.adslot { margin: 32px 0; text-align: center; min-height: 90px; }

/* ===========================
   Responsive
=========================== */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }

  .nav-links.open { display: flex; }
  .nav-links > li { width: 100%; }
  .nav-links > li > a { display: block; padding: 10px 0; }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 12px;
  }

  .dropdown.active .dropdown-menu { display: block; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .tool-layout { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
}
