/* =========================================
   Massachusetts Paycheck Calculator
   Design: Clean, authoritative, trustworthy
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --navy: #0d2240;
  --navy-mid: #163461;
  --blue: #1a56b0;
  --blue-light: #2f7de1;
  --accent: #d4a017;
  --accent-light: #f0c842;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-100: #f1f3f8;
  --gray-200: #e2e6ef;
  --gray-500: #8490a8;
  --gray-700: #3f4f6e;
  --text: #1a2336;
  --success: #1a8a5a;
  --success-bg: #e6f7ef;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(13,34,64,0.10);
  --shadow-lg: 0 8px 40px rgba(13,34,64,0.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.2;
  color: var(--navy);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* ===== HEADER ===== */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1140px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  font-family: 'DM Serif Display', serif;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--white);
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

nav a {
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

nav a:hover, nav a.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

nav a.cta-nav {
  background: var(--accent);
  color: var(--navy);
  font-weight: 600;
}

nav a.cta-nav:hover {
  background: var(--accent-light);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a4070 100%);
  padding: 60px 24px 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,23,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.hero-text { padding-bottom: 48px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212,160,23,0.18);
  border: 1px solid rgba(212,160,23,0.35);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  color: var(--white);
  margin-bottom: 20px;
  line-height: 1.12;
}

.hero h1 span { color: var(--accent-light); }

.hero-desc {
  color: rgba(255,255,255,0.72);
  font-size: 17px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat strong {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--accent-light);
}

.hero-stat span {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== CALCULATOR CARD ===== */
.calc-card {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.calc-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
}

.calc-tab {
  flex: 1;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: var(--gray-100);
  color: var(--gray-500);
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.calc-tab.active {
  background: var(--white);
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
  margin-bottom: -2px;
}

.calc-body { padding: 28px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--off-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,86,176,0.12);
  background: var(--white);
}

.input-prefix {
  position: relative;
}

.input-prefix span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-weight: 600;
}

.input-prefix input { padding-left: 26px; }

.section-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin: 20px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.calc-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 8px;
}

.calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,86,176,0.3);
}

.calc-btn:active { transform: none; }

/* ===== RESULTS ===== */
.results-panel {
  display: none;
  background: var(--off-white);
  border-top: 1px solid var(--gray-200);
  padding: 24px 28px;
}

