/* Plan pages (scurry.run/plans/). Builds on /styles.css variables. */

.plan-main { padding-top: 2rem; padding-bottom: 3.5rem; }
.plan-main a:not(.btn-primary):not(.btn-secondary):not(.plan-card) { color: var(--green); }
.crumbs { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin-bottom: 1.75rem; }
.crumbs a { color: var(--ink-2) !important; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.plan-hero { padding-bottom: 1.75rem; border-bottom: 1px solid var(--rule-strong); }
.plan-hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 0.9rem; }
.plan-main .eyebrow { margin-bottom: 0.75rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 760px; }
.jump { margin-top: 1rem; font-family: var(--mono); font-size: 0.85rem; }

.stats { list-style: none; display: flex; flex-wrap: wrap; margin: 1.75rem 0 0; border: 1px solid var(--rule-strong); width: fit-content; max-width: 100%; }
.stats li { padding: 0.75rem 1.4rem 0.8rem 1rem; min-width: 130px; border-right: 1px solid var(--rule); }
.stats li:last-child { border-right: 0; }
.stats strong { display: block; font-family: var(--mono); font-size: 1.4rem; font-weight: 600; }
.stats span { color: var(--ink-2); font-size: 0.82rem; }

.plan-actions { background: var(--card); border: 1px solid var(--rule); padding: 1.25rem 1.5rem; margin: 2rem 0; }
.date-field { display: inline-flex; flex-direction: column; font-weight: 600; font-size: 0.9rem; gap: 0.35rem; }
.date-field input { font: inherit; font-family: var(--mono); font-weight: 400; padding: 0.5rem 0.65rem; border-radius: 4px; border: 1px solid var(--rule-strong); background: #fff; color: var(--ink); color-scheme: light; }
.date-hint, .action-note, .table-help { color: var(--ink-2); font-size: 0.9rem; margin: 0.5rem 0; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 0.5rem; }
.action-buttons button { font: inherit; font-weight: 600; font-size: 0.95rem; }

.plan-section { margin: 3rem 0; max-width: 1100px; }
.plan-section h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.85rem; }
.plan-section h3 { font-size: 1.1rem; margin: 1.25rem 0 0.35rem; }
.plan-section p { margin-bottom: 0.85rem; color: var(--ink-2); max-width: 820px; }
.plan-section p strong { color: var(--ink); }

/* table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule-strong); background: var(--card); }
.plan-table { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 0.86rem; }
.plan-table th, .plan-table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); vertical-align: top; text-align: left; }
.plan-table th:last-child, .plan-table td:last-child { border-right: 0; }
.plan-table thead th { background: var(--paper-2); position: sticky; top: 0; font-family: var(--mono); font-weight: 400; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); border-bottom: 1px solid var(--rule-strong); }
.plan-table tbody th { position: sticky; left: 0; background: var(--card); white-space: nowrap; min-width: 92px; }
.plan-table .wk { display: block; font-family: var(--mono); font-weight: 600; font-size: 0.82rem; }
.plan-table .wk-date { display: block; font-family: var(--mono); font-weight: 400; color: var(--ink-3); font-size: 0.72rem; }
.plan-table .lbl { display: block; line-height: 1.3; color: var(--ink-2); }
.plan-table .mi { display: block; font-family: var(--mono); font-weight: 600; margin-top: 0.15rem; color: var(--ink); }
.plan-table td.total { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.plan-table td[title] { cursor: help; }
.t-rest { color: var(--ink-3); }
.t-rest .lbl { color: var(--ink-3); }
.t-long { background: var(--green-tint); }
.t-workout { background: var(--orange-tint); }
.t-workout .mi { color: var(--orange); }
.t-recovery .mi { color: var(--ink-2); }
.t-cross { color: var(--ink-2); font-style: italic; }
.t-race { background: var(--ink); font-weight: 700; }
.t-race .lbl, .t-race .mi { color: var(--paper); }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.25rem; font-weight: 400; color: var(--ink-2); }
.tag-peak { color: var(--orange); }
.tag-race { color: var(--green); }

.workout-list { padding-left: 1.2rem; color: var(--ink-2); columns: 2; column-gap: 2.5rem; }
.workout-list li { margin-bottom: 0.45rem; break-inside: avoid; font-size: 0.95rem; }
.guide-page .workout-list { columns: 1; max-width: 46rem; }
.guide-page .plan-section > p { max-width: 46rem; }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 0; border-top: 1px solid var(--rule-strong); }
.glossary dt, .glossary dd { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }
.glossary dt { font-weight: 700; padding-right: 1.5rem; }
.glossary dd { color: var(--ink-2); }

.plan-cta { background: var(--green-tint); border: 1px solid var(--rule); border-left: 4px solid var(--green); padding: 2rem 2rem 2.1rem; margin: 3.5rem 0; }
.plan-cta h2 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-cta p { max-width: 640px; margin: 0.5rem 0 1.25rem; color: var(--ink-2); }

.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.related ul { list-style: none; }
.related li { margin: 0.35rem 0; }

/* index page */
.plan-group { margin: 3rem 0; }
.plan-group h2 { margin-bottom: 1rem; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--rule-strong); border-left: 1px solid var(--rule); }
.plan-card { display: flex; flex-direction: column; gap: 0.35rem; background: var(--card); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1rem 1.1rem 1.1rem; color: var(--ink); text-decoration: none; transition: background 0.15s; }
.plan-card:hover { background: #fff; }
.plan-card:hover strong, .plan-card:hover h3 { color: var(--green); text-decoration: underline; }
.card-meta { color: var(--ink-2); font-family: var(--mono); font-size: 0.78rem; }
.card-level { align-self: flex-start; font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 400; color: var(--ink-2); }
.lvl-beginner { color: var(--green); }
.lvl-intermediate { color: var(--ink-2); }
.lvl-advanced { color: var(--orange); }

.plan-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--ink-2); font-size: 0.85rem; }
.plan-footer p { margin-bottom: 0.75rem; max-width: 820px; }
.plan-footer a { color: var(--ink-2); }

