/*
Theme Name: BudgetMate AI
Theme URI: https://budgetmateai.com
Description: Clean, minimal, Notion-inspired blog theme for BudgetMate AI
Version: 1.0.0
Author: BudgetMate AI
*/

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.82;
  color: #3d3d3d;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #1B4FFF; text-decoration: none; }

/* ── LAYOUT ── */
.site-container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.content-container { max-width: 720px; margin: 0 auto; padding: 0 32px; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #f0f0f0;
  height: 64px; display: flex; align-items: center;
}
.site-header .site-container {
  display: flex; align-items: center;
  justify-content: space-between; width: 100%;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.95rem; font-weight: 700; color: #0f0f0f;
  text-decoration: none; letter-spacing: -0.2px;
  white-space: nowrap; flex-shrink: 0;
}
.site-logo svg { flex-shrink: 0; }
.site-logo:hover { color: #0f0f0f; }

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  font-size: 0.875rem; font-weight: 500; color: #6b7280;
  padding: 6px 14px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.site-nav a:hover { color: #0f0f0f; background: #f5f5f5; }
.site-nav a.current { color: #0f0f0f; font-weight: 600; }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px; color: #3d3d3d;
}
.mobile-nav {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid #f0f0f0;
  padding: 16px 24px; flex-direction: column; gap: 4px;
  z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.mobile-nav a {
  font-size: 1rem; font-weight: 500; color: #3d3d3d;
  padding: 10px 14px; border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none; display: block;
}
.mobile-nav a:hover { background: #f5f5f5; color: #0f0f0f; }
.mobile-nav.open { display: flex; }

/* ── HOMEPAGE ── */
.home-hero {
  padding: 88px 0 72px;
  text-align: center;
}
.home-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800; color: #0f0f0f;
  letter-spacing: -1.5px; line-height: 1.15;
  max-width: 780px; margin: 0 auto 20px;
}
.home-hero h1 span { color: #1B4FFF; }
.home-hero p {
  font-size: 1.15rem; color: #6b7280;
  max-width: 540px; margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: #0f0f0f; color: #fff;
  padding: 12px 28px; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: #1B4FFF; transform: translateY(-1px); color: #fff; }
.btn-secondary {
  background: transparent; color: #0f0f0f;
  padding: 12px 28px; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  border: 1.5px solid #e5e5e5;
  transition: border-color 0.2s, background 0.15s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { border-color: #0f0f0f; background: #f9f9f9; color: #0f0f0f; }

/* Stats row */
.home-stats {
  display: flex; justify-content: center;
  gap: 48px; flex-wrap: wrap;
  padding: 32px 0; margin-bottom: 72px;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}
.home-stat { text-align: center; }
.home-stat-num { display: block; font-size: 1.9rem; font-weight: 800; color: #0f0f0f; letter-spacing: -1px; }
.home-stat-label { font-size: 0.8rem; color: #9ca3af; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; }

/* Section headings */
.section-label {
  font-size: 0.72rem; font-weight: 700; color: #1B4FFF;
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 700; color: #0f0f0f;
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.section-sub { font-size: 0.95rem; color: #9ca3af; margin-bottom: 32px; }

/* Homepage section spacing */
.home-section { padding: 56px 0; }
.home-section + .home-section { border-top: 1px solid #f5f5f5; }

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.post-card {
  background: #FAFAFA; border: 1px solid #f0f0f0;
  border-radius: 12px; overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
  text-decoration: none; color: inherit; display: block;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.07);
  border-color: #e0e0e0;
  color: inherit;
  text-decoration: none;
}
.post-card-thumb {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: #f0f0f0;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-body { padding: 22px 24px 24px; }
.post-card-cat {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700;
  color: #1B4FFF; background: #EEF2FF;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.post-card-title {
  font-size: 1.05rem; font-weight: 700; color: #0f0f0f;
  line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-excerpt {
  font-size: 0.875rem; color: #6b7280;
  line-height: 1.6; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; color: #9ca3af;
}
.reading-time { display: flex; align-items: center; gap: 4px; }

/* Featured post (large card) */
.post-card-featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
}
.post-card-featured .post-card-thumb { aspect-ratio: auto; min-height: 280px; }
.post-card-featured .post-card-body {
  padding: 36px 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.post-card-featured .post-card-title { font-size: 1.4rem; -webkit-line-clamp: 3; }
.post-card-featured .post-card-excerpt { -webkit-line-clamp: 3; }

/* Start here steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.step-card {
  padding: 24px; border: 1px solid #f0f0f0;
  border-radius: 10px; background: #fff;
}
.step-num {
  width: 32px; height: 32px; border-radius: 8px;
  background: #0f0f0f; color: #fff;
  font-weight: 800; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step-title { font-size: 1rem; font-weight: 700; color: #0f0f0f; margin-bottom: 6px; }
.step-desc { font-size: 0.875rem; color: #6b7280; line-height: 1.6; }
.step-desc a { color: #1B4FFF; font-weight: 500; }
.step-desc a:hover { text-decoration: underline; }

/* CTA Banner */
.home-cta {
  padding: 64px 40px; text-align: center;
  background: #0f0f0f; border-radius: 16px;
  margin: 56px 0;
}
.home-cta h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800; color: #fff;
  letter-spacing: -0.5px; margin-bottom: 12px;
}
.home-cta p { color: #9ca3af; margin-bottom: 28px; font-size: 1rem; }
.btn-white {
  background: #fff; color: #0f0f0f;
  padding: 12px 28px; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem;
  text-decoration: none; display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,255,255,0.15); color: #0f0f0f; }

/* ── BLOG LISTING (home.php) ── */
.blog-header { padding: 56px 0 40px; }
.blog-header h1 { font-size: 2rem; font-weight: 800; color: #0f0f0f; letter-spacing: -0.5px; }
.blog-header p { color: #9ca3af; margin-top: 6px; }
.blog-grid-wrap { padding-bottom: 72px; }

/* Pagination */
.pagination { padding: 40px 0; display: flex; gap: 8px; justify-content: center; align-items: center; }
.pagination a, .pagination span {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 600;
  border: 1px solid #e5e5e5; color: #6b7280;
  text-decoration: none; transition: all 0.15s;
}
.pagination a:hover { border-color: #0f0f0f; color: #0f0f0f; }
.pagination .current { background: #0f0f0f; color: #fff; border-color: #0f0f0f; }

/* ── SINGLE POST ── */
.article-header { padding: 56px 0 40px; }
.article-cat {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  color: #1B4FFF; background: #EEF2FF;
  padding: 4px 12px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 16px;
}
.article-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; color: #0f0f0f;
  letter-spacing: -1px; line-height: 1.2;
  margin-bottom: 16px;
}
.article-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.82rem; color: #9ca3af; flex-wrap: wrap;
}
.reading-time-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; font-weight: 600; color: #1B4FFF;
  background: #EEF2FF; padding: 4px 12px; border-radius: 20px;
}

/* Featured image */
.article-featured-image {
  margin: 32px 0 48px;
  border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/9;
}
.article-featured-image img { width: 100%; height: 100%; object-fit: cover; }

/* Article content */
.article-content { font-size: 1rem; line-height: 1.82; color: #3d3d3d; }
.article-content h2 {
  font-size: 1.5rem; font-weight: 700; color: #0f0f0f;
  letter-spacing: -0.3px; margin: 2.5em 0 0.6em;
  line-height: 1.3;
}
.article-content h3 {
  font-size: 1.15rem; font-weight: 700; color: #0f0f0f;
  margin: 2em 0 0.5em; line-height: 1.4;
}
.article-content h4 { font-size: 1rem; font-weight: 700; color: #0f0f0f; margin: 1.5em 0 0.4em; }
.article-content p { margin-bottom: 1.5em; }
.article-content a {
  color: #1B4FFF; font-weight: 500;
  text-decoration: underline; text-decoration-color: rgba(27,79,255,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.article-content a:hover { text-decoration-color: #1B4FFF; }
.article-content ul, .article-content ol {
  padding-left: 1.6em; margin-bottom: 1.5em;
}
.article-content li { margin-bottom: 0.4em; }
.article-content blockquote {
  border-left: 3px solid #0f0f0f;
  padding: 4px 0 4px 24px;
  margin: 2em 0; color: #6b7280;
  font-style: italic; font-size: 1.05rem;
}
.article-content code {
  background: #f5f5f5; padding: 2px 6px;
  border-radius: 4px; font-size: 0.875em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #1B4FFF;
}
.article-content pre {
  background: #0f0f0f; color: #e5e5e5;
  padding: 20px 24px; border-radius: 10px;
  overflow-x: auto; margin: 1.5em 0; font-size: 0.875rem;
}
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content img { border-radius: 8px; margin: 2em auto; }

/* Tables */
.article-content table {
  width: 100%; border-collapse: collapse;
  margin: 2em 0; font-size: 0.9rem; display: block; overflow-x: auto;
}
.article-content th {
  text-align: left; padding: 10px 16px;
  font-weight: 700; color: #0f0f0f;
  border-bottom: 2px solid #0f0f0f;
  white-space: nowrap;
}
.article-content td {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
.article-content tr:last-child td { border-bottom: none; }
.article-content tr:hover td { background: #FAFAFA; }

/* Article footer */
.article-footer {
  margin-top: 56px; padding-top: 32px;
  border-top: 1px solid #f0f0f0;
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.article-tag {
  font-size: 0.78rem; font-weight: 600;
  color: #6b7280; background: #f5f5f5;
  padding: 5px 12px; border-radius: 6px;
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.article-tag:hover { background: #0f0f0f; color: #fff; }

/* Related posts */
.related-posts { margin-top: 56px; padding-top: 40px; border-top: 1px solid #f0f0f0; }
.related-posts h2 { font-size: 1.25rem; font-weight: 700; color: #0f0f0f; margin-bottom: 24px; }
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ── PAGE TEMPLATE ── */
.page-header { padding: 56px 0 32px; border-bottom: 1px solid #f0f0f0; margin-bottom: 40px; }
.page-title { font-size: 2rem; font-weight: 800; color: #0f0f0f; letter-spacing: -0.5px; }
.page-content { padding-bottom: 72px; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid #f0f0f0;
  padding: 40px 0;
  background: #fff;
}
.site-footer .site-container {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 700; color: #0f0f0f;
  text-decoration: none;
}
.footer-copyright { font-size: 0.8rem; color: #9ca3af; }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { font-size: 0.82rem; color: #9ca3af; text-decoration: none; transition: color 0.15s; }
.footer-nav a:hover { color: #0f0f0f; }

/* ── 404 ── */
.error-404 { padding: 120px 0; text-align: center; }
.error-404 h1 { font-size: 6rem; font-weight: 800; color: #f0f0f0; line-height: 1; margin-bottom: 16px; }
.error-404 h2 { font-size: 1.5rem; font-weight: 700; color: #0f0f0f; margin-bottom: 12px; }
.error-404 p { color: #9ca3af; margin-bottom: 32px; }

/* ── SCROLL ANIMATIONS ── */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up-delay-1 { transition-delay: 0.08s; }
.fade-up-delay-2 { transition-delay: 0.16s; }
.fade-up-delay-3 { transition-delay: 0.24s; }

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 768px) {
  html { font-size: 16px; }
  .site-container, .content-container { padding: 0 20px; }
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .home-hero { padding: 56px 0 48px; }
  .home-stats { gap: 28px; }
  .post-card-featured { grid-template-columns: 1fr; }
  .post-card-featured .post-card-thumb { min-height: 200px; }
  .post-card-featured .post-card-body { padding: 24px; }
  .home-cta { padding: 40px 24px; border-radius: 12px; }
  .article-title { font-size: 1.7rem; }
  .article-content h2 { font-size: 1.25rem; }
  .site-footer .site-container { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-nav { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 480px) {
  .post-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; align-items: center; }
}

/* ── CONTACT FORM 7 ── */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: #0f0f0f;
    background: #fff;
    transition: border-color 0.15s;
    margin-bottom: 16px;
    display: block;
    outline: none;
}
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
    border-color: #1B4FFF;
}
.wpcf7 textarea { min-height: 140px; resize: vertical; }
.wpcf7 input[type="submit"] {
    background: #0f0f0f;
    color: #fff;
    border: none;
    padding: 14px 36px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    width: 100%;
    margin-top: 4px;
}
.wpcf7 input[type="submit"]:hover {
    background: #1B4FFF;
    transform: translateY(-1px);
}
.wpcf7-form p { margin-bottom: 0; }
.wpcf7-response-output {
    margin-top: 16px !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
}
