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

:root {
  --primary: #0f2847;
  --primary-dark: #081a33;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --text: #1f2937;
  --text-light: #4b5563;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-alt: #f1f5f9;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(15, 40, 71, 0.05);
  --shadow: 0 4px 12px rgba(15, 40, 71, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 40, 71, 0.12);
  --radius: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  --transition: all 0.25s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ HEADER ============ */
.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 20px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary) !important;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.main-nav ul {
  display: flex;
  gap: 32px;
}
.main-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  position: relative;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.main-nav a:hover::after { width: 100%; }
.main-nav a:hover { color: var(--primary); }

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.mobile-toggle .bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}
.mobile-toggle.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-toggle.active .bar:nth-child(2) { opacity: 0; }
.mobile-toggle.active .bar:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.progress-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.1s linear;
}

/* ============ ARTICLE LAYOUT ============ */
.article-wrapper {
  padding: 40px 0 60px;
}

.article-grid {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 40px;
  align-items: start;
}

.article-main {
  background: var(--bg);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-width: 100%;
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.category-tag {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  color: var(--primary-dark);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-hero {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}
.hero-placeholder {
  aspect-ratio: 2 / 1;
  width: 100%;
}
.hero-placeholder svg { width: 100%; height: 100%; }

/* ============ ARTICLE CONTENT ============ */
.article-section {
  margin-bottom: 36px;
}
.article-section:last-of-type { margin-bottom: 0; }

.article-section h2 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.5vw, 28px);
  color: var(--primary);
  margin-bottom: 16px;
  padding-top: 12px;
  letter-spacing: -0.3px;
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  scroll-margin-top: 90px;
}

.article-section h3 {
  font-size: 19px;
  color: var(--primary-dark);
  margin: 20px 0 10px;
  font-weight: 700;
  scroll-margin-top: 90px;
}

.article-section p {
  margin-bottom: 16px;
  color: var(--text);
}

.article-section ul {
  list-style: none;
  padding-left: 0;
  margin: 12px 0 20px;
}
.article-section ul li {
  position: relative;
  padding: 8px 0 8px 28px;
  line-height: 1.6;
}
.article-section ul li::before {
  content: '✓';
  position: absolute;
  left: 0; top: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.article-section a {
  color: var(--accent-hover);
  font-weight: 600;
  border-bottom: 1px solid transparent;
}
.article-section a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============ TOC ============ */
.toc-wrapper {
  position: relative;
}
.toc-sticky {
  position: sticky;
  top: 100px;
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.toc-title {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toc-list {
  counter-reset: toc;
  padding: 0;
}
.toc-list li {
  counter-increment: toc;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
}
.toc-list a {
  color: var(--text-light);
  display: block;
  padding: 4px 0;
  transition: var(--transition);
}
.toc-list a::before {
  content: counter(toc) ". ";
  color: var(--accent);
  font-weight: 600;
}
.toc-list a:hover, .toc-list a.active {
  color: var(--primary);
  font-weight: 500;
  transform: translateX(4px);
}

/* ============ SIDEBAR ============ */
.sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-card {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.sidebar-card h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 12px;
}
.business-tagline {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 14px;
}
.contact-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.contact-list a {
  color: var(--primary);
  font-weight: 500;
  word-break: break-all;
}
.contact-list a:hover { color: var(--accent); }

.summary-list li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-light);
}

/* ============ CTA BOX ============ */
.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  margin-top: 40px;
  text-align: center;
}
.cta-box h3 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin-bottom: 12px;
  color: white;
}
.cta-box p {
  margin-bottom: 24px;
  opacity: 0.9;
}
.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--primary-dark) !important;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}
.btn-secondary {
  background: transparent;
  color: white !important;
  border: 2px solid white;
}
.btn-secondary:hover {
  background: white;
  color: var(--primary) !important;
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 90;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  color: var(--primary-dark);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--primary-dark);
  color: #cbd5e1;
  padding: 60px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: white;
  font-size: 16px;
  margin-bottom: 16px;
  font-weight: 700;
}
.footer-col p {
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
}
.footer-col ul li {
  margin-bottom: 10px;
  font-size: 14px;
  color: #94a3b8;
}
.footer-col a {
  color: #cbd5e1;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid #1e3a5f;
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: 1fr 300px;
  }
  .toc-wrapper { display: none; }
  .article-main { padding: 36px 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    box-shadow: var(--shadow);
    padding: 20px;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border-top: 1px solid var(--border);
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 16px;
  }
  .article-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sidebar { position: static; }
  .article-main { padding: 28px 20px; }
  .article-section h2 { font-size: 22px; padding-left: 12px; }
  .cta-box { padding: 28px 20px; }
  .cta-box h3 { font-size: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-col { text-align: center; }
  body { font-size: 16px; }
}

@media (max-width: 480px) {
  .article-meta { gap: 10px; font-size: 13px; }
  .btn { padding: 11px 20px; font-size: 14px; width: 100%; }
  .cta-buttons { flex-direction: column; }
  .back-to-top { width: 42px; height: 42px; right: 16px; bottom: 16px; }
}