/* ============================================
   RUNNING PACE CALCULATOR - MAIN STYLESHEET
   Health/Fitness - Emerald Theme
   ============================================ */

:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #34d399;
  --primary-bg: #ecfdf5;
  --secondary: #047857;
  --accent: #06b6d4;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --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;
  --gray-900: #111827;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); font-size: 16px; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary-dark); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary); text-decoration: underline; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.content-narrow { max-width: 800px; margin: 0 auto; }
main { flex: 1; padding: 2rem 0 3rem; }

/* Header */
.header { background: white; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; color: var(--gray-900); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--primary-dark); }
.logo-icon { width: 32px; height: 32px; color: var(--primary); }
.nav-desktop { display: flex; align-items: center; gap: 1.5rem; }
.nav-desktop a { font-size: 0.9375rem; font-weight: 500; color: var(--gray-600); padding: 0.5rem 0; border-bottom: 2px solid transparent; transition: all 0.15s ease; }
.nav-desktop a:hover, .nav-desktop a.active { color: var(--primary-dark); text-decoration: none; border-bottom-color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--gray-700); }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-mobile { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; border-bottom: 1px solid var(--gray-200); padding: 1rem; box-shadow: var(--shadow-lg); }
.nav-mobile.active { display: block; }
.nav-mobile a { display: block; padding: 0.5rem 1rem; color: var(--gray-700); font-weight: 500; border-radius: var(--radius-md); }
.nav-mobile a:hover { background: var(--gray-100); text-decoration: none; }
@media (max-width: 768px) { .nav-desktop { display: none; } .nav-toggle { display: block; } }

.intro-text { font-size: 1.125rem; color: var(--gray-600); margin-bottom: 1.5rem; max-width: 700px; }

/* Calculator Card */
.calculator-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Tabs */
.calc-tabs { display: flex; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.calc-tab { flex: 1; min-width: 0; padding: 0.875rem 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--gray-600); background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.375rem; transition: all 0.15s ease; border-bottom: 3px solid transparent; }
.calc-tab:hover { color: var(--gray-800); background: var(--gray-50); }
.calc-tab.active { color: var(--primary-dark); background: white; border-bottom-color: var(--primary); }
.calc-tab svg { width: 22px; height: 22px; flex-shrink: 0; }
.calc-tab-label { white-space: nowrap; font-size: 0.75rem; }
@media (min-width: 540px) {
  .calc-tab { padding: 1rem 1rem; font-size: 0.875rem; }
  .calc-tab-label { font-size: 0.8125rem; }
  .calc-tab svg { width: 24px; height: 24px; }
}

.calc-panel { display: none; padding: 1.25rem; }
.calc-panel.active { display: block; }

/* Form */
.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
@media (max-width: 600px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { font-size: 0.8125rem; font-weight: 500; color: var(--gray-700); }
.form-hint { font-size: 0.75rem; color: var(--gray-500); }

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 0.875rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: text;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-input[type="number"] { -moz-appearance: textfield; }
.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.form-input[type="date"] { cursor: pointer; }
.form-input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; padding: 0; margin: 0; position: absolute; right: 0.75rem; width: 100%; height: 100%; opacity: 0; }

.form-select {
  height: 44px;
  padding: 0 2rem 0 0.875rem;
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  background-size: 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

/* Time inputs */
.time-inputs { display: flex; gap: 0.375rem; align-items: center; flex-wrap: wrap; }
.time-inputs .form-input { width: 60px; text-align: center; padding: 0 0.5rem; }
.time-inputs .form-select { width: auto; min-width: 70px; }
.time-separator { font-size: 1.125rem; font-weight: 600; color: var(--gray-400); line-height: 44px; }

/* Distance presets */
.distance-presets { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.5rem; }
.preset-btn { padding: 0.375rem 0.75rem; font-size: 0.8125rem; font-weight: 500; color: var(--gray-600); background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: var(--radius-full); cursor: pointer; transition: all 0.15s ease; }
.preset-btn:hover { background: var(--gray-200); }
.preset-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Radio */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-option { display: flex; align-items: center; gap: 0.375rem; cursor: pointer; padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius-md); transition: all 0.15s ease; font-size: 0.875rem; }
.radio-option:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.radio-option:has(input:checked) { border-color: var(--primary); background: var(--primary-bg); }
.radio-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0; }