.results-panel.show { display: block; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-header h3 {
  font-size: 16px;
  color: var(--navy);
}

.results-period-badge {
  font-size: 12px;
  background: var(--navy);
  color: var(--white);
  padding: 3px 12px;
  border-radius: 100px;
  font-weight: 500;
}

.takehome-box {
  background: linear-gradient(135deg, var(--success-bg) 0%, #d0f0e2 100%);
  border: 1.5px solid #a3dfc0;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.takehome-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--success);
  margin-bottom: 4px;
}

.takehome-amount {
  font-family: 'DM Serif Display', serif;
  font-size: 42px;
  color: var(--success);
  line-height: 1;
}

.takehome-sub {
  font-size: 13px;
  color: #3a7a5a;
  margin-top: 4px;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.breakdown-table tr {
  border-bottom: 1px solid var(--gray-200);
}

.breakdown-table tr:last-child { border-bottom: none; }

.breakdown-table td {
  padding: 9px 0;
  color: var(--gray-700);
}

.breakdown-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

.breakdown-table .deduction td { color: #b04040; }
.breakdown-table .deduction td:last-child { color: #b04040; }

.breakdown-table .total-row td {
  padding-top: 12px;
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  border-top: 2px solid var(--gray-200);
}

.breakdown-section-head td {
  padding-top: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}

.disclaimer {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 16px;
  line-height: 1.5;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  background: var(--white);
  padding: 72px 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  align-items: start;
}

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 10px;
}

.section-h2 {
  font-size: clamp(26px, 3.5vw, 38px);
  color: var(--navy);
  margin-bottom: 16px;
}

.section-intro {
  font-size: 17px;
  color: var(--gray-700);
  margin-bottom: 36px;
  line-height: 1.7;
}

/* ===== TAX INFO CARDS ===== */
.tax-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.tax-card {
  background: var(--off-white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tax-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.tax-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.tax-card h4 {
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tax-card .rate {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 4px;
}

.tax-card p {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ===== CONTENT PROSE ===== */
.prose h3 {
  font-size: 22px;
  color: var(--navy);
  margin: 32px 0 12px;
}

.prose p {
  color: var(--gray-700);
  margin-bottom: 16px;
  line-height: 1.75;
}

.prose ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--gray-700);
}

.prose ul li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.info-box {
  background: linear-gradient(135deg, #eef3ff 0%, #f0f7ff 100%);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14.5px;
  color: var(--gray-700);
  line-height: 1.65;
}

.info-box strong { color: var(--navy); }

/* ===== SIDEBAR ===== */
.sidebar { position: sticky; top: 90px; }

.sidebar-card {
  background: var(--off-white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar-card h4 {
  font-size: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-link-list li a {
  font-size: 14px;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.sidebar-link-list li a::before {
  content: '→';
  font-size: 12px;
}

.quick-facts li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
}

.quick-facts li:last-child { border-bottom: none; }
.quick-facts li span:first-child { color: var(--gray-700); }
.quick-facts li span:last-child { font-weight: 700; color: var(--navy); }

/* ===== FAQ ===== */
.faq-section {
  background: var(--off-white);
  padding: 72px 0;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}

.faq-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
}

.faq-question {
  padding: 18px 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--navy);
  transition: background 0.2s;
}

.faq-question:hover { background: var(--gray-100); }

.faq-question .icon {
  font-size: 20px;
  font-weight: 300;
  color: var(--blue);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.open .faq-question .icon { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--gray-700);
  line-height: 1.7;
  border-top: 1px solid var(--gray-200);
  padding-top: 14px;
}

.faq-item.open .faq-answer { display: block; }

/* ===== BLOG SECTION ===== */
.blog-section {
  padding: 72px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.blog-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }

.blog-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: #eef3ff;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.blog-card h3 {
  font-size: 19px;
  margin-bottom: 10px;
  line-height: 1.3;
  color: var(--navy);
}

.blog-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.blog-meta {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  margin-top: auto;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 300px;
}

.footer-col h5 {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--white); }

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-disclaimer {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  margin-top: 16px;
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
}

/* ===== BLOG PAGE ===== */
.blog-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 64px 24px;
  text-align: center;
}

.blog-hero h1 { color: var(--white); font-size: clamp(28px, 5vw, 46px); margin-bottom: 16px; }
.blog-hero p { color: rgba(255,255,255,0.7); font-size: 17px; max-width: 600px; margin: 0 auto; }

.blog-main {
  padding: 60px 0;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.article-meta-item {
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-body h2 {
  font-size: 26px;
  margin: 36px 0 14px;
  color: var(--navy);
}

.article-body h3 {
  font-size: 20px;
  margin: 28px 0 12px;
  color: var(--navy);
}

.article-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--gray-700);
  margin-bottom: 18px;
}

.article-body ul, .article-body ol {
  padding-left: 22px;
  margin-bottom: 18px;
  color: var(--gray-700);
  line-height: 1.75;
}

.article-body li { margin-bottom: 8px; }

.article-body .info-box { margin: 28px 0; }

.cta-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin: 36px 0;
}

.cta-box h4 {
  font-size: 22px;
  color: var(--white);
  margin-bottom: 10px;
}

.cta-box p {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--navy);
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s;
}

.cta-btn:hover { background: var(--accent-light); text-decoration: none; }

.placeholder-section {
  background: repeating-linear-gradient(
    45deg,
    var(--gray-100),
    var(--gray-100) 10px,
    var(--white) 10px,
    var(--white) 20px
  );
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

.placeholder-section strong { display: block; font-size: 18px; margin-bottom: 8px; color: var(--gray-700); }

/* ===== BLOG INDEX ===== */
.blog-index-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.blog-list-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.blog-list-card:hover { box-shadow: var(--shadow); }

.blog-list-card-thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.blog-list-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.blog-list-card h2 { font-size: 20px; margin-bottom: 8px; }
.blog-list-card p { font-size: 14px; color: var(--gray-500); flex: 1; }
.blog-list-card .read-more { margin-top: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; }
  .calc-card { border-radius: var(--radius); }
  .hero { padding-bottom: 40px; }
  .content-grid, .blog-layout { grid-template-columns: 1fr; }
  .tax-cards { grid-template-columns: 1fr 1fr; }
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .blog-index-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .tax-cards { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  nav a:not(.cta-nav) { display: none; }
}
