/* ============================================
   529Calc - Main Stylesheet
   Aesthetic: Editorial Finance — dark navy, warm gold, crisp serif
   ============================================ */

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

:root {
  --navy:    #0d1b2a;
  --navy-2:  #162032;
  --navy-3:  #1e2f45;
  --gold:    #d4a847;
  --gold-lt: #e8c87a;
  --cream:   #f9f5ee;
  --cream-2: #f1ebe0;
  --text:    #1a1a2e;
  --text-2:  #4a4a6a;
  --white:   #ffffff;
  --border:  #e2d9cc;
  --shadow:  0 4px 24px rgba(13,27,42,.10);
  --radius:  12px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

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

/* --- Utilities --- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* --- Header --- */
.site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--gold);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--white);
  font-family: var(--font-body); font-size: 1.2rem;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { letter-spacing: -.02em; }
.logo-text strong { color: var(--gold); font-weight: 600; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-link {
  display: block; padding: 8px 16px; border-radius: 6px;
  color: rgba(255,255,255,.75); text-decoration: none;
  font-size: .9rem; font-weight: 500; transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.1);
  color: var(--gold);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--navy);
  padding: 12px 24px; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: all .2s; border: 2px solid var(--gold);
  cursor: pointer;
}
.btn-primary:hover { background: var(--gold-lt); border-color: var(--gold-lt); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212,168,71,.35); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--navy);
  padding: 11px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 2px solid var(--navy); transition: all .2s;
}
.btn-secondary:hover { background: var(--navy); color: var(--cream); }

.btn-sm { padding: 9px 18px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; margin-top: 8px; }

.btn-calculate {
  width: 100%; padding: 14px; margin-top: 8px;
  background: var(--navy); color: var(--white);
  border: 2px solid var(--navy); border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all .2s; font-family: var(--font-body);
}
.btn-calculate:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 60%, #1a3050 100%);
  color: var(--white); padding: 80px 0 64px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 75% 50%, rgba(212,168,71,.12) 0%, transparent 65%);
}
.hero-inner {
  position: relative; display: grid;
  grid-template-columns: 1fr 320px; gap: 60px; align-items: center;
}
.hero-tag {
  display: inline-block; background: rgba(212,168,71,.18);
  color: var(--gold); border: 1px solid rgba(212,168,71,.35);
  padding: 4px 12px; border-radius: 20px;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-text h1 {
  font-family: var(--font-display); font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.15; margin-bottom: 20px; color: var(--white);
}
.hero-text h1 em { color: var(--gold); font-style: italic; }
.hero-sub {
  color: rgba(255,255,255,.72); font-size: 1.05rem; max-width: 480px;
  margin-bottom: 32px; line-height: 1.65;
}
.hero-stats { display: flex; flex-direction: column; gap: 16px; }
.stat-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 16px 20px;
  backdrop-filter: blur(8px);
}
.stat-num { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); line-height: 1; }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.6); margin-top: 4px; display: block; }

/* --- Page Hero (blog) --- */
.page-hero {
  background: var(--navy); color: var(--white);
  padding: 60px 0;
  text-align: center;
}
.page-hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 12px 0 16px; }
.page-hero h1 em { color: var(--gold); font-style: italic; }
.page-hero p { color: rgba(255,255,255,.7); max-width: 540px; margin: 0 auto 28px; font-size: 1.05rem; }

/* --- Calculator Section --- */
.calc-section { padding: 60px 0 80px; }
.calc-wrapper {
  display: grid; grid-template-columns: 400px 1fr;
  gap: 32px; align-items: start;
}
.calc-inputs, .calc-results {
  background: var(--white); border-radius: 16px;
  padding: 32px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.panel-title {
  font-family: var(--font-display); font-size: 1.4rem;
  color: var(--navy); margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 2px solid var(--cream-2);
}

/* Form Elements */
.form-group { margin-bottom: 22px; }
.form-group label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px;
}
.form-group .optional {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: #aaa; font-size: .75rem;
}
.input-row {
  display: flex; align-items: center; gap: 8px;
}
input[type="range"] {
  flex: 1; height: 4px; cursor: pointer; accent-color: var(--gold);
}
.num-input {
  width: 68px; padding: 8px 10px; border-radius: 8px;
  border: 1.5px solid var(--border); font-family: var(--font-body);
  font-size: .95rem; text-align: right; color: var(--navy);
  background: var(--cream); transition: border-color .2s;
}
.num-input.wide { width: 110px; text-align: left; }
.num-input:focus { outline: none; border-color: var(--gold); background: white; }
.prefix, .unit {
  font-size: .85rem; color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.hint { font-size: .75rem; color: #aaa; margin-top: 5px; }

/* Results Grid */
.results-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 28px;
}
.result-card {
  background: var(--cream); border-radius: var(--radius);
  padding: 16px 18px; border: 1px solid var(--border);
}
.result-card.primary {
  grid-column: span 2;
  background: var(--navy); border-color: var(--navy);
}
.result-card.highlight {
  background: rgba(212,168,71,.12); border-color: rgba(212,168,71,.3);
}
.result-label {
  display: block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); margin-bottom: 6px;
}
.result-card.primary .result-label { color: rgba(255,255,255,.6); }
.result-value {
  display: block; font-family: var(--font-display); font-size: 1.6rem;
  color: var(--navy); line-height: 1.1;
}
.result-card.primary .result-value { color: var(--gold); font-size: 2rem; }
.result-card.highlight .result-value { color: #a07a1e; }

/* Chart */
.chart-wrap { margin-bottom: 24px; }
.chart-wrap h3 {
  font-size: .9rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-2); margin-bottom: 14px;
}
#growthChart { width: 100%; height: auto; border-radius: 8px; }

