/* ============================================================
   CV Christophe ILLGEN — style.css
   Optimisé pour Parsedown.php + responsive smartphone/tablette
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #222;
  background: #f4f4f4;
}

/* ---------- Page wrapper ---------- */
.cv-wrapper,
body > * {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  padding: 0;
}

/* Parsedown wraps everything in a div — target the direct child of body */
body > div,
body > article,
.cv-page {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

/* ---------- Header banner (blue background) ---------- */
.header-banner {
  background-color: #0070C0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem 1.5rem 1.5rem;
  position: relative;
  min-height: 130px;
}

.header-photo {
  flex: 0 0 auto;
}

.header-photo img {
  width: 150px;
  height: 150px;
  border-radius: 10% 10% 10% 10%; /* rounded corner style like Word */
  object-fit: cover;
  display: block;
}

.header-text {
  flex: 1 1 auto;
}

.header-name {
  font-size: 2rem;
  font-weight: normal;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.2rem;
  border: none;
  padding: 0;
}

.header-name strong {
  font-weight: 700;
}

.header-title {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.1rem;
}

.header-subtitle {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

.header-subtitle em {
  font-style: italic;
}

.header-contact {
  font-size: 0.85rem;
  color: #dce8f8;
  margin-bottom: 0.1rem;
}

.header-formation {
  font-size: 0.85rem;
  color: #dce8f8;
}

/* ---------- Main content padding ---------- */
body > div > *:not(.header-banner):not(.kpi-table):not(.cert-table):not(.mission-header),
body > div > p,
body > div > ul,
body > div > ol,
body > div > h2,
body > div > h3,
body > div > hr,
body > div > blockquote {
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Apply global horizontal padding via a wrapper approach */
h2, h3, p, ul, ol, blockquote, hr {
  margin-left: 0;
  margin-right: 0;
}

/* Wrap inner content in padding */
body > div {
  padding: 0;
}

/* Global inner padding for text elements */
h2 { padding: 0 2rem; }
h3 { padding: 0 2rem; }
p  { padding: 0 2rem; }
ul { padding-left: 3.2rem; padding-right: 2rem; }
ol { padding-left: 3.2rem; padding-right: 2rem; }
hr { margin: 1.2rem 2rem; }

/* ---------- Headings ---------- */
h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0070C0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #0070C0;
  padding-bottom: 0.25rem;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1F4E79;
  margin-top: 1.1rem;
  margin-bottom: 0.3rem;
}

/* ---------- Paragraphs ---------- */
p {
  margin-bottom: 0.5rem;
  text-align:justify;
}

/* ---------- Lists ---------- */
ul, ol {
  margin-bottom: 0.5rem;
}

ul li, ol li {
  margin-bottom: 0.2rem;
  text-align:justify;
}

/* Nested lists (sub-bullets) */
ul ul, ol ul {
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  padding-left: 1.5rem;
}

/* ---------- Strong / em ---------- */
strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

/* ---------- HR separator ---------- */
hr {
  border: none;
  border-top: 1px solid #BDD7EE;
  margin-top: 1.4rem;
  margin-bottom: 0;
}

/* ---------- KPI table (chiffres clés) ---------- */
.kpi-table {
  display: flex;
  flex-wrap: wrap;
  background-color: #BDD7EE;
  border-top: 3px solid #0070C0;
  margin: 0.8rem 2rem 0.2rem;
  border-radius: 2px;
}

.kpi-cell {
  flex: 1 1 140px;
  text-align: center;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  color: #1F3864;
  border-right: 1px solid #9DC3E6;
  line-height: 1.3;
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-cell.kpi-wide {
  flex: 2 1 200px;
}

.kpi-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #0070C0;
  margin-bottom: 0.1rem;
}

/* ---------- Certifications table ---------- */
.cert-table {
  display: flex;
  flex-wrap: wrap;
  background-color: #1F4E79;
  margin: 0.6rem 2rem 0.8rem;
  border-radius: 2px;
  text-align: center;
}

.cert-cell {
  flex: 1 1 180px;
  padding: 0.7rem 1rem;
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.4;
  border-right: 1px solid #2E75B6;
  vertical-align:middle;
}

.cert-cell:last-child {
  border-right: none;
}

.cert-cell strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.88rem;
}

/* ---------- Mission header (metadata bar) ---------- */
.mission-header {
  display: flex;
  flex-wrap: wrap;
  background-color: #DEEAF1;
  border-left: 4px solid #0070C0;
  margin: 0.4rem 2rem 0.7rem;
  padding: 0.5rem 0.8rem;
  gap: 0.5rem 1.5rem;
  font-size: 0.82rem;
  color: #1F3864;
  border-radius: 0 2px 2px 0;
}

.mission-meta {
  white-space: nowrap;
}

.meta-label {
  color: #2E75B6;
  font-weight: 600;
  margin-right: 0.25rem;
}

/* ---------- Inline badge / habilitation styling ---------- */
/* The emoji lock + "TRÈS SECRET" text rendered inline */

/* ---------- Responsive: Tablet (max-width: 768px) ---------- */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .header-banner {
    padding: 1.2rem 1.2rem;
    gap: 1rem;
    min-height: auto;
  }

  .header-photo img {
    width: 85px;
    height: 85px;
  }

  .header-name {
    font-size: 1.5rem;
  }

  .header-title {
    font-size: 0.95rem;
  }

  .header-subtitle {
    font-size: 0.88rem;
  }

  h2 { padding: 0 1.2rem; }
  h3 { padding: 0 1.2rem; }
  p  { padding: 0 1.2rem; }
  ul { padding-left: 2.2rem; padding-right: 1.2rem; }
  ol { padding-left: 2.2rem; padding-right: 1.2rem; }
  hr { margin: 1rem 1.2rem; }

  .kpi-table  { margin: 0.8rem 1.2rem 0.2rem; }
  .cert-table { margin: 0.6rem 1.2rem 0.8rem; }
  .mission-header { margin: 0.4rem 1.2rem 0.7rem; }

  .kpi-cell { flex-basis: 110px; }
  .kpi-cell.kpi-wide { flex-basis: 160px; }
  .cert-cell { flex-basis: 150px; }
}

