/* ============================================================
   Trinity Air Link — Shared Print Stylesheet
   Optimized for Letter (8.5×11) PDF output
   ============================================================ */

:root {
  --navy:    #0f2444;
  --blue:    #1a4a7a;
  --cyan:    #00D4FF;
  --gold:    #b8860b;
  --light:   #e8f4f8;
  --border:  #c5d8e8;
  --text:    #1a1a1a;
  --muted:   #5a6a7a;
  --white:   #ffffff;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 11pt; }

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  widows: 2;
  orphans: 2;
}

/* ---- Page Setup ---- */
@page {
  size: letter;
  margin: 0.75in 0.85in 0.9in 0.85in;
}

@page :first { margin-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0; }

/* ---- Cover Page ---- */
.cover-page {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  page-break-after: always;
  break-after: page;
  page-break-inside: avoid;
  break-inside: avoid;
  position: relative;
  overflow: hidden;
}

.cover-hero {
  width: 100%;
  height: 65vh;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  opacity: 0.55;
}

.cover-body {
  flex: 1;
  padding: 1.8rem 3rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cover-eyebrow {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.6rem;
}

.cover-title {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  font-size: 26pt;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 0.4rem;
}

.cover-subtitle {
  font-size: 11pt;
  color: #a0c4d8;
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.cover-divider {
  width: 60px;
  height: 3px;
  background: var(--cyan);
  margin-bottom: 0.8rem;
}

.cover-desc {
  font-size: 9.5pt;
  color: #c8dde8;
  max-width: 540px;
  line-height: 1.5;
  margin-bottom: 0;
}

.cover-footer {
  background: rgba(0,0,0,0.35);
  padding: 0.8rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 8.5pt;
  color: #8aafc0;
  flex-shrink: 0;
  gap: 1rem;
}

.cover-footer .logo {
  font-weight: 800;
  font-size: 10pt;
  color: #fff;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.cover-footer > span:not(.logo) {
  white-space: nowrap;
}

.cover-stat-bar {
  display: flex;
  gap: 2rem;
  margin: 1rem 0 0;
  flex-wrap: nowrap;
}

.cover-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.cover-stat .val {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 16pt;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1.1;
}
.cover-stat .lbl {
  font-size: 7pt;
  color: #8aafc0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  white-space: nowrap;
}

/* ---- Confidentiality Banner ---- */
.confidential-banner {
  background: var(--gold);
  color: #fff;
  text-align: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem;
}

/* ---- Running Header/Footer (non-cover pages) ---- */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 1.8rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 8pt;
  color: var(--muted);
}

.doc-header .brand {
  font-weight: 700;
  font-size: 9pt;
  color: var(--navy);
  letter-spacing: 0.05em;
}

.doc-footer-bar {
  margin-top: 2rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 7.5pt;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: 'Helvetica Neue', 'Arial', sans-serif;
  color: var(--navy);
  line-height: 1.25;
}

h1 { font-size: 20pt; font-weight: 900; margin-bottom: 0.5rem; }
h2 { font-size: 14pt; font-weight: 800; margin: 2rem 0 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--navy); page-break-after: avoid; break-after: avoid; }
h3 { font-size: 11.5pt; font-weight: 700; margin: 1.4rem 0 0.5rem; color: var(--blue); }
h4 { font-size: 10pt; font-weight: 700; margin: 1rem 0 0.3rem; color: var(--navy); }

p { margin-bottom: 0.75rem; }

strong { font-weight: 700; }
em { font-style: italic; }

/* ---- Section Numbers ---- */
.section-num {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 8pt;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
  page-break-after: avoid;
  break-after: avoid;
}

/* ---- Pull Quote / Callout ---- */
.callout {
  border-left: 4px solid var(--cyan);
  background: var(--light);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  font-size: 10.5pt;
}

.callout.alert {
  border-left-color: #d97706;
  background: #fffbeb;
}