/* Calculate Button */
.calculate-btn {
  width: 100%;
  height: 48px;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
}
.calculate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.45); }
.calculate-btn:active { transform: translateY(0); }
.calculate-btn svg { width: 20px; height: 20px; }

/* Results */
.results-section { display: none; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); }
.results-section.visible { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-primary { text-align: center; padding: 1.25rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary-bg) 0%, #d1fae5 100%); border-radius: var(--radius-md); border: 1px solid var(--primary-light); }
.result-label { font-size: 0.75rem; font-weight: 500; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.375rem; }
.result-value { font-size: 2.25rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; font-family: var(--font-mono); }
.result-sublabel { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.375rem; }

/* Results Grid */
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.625rem; margin-top: 1rem; }
.results-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .results-grid, .results-grid-4 { grid-template-columns: repeat(2, 1fr); } }
.result-item { padding: 0.875rem; background: var(--gray-50); border-radius: var(--radius-md); text-align: center; border: 1px solid var(--gray-200); }
.result-item-label { font-size: 0.6875rem; color: var(--gray-500); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.03em; }
.result-item-value { font-size: 1.0625rem; font-weight: 600; color: var(--gray-800); font-family: var(--font-mono); }

/* Enhanced Results Components */
.results-extended { max-width: 800px; margin: 1.5rem auto 0; }

/* Pace Visual Bar */
.pace-visual { margin: 1rem 0 1.5rem; }
.pace-bar { height: 44px; background: var(--gray-100); border-radius: var(--radius-md); position: relative; overflow: hidden; border: 1px solid var(--gray-200); }
.pace-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%); border-radius: var(--radius-md) 0 0 var(--radius-md); transition: width 0.5s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.75rem; }
.pace-bar-value { font-size: 0.875rem; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.pace-bar-labels { display: flex; justify-content: space-between; margin-top: 0.375rem; font-size: 0.75rem; color: var(--gray-500); }
.pace-bar-marker { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gray-600); }
.pace-bar-marker::after { content: attr(data-label); position: absolute; bottom: -1.25rem; left: 50%; transform: translateX(-50%); font-size: 0.625rem; color: var(--gray-500); white-space: nowrap; }

/* Results Summary Table */
.results-summary-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin: 1rem 0; }
.results-summary-table th, .results-summary-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.results-summary-table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.results-summary-table td { color: var(--gray-700); }
.results-summary-table td:first-child { font-weight: 500; color: var(--gray-800); }
.results-summary-table td.value { font-family: var(--font-mono); font-weight: 600; color: var(--primary-dark); }
.results-summary-table tr:hover { background: var(--gray-50); }

/* Input Summary */
.input-summary { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1rem; margin: 1rem 0; }
.input-summary-title { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.5rem; }
.input-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.input-summary-item { font-size: 0.8125rem; }
.input-summary-item strong { display: block; color: var(--gray-800); font-weight: 600; }
.input-summary-item span { color: var(--gray-500); font-size: 0.75rem; }

/* Inline variant for single-line summaries */
.input-summary > .input-summary-item { display: flex; align-items: center; gap: 0.5rem; }
.input-summary > .input-summary-item strong { display: inline; margin-right: 0.25rem; }
.input-summary > .input-summary-item span { display: inline; font-size: 0.8125rem; color: var(--gray-700); }

