/* Homeschool transcript template page only. Loaded after style.css. */

/* CLS reservation for the JS-built tool (see the #gpa-app notes in style.css).
   Swept 2026-11-29 (iframes 316-1350px, min-height cleared): mobile peak 3984 at 316, desktop 2341 at the narrow end. Re-sweep if START_ROWS or row markup changes. */
@media (min-width: 641px) { #gpa-app[data-mode="transcript"] { min-height: 2345px; } }
@media (max-width: 640px) { #gpa-app[data-mode="transcript"] { min-height: 3990px; } }

.tr-section {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.tr-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.tr-field { display: block; }
.tr-field > span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}
.tr-hint { margin: 10px 0 18px; }
.tr-card > .tr-info + .tr-hint { margin-bottom: 22px; }
.tr-year { border-top: 1px solid var(--border); padding-top: 18px; }
.tr-year-row { margin: -4px 0 12px; max-width: 260px; }
.tr-year-input { min-height: 40px; padding: 7px 11px; }

@media (min-width: 641px) {
  .calc-row.tr-row { grid-template-columns: minmax(0, 1fr) 156px 104px 88px 44px; }
}

.tr-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.btn-print {
  appearance: none;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  min-height: 46px;
  padding: 0 18px;
  cursor: pointer;
}
.btn-print:hover { background: var(--accent-ink); }
.btn-print.btn-print-outline { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn-print.btn-print-outline:hover { background: var(--bg); }
.btn-print:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.tr-actions + .tr-hint { margin: 10px 0 0; }

/* the sticky results bar would cover rows on this long form */
#gpa-app[data-mode="transcript"] .results { position: static; }

@media (max-width: 640px) {
  .tr-info { grid-template-columns: 1fr; }
  .tr-year-row { max-width: none; }
  .tr-actions .btn-print { flex: 1 1 100%; }
  /* give the Level dropdown the spare width so "Regular" isn't clipped */
  .calc-row.tr-row .cell[data-label="Level"] { flex: 1 1 0; }
  .calc-row.tr-row .cell[data-label="Grade"] { flex: 0 0 88px; }
  .calc-row.tr-row .cell[data-label="Credits"] { flex: 0 0 68px; }
}

/* sample transcript figure in the article */
.tr-sample { font-variant-numeric: tabular-nums; }
.tr-sample td:nth-child(n+2), .tr-sample th:nth-child(n+2) { white-space: nowrap; }

/* ---------- printed transcript ---------- */
#tr-print { display: none; }

@media print {
  @page { size: letter; margin: 0.5in; }
  body.tr-printing > *:not(#tr-print) { display: none !important; }
  body.tr-printing #tr-print { display: block; }
  #tr-print {
    font-family: Georgia, "Times New Roman", serif;
    color: #000;
    font-size: 9.5pt;
    line-height: 1.35;
  }
  #tr-print h1, #tr-print h2 { font-family: inherit; color: #000; }
  #tr-print h1 {
    font-size: 17pt;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 10pt;
    padding-bottom: 6pt;
    border-bottom: 1.5pt solid #000;
  }
  #tr-print .tp-line { display: flex; gap: 6pt; align-items: baseline; }
  #tr-print .tp-label { font-weight: bold; white-space: nowrap; }
  #tr-print .tp-value { flex: 1; border-bottom: 0.5pt solid #777; min-height: 12pt; }
  #tr-print .tp-info { display: grid; grid-template-columns: 1fr 1fr; gap: 5pt 18pt; margin-bottom: 12pt; }
  #tr-print .tp-years { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt 14pt; }
  #tr-print .tp-year { break-inside: avoid; }
  #tr-print h2 { font-size: 10.5pt; margin: 0 0 3pt; }
  #tr-print table { width: 100%; border-collapse: collapse; }
  #tr-print th, #tr-print td { border: 0.5pt solid #555; padding: 2pt 4pt; text-align: left; }
  #tr-print th { font-size: 8.5pt; background: #eee; }
  #tr-print td:nth-child(n+2), #tr-print th:nth-child(n+2) { width: 13%; text-align: center; }
  #tr-print.tp-blank td { height: 15pt; }
  #tr-print .tp-yfoot { margin: 3pt 0 0; font-size: 8.5pt; }
  #tr-print .tp-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5pt 18pt; margin: 14pt 0 8pt; padding: 6pt 0; border-top: 1pt solid #000; border-bottom: 1pt solid #000; }
  #tr-print .tp-summary .tp-label { white-space: normal; }
  #tr-print .tp-summary .tp-value { min-width: 44pt; }
  #tr-print .tp-key { font-size: 8pt; margin: 0 0 22pt; }
  #tr-print .tp-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 18pt; }
  #tr-print .tp-sign .tp-value { min-height: 18pt; }
}