/* Tax Banner */
.tax-banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(212,168,71,.1); border: 1px solid rgba(212,168,71,.3);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.tax-icon { font-size: 1.4rem; flex-shrink: 0; }
.tax-banner strong { display: block; color: var(--navy); }
.tax-banner p { font-size: .82rem; color: var(--text-2); margin-top: 2px; }

/* CTA Box inside results */
.cta-box {
  background: var(--cream-2); border-radius: var(--radius);
  padding: 20px; text-align: center; border: 1px solid var(--border);
}
.cta-box p { font-size: .9rem; color: var(--text-2); margin-bottom: 12px; }

/* --- How It Works --- */
.how-section { background: var(--navy); padding: 80px 0; color: var(--white); }
.section-title {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--white); text-align: center; margin-bottom: 48px;
}
.how-section .section-title { color: var(--white); }
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.step {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius); padding: 28px 24px;
}
.step-num {
  display: block; font-family: var(--font-display); font-size: 2.5rem;
  color: var(--gold); opacity: .7; margin-bottom: 12px; line-height: 1;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--white); }
.step p { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.65; }

/* --- FAQ --- */
.faq-section { padding: 80px 0; background: var(--cream); }
.faq-section .section-title { color: var(--navy); }
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.faq-item summary {
  font-size: 1rem; font-weight: 600; color: var(--navy);
  padding: 16px 0; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::after {
  content: '+'; font-size: 1.4rem; font-weight: 300; color: var(--gold);
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  font-size: .93rem; color: var(--text-2);
  padding: 0 0 16px; line-height: 1.7;
}
.blog-cta { text-align: center; margin-top: 48px; }
.blog-cta p { color: var(--text-2); margin-bottom: 16px; }

/* --- Blog Index --- */
.blog-index-section { padding: 60px 0 80px; }
.blog-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.blog-card {
  background: var(--white); border-radius: 16px;
  padding: 32px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.blog-card.featured { border-top: 4px solid var(--gold); }
.blog-card-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.blog-tag {
  background: rgba(212,168,71,.15); color: #8a6a00;
  padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.blog-card-meta time { font-size: .8rem; color: var(--text-2); }
.blog-card h2 { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.3; margin-bottom: 12px; }
.blog-card h2 a { color: var(--navy); text-decoration: none; transition: color .2s; }
.blog-card h2 a:hover { color: var(--gold); }
.blog-card p { color: var(--text-2); font-size: .93rem; line-height: 1.7; margin-bottom: 20px; }
.read-more {
  color: var(--navy); font-weight: 600; text-decoration: none; font-size: .9rem;
  border-bottom: 2px solid var(--gold); padding-bottom: 2px; transition: color .2s;
}
.read-more:hover { color: var(--gold); }
.blog-coming-soon {
  background: var(--cream-2); border-radius: 16px; padding: 32px;
  text-align: center; border: 1px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.coming-icon { font-size: 2rem; margin-bottom: 12px; }
.blog-coming-soon h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--navy); }
.blog-coming-soon p { font-size: .88rem; color: var(--text-2); margin-bottom: 20px; }

/* --- CTA Strip --- */
.cta-strip {
  background: var(--gold); padding: 48px 0;
}
.cta-strip-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.cta-strip h2 {
  font-family: var(--font-display); font-size: 1.6rem;
  color: var(--navy); margin-bottom: 8px;
}
.cta-strip p { color: rgba(13,27,42,.7); font-size: .95rem; }
.cta-strip .btn-primary { background: var(--navy); border-color: var(--navy); color: var(--white); flex-shrink: 0; }
.cta-strip .btn-primary:hover { background: var(--navy-3); }

/* --- Article --- */
.breadcrumb-bar { background: var(--cream-2); border-bottom: 1px solid var(--border); padding: 10px 0; }
.breadcrumb { display: flex; gap: 8px; list-style: none; font-size: .82rem; }
.breadcrumb li { color: var(--text-2); }
.breadcrumb li::after { content: '/'; margin-left: 8px; opacity: .4; }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); }