/* distance hub comparison table */
.compare-table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 0.9rem; }
.compare-table th, .compare-table td { padding: 0.6rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.compare-table thead th { background: var(--paper-2); font-family: var(--mono); font-weight: 400; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); border-bottom: 1px solid var(--rule-strong); }
.compare-table tbody th { font-weight: 600; min-width: 170px; }
.compare-table td:nth-child(3), .compare-table td:nth-child(4), .compare-table td:nth-child(5), .compare-table td:nth-child(6) { font-family: var(--mono); white-space: nowrap; }
.compare-table .start-if { color: var(--ink-2); min-width: 220px; }
.plan-group h2 a { color: inherit; text-decoration: none; }
.plan-group h2 a:hover { text-decoration: underline; }

/* pace calculator */
.date-field[hidden] { display: none; }
.calc-mode { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1rem; font-weight: 600; }
.calc-mode label { display: inline-flex; gap: 0.4rem; align-items: center; cursor: pointer; }
.calc-grid { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.calc-inline { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-weight: 400; }
.calc-inline input[type="number"] { width: 4.5rem; }
.date-field select { font: inherit; font-weight: 400; padding: 0.5rem 0.65rem; border-radius: 4px; border: 1px solid var(--rule-strong); background: #fff; color: var(--ink); color-scheme: light; }
.calc-result .stats { margin-top: 1.5rem; }
.calc-sub { font-size: 1.1rem; margin: 1.75rem 0 0.6rem; }
.calc .compare-table { min-width: 0; }

/* quick answers */
.quick-answers { margin: 2rem 0 0; max-width: 1100px; }
.quick-answers h2 { font-family: var(--mono); font-weight: 400; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin-bottom: 0.6rem; }
.quick-answers dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--rule-strong); }
.quick-answers dl > div { padding: 0.8rem 1rem 0.9rem 0; border-bottom: 1px solid var(--rule); }
.quick-answers dt { font-weight: 700; margin-bottom: 0.25rem; }
.quick-answers dd { color: var(--ink-2); font-size: 0.95rem; margin: 0; }

@media (max-width: 700px) {
  .workout-list { columns: 1; }
  .glossary { grid-template-columns: 1fr; }
  .glossary dt { border-bottom: 0; padding-bottom: 0; }
  .plan-actions { padding: 1rem; }
  .action-buttons > * { width: 100%; text-align: center; }
  .stats li { min-width: 50%; border-bottom: 1px solid var(--rule); }
}

@media (prefers-color-scheme: dark) {
  .date-field input, .date-field select { background: var(--paper); color: var(--ink); color-scheme: dark; border-color: var(--rule-strong); }
  .t-race { background: var(--green); }
  .t-race .lbl, .t-race .mi { color: var(--on-pop); }
  .tag-race { color: var(--green); }
  .plan-card:hover { background: var(--paper-2); }
  .lvl-intermediate { color: var(--yellow); }
  .t-long .mi { color: var(--green); }
}

/* ---------- printable view ---------- */
@media print {
  :root { --ink: #000; --ink-2: #333; --ink-3: #666; --paper: #fff; --paper-2: #eee; --card: #fff; --rule: #999; --rule-strong: #666; --green: #0a6b4b; --orange: #c2410c; --yellow: #333; --green-tint: #e6f4f1; --orange-tint: #fdeee2; --on-pop: #000; }
  @page { size: landscape; margin: 10mm; }
  body, .plan-page { background: #fff !important; color: #000 !important; }
  .navbar, .plan-actions, .plan-cta, .related, .plan-footer, .crumbs, .table-help, .glossary, .faq, .quick-answers, .stats, script { display: none !important; }
  .plan-section:not(:has(.plan-table)) { display: none; }
  .plan-main { padding: 0; max-width: none; }
  .plan-hero h1 { font-size: 16pt; margin: 0 0 2mm; color: #000; }
  .eyebrow { color: #333; margin: 0; }
  .lede { display: none; }
  .plan-section { margin: 3mm 0 0; max-width: none; }
  .plan-section h2 { display: none; }
  .table-wrap { overflow: visible; border: 0; }
  .plan-table { min-width: 0; font-size: 7.5pt; color: #000; }
  .plan-table th, .plan-table td { padding: 1.2mm 1mm; border: 0.5pt solid #999; background: none !important; color: #000 !important; opacity: 1 !important; }
  .plan-table thead th, .plan-table tbody th { position: static; background: #eee !important; }
  .plan-table .mi, .plan-table .wk-date { color: #000 !important; }
  .t-long { background: #e6f4f1 !important; }
  .t-workout { background: #fdeee2 !important; }
  .t-race { background: #d9f2df !important; }
  .t-rest { color: #888 !important; }
  .tag { border: 0.5pt solid #666; background: none !important; }
  tr { break-inside: avoid; }
  .plan-table .lbl, .plan-table .mi, .plan-table .wk, .plan-table .wk-date { display: inline; margin: 0; }
  .plan-table .mi::before, .plan-table .wk-date::before { content: " "; }
  .plan-table .tag { margin: 0 0 0 1mm; font-size: 6pt; padding: 0 1mm; }
  .plan-table th, .plan-table td { padding: 0.9mm 1mm; line-height: 1.25; }
  .plan-hero::after { content: "scurry.run/plans · Customize this plan free at app.scurry.run"; display: block; font-size: 8pt; color: #555; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; }
}
