/*
Theme Name: AgeOnCalculator
Author: AgeOnCalculator
Description: AgeOnCalculator WordPress theme using the verified production design system.
Version: 1.1.0
Text Domain: ageoncalculator
*/
/* AgeOneCalculator Design System — Mobile-First, Light & Dark Mode, WCAG 2.2 AA */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #cbd5e1;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1080px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-soft: #1e3a8a;
  --accent: #2dd4bf;
  --danger: #fca5a5;
  --danger-bg: #450a0a;
  --success: #86efac;
  --success-bg: #052e16;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 0.75rem 1rem;
  z-index: 1000;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header & Navigation */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand img, .brand svg {
  width: 28px;
  height: 28px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
  box-shadow: var(--shadow-md);
}

.site-nav.is-open {
  display: flex;
}

.site-nav a {
  padding: 0.625rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--primary);
}

@media (min-width: 880px) {
  .menu-toggle {
    display: none;
  }
  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    border-bottom: none;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }
  .site-nav a {
    padding: 0.45rem 0.65rem;
    font-size: 0.9375rem;
    white-space: nowrap;
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
}

.icon-btn:hover {
  border-color: var(--primary);
}

/* Main Layout */
main {
  padding: 1.5rem 0 3rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  list-style: none;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.375rem;
  color: var(--text-muted);
}

h1 {
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 0.625rem;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 72ch;
}

h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  margin: 1.25rem 0 0.5rem;
}

/* Calculator Card */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.75rem;
}

@media (min-width: 640px) {
  .calc-card {
    padding: 1.75rem;
  }
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .calc-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.date-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.input-control {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.input-control:focus {
  border-color: var(--primary);
}

.native-picker {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.9375rem;
}

.checkbox-row input[type="checkbox"],
.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.25rem;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary {
  color: #0b1120;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

.error-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-weight: 500;
}

/* Results Area */
.results-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.result-highlight {
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.result-highlight__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-highlight__value {
  font-size: clamp(1.375rem, 2.8vw, 1.875rem);
  font-weight: 800;
  color: var(--text);
  margin-top: 0.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
}

.stat-box__label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stat-box__val {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.copy-status {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 600;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--surface);
}

th, td {
  padding: 0.75rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-alt);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: none;
}

/* Cards Grid for Hubs & Related Tools */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.info-card h3 {
  margin: 0;
  font-size: 1.0625rem;
}

.info-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Content Sections & FAQ */
.content-section {
  max-width: 78ch;
}

.callout {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  padding: 0.875rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-item p {
  margin: 0.625rem 0 0;
  color: var(--text-muted);
}

/* Reserved AdSense Slot (Disabled by default; prevents CLS when enabled) */
.ad-slot-reserved {
  display: none;
  min-height: 90px;
  margin: 1.5rem 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.footer-col h2 {
  font-size: 0.9375rem;
  margin: 0 0 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.footer-col a {
  text-decoration: none;
  color: var(--text);
}

.footer-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}
