/* =============================================================================
   CV PAGE — styles spécifiques
   Chargé uniquement sur /cv/ (type: cv) via head-additions.html
   Le baseof est le thème Mainroad natif — pas de chrome custom.
   ============================================================================= */

/* =============================================================================
   LAYOUT — vraie <table> HTML
   ============================================================================= */
.cv-table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: collapse;
}
.cv-main-content {
  vertical-align: top;
  padding-right: 18px;
}
.cv-aside {
  width: 160px;
  vertical-align: top;
  padding-left: 10px;
}

/* =============================================================================
   EN-TÊTE — fond bleu-gris comme le CV original
   ============================================================================= */
.cv-header {
  background: #eef2f7;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.cv-header h1 {
  font-size: 1.5rem !important;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
  margin: 0 0 4px 0 !important;
}
.cv-job-title {
  font-size: 1.1rem;
  color: #444;
  margin: 0 0 10px 0;
  font-weight: 400;
}
.cv-summary {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.6;
  margin: 0;
}

/* =============================================================================
   TITRES DE SECTION — dashed border, centré, comme le CV original
   ============================================================================= */
.cv-section-title {
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #333;
  border: 1.5px dashed #aaa;
  text-align: center;
  padding: 6px 10px;
  margin: 14px 0 12px 0;
}

/* =============================================================================
   SIDEBAR — séparateurs entre sections, titres uppercase bold à droite
   ============================================================================= */
.cv-aside-section {
  margin-bottom: 0;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
}
.cv-aside-section:last-child {
  border-bottom: none;
}
.cv-aside-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #222;
  text-align: right;
  margin-bottom: 6px;
}
.cv-aside-list {
  list-style: none;
  text-align: right;
  margin: 0;
  padding: 0;
}
.cv-aside-list li {
  font-size: 0.8rem;
  line-height: 1.7;
  color: #333;
}
.cv-aside-list a {
  font-size: 0.8rem;
  color: #2980b9;
}

/* =============================================================================
   EXPÉRIENCES
   ============================================================================= */
.cv-experience-item {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eee;
  page-break-inside: avoid;
}
.cv-experience-item:last-child { border-bottom: none; }

.cv-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}
.cv-exp-company {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}
.cv-exp-company a { color: #2980b9; }
.cv-exp-period {
  font-size: 0.82rem;
  color: #777;
  font-style: italic;
  white-space: nowrap;
}

/* Contenu Markdown : OVERRIDE avec !important car custom.css a h2/h3 !important */
.cv-exp-content { font-size: 0.88rem; color: #333; }
.cv-exp-content p { margin: 3px 0; }
.cv-exp-content ul { margin: 3px 0 3px 14px; }
.cv-exp-content li { margin-bottom: 2px; }

.cv-exp-content h2 {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  margin: 8px 0 3px 0 !important;
  color: #222 !important;
  line-height: 1.3 !important;
  border: none !important;
  padding: 0 !important;
  letter-spacing: 0 !important;
}
.cv-exp-content h3 {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  margin: 6px 0 2px 0 !important;
  color: #333 !important;
  line-height: 1.3 !important;
  border: none !important;
  padding: 0 !important;
  letter-spacing: 0 !important;
}
.cv-exp-content strong { font-weight: 600; }

/* Tags groupés par catégorie dans chaque expérience */
.cv-exp-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.cv-tag-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}
.cv-tag-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-right: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}
.cv-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.6;
}
.cv-tag--platform,
.cv-tag--tool,
.cv-tag--methodology,
.cv-tag--service,
.cv-tag--language,
.cv-tag--skill       { background: #f0f0f0; color: #444; border: 1px solid #ddd; }

/* Masquer la section 'Environnement & Technologies' dans la vue CV
   Les tags la remplacent avantageusement */
.cv-exp-content h2:last-of-type,
.cv-exp-content h3:last-of-type { display: none; }
.cv-exp-content h2:last-of-type ~ *,
.cv-exp-content h3:last-of-type ~ * { display: none; }

/* Expériences legacy */
.cv-exp-legacy .cv-exp-company { color: #555; font-size: 0.9rem; font-weight: 600; }
.cv-exp-legacy .cv-exp-content { font-size: 0.82rem; color: #666; }

/* =============================================================================
   DARK MODE
   ============================================================================= */
[data-theme="dark"] .cv-header           { background: #1e2a38; }
[data-theme="dark"] .cv-header h1        { color: #f0f0f0 !important; }
[data-theme="dark"] .cv-job-title        { color: #bbb; }
[data-theme="dark"] .cv-summary          { color: #ccc; }

[data-theme="dark"] .cv-section-title    { color: #ccc; border-color: #555; }

[data-theme="dark"] .cv-aside-section    { border-bottom-color: #333; }
[data-theme="dark"] .cv-aside-title      { color: #ddd; }
[data-theme="dark"] .cv-aside-list li    { color: #ccc; }

[data-theme="dark"] .cv-experience-item  { border-bottom-color: #333; }
[data-theme="dark"] .cv-exp-company      { color: #f0f0f0; }
[data-theme="dark"] .cv-exp-period       { color: #999; }
[data-theme="dark"] .cv-exp-content      { color: #ccc; }
[data-theme="dark"] .cv-exp-content h2   { color: #eee !important; }
[data-theme="dark"] .cv-exp-content h3   { color: #ddd !important; }
[data-theme="dark"] .cv-exp-legacy .cv-exp-company { color: #aaa; }
[data-theme="dark"] .cv-exp-legacy .cv-exp-content { color: #999; }

/* =============================================================================
   PRINT / WeasyPrint — masque le chrome Mainroad, pleine largeur A4
   ============================================================================= */
@page { size: A4; margin: 12mm; }

@media print {
  /* Masquer le chrome Mainroad */
  .header, .footer, footer, .menu, nav,
  .lang-switcher, .theme-switcher,
  .sidebar, .widget, .pager, .authorbox,
  .cv-download-action      { display: none !important; }

  /* Fond blanc, supprimer les contraintes de largeur */
  html, body               { background: #fff !important; }
  .container--outer, .wrapper, .wrapper.flex,
  .primary, .main, .content, .main__content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    box-shadow: none !important;
  }

  /* Tags : compact et sans couleur dans le PDF */
  .cv-exp-tags       { display: block !important; margin-top: 4pt !important; }
  .cv-tag-group      { display: inline !important; margin-right: 6pt; }
  .cv-tag-label      { display: none !important; }
  .cv-tag {
    display: inline !important;
    background: none !important;
    color: #444 !important;
    font-size: 6.5pt !important;
    padding: 0 2pt !important;
    border-radius: 0 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
  }

  /* Adapter la taille du texte pour A4 */
  .cv-header h1            { font-size: 14pt !important; }
  .cv-job-title            { font-size: 10pt !important; }
  .cv-summary              { font-size: 8pt !important; }
  .cv-exp-company          { font-size: 9pt !important; }
  .cv-exp-content          { font-size: 8pt !important; }
  .cv-exp-content h2       { font-size: 8pt !important; }
  .cv-exp-content h3       { font-size: 7.5pt !important; }
  .cv-aside-list li        { font-size: 7.5pt !important; }
  .cv-aside-title          { font-size: 7pt !important; }
  .cv-section-title        { font-size: 7pt !important; }
  .cv-aside                { width: 145px !important; }

  /* Fond header adapté pour l'impression */
  .cv-header               { background: #f0f4f8 !important; }
}