.pull-quote {
  border-left: 4px solid var(--navy);
  padding: 0.8rem 1.5rem;
  margin: 1.5rem 2rem;
  font-size: 12pt;
  font-style: italic;
  color: var(--blue);
  line-height: 1.5;
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 9.5pt;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

th {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 0.7rem;
  text-align: left;
  font-size: 8.5pt;
  letter-spacing: 0.03em;
}

td {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:nth-child(even) td { background: #f4f8fb; }
tr:last-child td { font-weight: 700; background: #e8f4f8; }

/* ---- Stat Grid ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.stat-box {
  background: var(--navy);
  color: #fff;
  padding: 0.9rem 0.8rem;
  text-align: center;
  border-radius: 4px;
}

.stat-box .val {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 16pt;
  font-weight: 900;
  color: var(--cyan);
  display: block;
  line-height: 1.1;
}

.stat-box .lbl {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 7.5pt;
  color: #a0c4d8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
  display: block;
}

.stat-box .sub {
  font-size: 7pt;
  color: #6899b0;
  display: block;
  margin-top: 0.2rem;
}

/* ---- Phase Timeline ---- */
.phase-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}

.phase-box {
  border: 1.5px solid var(--border);
  border-top: 4px solid var(--cyan);
  padding: 0.8rem 0.7rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.phase-box .ph-num {
  font-size: 7.5pt;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.phase-box .ph-name {
  font-size: 9.5pt;
  font-weight: 800;
  color: var(--navy);
  margin: 0.2rem 0;
}

.phase-box .ph-detail {
  font-size: 7.5pt;
  color: var(--muted);
  line-height: 1.4;
}

/* ---- Two-Column Layout ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 0;
}

.two-col.wide-left  { grid-template-columns: 3fr 2fr; }
.two-col.wide-right { grid-template-columns: 2fr 3fr; }

/* ---- Lists ---- */
ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 0.8rem;
}

li { margin-bottom: 0.3rem; font-size: 10.5pt; }

ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li::before { content: "✓ "; color: var(--cyan); font-weight: 700; }

ul.bullets { list-style: disc; }
ul.bullets li { color: var(--text); }

/* ---- Image ---- */
.doc-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 3px;
  margin: 0.8rem 0;
  display: block;
}

.doc-image.tall { height: 280px; }
.doc-image.short { height: 130px; }

.image-caption {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 7.5pt;
  color: var(--muted);
  font-style: italic;
  margin-top: -0.4rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ---- Risk Table Colors ---- */
.risk-low  td:first-child { border-left: 4px solid #16a34a; }
.risk-med  td:first-child { border-left: 4px solid #d97706; }
.risk-high td:first-child { border-left: 4px solid #dc2626; }

/* ---- Revenue Scenario Bar ---- */
.scenario-bar {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin: 1rem 0;
  height: 90px;
}

/* ---- Page Breaks ---- */
.page-break     { page-break-before: always; break-before: page; }
.no-break       { page-break-inside: avoid;  break-inside: avoid; }
.keep-with-next { page-break-after: avoid;   break-after:  avoid; }

/* ---- TOC ---- */
.toc { margin: 1rem 0 1.5rem; }
.toc-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.25rem 0;
  border-bottom: 1px dotted var(--border);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 9.5pt;
}
.toc-item .toc-title { color: var(--text); }
.toc-item .toc-pg { color: var(--muted); font-size: 8.5pt; }
.toc-section {
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.5rem;
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.5rem;
}

/* ---- Contact Block ---- */
.contact-block {
  background: var(--navy);
  color: #fff;
  padding: 1.2rem 1.5rem;
  border-radius: 4px;
  margin-top: 1.5rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 9pt;
}

.contact-block h4 { color: var(--cyan); margin-bottom: 0.5rem; font-size: 10pt; }
.contact-block a  { color: #a0d8ef; text-decoration: none; }

/* ---- Print overrides ---- */
@media print {
  body { font-size: 10.5pt; }
  .cover-page { page-break-after: always; break-after: page; height: 100vh; }
  a { text-decoration: none; color: inherit; }

  h2 { page-break-before: auto; break-before: auto; page-break-after: avoid; break-after: avoid; }
  h3, h4 { page-break-after: avoid; break-after: avoid; }
  table, .stat-grid, .phase-row, .two-col, .callout {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  tr { page-break-inside: avoid; break-inside: avoid; }
  .no-break { page-break-inside: avoid; break-inside: avoid; }
}

/* ---- Screen preview (desktop) ---- */
@media screen {
  body { max-width: 8.5in; margin: 0 auto; padding: 0; background: #d0d8e0; }
  .cover-page { min-height: 11in; }
  .doc-page {
    background: #fff;
    padding: 0.75in 0.85in 0.9in;
    margin: 0.5rem auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-height: 11in;
  }
}

/* ---- Mobile Back-to-Site Navigation ---- */
.mobile-back-nav {
  display: none;
}

/* ---- Mobile Responsive (screen only, never applied to print) ---- */
@media screen and (max-width: 768px) {

  /* Show back-to-site nav bar */
  .mobile-back-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--navy);
    color: #fff;
    padding: 0.75rem 1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .mobile-back-nav a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
  }
  .mobile-back-nav .doc-name {
    color: #a0c4d8;
    font-size: 11px;
    text-align: right;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Reset desktop preview constraints */
  body {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    font-size: 14px;
  }

  .doc-page {
    padding: 1rem !important;
    min-height: unset !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  /* ---- Cover Page ---- */
  .cover-page {
    height: auto !important;
    min-height: unset !important;
  }
  .cover-hero {
    height: 200px !important;
    width: 100%;
  }
  .cover-body {
    padding: 1.2rem 1rem 1rem !important;
  }
  .cover-footer {
    padding: 0.75rem 1rem !important;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .cover-footer > span:not(.logo) {
    white-space: normal;
    font-size: 10px;
  }
  .cover-stat-bar {
    flex-wrap: wrap !important;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
  }
  .cover-stat {
    min-width: 44%;
    flex: 1 1 44%;
  }
  .cover-stat .val { font-size: 18px; }
  .cover-stat .lbl { font-size: 9px; white-space: normal; text-align: center; }
  .cover-title { font-size: 22px !important; }
  .cover-subtitle { font-size: 13px !important; }
  .cover-divider { margin-bottom: 0.6rem; }
  .cover-desc { font-size: 13px; }

  /* ---- Typography ---- */
  h1 { font-size: 20px !important; }
  h2 { font-size: 16px !important; margin: 1.2rem 0 0.6rem; }
  h3 { font-size: 14px !important; margin: 1rem 0 0.4rem; }
  h4 { font-size: 13px !important; }
  p  { font-size: 13px; }
  li { font-size: 13px; }

  /* ---- Shared Grid Layouts → single column ---- */
  .stat-grid,
  .stat-grid.cols-3,
  .stat-grid.cols-2,
  .phase-row,
  .two-col,
  .two-col.wide-left,
  .two-col.wide-right {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  /* Stat box font scaling */
  .stat-box .val { font-size: 20px; }
  .stat-box .lbl { font-size: 10px; }

  /* Phase box readable */
  .phase-box .ph-num  { font-size: 10px; }
  .phase-box .ph-name { font-size: 12px; }
  .phase-box .ph-detail { font-size: 11px; }

  /* ---- Tables: horizontal scroll ---- */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
    white-space: nowrap;
    min-width: unset;
  }
  thead, tbody, tr { display: table; width: 100%; }
  th { font-size: 11px; padding: 0.4rem 0.5rem; }
  td { font-size: 11px; padding: 0.35rem 0.5rem; }

  /* ---- Callout & Pull Quote ---- */
  .callout { padding: 0.75rem 1rem; font-size: 13px; }
  .pull-quote { margin: 1rem 0; padding: 0.6rem 0.8rem; font-size: 13px; }

  /* ---- Images ---- */
  .doc-image,
  .doc-image.tall,
  .doc-image.short {
    height: auto !important;
    max-height: 220px;
  }

  /* ---- Confidential banner ---- */
  .confidential-banner { font-size: 10px; padding: 0.3rem; }

  /* ---- Running header/footer (print artifacts) ---- */
  .doc-header  { display: none; }
  .doc-footer-bar { display: none; }

  /* ---- Contact block ---- */
  .contact-block { padding: 1rem; }
  .contact-block h4 { font-size: 13px; }

  /* ---- Scenario bar ---- */
  .scenario-bar { height: auto; flex-wrap: wrap; }
}
