/* ============================================================
   form.css — Forms tier theme (Spec 2 §8)
   ============================================================
   Visual identity:
   - Primary color: burgundy #8C2D2D (the operational-artifact
     accent, deliberately apart from the governance gold/green/
     teal palette). Bright variant for hover/secondary accents.
   - Header layout: small logo + title with "Form" type label
     below (mirrors the WI inversion).
   - Body is a PDF iframe (not markdown prose) — no body
     typography rules needed; just the header band, the compact
     metadata table, and the iframe container.

   Used by class="form" documents (FORM-XX-NNN, Tier 4).
   ============================================================ */

:root {
  --form-accent-primary: #8C2D2D;
  --form-accent-bright:  #A63D3D;
  --form-accent-light:   #F5E6E6;
  --form-accent-dark:    #6F2424;
}

/* ---------- Header band ------------------------------------ */
.gov-header.form {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--form-accent-primary);
  margin-bottom: 10px;
}

.form-logo-strip {
  margin-bottom: 8px;
}

.form-logo-strip img {
  height: 56px;
  width: auto;
  display: block;
}

.form-meta-block { width: 100%; }

.form-title {
  font-size: 14pt;
  font-weight: 600;
  color: #1F1F1F;
  line-height: 1.15;
  margin: 0;
}

.form-type {
  font-family: Calibri, sans-serif;
  font-style: italic;
  color: var(--form-accent-primary);
  font-size: 9pt;
  margin: 0;
  line-height: 1.2;
}

/* ---------- Metadata table — compact, two pairs per row ----- */
.form-meta-table {
  width: 100%;
  margin: 0 0 10px 0;
  font-size: 8.5pt;
}

/* Lay the label/value cells out as two field-pairs per row (label | value | label |
   value) to use the full width and roughly halve the table's height. Each <tr> is
   display:contents so its <th>/<td> become grid items that flow into the four tracks;
   the two label tracks are max-content (so labels align) and the two value tracks share
   the remaining width equally. */
.form-meta-table tbody {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
  column-gap: 18px;
}

.form-meta-table tr { display: contents; }

.form-meta-table th,
.form-meta-table td {
  text-align: left;
  vertical-align: top;
  padding: 3px 8px;
  border-bottom: 1px solid #ECECEC;
  line-height: 1.3;
}

.form-meta-table th {
  font-weight: 600;
  color: var(--form-accent-dark);
  background: var(--form-accent-light);
  white-space: nowrap;
}

@media (max-width: 700px) {
  /* Stack back to a single pair per row on narrow viewports. */
  .form-meta-table tbody { grid-template-columns: max-content minmax(0, 1fr); }
}

/* ---------- PDF iframe container --------------------------- */
.form-iframe-wrap {
  width: 100%;
  height: 80vh;
  min-height: 480px;
  border: 1px solid #D4D4D4;
  border-radius: 3px;
  margin: 10px 0;
  background: #F8F8F8;
}

.form-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.form-iframe-fallback {
  font-size: 8.5pt;
  color: var(--text-muted, #555);
  margin: 6px 0 0 0;
}

/* ---------- Sidebar tier-dot accent (used by _TierSidebar) -- */
.sb-dot.burgundy { background: var(--form-accent-primary); }
.sb-tier.burgundy.active { color: var(--form-accent-primary); }

/* ---------- Print: collapse to first-page only -------------- */
@media print {
  .form-iframe-wrap,
  .form-iframe-fallback {
    display: none !important;
  }
  /* The metadata table still prints — staff who print the View page get the
     summary cover sheet; the PDF body itself is printed separately via the
     browser's PDF reader. */
}
