/* ============================================
   VetCalc - Global Styles
   Mobile-first, accessible, no frameworks
   ============================================ */

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

:root {
  --navy: #1a365d;
  --navy-light: #2a4a7f;
  --navy-dark: #0f2440;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --red-accent: #9B2C2C;
  --red-accent-light: #B83232;
  --yellow: #946800;
  --yellow-light: #fef9c3;
  --teal: #0d9488;
  --teal-light: #ccfbf1;
  --indigo: #4f46e5;
  --indigo-light: #e0e7ff;
  --flag-red: #B22234;
  --flag-red-light: #fce8eb;
  --flag-blue: #3C3B6E;
  --flag-blue-light: #e8e8f4;
  --flag-gold: #866100;
  --flag-gold-light: #fef7e0;
  --steel-blue: #3b6d94;
  --steel-blue-light: #e6f0f8;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--navy);
  text-decoration: underline;
}

a:hover {
  color: var(--navy-light);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--navy);
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.625rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 2rem 0;
}

/* --- Patriotic Stripe --- */
.patriotic-stripe {
  height: 3px;
  background: linear-gradient(to right, var(--red-accent) 33.33%, var(--white) 33.33%, var(--white) 66.66%, var(--navy) 66.66%);
  flex-shrink: 0;
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.breadcrumb a {
  color: var(--gray-500);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.breadcrumb .sep {
  margin: 0 0.35rem;
  color: var(--gray-300);
}

/* --- Header --- */
.site-header {
  background: var(--white);
  color: var(--navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  border-top: 3px solid transparent;
  border-image: linear-gradient(to right, var(--red-accent) 33.33%, var(--white) 33.33%, var(--white) 66.66%, var(--navy) 66.66%) 1;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img {
  height: 32px;
  width: auto;
}

/* Mobile nav toggle */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--navy);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  line-height: 1;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
}

.site-nav.open {
  display: block;
}

.site-nav ul {
  list-style: none;
  padding: 0.5rem 0;
}

.site-nav a {
  display: block;
  color: var(--navy);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--gray-100);
  color: var(--navy-dark);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 3rem 1rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(155, 44, 44, 0.045) 0px,
    rgba(155, 44, 44, 0.045) 14px,
    transparent 14px,
    transparent 28px
  );
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 35%;
  height: 55%;
  background: rgba(26, 54, 93, 0.08);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--gray-200);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-hero-primary {
  display: inline-block;
  background: var(--white);
  color: var(--navy) !important;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none !important;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-hero-secondary {
  display: inline-block;
  background: var(--white);
  color: var(--navy) !important;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none !important;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-hero-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.audience-card small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  opacity: 0.75;
}

/* --- Calculator Cards --- */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
}

.calc-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.calc-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
}

.calc-card-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-card-updated {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.calc-card h3 {
  margin-bottom: 0.5rem;
}

.calc-card p {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Coming Soon Card --- */
.calc-card.coming-soon {
  opacity: 0.6;
  cursor: default;
}

.calc-card.coming-soon:hover {
  box-shadow: var(--shadow);
  transform: none;
}

.calc-card.coming-soon .calc-card-tag {
  background: var(--gray-500);
}

/* --- Footer --- */
.site-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.8;
}

.site-footer a {
  color: var(--gray-600);
}

.disclaimer {
  color: var(--gray-600);
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ============================================
   Calculator Page Styles
   ============================================ */

/* --- Calculator Container --- */
.calc-intro {
  max-width: 700px;
  margin-bottom: 1.5rem;
}

.calc-intro p {
  color: var(--gray-600);
  font-size: 1rem;
}

.calculator-box {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

/* --- Rating Entries --- */
.rating-entry {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.rating-entry label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.rating-entry select {
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
  min-width: 100px;
}

.rating-entry select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.15);
}

.bilateral-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.bilateral-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.btn-remove {
  background: none;
  border: 1px solid var(--gray-300);
  color: var(--gray-500);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  line-height: 1;
  margin-left: auto;
  transition: all 0.15s;
}

.btn-remove:hover {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

.btn-remove:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  text-align: center;
}

.btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

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

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-secondary:hover {
  background: var(--gray-50);
}

/* --- Dependents Section --- */
.dep-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.dep-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--gray-700);
}