.article-main { padding: 60px 0 80px; }
.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start; }
.article-header { margin-bottom: 32px; }
.article-tags { display: flex; gap: 8px; margin-bottom: 14px; }
.article-header h1 {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2; color: var(--navy); margin-bottom: 14px;
}
.article-byline {
  display: flex; gap: 16px; align-items: center;
  font-size: .85rem; color: var(--text-2); margin-bottom: 20px;
}
.article-intro {
  font-size: 1.05rem; color: var(--text-2); line-height: 1.75;
  border-left: 4px solid var(--gold); padding-left: 18px;
  background: var(--cream-2); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px 16px 22px;
}

.article-tool-cta {
  display: flex; gap: 16px; align-items: center;
  background: rgba(212,168,71,.1); border: 1px solid rgba(212,168,71,.3);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 36px;
  flex-wrap: wrap;
}
.tool-cta-icon { font-size: 1.8rem; flex-shrink: 0; }
.article-tool-cta div { flex: 1; min-width: 180px; }
.article-tool-cta strong { display: block; color: var(--navy); margin-bottom: 4px; }
.article-tool-cta p { font-size: .88rem; color: var(--text-2); margin: 0; }
.article-tool-cta a.inline-link { color: var(--navy); font-weight: 600; }

.article-section { margin-bottom: 40px; }
.article-section h2 {
  font-family: var(--font-display); font-size: 1.5rem;
  color: var(--navy); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.article-section p { color: var(--text-2); margin-bottom: 16px; font-size: .97rem; line-height: 1.75; }
.article-section p:last-child { margin-bottom: 0; }
.inline-link { color: var(--navy); font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold); }
.inline-link:hover { color: var(--gold); }

.article-list { margin: 16px 0 20px; padding-left: 20px; }
.article-list li { color: var(--text-2); font-size: .95rem; margin-bottom: 10px; line-height: 1.6; }
.article-list.ordered { list-style: decimal; }
.article-list.ordered li { padding-left: 6px; }
.article-list.ordered li strong { display: block; color: var(--navy); margin-bottom: 4px; }
.article-list.ordered li p { margin: 0; }

.article-callout {
  background: var(--cream-2); border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 20px; margin: 20px 0;
}
.article-callout h4 { color: var(--navy); margin-bottom: 8px; }
.article-callout p { color: var(--text-2); font-size: .9rem; margin: 0; }

.article-cta-bottom {
  background: var(--navy); color: var(--white);
  border-radius: 16px; padding: 32px; text-align: center; margin-top: 48px;
}
.article-cta-bottom h3 {
  font-family: var(--font-display); font-size: 1.5rem;
  color: var(--white); margin-bottom: 10px;
}
.article-cta-bottom p { color: rgba(255,255,255,.7); margin-bottom: 20px; }

/* Sidebar */
.article-sidebar { position: sticky; top: 80px; }
.sidebar-widget {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; border: 1px solid var(--border); margin-bottom: 20px;
}
.sidebar-widget h3 {
  font-family: var(--font-display); font-size: 1.1rem;
  color: var(--navy); margin-bottom: 10px;
}
.sidebar-widget p { font-size: .88rem; color: var(--text-2); margin-bottom: 4px; }
.sidebar-facts { list-style: none; padding: 0; }
.sidebar-facts li { font-size: .85rem; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--border); }
.sidebar-facts li:last-child { border: none; }
.sidebar-links { list-style: none; padding: 0; }
.sidebar-links li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sidebar-links li:last-child { border: none; }
.sidebar-links a { color: var(--navy); text-decoration: none; font-size: .88rem; font-weight: 500; }
.sidebar-links a:hover { color: var(--gold); }

/* --- Footer --- */
.site-footer {
  background: var(--navy); color: rgba(255,255,255,.7);
  padding: 60px 0 0;
}
.footer-inner {
  display: grid; grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 48px; padding-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: .85rem; color: rgba(255,255,255,.5); line-height: 1.6; }
.footer-nav h4, .footer-disclaimer h4 {
  color: var(--white); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 14px;
}
.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: rgba(255,255,255,.55); text-decoration: none; font-size: .88rem; transition: color .2s; }
.footer-nav a:hover { color: var(--gold); }
.footer-disclaimer p { font-size: .8rem; color: rgba(255,255,255,.4); line-height: 1.65; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0; text-align: center;
  font-size: .8rem; color: rgba(255,255,255,.3);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-stats { flex-direction: row; }
  .calc-wrapper { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .cta-strip-inner { flex-direction: column; text-align: center; }
  .results-grid { grid-template-columns: 1fr; }
  .result-card.primary { grid-column: span 1; }
}
@media (max-width: 600px) {
  .hero-stats { flex-direction: column; }
  .header-inner { gap: 16px; }
  .article-sidebar { grid-template-columns: 1fr; }
  .article-tool-cta { flex-direction: column; }
}