/* Pace Context/Comparison */
.pace-context { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1rem; margin: 1rem 0; }
.pace-context-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.pace-context-title svg { width: 18px; height: 18px; color: var(--primary); }
.pace-category { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem; border-radius: var(--radius-full); font-size: 0.8125rem; font-weight: 500; }
.pace-category.elite { background: #fef3c7; color: #92400e; }
.pace-category.competitive { background: #dbeafe; color: #1e40af; }
.pace-category.intermediate { background: var(--primary-bg); color: var(--primary-dark); }
.pace-category.recreational { background: var(--gray-100); color: var(--gray-700); }
.pace-category.beginner { background: #f3e8ff; color: #7c3aed; }

/* Tips Grid */
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }
@media (max-width: 600px) { .tips-grid { grid-template-columns: 1fr; } }
.tip-card { display: flex; gap: 0.75rem; padding: 0.875rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.tip-icon { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-bg); border-radius: var(--radius-md); color: var(--primary-dark); }
.tip-icon svg { width: 18px; height: 18px; }
.tip-content { flex: 1; min-width: 0; }
.tip-title { font-size: 0.8125rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.125rem; }
.tip-desc { font-size: 0.75rem; color: var(--gray-600); line-height: 1.4; }

/* What This Means Section */
.interpretation-box { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1px solid #bae6fd; border-radius: var(--radius-md); padding: 1rem; margin: 1rem 0; }
.interpretation-box h4 { font-size: 0.875rem; font-weight: 600; color: #0369a1; margin: 0 0 0.5rem 0; display: flex; align-items: center; gap: 0.5rem; }
.interpretation-box h4 svg { width: 18px; height: 18px; }
.interpretation-box p { font-size: 0.8125rem; color: #0c4a6e; margin: 0; line-height: 1.5; }

/* Print Button */
.print-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; font-size: 0.8125rem; font-weight: 500; color: var(--gray-600); background: white; border: 1px solid var(--gray-300); border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s ease; }
.print-btn:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-800); }
.print-btn svg { width: 16px; height: 16px; }

/* Results Section Header */
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.results-header h3 { font-size: 1rem; font-weight: 600; color: var(--gray-800); margin: 0; }
.results-title { font-size: 1rem; font-weight: 600; color: var(--gray-800); margin: 0; }

/* Collapsible Formula */
.formula-toggle { font-size: 0.75rem; color: var(--gray-500); cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 0.5rem; }
.formula-toggle:hover { color: var(--primary-dark); }
.formula-box { display: none; margin-top: 0.75rem; padding: 0.75rem; background: var(--gray-900); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--primary-light); }
.formula-box.visible { display: block; }

/* Splits Table */
.splits-table-wrapper { margin-top: 1rem; max-height: 300px; overflow-y: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.splits-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.splits-table th, .splits-table td { padding: 0.5rem 0.75rem; text-align: center; border-bottom: 1px solid var(--gray-200); }
.splits-table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); position: sticky; top: 0; font-size: 0.75rem; }
.splits-table td { color: var(--gray-600); font-family: var(--font-mono); }
.splits-table tr:hover { background: var(--primary-bg); }
.splits-table .mile-marker { font-weight: 600; color: var(--gray-800); }
.splits-table .cumulative { color: var(--primary-dark); font-weight: 500; }
.splits-table tr.highlight { background: var(--primary-bg); }

/* Pace Chart */
.pace-chart { margin-top: 1rem; }
.pace-chart-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.5rem; }
.pace-chart-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.pace-chart-table th, .pace-chart-table td { padding: 0.375rem 0.5rem; text-align: center; border: 1px solid var(--gray-200); }
.pace-chart-table th { font-weight: 600; color: var(--gray-700); background: var(--gray-100); }
.pace-chart-table td { font-family: var(--font-mono); color: var(--gray-600); }
.pace-chart-table tr:hover { background: var(--primary-bg); }
.pace-chart-table .highlight { background: var(--primary-bg); font-weight: 600; }

/* Unit Toggle */
.unit-toggle { display: flex; background: var(--gray-100); border-radius: var(--radius-full); padding: 4px; width: fit-content; }
.unit-toggle-btn { padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; color: var(--gray-600); background: transparent; border: none; border-radius: var(--radius-full); cursor: pointer; transition: all 0.15s ease; }
.unit-toggle-btn.active { background: white; color: var(--primary-dark); box-shadow: var(--shadow-sm); }

/* Converter Grid */
.converter-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: end; }
.converter-arrow { font-size: 1.5rem; color: var(--gray-400); padding-bottom: 0.75rem; }
@media (max-width: 600px) { .converter-grid { grid-template-columns: 1fr; } .converter-arrow { display: none; } }