.dep-field select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--white);
}

.dep-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-700);
  padding: 0.4rem 0;
}

.dep-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

@media (min-width: 640px) {
  .dep-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
  }
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* --- Results --- */
.results-box {
  display: none;
  background: var(--gray-50);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.results-box.visible {
  display: block;
}

.results-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.result-item .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.result-item .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
}

.result-item .value.highlight {
  color: var(--green);
}

.result-item .sub {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.15rem;
}

/* Step-by-step breakdown */
.breakdown {
  margin-top: 1rem;
}

.breakdown h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.breakdown ol {
  padding-left: 1.5rem;
}

.breakdown li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.breakdown li strong {
  color: var(--navy);
}

.compensation-note {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--yellow-light);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--gray-700);
}

.compensation-note strong {
  color: var(--yellow);
}

/* --- Disclaimer Banner --- */
.disclaimer-banner {
  background: var(--yellow-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* --- Expandable Sections --- */
.expandable {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.expandable summary {
  padding: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.expandable summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-500);
  transition: transform 0.2s;
}

.expandable[open] summary::after {
  content: "\2212";
}

.expandable summary::-webkit-details-marker {
  display: none;
}

.expandable-body {
  padding: 0 1rem 1rem;
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.7;
}

.expandable-body p {
  margin-bottom: 0.75rem;
}

.expandable-body ul,
.expandable-body ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.expandable-body li {
  margin-bottom: 0.35rem;
}

/* --- FAQ --- */
.faq-section {
  margin-top: 2rem;
}

.faq-section h2 {
  margin-bottom: 1rem;
}

/* --- Data Sources --- */
.data-sources {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.data-sources h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.data-sources ul {
  list-style: none;
  padding: 0;
}

.data-sources li {
  margin-bottom: 0.35rem;
}

.data-sources li::before {
  content: "\2192\00a0";
  color: var(--gray-500);
}

/* Homepage data source list */
.data-source-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.data-source-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600);
}

.data-source-list li:last-child {
  border-bottom: none;
}

.data-source-list a {
  color: var(--navy);
}

/* Footer links */
.footer-links a {
  color: var(--gray-600);
  text-decoration: none;
}

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

/* --- Calculator Form (Military Pay) --- */
.calc-form-group {
  margin-bottom: 1rem;
}

.calc-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.calc-form-group select,
.calc-form-group input[type="number"] {
  width: 100%;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
}

.calc-form-group select:focus,
.calc-form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.15);
}

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

.calc-form-group .help-text {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

.calc-form-group .help-text a {
  color: var(--gray-500);
}

.hidden {
  display: none;
}

/* Pay results grid */
.pay-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pay-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.pay-line .pay-label {
  font-size: 0.9rem;
  color: var(--gray-600);
}

.pay-line .pay-label small {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 400;
}

.pay-line .pay-amount {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}

.pay-line .pay-amount.deduction {
  color: var(--red-accent);
}

.pay-line.pay-total {
  background: var(--navy);
  border-color: var(--navy);
}

.pay-line.pay-total .pay-label {
  color: var(--gray-200);
  font-weight: 600;
}

.pay-line.pay-total .pay-amount {
  color: var(--white);
  font-size: 1.35rem;
}

.pay-line.pay-annual {
  background: var(--gray-50);
  border-style: dashed;
}

.tax-note {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--green-light);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--gray-700);
}

/* Searchable location dropdown */
.search-select {
  position: relative;
}

.search-select-input {
  width: 100%;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
}

.search-select-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.15);
}

.search-select-input::placeholder {
  color: var(--gray-500);
}

.search-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 50;
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-select-dropdown.hidden {
  display: none;
}

.search-select-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

