/* ================================================================
   Torque Converter — GLOBAL STYLESHEET
   Fonts: Space Grotesk (headings) + Inter (body)
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F8FAFC;
  --color-bg-blue: #EFF6FF;
  --color-text: #0F172A;
  --color-text-secondary: #475569;
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-accent-light: #DBEAFE;
  --color-border: #E2E8F0;
  --color-success: #10B981;
  --color-dark: #0A1628;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --spacing-xs: 0.375rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1.25rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 5rem;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(37,99,235,0.15);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --header-height: 82px;
  --transition: all 0.22s ease;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--color-accent-hover); }

ul, ol { list-style: none; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  color: var(--color-text-secondary);
  line-height: 1.85;
  margin-bottom: 1.2rem;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-accent-light);
  color: var(--color-accent-hover);
}

.btn-white {
  background: white;
  color: var(--color-accent);
  font-weight: 700;
}
.btn-white:hover {
  background: #EFF6FF;
  color: var(--color-accent-hover);
  transform: translateY(-2px);
}

.btn-lg { padding: 1rem 2rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ===== BADGE / TAG ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ================================================================
   HEADER
================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 1.125rem 0;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--color-text); }
.site-logo svg { width: 38px; height: 38px; }
.site-logo .logo-accent { color: var(--color-accent); }

/* Desktop Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.nav-cta {
  margin-left: 0.875rem;
  padding: 0.55rem 1.25rem;
  background: var(--color-accent);
  color: white !important;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.nav-cta:hover {
  background: var(--color-accent-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 25px;
  height: 2.5px;
  background: var(--color-text);
  border-radius: 3px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-md);
  z-index: 999;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 0.875rem 0;
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
}
.mobile-nav a:last-child {
  border-bottom: none;
  color: white;
  background: var(--color-accent);
  text-align: center;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  padding: 0.875rem;
  font-weight: 700;
}

/* ================================================================
   FOOTER
================================================================ */
.site-footer {
  background: var(--color-dark);
  color: #94A3B8;
  padding: 4rem 0 0;
  margin-top: 5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-brand .site-logo {
  color: white;
  margin-bottom: 1rem;
}
.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.75;
  max-width: 270px;
  color: #94A3B8;
}

.footer-col h5 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: white;
  margin-bottom: 1.25rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.625rem; }
.footer-col a {
  color: #94A3B8;
  font-size: 0.875rem;
  transition: var(--transition);
  text-decoration: none;
}
.footer-col a:hover { color: #60A5FA; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}
.footer-bottom p {
  font-size: 0.82rem;
  color: #64748B;
  margin: 0;
}

.footer-socials { display: flex; gap: 0.75rem; }
.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.07);
  color: #94A3B8;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition);
  text-decoration: none;
}
.footer-socials a:hover {
  background: var(--color-accent);
  color: white;
  transform: translateY(-2px);
}

/* ================================================================
   BLOG GRID
================================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.blog-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: white;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #BFDBFE;
}

.blog-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.blog-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0.625rem 0;
  line-height: 1.4;
}

.blog-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.read-more-link {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.read-more-link::after { content: '→'; transition: transform 0.2s; }
.blog-card:hover .read-more-link::after { transform: translateX(4px); }

/* ================================================================
   CALCULATOR CTA BANNER (for blog posts)
================================================================ */
.calc-cta-banner {
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  margin: 3rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 8px 32px rgba(37,99,235,0.25);
}
.calc-cta-banner .cta-text h3 {
  color: white;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.calc-cta-banner .cta-text p {
  color: rgba(255,255,255,0.82);
  margin: 0;
  font-size: 0.95rem;
}

/* ================================================================
   ARTICLE PAGE STYLES
================================================================ */
.article-header {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F4FF 100%);
  padding: 3.5rem 0 3rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}

.article-breadcrumb {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.article-breadcrumb a { color: var(--color-accent); }
.article-breadcrumb span { color: #CBD5E1; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  padding: 3rem 0;
}

.article-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
}
.article-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.875rem;
}
.article-body p { font-size: 1.02rem; }
.article-body ul, .article-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  list-style: disc;
}
.article-body ol { list-style: decimal; }
.article-body li {
  color: var(--color-text-secondary);
  line-height: 1.85;
  margin-bottom: 0.5rem;
}

.article-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 2rem 0 0.5rem;
  box-shadow: var(--shadow-md);
}
.img-caption {
  text-align: center;
  font-size: 0.82rem;
  color: #94A3B8;
  margin-bottom: 2rem;
  font-style: italic;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  height: fit-content;
}
.sidebar-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sidebar-card h4 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* Related articles */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.related-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: white;
  transition: var(--transition);
  text-decoration: none;
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.related-card img { height: 140px; width: 100%; object-fit: cover; }
.related-card-body { padding: 1rem; }
.related-card-body h5 { font-size: 0.9rem; color: var(--color-text); line-height: 1.4; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .calc-cta-banner { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .blog-card-img { height: 190px; }
}