/* ---------- Responsive: Smartphone (max-width: 480px) ---------- */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .header-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.8rem;
    text-align: left;
  }

  .header-photo img {
    width: 75px;
    height: 75px;
  }

  .header-name {
    font-size: 1.35rem;
  }

  h2 { padding: 0 1rem; font-size: 0.95rem; }
  h3 { padding: 0 1rem; }
  p  { padding: 0 1rem; }
  ul { padding-left: 2rem; padding-right: 1rem; }
  ol { padding-left: 2rem; padding-right: 1rem; }
  hr { margin: 0.8rem 1rem; }

  .kpi-table  { margin: 0.6rem 1rem 0.2rem; flex-direction: column; }
  .cert-table { margin: 0.5rem 1rem 0.6rem; flex-direction: column; }
  .mission-header { margin: 0.3rem 1rem 0.6rem; flex-direction: column; gap: 0.2rem; }

  .kpi-cell {
    border-right: none;
    border-bottom: 1px solid #9DC3E6;
    flex-basis: auto;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
  }

  .kpi-cell:last-child { border-bottom: none; }

  .kpi-value {
    display: inline;
    font-size: 0.95rem;
    margin-bottom: 0;
    min-width: 80px;
  }

  .cert-cell {
    border-right: none;
    border-bottom: 1px solid #2E75B6;
    flex-basis: auto;
    padding: 0.5rem 0.8rem;
  }

  .cert-cell:last-child { border-bottom: none; }

  .mission-meta { white-space: normal; }
}

/* ---------- Print styles ---------- */
@media print {
  body {
    background: #fff;
    font-size: 10pt;
  }

  body > div {
    box-shadow: none;
    max-width: 100%;
  }

  .header-banner {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    background-color: #0070C0 !important;
  }

  .kpi-table, .cert-table {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h2, h3 { page-break-after: avoid; }
  ul, ol, p { page-break-inside: avoid; }

  hr { border-top-color: #BDD7EE; }
}


/* ==========================================================================
   BOUTON FLOTTANT DE TÉLÉCHARGEMENT
   ========================================================================== */
.btn-flottant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: #ffffff !important; /* Force le texte en blanc */
    padding: 12px 24px;
    border-radius: 50px; /* Donne un effet pilule/arrondi */
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
    z-index: 1000; /* S'assure que le bouton passe au-dessus du reste du contenu */
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

/* Effets au survol */
.btn-flottant:hover {
    background-color: #004085; /* Un bleu légèrement plus soutenu */
    transform: translateY(-3px); /* Léger effet de surélévation */
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
    text-decoration: none;
}

/* Effet au clic */
.btn-flottant:active {
    transform: translateY(-1px);
}

/* ==========================================================================
   ADAPTATION MOBILE (MEDIA QUERY)
   ========================================================================== */
@media (max-width: 768px) {
    .btn-flottant {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 0.85rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }
}