.search-select-item:last-child {
  border-bottom: none;
}

.search-select-item:hover,
.search-select-item.highlighted {
  background: var(--gray-50);
  color: var(--navy);
}

.search-select-item .loc-state {
  color: var(--gray-600);
  font-size: 0.8rem;
}

.search-no-results {
  padding: 0.75rem;
  color: var(--gray-600);
  font-size: 0.85rem;
  font-style: italic;
}

/* Civilian equivalent row */
.pay-line.pay-civilian {
  background: var(--yellow-light);
  border-color: #fde68a;
}

/* Related calculators */
.related-calcs {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.related-calcs h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.related-calcs a {
  font-weight: 600;
}

/* Radio and checkbox groups */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--gray-700);
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
  cursor: pointer;
}

.radio-label span,
.checkbox-label span {
  flex: 1;
}

/* Chart containers */
.chart-container {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.chart-container h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.chart-container canvas {
  max-width: 100%;
}

/* Featured calc card (legacy) */
.calc-card.featured {
  border-color: var(--red-accent);
  border-width: 2px;
}

.calc-card.featured .calc-card-tag {
  background: var(--red-accent);
}

/* --- Info Pages (About/Contact) --- */
.page-content {
  padding: 2rem 0;
}

.page-content h1 {
  margin-bottom: 1.5rem;
}

.page-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content p,
.page-content li {
  color: var(--gray-600);
  line-height: 1.7;
}

.page-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content li {
  margin-bottom: 0.35rem;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

/* ============================================
   Responsive - Tablet+
   ============================================ */
@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }

  .hero {
    padding: 4rem 1.5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .rating-entry {
    flex-wrap: nowrap;
  }

  .calc-form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Responsive - Desktop
   ============================================ */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    background: none;
    border: none;
  }

  .site-nav ul {
    display: flex;
    gap: 0.25rem;
    padding: 0;
  }

  .site-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
  }

  .calculator-box {
    padding: 2rem;
  }
}

/* ============================================
   Blog Styles
   ============================================ */

/* Blog hub */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.blog-card-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.blog-card-date {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 0.35rem;
}

.blog-card h3 {
  margin-bottom: 0.5rem;
}

.blog-card p {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.blog-card .read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

/* Blog article */
.article-meta {
  color: var(--gray-600);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.article-content {
  max-width: 700px;
}

.article-content p {
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

.article-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-content li {
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.article-content strong {
  color: var(--gray-800);
}

.article-content blockquote {
  border-left: 3px solid var(--navy);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: var(--gray-50);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-content blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--gray-700);
}

.article-cta {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius);
  text-align: center;
}

.article-cta p {
  color: var(--gray-200) !important;
  margin-bottom: 1rem !important;
  font-size: 1.05rem !important;
}

.article-cta .btn {
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
}

.article-cta .btn:hover {
  background: var(--gray-100);
}

/* Example box for calculations */
.example-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.example-box p {
  margin-bottom: 0.5rem !important;
  font-size: 0.95rem !important;
}

.example-box p:last-child {
  margin-bottom: 0 !important;
}

.example-box .example-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.8rem !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem !important;
}

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

/* ============================================
   BAH Location Page Styles
   ============================================ */

/* --- BAH Summary Cards --- */
.bah-summary-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.bah-summary-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.bah-summary-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.bah-summary-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--green);
}

.bah-summary-card .sub {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.15rem;
}

/* --- BAH Tabs --- */
.bah-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--gray-200);
}

.bah-tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.bah-tab:hover {
  color: var(--navy);
}

.bah-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.bah-tab-panel {
  display: none;
}

.bah-tab-panel.active {
  display: block;
}

