/* Performance tables on the aircraft pages.
 *
 * Its own shared stylesheet on purpose: the look of 40+ generated pages is
 * changed here, not by regenerating them. Colours come from the site tokens in
 * pages.css so a theme change carries through without touching this file.
 */

/* FD-715: the status line (in the app or not, reviewed when, how many tables
 * are from the handbook) and the heading on a section still drawn from the
 * app's library rather than the handbook data file. Two classes deep, so
 * .prose p (0,1,1) cannot repaint them. */
.prose p.ac-status {
  margin: 0 0 18px; padding: 10px 14px; font-size: 0.92rem; line-height: 1.5;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.prose p.ac-status strong { color: var(--text); font-weight: 650; }
.prose p.legacy-head {
  margin: -6px 0 10px; padding-left: 10px; font-size: 0.88rem; font-weight: 650;
  line-height: 1.4; color: var(--accent-amber); border-left: 3px solid var(--accent-amber);
}

.perf-cond { margin: 2px 0 2px; font-size: 0.95rem; color: var(--text); }
.perf-src  { margin: 0 0 14px; font-size: 0.82rem; color: var(--text-dim); }

/* --- weight selector ---------------------------------------------------- */
.perf-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.perf-tabs button {
  font: inherit; font-size: 0.86rem; line-height: 1.2; padding: 6px 14px;
  cursor: pointer; border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: var(--bg-card); color: var(--text-muted);
}
.perf-tabs button:hover { background: var(--bg-card-hover); color: var(--text); }
.perf-tabs button[aria-pressed="true"] {
  background: rgba(59,130,246,0.18); border-color: var(--accent-blue);
  color: var(--text); font-weight: 600;
}

/* --- the grid ------------------------------------------------------------ */
table.perf-table {
  width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums;
}
table.perf-table caption {
  text-align: left; font-size: 0.84rem; color: var(--text-dim); padding: 0 0 8px;
}
table.perf-table th, table.perf-table td {
  padding: 6px 10px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.perf-table thead th {
  font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border-bright);
}
table.perf-table th[scope="row"] { text-align: left; color: var(--text-muted); font-weight: 500; }
table.perf-table td b { font-weight: 650; color: var(--text); }
table.perf-table td span { display: block; font-size: 0.82rem; color: var(--text-dim); }
/* Only rendered when this stylesheet is missing; see gen_aircraft_perf.py. */
table.perf-table td i.sep { display: none; }

/* How a cell was obtained -- three different kinds of claim, never alike. */
td.c-int { background: rgba(59,130,246,0.07); }
td.c-ext { background: rgba(148,163,184,0.10); }

.perf-key { font-size: 0.82rem; color: var(--text-muted); margin: 10px 0 0; }
.perf-key .k {
  display: inline-block; width: 11px; height: 11px; vertical-align: -1px;
  border: 1px solid var(--border-bright); border-radius: 3px; margin-right: 4px;
}
.perf-key .k-poh { background: transparent; }
.perf-key .k-int { background: rgba(59,130,246,0.30); }
.perf-key .k-ext { background: rgba(148,163,184,0.35); }

.perf-note {
  margin: 10px 0; font-size: 0.86rem; color: var(--text-muted);
}
.perf-notes { font-size: 0.85rem; color: var(--text-muted); margin: 12px 0 0; padding-left: 20px; }
.perf-notes li { margin: 4px 0; }

@media (max-width: 640px) {
  table.perf-table th, table.perf-table td { padding: 5px 7px; font-size: 0.86rem; }
  table.perf-table thead th { font-size: 0.72rem; }
}

@media print {
  .perf-tabs { display: none; }
  .perf-panel[hidden] { display: block !important; }   /* print every weight */
  td.c-int, td.c-ext { background: none; }
  td.c-ext b::after { content: " *"; font-weight: 400; }
  table.perf-table td i.sep { display: inline; }
  table.perf-table td span { display: inline; }
}

/* FD-715: a cell the handbook itself prints in gray ("may not be achievable"). */
td.c-gray { color: var(--text-dim); background: rgba(148,163,184,0.10); }
.perf-key .k-gray { background: rgba(148,163,184,0.35); }
@media print { td.c-gray { color: #666; } }