/* Content Section */
.content-section { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 1.5rem; margin-bottom: 1.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.content-section h2 { margin-top: 0; }
.content-section h2::after { content: ''; display: block; width: 60px; height: 3px; background: var(--primary); margin-top: 0.5rem; border-radius: var(--radius-full); }

/* Tables */
.table-responsive { overflow-x: auto; margin: 1.5rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 0.625rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.data-table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); }
.data-table td { color: var(--gray-600); }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table code { font-family: var(--font-mono); background: var(--gray-100); padding: 0.125rem 0.375rem; border-radius: var(--radius-sm); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.faq-question { width: 100%; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9375rem; font-weight: 500; text-align: left; color: var(--gray-800); background: var(--gray-50); border: none; cursor: pointer; }
.faq-question:hover { background: var(--gray-100); }
.faq-question svg { width: 18px; height: 18px; color: var(--gray-400); transition: transform 0.15s ease; flex-shrink: 0; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { display: none; padding: 1rem; background: white; }
.faq-item.open .faq-answer { display: block; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.blog-card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; transition: all 0.15s ease; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-content { padding: 1.25rem; }
.blog-card-meta { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.blog-card h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.blog-card h3 a { color: var(--gray-900); }
.blog-card h3 a:hover { color: var(--primary-dark); text-decoration: none; }
.blog-card p { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 0; }

/* Footer */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 2.5rem 0 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { color: white; margin-bottom: 1rem; }
.footer-brand .logo-icon { color: var(--primary-light); }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; }
.footer-nav h4 { color: white; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a { font-size: 0.875rem; color: var(--gray-400); }
.footer-nav a:hover { color: white; text-decoration: none; }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--gray-800); font-size: 0.8125rem; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--gray-500); margin-bottom: 1.25rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--gray-500); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary-dark); text-decoration: underline; }
.breadcrumb .breadcrumb-sep { color: var(--gray-400); user-select: none; }
.breadcrumb .breadcrumb-current { color: var(--gray-700); font-weight: 500; }