/* --- BAH Rate Table --- */
.bah-table-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.bah-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.bah-table thead th {
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.bah-table thead th:nth-child(2),
.bah-table thead th:nth-child(3) {
  text-align: right;
}

.bah-table tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.bah-table tbody td:nth-child(2),
.bah-table tbody td:nth-child(3) {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bah-table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.bah-table tbody tr:hover {
  background: var(--yellow-light);
}

.bah-group-header td {
  background: var(--gray-100) !important;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem !important;
  border-bottom: 1px solid var(--gray-200) !important;
}

/* --- ZIP Lookup Widget --- */
.zip-lookup {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.zip-lookup h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.zip-lookup-form {
  display: flex;
  gap: 0.5rem;
}

.zip-lookup-input {
  flex: 1;
  max-width: 200px;
  font-size: 1.1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
  letter-spacing: 2px;
  text-align: center;
}

.zip-lookup-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.15);
}

.zip-lookup-input::placeholder {
  color: var(--gray-500);
  letter-spacing: 1px;
}

.zip-lookup .btn {
  white-space: nowrap;
}

.zip-result {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  display: none;
}

.zip-result.visible {
  display: block;
}

.zip-result.success {
  background: var(--green-light);
  color: var(--gray-800);
}

.zip-result.error {
  background: var(--red-light);
  color: var(--gray-800);
}

.zip-result a {
  font-weight: 600;
}

/* --- State Grid --- */
.state-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.state-grid a {
  display: block;
  padding: 0.6rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, box-shadow 0.15s;
}

.state-grid a:hover {
  background: var(--gray-50);
  box-shadow: var(--shadow);
}

.state-grid a span {
  color: var(--gray-600);
  font-weight: 400;
  font-size: 0.8rem;
}

/* --- MHA Location List --- */
.mha-list {
  list-style: none;
  padding: 0;
  columns: 1;
  column-gap: 2rem;
}

.mha-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
  break-inside: avoid;
}

.mha-list a {
  text-decoration: none;
  color: var(--navy);
}

.mha-list a:hover {
  text-decoration: underline;
}

.mha-list .mha-rate {
  float: right;
  color: var(--gray-500);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* --- BAH State Hub Table --- */
.state-mha-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.state-mha-table thead th {
  background: var(--navy);
  color: var(--white);
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
}

.state-mha-table thead th:nth-child(n+2) {
  text-align: right;
}

.state-mha-table tbody td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.state-mha-table tbody td:nth-child(n+2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.state-mha-table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.state-mha-table tbody tr:hover {
  background: var(--yellow-light);
}

.state-mha-table a {
  font-weight: 600;
  text-decoration: none;
}

.state-mha-table a:hover {
  text-decoration: underline;
}

/* --- BAH Highlight Row --- */
.bah-table tbody tr.highlight-row {
  background: var(--green-light);
}

/* --- BAH Location Context --- */
.bah-location-context {
  margin-bottom: 2rem;
}

.bah-zip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.5rem;
}

.bah-zip-list span {
  display: inline-block;
  background: var(--gray-100);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--gray-600);
}

/* --- BAH Responsive --- */
@media (min-width: 640px) {
  .bah-summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .state-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mha-list {
    columns: 2;
  }
}

@media (min-width: 768px) {
  .state-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .mha-list {
    columns: 3;
  }
}

/* ============================================
   Site Reorganization Styles
   ============================================ */

