/*
Theme Name: CalcHub Theme
Theme URI: https://www.calchub.website
Author: CalcHub
Author URI: https://www.calchub.website
Description: Custom WordPress theme for CalcHub - Free Online Calculators. Matches calchub.website exactly.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: calchub
*/

/* =========================================
   CSS VARIABLES - CalcHub Color System
   ========================================= */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --gray: #64748b;
  --gray-light: #f1f5f9;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(37,99,235,0.10);
  --shadow-lg: 0 8px 40px rgba(37,99,235,0.15);
  --radius: 14px;
  --radius-lg: 22px;
  --font-main: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-main);
  background: var(--white);
  color: var(--dark);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { font-size: 1rem; color: var(--gray); }

/* =========================================
   LAYOUT UTILITIES
   ========================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.text-center { text-align: center; }
.flex { display: flex; }
.grid { display: grid; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}
.btn-accent {
  background: var(--accent);
  color: var(--dark);
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* =========================================
   HEADER / NAVBAR
   ========================================= */
#calchub-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--dark); }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  border-radius: 8px;
  transition: var(--transition);
}
.nav-menu > li > a:hover {
  background: var(--primary-light);
  color: var(--primary);
}
/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
  z-index: 100;
}
.nav-menu li:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--dark);
  font-weight: 500;
}
.nav-dropdown a:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.nav-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: var(--transition);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
  background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 50%, #f5f0ff 100%);
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(37,99,235,0.06) 0%, transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(245,158,11,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 20px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 strong { color: var(--primary); }
.hero p {
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--gray);
}
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* =========================================
   TOOLS GRID / CALCULATOR CARDS
   ========================================= */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: var(--transition);
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.tool-card:hover::before { transform: scaleX(1); }
.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}
.tool-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--dark); }
.tool-card p { font-size: 0.9rem; margin-bottom: 20px; }
.tool-card .btn { width: 100%; justify-content: center; }

/* =========================================
   FEATURES / WHY SECTION
   ========================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.feature-item {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius);
  background: var(--gray-light);
  transition: var(--transition);
}
.feature-item:hover { background: var(--primary-light); transform: translateY(-4px); }
.feature-icon { font-size: 2.2rem; margin-bottom: 14px; }
.feature-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-item p { font-size: 0.875rem; }

/* =========================================
   CATEGORY CARDS
   ========================================= */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.category-card {
  background: linear-gradient(135deg, var(--primary-light), #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.cat-icon { font-size: 2rem; margin-bottom: 12px; }
.category-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.category-card p { font-size: 0.875rem; margin-bottom: 16px; }

/* =========================================
   TRENDING / SPOTLIGHT CARD
   ========================================= */
.spotlight {
  background: linear-gradient(135deg, var(--dark), var(--dark-soft));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}
.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ff4500;
  color: white;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.spotlight h2 { color: var(--white); margin-bottom: 12px; }
.spotlight p { color: rgba(255,255,255,0.75); margin-bottom: 20px; }
.spotlight-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.spotlight-list li { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.spotlight-img { flex: 0 0 240px; opacity: 0.85; }

/* =========================================
   FAQ SECTION
   ========================================= */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  padding: 20px 24px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  color: var(--dark);
  transition: var(--transition);
}
.faq-question:hover { background: var(--primary-light); color: var(--primary); }
.faq-question .faq-icon { font-size: 1.2rem; transition: var(--transition); }
.faq-answer {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}
.faq-answer p { padding: 16px 0; }
.faq-item.open .faq-question { background: var(--primary-light); color: var(--primary); }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-item.open .faq-answer { max-height: 200px; }

/* =========================================
   CTA SECTION
   ========================================= */
.cta-section {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  text-align: center;
  padding: 80px 24px;
  border-radius: var(--radius-lg);
  margin: 0 24px;
}
.cta-section h2 { color: var(--white); margin-bottom: 12px; }
.cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 28px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-section .btn-outline {
  border-color: white;
  color: white;
}
.cta-section .btn-outline:hover { background: white; color: var(--primary); }

/* =========================================
   SECTION HEADERS
   ========================================= */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { max-width: 580px; margin: 0 auto; font-size: 1rem; }
.section-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 50px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* =========================================
   CALCULATOR TOOL PAGE
   ========================================= */
.tool-page-hero {
  background: linear-gradient(135deg, #f0f6ff, #e8f0fe);
  padding: 60px 0 40px;
  text-align: center;
}
.tool-page-hero h1 { margin-bottom: 12px; }
.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--dark);
  padding: 6px 18px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.calculator-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  max-width: 640px;
  margin: 0 auto;
}
.calc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.calc-tab {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  color: var(--gray);
}
.calc-tab.active, .calc-tab:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.calc-input-group { margin-bottom: 20px; }
.calc-input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 6px;
  color: var(--dark);
}
.calc-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: var(--transition);
  background: var(--gray-light);
}
.calc-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.calc-result {
  background: linear-gradient(135deg, var(--primary-light), #f0f9ff);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  margin-top: 20px;
}
.calc-result .result-label { font-size: 0.85rem; color: var(--gray); margin-bottom: 6px; }
.calc-result .result-value { font-size: 2rem; font-weight: 800; color: var(--primary); }

/* =========================================
   BLOG CARDS
   ========================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-thumb { height: 180px; background: var(--primary-light); overflow: hidden; }
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 24px; }
.blog-card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.blog-card h3 { font-size: 1rem; margin-bottom: 10px; color: var(--dark); }
.blog-card h3 a { color: var(--dark); }
.blog-card h3 a:hover { color: var(--primary); }
.blog-card p { font-size: 0.875rem; margin-bottom: 16px; }

/* =========================================
   FOOTER
   ========================================= */
#calchub-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.75);
  padding: 60px 0 24px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .nav-logo { color: var(--white); font-size: 1.3rem; margin-bottom: 12px; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; max-width: 280px; }
.footer-col h4 {
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: var(--white); }

/* =========================================
   ABOUT PAGE
   ========================================= */
.about-hero {
  background: linear-gradient(135deg, #f0f6ff, #e8f0fe);
  padding: 80px 0;
  text-align: center;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.about-card {
  padding: 32px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--white);
  transition: var(--transition);
}
.about-card:hover { box-shadow: var(--shadow); border-color: var(--primary); transform: translateY(-4px); }
.about-card .icon { font-size: 2.5rem; margin-bottom: 16px; }

/* =========================================
   CONTACT PAGE
   ========================================= */
.contact-form-wrap {
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 6px;
  color: var(--dark);
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: var(--transition);
  background: var(--gray-light);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-control { resize: vertical; min-height: 130px; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
    align-items: stretch;
  }
  .nav-menu.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 4px 0 4px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .spotlight { flex-direction: column; padding: 32px; }
  .section { padding: 56px 0; }
  .cta-section { margin: 0; border-radius: 0; }
  .hero { padding: 60px 0; }
}

@media (max-width: 480px) {
  .tools-grid, .features-grid, .categories-grid { grid-template-columns: 1fr; }
  .calc-tabs { gap: 6px; }
  .calc-tab { font-size: 0.78rem; padding: 6px 12px; }
}
