/* ═══════════════════════════════════════════════════════════════
   mofa-print.css — Ministerial Briefing Print Stylesheet
   وزارة الخارجية والتعاون الدولي — MOFA Intelligence
   © TamkeenAI 2026 | للاستخدام الداخلي فقط
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   SCREEN STYLES (visible on screen, hidden in print)
   ────────────────────────────────────────────────────────────── */

.pdf-fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9999;
  background: linear-gradient(135deg, #D4AF37, #f0c040);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 12px 22px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(212,175,55,0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
  direction: rtl;
  letter-spacing: 0.3px;
}
.pdf-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(212,175,55,0.6);
}
.pdf-fab:active { transform: translateY(0); }

/* Print-only elements hidden on screen */
.print-header,
.print-class-banner,
.print-footer-stamp {
  display: none;
}

/* ──────────────────────────────────────────────────────────────
   PRINT STYLES
   ────────────────────────────────────────────────────────────── */

@media print {

  /* ── Page setup ── */
  @page {
    size: A4 portrait;
    margin: 18mm 22mm 20mm 22mm;
  }
  @page :first {
    margin-top: 12mm;
  }

  /* ── Global reset: dark → white ── */
  html, body {
    background: #fff !important;
    color: #111 !important;
    font-family: 'Cairo', 'Noto Kufi Arabic', Arial, sans-serif !important;
    font-size: 10pt !important;
    line-height: 1.65 !important;
    direction: rtl !important;
  }

  /* ── Kill dark backgrounds everywhere ── */
  *, *::before, *::after {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* ── Hide UI chrome ── */
  nav,
  .pdf-fab,
  .ticker-bar,
  .hd-btn,
  .nav-links,
  .hd-right,
  button:not(.print-keep),
  .profile-badge,
  .alert-action,
  .search-bar,
  .status-pill,
  .mofa-gate-overlay,
  .mofa-gate-lock,
  #mofaGateOverlay,
  [data-pdf-hide] {
    display: none !important;
  }

  /* ── Show print-only elements ── */
  .print-header       { display: block !important; }
  .print-class-banner { display: flex  !important; }
  .print-footer-stamp { display: block !important; }

  /* ────────────────────────────────────────────────
     OFFICIAL HEADER (shown only in print)
     ──────────────────────────────────────────────── */
  .print-header {
    text-align: center;
    padding: 0 0 14pt 0;
    border-bottom: 2.5pt double #8B6914;
    margin-bottom: 12pt;
  }
  .print-header .ph-emblem {
    font-size: 42pt;
    display: block;
    margin-bottom: 6pt;
  }
  .print-header .ph-title {
    font-size: 15pt;
    font-weight: 900;
    color: #5a3d0a !important;
    display: block;
    margin: 4pt 0 2pt;
  }
  .print-header .ph-sub {
    font-size: 9pt;
    color: #666 !important;
    display: block;
    margin: 2pt 0;
  }
  .print-header .ph-date {
    font-size: 8pt;
    color: #999 !important;
    display: block;
    margin-top: 6pt;
    letter-spacing: 0.5px;
  }
  .print-header .ph-docid {
    font-size: 7pt;
    color: #aaa !important;
    display: block;
    margin-top: 3pt;
    direction: ltr;
  }

  /* ────────────────────────────────────────────────
     CLASSIFICATION BANNER
     ──────────────────────────────────────────────── */
  .print-class-banner {
    justify-content: center;
    align-items: center;
    gap: 16pt;
    background: #111 !important;
    color: #fff !important;
    padding: 4pt 0;
    font-size: 8pt;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 12pt;
  }
  .print-class-banner span { color: #fff !important; }

  /* ────────────────────────────────────────────────
     COLOR REMAPPING: gold/accent → dark gold/bronze
     ──────────────────────────────────────────────── */
  .profile-name span,
  .section-title, .section-tag, .section-hd-title,
  h1, h2, h3,
  .kpi-val, .tl-date,
  .hd-brand .hd-title,
  .gold-text,
  .nav-logo-text,
  .feed-badge,
  .feed-card.statement,
  .focus-card h3,
  [style*="color: var(--gold)"],
  [style*="color:var(--gold)"],
  [style*="color: #D4AF37"],
  [style*="color:#D4AF37"],
  [style*="color: #f0c040"],
  [style*="color:#f0c040"] {
    color: #7a5010 !important;
    -webkit-text-fill-color: #7a5010 !important;
  }

  /* ── Muted text ── */
  .muted, [class*="muted"],
  .profile-since, .tl-desc, .feed-source, .feed-date,
  .alert-sub, .kpi-lbl, .kpi-trend,
  .ev-person, .news-footer, .news-date,
  footer, .hd-sub,
  [style*="color: var(--muted)"],
  [style*="color:var(--muted)"] {
    color: #555 !important;
  }

  /* ── White/light text → dark ── */
  .profile-name, .section-title, .info-card h3,
  .tl-title, .feed-title, .news-title, .ev-title,
  .focus-card h3, .alert-title,
  [style*="color:#fff"], [style*="color: #fff"],
  [style*="color: white"], [style*="color:white"] {
    color: #111 !important;
  }

  /* ────────────────────────────────────────────────
     CARDS & PANELS
     ──────────────────────────────────────────────── */
  .info-card, .focus-card, .feed-card, .diplomat-card,
  .kpi-tile, .alert, .ev-item, [class*="card"],
  [class*="panel"], [class*="tile"], .section-wrap,
  .tl-item {
    background: #fff !important;
    border: 0.4pt solid #ccc !important;
    border-radius: 3pt !important;
    color: #111 !important;
  }

  /* KPI tiles accent bar */
  .kpi-tile::after {
    background: #8B6914 !important;
  }

  /* Alert borders */
  .alert.critical { border-color: #c0392b !important; }
  .alert.warning  { border-color: #d35400 !important; }
  .alert.info     { border-color: #8B6914 !important; }
  .alert.success  { border-color: #27ae60 !important; }

  /* ────────────────────────────────────────────────
     TABLES
     ──────────────────────────────────────────────── */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  table th {
    background: #f5eed8 !important;
    color: #5a3d0a !important;
    border-bottom: 1.5pt solid #8B6914 !important;
    font-size: 9pt !important;
    padding: 6pt 8pt !important;
  }
  table td {
    border-bottom: 0.3pt solid #ddd !important;
    font-size: 9pt !important;
    padding: 5pt 8pt !important;
    color: #111 !important;
  }
  table tr:hover { background: transparent !important; }

  /* ────────────────────────────────────────────────
     GRID ADJUSTMENTS FOR PRINT
     ──────────────────────────────────────────────── */
  .info-grid, .focus-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .feed-grid {
    grid-template-columns: 1fr !important;
  }
  .diplomat-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  .kpi-strip {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* ────────────────────────────────────────────────
     TIMELINE
     ──────────────────────────────────────────────── */
  .timeline::before {
    background: #8B6914 !important;
    width: 1.5pt !important;
  }
  .tl-item::before {
    background: #8B6914 !important;
    border-color: #fff !important;
    border-width: 2pt !important;
  }

  /* ────────────────────────────────────────────────
     PAGE BREAKS
     ──────────────────────────────────────────────── */
  section {
    page-break-inside: avoid;
  }
  h2, h3 {
    page-break-after: avoid;
  }
  .info-grid, .focus-grid, .kpi-strip {
    page-break-inside: avoid;
  }
  .timeline { page-break-inside: avoid; }

  /* ────────────────────────────────────────────────
     BADGES
     ──────────────────────────────────────────────── */
  .award-badge, .feed-tags .tag,
  [class*="badge"], .news-type-badge,
  .status-tag, .relation-badge, .risk-badge {
    background: #eee !important;
    color: #333 !important;
    border: 0.3pt solid #aaa !important;
  }

  /* ────────────────────────────────────────────────
     LINKS
     ──────────────────────────────────────────────── */
  a { color: #1a56a0 !important; }
  a[href]::after {
    content: none !important; /* Don't print URLs */
  }

  /* ────────────────────────────────────────────────
     HERO SECTION
     ──────────────────────────────────────────────── */
  .hero { padding-top: 16pt !important; }
  .profile-icon, .hero::before { display: none !important; }

  /* ────────────────────────────────────────────────
     FOOTER
     ──────────────────────────────────────────────── */
  footer {
    border-top: 0.5pt solid #ccc !important;
    font-size: 7.5pt !important;
    color: #999 !important;
    padding: 8pt 0 !important;
    text-align: center;
    margin-top: 20pt !important;
  }

  .print-footer-stamp {
    text-align: center;
    font-size: 7pt !important;
    color: #aaa !important;
    border-top: 0.3pt solid #ddd;
    padding-top: 6pt;
    margin-top: 10pt;
  }

  /* ────────────────────────────────────────────────
     LEAFLET MAP — hide in print
     ──────────────────────────────────────────────── */
  .leaflet-container, #map, [id*="map"], [class*="map-"] {
    display: none !important;
  }

  /* ────────────────────────────────────────────────
     RADAR / SVG — basic print
     ──────────────────────────────────────────────── */
  svg { max-width: 200pt !important; }
}
