/*
Theme Name: RMD Calculator Theme
Theme URI: https://example.com/
Author: OpenAI
Description: Literal WordPress port of the uploaded RMD calculator site with tool deep links, long-form source content, menus, logo/site icon support, and Customizer-controlled ad slots/footer settings.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: rmdcalculator-theme
*/

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: rgba(0,0,0,.06);
  --emerald: #059669;
  --emerald-dark: #065f46;
  --emerald-soft: #ecfdf5;
  --purple-soft: #f5f3ff;
  --purple-dark: #5b21b6;
  --indigo-soft: #eef2ff;
  --indigo-dark: #3730a3;
  --orange-soft: #fff7ed;
  --orange-dark: #9a3412;
  --blue-soft: #eff6ff;
  --blue-dark: #1d4ed8;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select { font: inherit; }
.site-shell { min-height: 100vh; }
.container {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 16px;
}
.content-narrow {
  width: min(100%, 900px);
  margin: 0 auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--emerald);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(5,150,105,.2);
  font-size: 20px;
}
.brand-text {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-text .light { color: var(--emerald); font-weight: 300; }
.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.primary-nav,
.footer-nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav a,
.tool-switcher button,
.mobile-nav button {
  color: #6b7280;
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 500;
}
.primary-nav a:hover,
.primary-nav a.is-active,
.tool-switcher button.is-active,
.mobile-nav button.is-active {
  color: var(--emerald);
}
.header-divider {
  width: 1px; height: 18px; background: #e5e7eb;
}
.language-switcher select {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.mobile-menu-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 26px;
  cursor: pointer;
}
.mobile-panel {
  display: none;
  position: fixed;
  inset: 64px 0 auto 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}
.mobile-nav,
.mobile-lang-grid {
  display: grid;
  gap: 12px;
}
.mobile-lang-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 18px; }
.mobile-lang-grid button {
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
}
.mobile-lang-grid button.is-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: var(--emerald-dark);
}
.main-area { padding: 48px 0 72px; }
.hero { text-align: center; margin-bottom: 42px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.hero p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px;
}
.calc-card h2 { margin: 0 0 24px; font-size: 1.7rem; }
.form-stack { display: grid; gap: 18px; }
.form-row-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field label {
  display: block;
  font-size: .92rem;
  color: #374151;
  font-weight: 600;
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  outline: none;
  background: #fff;
}
.field input:focus {
  border-color: #6ee7b7;
  box-shadow: 0 0 0 4px rgba(16,185,129,.13);
}
.result-box {
  margin-top: 10px;
  border-radius: 18px;
  padding: 24px;
  border: 1px solid transparent;
}
.result-box .eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 700;
}
.result-box .value {
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.result-box .note {
  margin-top: 10px;
  font-size: .82rem;
  opacity: .85;
}
.theme-rmd { background: var(--emerald-soft); border-color: #bbf7d0; color: var(--emerald-dark); }
.theme-inherited { background: var(--purple-soft); border-color: #ddd6fe; color: var(--purple-dark); }
.theme-tax { background: var(--indigo-soft); border-color: #c7d2fe; color: var(--indigo-dark); }
.theme-roth { background: var(--orange-soft); border-color: #fed7aa; color: var(--orange-dark); }
.theme-life { background: var(--blue-soft); border-color: #bfdbfe; color: var(--blue-dark); }
.cta-box {
  margin-top: 20px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #059669, #0f766e);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(6,95,70,.2);
}
.cta-box::after {
  content: '✦';
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 90px;
  line-height: 1;
  opacity: .08;
}
.cta-kicker {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.cta-box h3 { margin: 14px 0 8px; font-size: 1.35rem; }
.cta-box p { margin: 0 0 16px; color: rgba(255,255,255,.92); }
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--emerald);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
}
.action-row {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ghost-button {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.related-tools { margin-top: 44px; }
.related-tools h3 { margin: 0 0 18px; font-size: 1.2rem; }
.tool-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.tool-item {
  border: 1px solid #f3f4f6;
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.tool-item:hover { border-color: #a7f3d0; background: rgba(236,253,245,.5); }
.tool-item-title { font-weight: 700; color: #111827; }
.tool-item-desc { margin-top: 6px; font-size: .95rem; color: var(--muted); }
.tool-content-wrap {
  margin-top: 44px;
  display: grid;
  gap: 28px;
}
.article-card { padding: 32px; }
.article-card h2, .article-card h3 { letter-spacing: -0.02em; }
.article-card p, .article-card li { color: #4b5563; line-height: 1.8; }
.article-card ul { padding-left: 18px; }
.ad-slot { margin: 22px 0; }
.ad-box {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 18px;
}
.ad-box .ad-label {
  font-size: .72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 8px;
  font-weight: 700;
}
.site-footer {
  margin-top: 40px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  padding: 38px 0;
}
.footer-title { margin: 0 0 10px; font-size: 1.1rem; }
.footer-copy,
.footer-text,
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--emerald); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0 28px;
  color: #6b7280;
  font-size: .92rem;
}
.screen-reader-text {
  position: absolute;
  left: -9999px;
}
@media (max-width: 900px) {
  .header-right { display: none; }
  .mobile-menu-toggle { display: inline-block; }
  .mobile-panel.is-open { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main-area { padding-top: 36px; }
  .card, .article-card { padding: 22px; }
  .tool-grid,
  .form-row-2 { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .site-footer, .action-row, .ad-slot, .mobile-panel { display: none !important; }
  body { background: #fff; }
  .card, .panel, .article-card { box-shadow: none; border-color: #ddd; }
}


.custom-logo-link img{max-height:52px;width:auto;display:block}
.article-card{line-height:1.7}
.article-card h1,.article-card h2,.article-card h3,.article-card h4{line-height:1.15;letter-spacing:-.02em;color:#111827}
.article-card h2{font-size:clamp(1.7rem,3vw,2.2rem);margin:0 0 18px}
.article-card h3{font-size:1.3rem;margin:28px 0 12px}
.article-card p,.article-card li{color:#374151}
.article-card ul,.article-card ol{padding-left:22px}
.url-hint{font-size:.9rem;color:#6b7280;text-align:center;margin-top:14px}
