/* ═══════════════════════════════════════════════════════════════════════════
   Company Profile — print / PDF export stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {

  /* ─── Page setup ─────────────────────────────────────────────────────── */
  @page {
    size: letter portrait;
    margin: 0.75in 0.85in 0.9in;
  }

  @page :first {
    margin-top: 0.5in;
  }

  /* ─── Base resets ────────────────────────────────────────────────────── */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cp-body {
    font-size: 10pt;
    background: #fff !important;
    color: #14140f !important;
  }

  /* ─── Hide interactive chrome ────────────────────────────────────────── */
  .cp-sidebar,
  .cp-header-brand,
  .cp-sidebar-controls,
  .cp-search-mount,
  .cp-search,
  .cp-period-picker,
  .cp-peer-tags,
  .cp-ai-refresh-btn,
  .cp-drawer,
  .cp-drawer-overlay,
  .cp-peer-modal,
  .cp-modal-overlay,
  .cp-not-found,
  .cp-coverage-card,
  #cp-peer-edit-btn,
  .cp-btn-ghost,
  .cp-btn-primary,
  nav,
  footer {
    display: none !important;
  }

  /* ─── Unstack the two-column layout ─────────────────────────────────── */
  .cp-layout {
    display: block !important;
  }

  .cp-main {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* ─── Header: full-width branded bar ─────────────────────────────────── */
  .cp-header {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    height: auto !important;
    padding: 0 0 12pt !important;
    border-bottom: 2pt solid #14140f !important;
    box-shadow: none !important;
    page-break-after: avoid;
    grid-template-columns: none !important;
  }

  .cp-header-identity {
    width: 100% !important;
  }

  .cp-company-name {
    font-size: 26pt !important;
    margin-bottom: 2pt !important;
  }

  .cp-company-sub {
    font-size: 10pt !important;
  }

  .cp-kpi-strip {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    border-top: 1pt solid #e4e4de;
    margin-top: 10pt;
    padding-top: 8pt;
    width: 100%;
  }

  .cp-kpi-tile {
    border-left: none !important;
    padding: 4pt 14pt 4pt 0 !important;
    min-width: 80pt !important;
  }

  /* ─── Section breaks ─────────────────────────────────────────────────── */
  .cp-section {
    page-break-before: auto;
    page-break-inside: avoid;
    padding-top: 18pt !important;
    padding-bottom: 18pt !important;
    border-bottom: none !important;
  }

  .cp-section-title { font-size: 16pt !important; }
  .cp-section-desc {
    font-size: 9pt !important;
    color: #6b6b66 !important;
    margin-bottom: 10pt !important;
  }

  /* ─── Cards ──────────────────────────────────────────────────────────── */
  .cp-card,
  .cp-ai-summary-card,
  .cp-what-changed {
    page-break-inside: avoid;
    box-shadow: none !important;
    border-color: #e4e4de !important;
    background: #fff !important;
  }

  /* ─── AI summary: italic serif blockquote ────────────────────────────── */
  .cp-ai-summary-text {
    font-size: 10pt !important;
    line-height: 1.45 !important;
  }

  /* ─── Charts: preserve rendered SVG ─────────────────────────────────── */
  .cp-chart-row {
    grid-template-columns: repeat(3, 1fr) !important;
    page-break-inside: avoid;
    gap: 8pt !important;
  }

  .cp-chart-container {
    min-height: 160pt !important;
  }

  /* ─── Financial tables (Income / BS / CF) ────────────────────────────── */
  .cp-fin-table-wrap { overflow: visible !important; }
  .cp-fin-table {
    font-size: 9pt !important;
    page-break-inside: auto;
  }
  .cp-fin-table thead { display: table-header-group; }
  .cp-fin-table tbody tr { page-break-inside: avoid; }
  .cp-fin-table td.clickable {
    color: #14140f !important;
    text-decoration: none !important;
  }
  .cp-fin-tabs { display: none !important; } /* tab buttons useless on paper */

  /* ─── Generic metric tables (Operations / Acreage / Reserves / Credit / Guidance) */
  .cp-metric-card { padding: 0 !important; }
  .cp-metric-meta { padding: 6pt 0 !important; font-size: 8pt !important; }
  .cp-metric-table-wrap { overflow: visible !important; }
  .cp-metric-table {
    font-size: 9pt !important;
    page-break-inside: auto;
  }
  .cp-metric-table thead { display: table-header-group; }
  .cp-metric-table tbody tr { page-break-inside: avoid; }
  .cp-metric-table .cp-metric-group-row td {
    background: #f5f5ef !important;
    font-size: 10pt !important;
    padding: 6pt 8pt 3pt !important;
  }
  .cp-metric-table tbody td { padding: 4pt 8pt !important; }

  /* ─── Hedge book ─────────────────────────────────────────────────────── */
  .cp-hedge-card { padding: 0 !important; }
  .cp-hedge-meta { padding: 6pt 0 !important; font-size: 8pt !important; }
  .cp-hedge-source-link { color: #14140f !important; text-decoration: none !important; }
  .cp-hedge-table-wrap { overflow: visible !important; }
  .cp-hedge-table {
    font-size: 9pt !important;
    page-break-inside: auto;
  }
  .cp-hedge-table thead { display: table-header-group; }
  .cp-hedge-table tbody tr { page-break-inside: avoid; }
  .cp-hedge-commodity {
    padding: 8pt 0 !important;
    page-break-inside: avoid;
  }
  .cp-hedge-commodity-label { font-size: 11pt !important; }

  /* ─── Maturity ladder: keep bars in print ────────────────────────────── */
  .cp-maturity-card {
    padding: 8pt 0 !important;
    page-break-inside: avoid;
  }
  .cp-maturity-bar {
    background: #00b09a !important;
  }
  .cp-maturity-row {
    page-break-inside: avoid;
  }

  /* ─── Coming-soon: hide in print ─────────────────────────────────────── */
  .cp-coming-soon-card { display: none !important; }

  /* ─── Drawer / modal: never print ───────────────────────────────────── */
  .cp-drawer,
  .cp-peer-modal { display: none !important; }

  /* ─── Branded print footer via CSS ──────────────────────────────────── */
  .cp-body::after {
    content: 'AFE Leaks  ·  afeleaks.com  ·  Confidential';
    display: block;
    font-size: 8pt;
    color: #9a9890;
    text-align: center;
    margin-top: 24pt;
    padding-top: 8pt;
    border-top: 1pt solid #e4e4de;
  }

}