/* --- Audience Paths (Homepage Hero) --- */
.audience-paths {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.audience-card {
  display: block;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--navy) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.audience-card:hover {
  background: var(--gray-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--navy);
}

.audience-card--va {
  border-color: var(--flag-red);
  border-left: 5px solid var(--flag-red);
  background: var(--flag-red-light);
}

.audience-card--active {
  border-color: var(--flag-blue);
  border-left: 5px solid var(--flag-blue);
  background: var(--flag-blue-light);
}

.audience-card--reserve {
  border-color: var(--steel-blue);
  border-left: 5px solid var(--steel-blue);
  background: var(--steel-blue-light);
}

/* --- Calculator Category Sections --- */
.calc-category {
  margin-bottom: 2.5rem;
}

.calc-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.calc-category-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.calc-category-desc {
  color: var(--gray-500);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.calc-category-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  background: var(--gray-50);
}

.flow-step {
  font-weight: 600;
  color: var(--navy);
}

.flow-arrow {
  color: var(--gray-300);
  font-size: 1rem;
}

/* Category-colored calc cards — American Flag Theme */
.calc-card--va {
  border-left: 5px solid var(--flag-red);
  background: var(--flag-red-light);
}

.calc-card--va .calc-card-tag {
  background: var(--flag-red);
}

.calc-card--active {
  border-left: 5px solid var(--flag-blue);
  background: var(--flag-blue-light);
}

.calc-card--active .calc-card-tag {
  background: var(--flag-blue);
}

.calc-card--reserve {
  border-left: 5px solid var(--steel-blue);
  background: var(--steel-blue-light);
}

.calc-card--reserve .calc-card-tag {
  background: var(--steel-blue);
}

.calc-card--education {
  border-left: 5px solid var(--flag-gold);
  background: var(--flag-gold-light);
}

.calc-card--education .calc-card-tag {
  background: var(--flag-gold);
}

/* Category-colored tags in category headers */
.calc-category-tag--va {
  background: var(--flag-red);
}

.calc-category-tag--active {
  background: var(--flag-blue);
}

.calc-category-tag--reserve {
  background: var(--steel-blue);
}

.calc-category-tag--education {
  background: var(--flag-gold);
}

/* --- Calculator Hub Jump Nav --- */
.calc-hub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}

.calc-hub-nav a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.calc-hub-nav a:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* --- Blog Category Sections --- */
.blog-category {
  margin-bottom: 2rem;
}

.blog-category-header {
  font-size: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1rem;
}

/* --- Related Calcs: Primary "Next Step" Link --- */
.related-calcs-primary {
  display: block;
  background: var(--green-light);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}

.related-calcs-primary:hover {
  background: #bbf7d0;
  transform: translateY(-1px);
  color: var(--gray-800);
}

.related-calcs-primary small {
  display: block;
  font-weight: 400;
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* --- Footer Grid --- */

/* Mobile: single column, all links inline */
.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-col {
  min-width: 0;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  display: inline;
}

.footer-list li::after {
  content: " \00B7 ";
  color: var(--gray-300);
}

.footer-list li:last-child::after {
  content: "";
}

.footer-list a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.8rem;
  display: inline-block;
  padding: 0.25rem 0;
  min-height: 44px;
  line-height: 2.2;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

/* --- Responsive: Tablet+ --- */
@media (min-width: 640px) {
  .audience-paths {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    text-align: left;
  }

  .footer-list li {
    display: block;
    margin-bottom: 0.35rem;
  }

  .footer-list li::after {
    content: "";
  }

  .footer-list a {
    font-size: 0.85rem;
    min-height: 0;
    line-height: 1.6;
    padding: 0.2rem 0;
  }

  .footer-list--2col {
    columns: 2;
    column-gap: 1rem;
  }
}

/* --- Email Signup --- */
.email-signup {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--white);
}

.email-signup h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.email-signup p {
  color: var(--gray-300);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.email-signup-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
}

