/* ---------------------------------------------------------------------------
   plans.css  ·  /workout-plans/*. The plan itself is the payload of these
   pages, so it is styled to be read and printed, not decorated.
--------------------------------------------------------------------------- */

/* Key facts, above the plan, so the reader can reject the page in two seconds. */
.plan-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 3px; margin: 30px 0 20px; overflow: hidden;
}
.plan-facts > div { background: var(--panel); padding: 14px 16px; min-width: 0; }
.plan-facts dt {
  font: 600 10.5px 'Space Grotesk', sans-serif; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--muted);
}
.plan-facts dd { margin: 5px 0 0; color: var(--ink); font-size: 15px; line-height: 1.45; }

.plan-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.plan-actions button { font: inherit; cursor: pointer; }

.plan-phase { margin: 30px 0 0; }
.plan-phase-head {
  border-left: 2px solid var(--lime); background: var(--panel);
  border: 1px solid var(--line); border-left-width: 2px;
  padding: 18px 20px; border-radius: 3px 3px 0 0;
}
.plan-phase-head small {
  display: block; font: 600 10.5px 'Space Grotesk', sans-serif;
  letter-spacing: 1.2px; color: var(--lime);
}
.plan-phase-head h3 {
  margin: 7px 0 5px; font: 600 22px 'Space Grotesk', sans-serif;
  letter-spacing: -0.6px; color: var(--ink); padding: 0; border: 0;
}
.plan-phase-head p { margin: 0; color: var(--muted); font-size: 15px; max-width: 70ch; }

.plan-days {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-top: 0;
}
.plan-day { background: var(--panel); padding: 16px 18px; min-width: 0; }
.plan-day > small {
  font: 600 10px 'Space Grotesk', sans-serif; letter-spacing: 1.3px; color: var(--muted);
}
.plan-day h4 {
  margin: 5px 0 12px; font: 600 17px 'Space Grotesk', sans-serif;
  letter-spacing: -0.3px; color: var(--ink);
}

.plan-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.plan-table thead th {
  font: 600 9.5px 'Space Grotesk', sans-serif; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 0 0 7px; border-bottom: 1px solid var(--line);
}
.plan-table tbody th {
  font-weight: 400; text-align: left; color: var(--ink);
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); line-height: 1.4;
}
.plan-table tbody td {
  padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--lime);
  white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums;
}
.plan-table tbody tr:last-child th, .plan-table tbody tr:last-child td { border-bottom: 0; }

.plan-note {
  background: var(--panel2); border: 1px solid var(--line); border-top: 0;
  padding: 14px 18px; margin: 0; font-size: 14.5px; color: var(--muted);
  border-radius: 0 0 3px 3px; max-width: none; line-height: 1.65;
}
.plan-note b { color: var(--ink); }

/* Swap tables are three columns of prose and need to breathe, not sit in cards. */
.tbl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; margin: 16px 0; }
.plan-table.swaps { min-width: 520px; font-size: 14.5px; }
.plan-table.swaps thead th { padding: 11px 14px; background: var(--panel2); }
.plan-table.swaps tbody th, .plan-table.swaps tbody td {
  padding: 10px 14px; text-align: left; white-space: normal; color: var(--ink);
}
.plan-table.swaps tbody td:first-child { color: var(--muted); }
.plan-table.swaps tbody td:last-child { color: var(--lime); }

.plan-grid .tool-card em {
  display: block; margin-top: 9px; font-style: normal;
  font: 600 10.5px 'Space Grotesk', sans-serif; letter-spacing: 1.1px; color: var(--lime);
}

@media print {
  /* The plan is the reason the sheet exists: keep each session whole and let
     the grid go to two columns so a four-day phase fits a page. */
  .plan-actions { display: none !important; }
  .plan-days { grid-template-columns: 1fr 1fr; }
  .plan-day, .plan-phase { break-inside: avoid; page-break-inside: avoid; }
  .plan-phase + .plan-phase { break-before: page; page-break-before: always; }
  .plan-table tbody td { color: #2f3d17; }
  .plan-phase-head small { color: #4c6b0a; }
  .plan-facts { border-color: #c2c8c0; }
}
