/*
 * calculator.css — Shared styles for all calculator pages
 * Extracted from inline <style> blocks duplicated across 110+ calculator pages.
 * Works alongside common.css which provides base layout, header, footer,
 * breadcrumb, financial-disclaimer, skip-nav, cookie-consent, and print styles.
 *
 * Improves content-to-code ratio for Google AdSense compliance
 * and enables browser caching of calculator-specific CSS.
 */

/* ===== Body Line-Height Override ===== */
/* Calculator pages use 1.45 line-height vs common.css 1.55 for denser form UI */
body {
  line-height: 1.45;
}

/* ===== Hero Section (calculator-specific overrides) ===== */
/* common.css provides base .hero styles; these are calculator-detail refinements */
.hero p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.hero p.lead {
  margin: 0 0 14px;
  color: var(--muted);
}

.hero .hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ===== Search Bar ===== */
.search-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #fff, #fbfbff);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 6px 20px rgba(12, 18, 32, 0.04);
}

.search svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.search input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  width: 100%;
}

/* ===== Categories List ===== */
.categories {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}

.category {
  background: linear-gradient(180deg, #ffffff, #fff);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(12, 18, 32, 0.04);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.category-header h2 {
  font-size: 16px;
  margin: 0;
}

.category-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ===== Card Grid (responsive, mobile-first) ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Calculator Cards ===== */
.calc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid rgba(12, 18, 32, 0.06);
  background: linear-gradient(145deg, #ffffff, #f8faff);
  transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(12, 18, 32, 0.06), 0 1px 3px rgba(12, 18, 32, 0.04);
}

.calc-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: var(--rainbow-grad);
  opacity: 1;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.calc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.02), rgba(161, 139, 250, 0.02));
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.calc-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 60px rgba(12, 18, 32, 0.12), 0 8px 25px rgba(12, 18, 32, 0.08);
  border-color: rgba(12, 18, 32, 0.08);
}

.calc-card:hover::after {
  opacity: 1;
}

.calc-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.calc-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  flex: 0 0 64px;
  border: 2px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 4px 12px rgba(12, 18, 32, 0.04);
  transition: all 0.24s ease;
}

.calc-card:hover .calc-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  border-color: rgba(12, 18, 32, 0.08);
  box-shadow: 0 8px 20px rgba(12, 18, 32, 0.08);
}

.calc-info .title {
  font-size: 16px;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.calc-info .desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}

.calc-card:hover .calc-info .title {
  color: #2563eb;
}

.chev {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  opacity: 0.8;
}

/* ===== Toggle Button ===== */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 700;
}

.toggle-btn svg {
  transition: transform 0.18s ease;
}

.toggle-btn[aria-expanded="false"] svg {
  transform: rotate(-90deg);
  opacity: 0.6;
}

/* ===== No Results ===== */
.no-results {
  padding: 18px;
  background: linear-gradient(180deg, #fff, #fbfbff);
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--muted);
  margin-top: 14px;
}

/* ===== Calculator Tool Layout (input/results grid) ===== */
.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

/* ===== Panel (input/result containers) ===== */
.panel {
  background: linear-gradient(180deg, #fff, #fcfdff);
  border: 2px solid rgba(12, 18, 32, 0.06);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(12, 18, 32, 0.04);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--rainbow-grad);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

/* ===== Muted Text Utility ===== */
.muted {
  color: var(--muted);
}

/* ===== Form Input Rows ===== */
.row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.row input,
.row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid rgba(12, 18, 32, 0.06);
  background: #fff;
  outline: none;
}

.row input:focus,
.row select:focus {
  border-color: rgba(12, 18, 32, 0.18);
}

/* ===== Result Totals Grid ===== */
.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

/* ===== Stat Cards ===== */
.stat {
  padding: 14px;
  border-radius: 12px;
  border: 2px solid rgba(12, 18, 32, 0.06);
  background: #fff;
}