.email-signup-form input[type="text"],
.email-signup-form input[type="email"] {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.email-signup-form input[type="text"]::placeholder,
.email-signup-form input[type="email"]::placeholder {
  color: var(--gray-300);
}

.email-signup-form input[type="text"]:focus,
.email-signup-form input[type="email"]:focus {
  border-color: rgba(255,255,255,0.5);
}

.email-signup-form button,
.email-signup-form input[type="button"] {
  padding: 0.7rem 1.5rem;
  background: var(--white);
  color: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.email-signup-form button:hover,
.email-signup-form input[type="button"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.email-signup .signup-note {
  font-size: 0.8rem;
  color: var(--gray-300);
  margin-top: 0.75rem;
}

@media (max-width: 600px) {
  .email-signup-form {
    flex-direction: column;
  }
}

/* ===== UX Improvements ===== */

/* Tabular figures for aligned numbers */
.calc-result-value,
.result-primary,
.bah-summary-card .value,
.rate-table td,
.pay-table td,
table.pay-chart td,
.result-amount,
.result-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Calculator card hover elevation */
.calc-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.calc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.calc-card:active {
  transform: translateY(0);
}

/* Result fade-in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.result-animate {
  animation: fadeInUp 0.3s ease-out;
}

/* Enhanced focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--navy, #1a365d);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove default outline for mouse clicks */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy, #1a365d);
  color: #fff;
  padding: 0.5rem 1.5rem;
  border-radius: 0 0 var(--radius, 8px) var(--radius, 8px);
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}

/* Better spacing for calculator inputs */
.calc-form label,
.calculator-form label {
  margin-bottom: 0.5rem;
  display: block;
  font-weight: 600;
}
.calc-form select,
.calc-form input,
.calculator-form select,
.calculator-form input {
  padding: 0.625rem 0.75rem;
  margin-bottom: 1rem;
}

/* Result display breathing room */
.calc-results,
.calculator-results,
.result-section {
  padding: 1.5rem;
  margin: 1.5rem 0;
}

/* Smooth hover transitions */
a {
  transition: color 0.15s ease;
}
.btn {
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* "Updated" date badge */
.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green, #16a34a);
  background: var(--green-light, #dcfce7);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius, 8px);
  margin-top: 0.5rem;
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.updated-badge .badge-icon {
  font-weight: 700;
}

/* Calculator definition paragraph for AI citations */
.calculator-definition {
  background: var(--flag-blue-light, #eff6ff);
  border-left: 4px solid var(--navy, #1a365d);
  padding: 1rem 1.25rem;
  border-radius: var(--radius, 8px);
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.calculator-definition p {
  margin: 0;
  color: var(--gray-700, #374151);
}
.calculator-definition strong {
  color: var(--navy, #1a365d);
}

/* Sticky Calculator Category Nav */
.calc-cat-nav {
  position: fixed;
  top: -50px;
  left: 0;
  right: 0;
  background: var(--navy, #1a365d);
  z-index: 100;
  transition: top 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.calc-cat-nav.visible {
  top: 0;
}
.calc-cat-nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.calc-cat-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
  border-bottom: 2px solid transparent;
}
.calc-cat-nav a:hover,
.calc-cat-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-bottom-color: #fff;
}

/* Hide in print */
@media print {
  .calc-cat-nav { display: none !important; }
}

/* ===== Print Styles ===== */
@media print {
  /* Hide non-essential elements */
  .patriotic-stripe,
  .site-header,
  .site-footer,
  .nav-toggle,
  .site-nav,
  .breadcrumb,
  .related-calcs,
  .article-cta,
  .email-signup,
  .zip-lookup,
  .print-btn,
  .btn-print,
  .bah-tabs,
  .no-print {
    display: none !important;
  }

  /* Reset page layout */
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
    margin: 0;
    padding: 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  main {
    padding: 0;
  }

  /* Make results stand out */
  .result-primary,
  .calc-result-value,
  .bah-summary-card .value {
    font-size: 18pt;
    font-weight: bold;
  }

  /* Ensure tables print well */
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #ccc;
    padding: 4px 8px;
  }

  /* Show both tab panels when printing */
  .bah-tab-panel {
    display: block !important;
  }

  /* Add source attribution */
  body::after {
    content: "Printed from VetCalc.org — Data verified February 2026";
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #666;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ccc;
  }

  /* Links show URL */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Don't show URL for internal navigation links */
  .breadcrumb a::after,
  .related-calcs a::after,
  .site-footer a::after,
  nav a::after {
    content: none;
  }

  /* Avoid page breaks in calculator sections */
  .section,
  .faq-section,
  details {
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }
}

/* ============================================
   What's Next? Cross-Navigation Section
   ============================================ */
.whats-next {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.whats-next h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.whats-next h3::before {
  content: "→";
  color: var(--green);
  font-weight: bold;
}

.whats-next-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.whats-next-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.whats-next-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.whats-next-card strong {
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.whats-next-card span {
  color: var(--gray-600);
  font-size: 0.85rem;
  line-height: 1.4;
}

.whats-next-card .cta-arrow {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

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

/* ============================================
   Floating Popular Tools Navigation
   ============================================ */
.floating-tools {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 90;
}

.floating-tools-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-tools-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.floating-tools-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 220px;
  padding: 0.5rem 0;
  display: none;
  border: 1px solid var(--gray-200);
}

.floating-tools-menu.open {
  display: block;
}

.floating-tools-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.floating-tools-menu a:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.floating-tools-menu a.current {
  background: var(--gray-50);
  color: var(--navy);
  font-weight: 600;
}

/* Hide floating tools on homepage */
body.homepage .floating-tools {
  display: none;
}

@media print {
  .floating-tools { display: none !important; }
}

/* ============================================
   Save Results Feature
   ============================================ */
.save-btn {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.save-btn:hover {
  background: #15803d;
}

.save-btn.saved {
  background: var(--gray-400);
  cursor: default;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy);
  color: #fff;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-size: 0.9rem;
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Saved calculations list */
.saved-calcs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.saved-calc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  gap: 1rem;
}

.saved-calc-item:last-child {
  border-bottom: none;
}

.saved-calc-info {
  flex: 1;
}

.saved-calc-name {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
}

.saved-calc-result {
  color: var(--green);
  font-weight: 700;
  font-size: 1rem;
}

.saved-calc-date {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.saved-calc-actions {
  display: flex;
  gap: 0.5rem;
}

.saved-calc-actions a,
.saved-calc-actions button {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.saved-calc-actions .recalc-btn {
  background: var(--navy);
  color: #fff;
}

.saved-calc-actions .clear-btn {
  background: var(--gray-100);
  color: var(--gray-600);
}

.saved-calc-actions .clear-btn:hover {
  background: var(--red-light);
  color: var(--red);
}

/* ============================================
   Homepage Decision Funnel (Task 2)
   ============================================ */
/* Hero Section - Compact Glass Style */
.hero-compact {
  padding: 2.5rem 1rem 2rem;
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 1.5rem;
}

.hero-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-btn {
  display: block;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-btn-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a365d;
  margin-bottom: 0.25rem;
}

.hero-btn-desc {
  display: block;
  font-size: 0.8rem;
  color: #4a5568;
}

/* Force navy text on hero buttons */
.hero a.hero-btn,
.hero a.hero-btn:link,
.hero a.hero-btn:visited,
.hero a.hero-btn:hover,
.hero a.hero-btn:active {
  color: #1a365d !important;
  text-decoration: none !important;
}

.hero a.hero-btn .hero-btn-title {
  color: #1a365d !important;
}

.hero a.hero-btn .hero-btn-desc {
  color: #4a5568 !important;
}

.hero-trust {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Tablet: 2x2 grid */
@media (max-width: 800px) {
  .hero-buttons {
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
  }
}

/* Mobile: single column */
@media (max-width: 540px) {
  .hero-compact {
    padding: 2rem 1rem 1.5rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-buttons {
    grid-template-columns: 1fr;
    max-width: 320px;
  }

  .hero-btn {
    padding: 0.875rem 1rem;
  }

  .hero-btn-title {
    font-size: 0.9rem;
  }

  .hero-btn-desc {
    font-size: 0.75rem;
  }
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.trust-badge svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.9);
}

.hero-trust-row span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.trust-check {
  color: #86efac;
  font-weight: bold;
}

@media (min-width: 480px) {
  .hero-cta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-cta-card {
    padding: 1.5rem 1rem;
  }
}

/* ============================================
   Popular Bases Section
   ============================================ */
.popular-bases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.popular-bases-grid a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.9rem;
  transition: background 0.15s;
}

.popular-bases-grid a:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.popular-bases-grid .base-rate {
  display: block;
  font-weight: 600;
  color: var(--green);
  font-size: 0.85rem;
}

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

@media (min-width: 768px) {
  .popular-bases-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