/* Table of Contents */
.toc { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.toc-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.toc-title::before { content: '📑'; font-size: 1rem; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc-counter; }
.toc ol li { counter-increment: toc-counter; margin-bottom: 0.375rem; }
.toc ol li a { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.8125rem; color: var(--gray-600); padding: 0.25rem 0; transition: color 0.15s ease; }
.toc ol li a::before { content: counter(toc-counter) "."; font-weight: 600; color: var(--primary); min-width: 1.25rem; }
.toc ol li a:hover { color: var(--primary-dark); text-decoration: none; }

/* CSS-Only Bar Chart */
.bar-chart { margin: 1.5rem 0; }
.bar-chart-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin-bottom: 1rem; }
.bar-chart-item { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 0.75rem; margin-bottom: 0.625rem; }
.bar-chart-label { font-size: 0.8125rem; font-weight: 500; color: var(--gray-700); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart-track { height: 28px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; position: relative; }
.bar-chart-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%); transition: width 0.4s ease; min-width: 2px; }
.bar-chart-fill.accent { background: linear-gradient(90deg, var(--accent) 0%, #67e8f9 100%); }
.bar-chart-fill.warning { background: linear-gradient(90deg, var(--warning) 0%, #fcd34d 100%); }
.bar-chart-fill.error { background: linear-gradient(90deg, var(--error) 0%, #fca5a5 100%); }
.bar-chart-fill.secondary { background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%); }
.bar-chart-value { font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); font-family: var(--font-mono); min-width: 52px; }
.bar-chart-subtitle { font-size: 0.75rem; color: var(--gray-500); margin-top: -0.25rem; margin-bottom: 1rem; }

/* Comparison Grid */
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.comparison-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; transition: all 0.15s ease; }
.comparison-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.comparison-card-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.comparison-card h4 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin: 0 0 0.75rem; }
.comparison-card-stat { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); font-family: var(--font-mono); line-height: 1.2; }
.comparison-card-label { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; }
.comparison-card-detail { font-size: 0.8125rem; color: var(--gray-600); margin-top: 0.5rem; line-height: 1.4; }
.comparison-card.highlight { border-color: var(--primary); background: var(--primary-bg); }
.comparison-card.highlight .comparison-card-stat { color: var(--primary-dark); }

/* Callout Boxes */
.callout { padding: 1.25rem; border-radius: var(--radius-lg); margin: 1.5rem 0; border-left: 4px solid; }
.callout-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.callout p { font-size: 0.875rem; line-height: 1.6; margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }
.callout ul, .callout ol { font-size: 0.875rem; margin-bottom: 0.5rem; padding-left: 1.25rem; }
.callout li { margin-bottom: 0.25rem; }
.callout.callout-tip { background: var(--primary-bg); border-color: var(--primary); color: var(--gray-800); }
.callout.callout-tip .callout-title { color: var(--primary-dark); }
.callout.callout-tip .callout-title::before { content: '💡'; }
.callout.callout-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--gray-800); }
.callout.callout-warning .callout-title { color: #92400e; }
.callout.callout-warning .callout-title::before { content: '⚠️'; }
.callout.callout-info { background: #eff6ff; border-color: #3b82f6; color: var(--gray-800); }
.callout.callout-info .callout-title { color: #1e40af; }
.callout.callout-info .callout-title::before { content: 'ℹ️'; }
.callout.callout-formula { background: var(--gray-900); border-color: var(--primary); color: var(--gray-300); }
.callout.callout-formula .callout-title { color: var(--primary-light); }
.callout.callout-formula .callout-title::before { content: '🔢'; }
.callout.callout-formula code { font-family: var(--font-mono); color: var(--primary-light); font-size: 1rem; }
.callout.callout-formula p { color: var(--gray-300); }

/* Related Articles */
.related-articles { margin: 2rem 0; }
.related-articles-title { font-size: 1.125rem; font-weight: 600; color: var(--gray-800); margin-bottom: 1rem; }
.related-articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.related-article-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem; transition: all 0.15s ease; display: flex; flex-direction: column; }
.related-article-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.related-article-card .related-tag { font-size: 0.6875rem; font-weight: 600; color: var(--primary-dark); background: var(--primary-bg); padding: 0.125rem 0.5rem; border-radius: var(--radius-full); width: fit-content; margin-bottom: 0.625rem; text-transform: uppercase; letter-spacing: 0.03em; }
.related-article-card h4 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin: 0 0 0.375rem; line-height: 1.3; }
.related-article-card p { font-size: 0.8125rem; color: var(--gray-500); margin: 0; flex: 1; line-height: 1.5; }

/* Stat Row (thin progress bars) */
.stat-row { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.stat-row-label { font-size: 0.8125rem; color: var(--gray-700); font-weight: 500; }
.stat-row-track { height: 8px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; }
.stat-row-fill { height: 100%; border-radius: var(--radius-full); background: var(--primary); transition: width 0.4s ease; }
.stat-row-fill.accent { background: var(--accent); }
.stat-row-fill.warning { background: var(--warning); }
.stat-row-fill.error { background: var(--error); }
.stat-row-value { font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); font-family: var(--font-mono); min-width: 40px; text-align: right; }

/* Category Tags */
.category-tag { display: inline-block; font-size: 0.6875rem; font-weight: 600; padding: 0.1875rem 0.625rem; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.04em; }
.category-tag.tag-pace { background: #dbeafe; color: #1e40af; }
.category-tag.tag-guide { background: var(--primary-bg); color: var(--primary-dark); }
.category-tag.tag-training { background: #fef3c7; color: #92400e; }
.category-tag.tag-strategy { background: #f3e8ff; color: #7c3aed; }
.category-tag.tag-reference { background: #e0f2fe; color: #0369a1; }

/* Blog Category Section */
.blog-category { margin-bottom: 2.5rem; }
.blog-category h2 { font-size: 1.25rem; color: var(--gray-800); margin-bottom: 0.5rem; }
.blog-category h2::after { content: ''; display: block; width: 50px; height: 3px; background: var(--primary); margin-top: 0.5rem; border-radius: var(--radius-full); }

/* Jump Links */
.jump-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.jump-link { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.875rem; font-size: 0.8125rem; font-weight: 500; color: var(--gray-600); background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-full); transition: all 0.15s ease; }
.jump-link:hover { color: var(--primary-dark); border-color: var(--primary); background: var(--primary-bg); text-decoration: none; }

/* Popular highlight callout */
.popular-callout { background: linear-gradient(135deg, var(--primary-bg) 0%, #d1fae5 100%); border: 1px solid var(--primary-light); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 2rem; }
.popular-callout h3 { font-size: 1rem; font-weight: 600; color: var(--primary-dark); margin: 0 0 0.75rem; }
.popular-callout ol { margin: 0; padding-left: 1.25rem; }
.popular-callout li { font-size: 0.875rem; color: var(--gray-700); margin-bottom: 0.375rem; }
.popular-callout a { font-weight: 600; }

/* CTA Wrapper */
.cta-wrapper { margin-top: 1.5rem; }
.cta-wrapper .calculate-btn { display: inline-flex; width: auto; padding: 0 2rem; }

/* Contact Form */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); }
.form-group input,
.form-group select,
.form-group textarea { width: 100%; padding: 0.625rem 0.75rem; font-size: 0.9375rem; font-family: var(--font-sans); color: var(--gray-900); background: var(--gray-50); border: 1px solid var(--gray-300); border-radius: var(--radius); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-group textarea { resize: vertical; min-height: 120px; }

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.font-mono { font-family: var(--font-mono); }

/* Calculator Mobile Styles */
@media (max-width: 800px) {
  .calculator-card { margin-left: 0; margin-right: 0; border-radius: var(--radius-lg); }
  .content-section { margin-left: 0; margin-right: 0; border-radius: var(--radius-lg); }
  .faq-list, .blog-grid { margin-left: 0; margin-right: 0; }
}
@media (max-width: 768px) {
  .comparison-grid { grid-template-columns: repeat(2, 1fr); }
  .related-articles-grid { grid-template-columns: 1fr 1fr; }
  .bar-chart-item { grid-template-columns: 110px 1fr auto; }
  .stat-row { grid-template-columns: 110px 1fr auto; }
}
@media (max-width: 600px) {
  .calc-panel { padding: 1rem; }
  .calc-tabs { gap: 0; }
  .calc-tab { min-width: 0; padding: 0.625rem 0.25rem; }
  .calc-tab svg { width: 18px; height: 18px; }
  .calc-tab-label { font-size: 0.625rem; }
  .time-inputs { gap: 0.25rem; }
  .time-inputs .form-input { width: 52px; padding: 0 0.25rem; font-size: 0.875rem; }
  .time-inputs .form-select { min-width: 60px; font-size: 0.8125rem; padding-right: 1.5rem; }
  .time-separator { font-size: 1rem; }
  .preset-btn { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }
  .radio-option { padding: 0.4375rem 0.625rem; font-size: 0.8125rem; }
  .result-value { font-size: 1.75rem; }
  .results-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tips-grid { grid-template-columns: 1fr; }
  .input-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .comparison-grid { grid-template-columns: 1fr; }
  .related-articles-grid { grid-template-columns: 1fr; }
  .bar-chart-item { grid-template-columns: 90px 1fr auto; gap: 0.5rem; }
  .bar-chart-label { font-size: 0.75rem; }
  .bar-chart-track { height: 22px; }
  .bar-chart-value { font-size: 0.75rem; min-width: 44px; }
  .stat-row { grid-template-columns: 90px 1fr auto; gap: 0.5rem; }
  .toc { padding: 1rem; }
  .breadcrumb { font-size: 0.75rem; }
  .callout { padding: 1rem; }
  .jump-links { gap: 0.375rem; }
  .jump-link { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }
}

/* Print Styles */
@media print {
  .splits-table-wrapper { max-height: none; overflow: visible; }
  .header, .footer, .nav-toggle, .calculate-btn, .print-btn, .jump-links { display: none !important; }
  .calculator-card, .content-section { box-shadow: none; border: 1px solid var(--gray-300); }
  .results-section { display: block !important; }
  body { background: white; }
  .result-primary { border: 2px solid var(--primary); }
  .bar-chart-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .stat-row-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .callout { print-color-adjust: exact; -webkit-print-color-adjust: exact; break-inside: avoid; }
  .comparison-grid { break-inside: avoid; }
  .comparison-card { border: 1px solid var(--gray-300); }
  .related-articles { display: none; }
  .toc { break-inside: avoid; }
  .breadcrumb { color: var(--gray-600); }
  .category-tag { border: 1px solid var(--gray-300); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