.stat .label {
  font-size: 12px;
  color: var(--muted);
}

.stat .value {
  font-weight: 800;
  font-size: 18px;
}

/* ===== Guide Cards ===== */
.guide-card {
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border: 2px solid rgba(12, 18, 32, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.guide-card h4 {
  margin: 0 0 8px;
}

/* ===== Pill Display ===== */
.pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid rgba(12, 18, 32, 0.08);
  background: #fff;
}

/* ===== Status Colors ===== */
.good {
  color: #0a7d34;
}

.warn {
  color: #b45309;
}

.bad {
  color: #9b1c1c;
}

/* ===== Blog Section (on calculator index pages) ===== */
.blog-section {
  background: linear-gradient(180deg, #ffffff, #fff);
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(12, 18, 32, 0.04);
  margin-top: 30px;
}

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

.blog-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.blog-header .view-all {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.blog-header .view-all:hover {
  color: #1d4ed8;
}

/* ===== Blog Layout (featured + sidebar on calc pages) ===== */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .blog-layout {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* ===== Featured Article Card ===== */
.featured-article {
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 4px 20px rgba(12, 18, 32, 0.06);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.featured-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(12, 18, 32, 0.1);
}

.featured-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.featured-image svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  color: white;
}

.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.featured-content {
  padding: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article-date {
  font-size: 13px;
  color: var(--muted);
}

.featured-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.4;
}

.featured-article:hover h3 {
  color: #2563eb;
}

.featured-content p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.6;
}

.read-article {
  color: #2563eb;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

.featured-article:hover .read-article {
  gap: 10px;
}

/* ===== Category Badges ===== */
.category-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-badge.savings { background: #dcfce7; color: #16a34a; }
.category-badge.mortgage { background: #dbeafe; color: #2563eb; }
.category-badge.investing { background: #fef3c7; color: #d97706; }
.category-badge.budgeting { background: #f3e8ff; color: #7c3aed; }
.category-badge.retirement { background: #ffe4e6; color: #e11d48; }
.category-badge.tax { background: #e0f2fe; color: #0284c7; }
.category-badge.credit { background: #fce7f3; color: #db2777; }
.category-badge.debt { background: #fee2e2; color: #dc2626; }

/* ===== Sidebar Articles ===== */
.sidebar-articles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-article {
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 2px 12px rgba(12, 18, 32, 0.04);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.sidebar-article:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(12, 18, 32, 0.08);
  border-color: rgba(12, 18, 32, 0.1);
}

.sidebar-article h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 8px 0;
  color: var(--text);
  line-height: 1.4;
}

.sidebar-article:hover h4 {
  color: #2563eb;
}

.sidebar-article p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== More Articles Grid ===== */
.more-articles {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.more-articles h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Article Cards ===== */
.article-card {
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 2px 12px rgba(12, 18, 32, 0.04);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(12, 18, 32, 0.08);
}

.article-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 10px 0 8px;
  color: var(--text);
}

.article-card:hover h4 {
  color: #2563eb;
}

.article-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== Blog Card with Images ===== */
.blog-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.featured-article .blog-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

/* ===== Sidebar Article with Image ===== */
.sidebar-article-with-img {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 2px 12px rgba(12, 18, 32, 0.04);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.sidebar-article-with-img:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(12, 18, 32, 0.08);
}

.sidebar-article-with-img img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.sidebar-article-with-img .article-content {
  flex: 1;
  min-width: 0;
}

.sidebar-article-with-img h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0;
  color: var(--text);
  line-height: 1.4;
}

.sidebar-article-with-img:hover h4 {
  color: #2563eb;
}

.sidebar-article-with-img p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Article Card with Image ===== */
.article-card-with-img {
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 2px 12px rgba(12, 18, 32, 0.04);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.article-card-with-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(12, 18, 32, 0.08);
}

.article-card-with-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.article-card-with-img .card-content {
  padding: 16px;
}

.article-card-with-img h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 8px 0;
  color: var(--text);
}

.article-card-with-img:hover h4 {
  color: #2563eb;
}

.article-card-with-img p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== Calculator List Section ===== */
.calculator-list-section {
  background: linear-gradient(180deg, #ffffff, #fff);
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(12, 18, 32, 0.04);
  margin-top: 30px;
}

.calculator-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.calculator-list-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.calculator-categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 600px) {
  .calculator-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .calculator-categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Calculator Category Cards ===== */
.calc-category-card {
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 2px 12px rgba(12, 18, 32, 0.04);
  transition: all 0.3s ease;
}

.calc-category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(12, 18, 32, 0.08);
}

.calc-category-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.calc-category-content {
  padding: 16px;
}

.calc-category-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 8px;
}

.calc-category-badge.tax { background: #e0f2fe; color: #0284c7; }
.calc-category-badge.loans { background: #fef3c7; color: #d97706; }
.calc-category-badge.insurance { background: #dcfce7; color: #16a34a; }
.calc-category-badge.credit { background: #fce7f3; color: #db2777; }
.calc-category-badge.currency { background: #f3e8ff; color: #7c3aed; }
.calc-category-badge.education { background: #dbeafe; color: #2563eb; }

.calc-category-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.calc-category-card:hover h3 {
  color: #2563eb;
}

/* ===== Calculator List Links ===== */
.calc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  background: rgba(248, 250, 255, 0.8);
  border: 1px solid transparent;
}

.calc-list li a:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.06));
  border-color: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  transform: translateX(4px);
}

.calc-list li a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rainbow-grad);
  flex-shrink: 0;
}

.calc-list li a svg {
  width: 16px;
  height: 16px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #2563eb;
}

.calc-list li a:hover svg {
  opacity: 1;
}

/* ===== Calculator + Blog Sidebar Layout ===== */
.calc-section-with-blog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 1000px) {
  .calc-section-with-blog {
    grid-template-columns: 1fr 320px;
  }
}

.calc-main-content {
  min-width: 0;
}

.calc-blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-blog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sidebar-blog-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

/* ===== Sidebar Blog Cards ===== */
.sidebar-blog-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(145deg, #ffffff, #f8faff);
  border-radius: 12px;
  border: 1px solid rgba(12, 18, 32, 0.06);
  box-shadow: 0 2px 8px rgba(12, 18, 32, 0.03);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.sidebar-blog-card:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(12, 18, 32, 0.08);
  border-color: rgba(37, 99, 235, 0.15);
}

.sidebar-blog-card img {
  width: 80px;
  height: 65px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-blog-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-blog-info .blog-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: fit-content;
}

.sidebar-blog-info h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-blog-card:hover h4 {
  color: #2563eb;
}

.sidebar-blog-info p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Blog Badge Colors (sidebar) ===== */
.blog-badge.savings { background: #dcfce7; color: #16a34a; }
.blog-badge.mortgage { background: #dbeafe; color: #2563eb; }
.blog-badge.investing { background: #fef3c7; color: #d97706; }
.blog-badge.budgeting { background: #f3e8ff; color: #7c3aed; }
.blog-badge.retirement { background: #ffe4e6; color: #e11d48; }
.blog-badge.tax { background: #e0f2fe; color: #0284c7; }
.blog-badge.credit { background: #fce7f3; color: #db2777; }
.blog-badge.debt { background: #fee2e2; color: #dc2626; }

/* ===== Educational Content Section ===== */
.edu-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 16px;
}

.edu-section h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 18px;
  line-height: 1.3;
}

.edu-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
  line-height: 1.3;
}

.edu-section p,
.edu-section li {
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
  margin: 0 0 14px;
}

.edu-section ul,
.edu-section ol {
  padding-left: 22px;
  margin: 0 0 18px;
}

.edu-section li {
  margin-bottom: 8px;
}

.edu-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 32px;
  margin-bottom: 28px;
}

/* ===== Disclaimer Box (in-page) ===== */
.disclaimer-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 32px;
  font-size: 14px;
  line-height: 1.7;
  color: #92400e;
}

.disclaimer-box strong {
  color: #78350f;
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

/* ===== Formula Block ===== */
.formula-block {
  background: #f0f4ff;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 18px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  color: #1e3a8a;
  overflow-x: auto;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ===== Comparison Table (calculator-specific) ===== */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}

.comparison-table th {
  background: var(--rainbow-grad);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.comparison-table tr:nth-child(even) td {
  background: rgba(9, 16, 28, 0.02);
}

.comparison-table tr:hover td {
  background: rgba(161, 139, 250, 0.06);
}

/* ===== Tip Cards ===== */
.tip-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.tip-card:hover {
  box-shadow: var(--shadow-2);
}

.tip-num {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--rainbow-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

.tip-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tip-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== FAQ Accordion (CSS-only) ===== */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--surface);
}

.faq-item input[type="checkbox"] {
  display: none;
}

.faq-item label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  transition: background 0.2s;
  user-select: none;
}

.faq-item label:hover {
  background: rgba(9, 16, 28, 0.02);
}

.faq-item label::after {
  content: '+';
  font-size: 22px;
  font-weight: 300;
  color: var(--muted);
  transition: transform 0.25s;
}

.faq-item input:checked ~ label::after {
  transform: rotate(45deg);
  color: var(--rainbow-1);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 22px;
}

.faq-item input:checked ~ .faq-answer {
  max-height: 400px;
  padding: 0 22px 20px;
}

.faq-answer p {
  font-size: 14px;
  line-height: 1.75;
  color: #4b5563;
  margin: 0;
}

/* FAQ accordion (JS-based variant) */
.faq-item.open > div:last-child {
  max-height: 500px !important;
}

.faq-item.open button span:last-child {
  transform: rotate(45deg);
}

.faq-item button:hover h3 {
  color: var(--rainbow-6) !important;
}

.faq-item button:focus {
  outline: 2px solid var(--rainbow-5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Related Calculators Grid ===== */
.related-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.related-calc-link {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.related-calc-link:hover {
  box-shadow: var(--shadow-1);
  border-color: rgba(161, 139, 250, 0.3);
}

.related-calc-link .rc-icon {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--rainbow-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
}

/* ===== Worked Example ===== */
.worked-example {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 18px 0;
}

.worked-example h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.worked-example p {
  font-size: 14px;
  margin: 0 0 8px;
  color: #4b5563;
}

/* ===== Article Link Hover ===== */
article a[href]:hover {
  box-shadow: var(--shadow-1);
}

/* ===== Topic Cluster Navigation ===== */
.topic-cluster-nav {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 32px 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.topic-cluster-nav h3 {
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--text);
}

.cluster-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cluster-links a {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(102, 217, 255, 0.06), rgba(161, 139, 250, 0.06));
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.cluster-links a:hover {
  background: linear-gradient(135deg, rgba(102, 217, 255, 0.15), rgba(161, 139, 250, 0.12));
  border-color: var(--rainbow-5);
}

/* ===== Further Reading ===== */
.further-reading {
  background: linear-gradient(135deg, rgba(123, 228, 149, 0.06), rgba(102, 217, 255, 0.06));
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.further-reading h3 {
  font-size: 17px;
  margin: 0 0 12px;
  color: var(--text);
}

.further-reading ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.further-reading li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.further-reading li:last-child {
  border-bottom: none;
}

.further-reading a {
  color: var(--rainbow-6);
  text-decoration: none;
  font-weight: 600;
}

.further-reading a:hover {
  text-decoration: underline;
}

/* ===== Related Calculators Inline ===== */
.related-calcs-inline {
  background: linear-gradient(135deg, rgba(102, 217, 255, 0.06), rgba(161, 139, 250, 0.06));
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
  border: 1px solid var(--border);
}

.related-calcs-inline h3 {
  font-size: 17px;
  margin: 0 0 14px;
  color: var(--text);
}

.related-calcs-inline-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-calcs-inline-grid a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface, #fff);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.related-calcs-inline-grid a:hover {
  border-color: var(--rainbow-5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.related-calcs-inline-grid a::before {
  content: "\1F4CA";
  font-size: 14px;
}

/* ===== Pillar Page Cross-References ===== */
.pillar-crossref {
  background: linear-gradient(135deg, rgba(255, 95, 109, 0.04), rgba(255, 195, 113, 0.04), rgba(161, 139, 250, 0.04));
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin: 36px 0;
  border: 1px solid var(--border);
}

.pillar-crossref h3 {
  font-size: 20px;
  margin: 0 0 18px;
  background: var(--rainbow-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pillar-crossref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pillar-crossref-grid a {
  display: block;
  padding: 16px 20px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.pillar-crossref-grid a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--rainbow-5);
}

.pillar-crossref-grid a strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
}

.pillar-crossref-grid a span {
  font-size: 13px;
  color: var(--muted);
}

/* ===== Calculator-specific Responsive Breakpoints ===== */
@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 1fr 120px;
  }
}

@media (max-width: 420px) {
  .hero h2 {
    font-size: 18px;
  }
}

/* ===== Print Styles (calculator-specific) ===== */
@media print {
  .panel,
  .grid {
    break-inside: avoid;
  }

  .panel::before {
    display: none;
  }

  .calc-card::before,
  .calc-card::after {
    display: none;
  }

  .topic-cluster-nav,
  .pillar-crossref,
  .related-calcs-inline,
  .related-calc-grid,
  .calculator-list-section,
  .blog-section,
  .calc-blog-sidebar,
  .edu-section {
    break-inside: avoid;
  }

  .faq-answer {
    max-height: none !important;
    padding: 0 22px 20px !important;
  }
}

/* === Enhanced Content Sections === */
.scenarios-section { margin: 2.5rem 0; }
.scenarios-section h2 { font-size: 1.35rem; margin: 0 0 1rem; color: var(--text); }
.scenario-card {
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.scenario-card h4 { color: var(--primary, #1a56db); margin: 0 0 0.5rem; font-size: 1.05rem; }
.scenario-card p { color: var(--muted, #6b7280); line-height: 1.7; margin: 0 0 0.5rem; font-size: 0.95rem; }
.scenario-card .scenario-result {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text, #081124);
}

.expert-tips-section { margin: 2.5rem 0; }
.expert-tips-section h2 { font-size: 1.35rem; margin: 0 0 1rem; color: var(--text); }
.expert-tip {
    display: flex;
    gap: 1rem;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.expert-tip .tip-icon { font-size: 1.5rem; flex-shrink: 0; }
.expert-tip h4 { margin: 0 0 0.5rem; color: #92400e; font-size: 1rem; }
.expert-tip p { margin: 0; color: var(--muted, #6b7280); line-height: 1.7; font-size: 0.93rem; }

.quick-checklist { margin: 2.5rem 0; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; }
.quick-checklist h2 { font-size: 1.35rem; margin: 0 0 1rem; color: var(--text); }
.quick-checklist ul { list-style: none; padding: 0; margin: 0; }
.quick-checklist li {
    padding: 0.5rem 0 0.5rem 2rem;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
    color: var(--muted, #6b7280);
    line-height: 1.6;
    font-size: 0.95rem;
}
.quick-checklist li:last-child { border-bottom: none; }
.quick-checklist li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #22c55e;
    font-weight: 700;
}

.compare-callout {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}
.compare-callout h3 { margin: 0 0 0.5rem; color: var(--text); font-size: 1.1rem; }
.compare-callout p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.95rem; }
.compare-callout a {
    display: inline-block;
    background: #1a56db;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
