/**
 * style_cv.css
 *
 * CV stylesheet inspired by mdmath.latex.css
 * Keeps a LaTeX / academic / refined visual identity,
 * adapted for a stable two-column A4 résumé layout.
 */

/* =========================
   Fonts
   ========================= */

@font-face {
  font-family: 'Latin Modern';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/LM-regular.woff2') format('woff2'),
    url('./fonts/LM-regular.woff') format('woff'),
    url('./fonts/LM-regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Latin Modern';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/LM-italic.woff2') format('woff2'),
    url('./fonts/LM-italic.woff') format('woff'),
    url('./fonts/LM-italic.ttf') format('truetype');
}

@font-face {
  font-family: 'Latin Modern';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/LM-bold.woff2') format('woff2'),
    url('./fonts/LM-bold.woff') format('woff'),
    url('./fonts/LM-bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Latin Modern';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/LM-bold-italic.woff2') format('woff2'),
    url('./fonts/LM-bold-italic.woff') format('woff'),
    url('./fonts/LM-bold-italic.ttf') format('truetype');
}

/* =========================
   Global
   ========================= */

html {
  font-size: 11pt;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Latin Modern', Palatino, Georgia, Cambria, 'Times New Roman', Times, serif;
  color: #072c2c;
  background-color: #fffff8;
  word-wrap: break-word;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

a,
a:visited,
a:hover {
  color: inherit;
  text-decoration-skip-ink: auto;
}

p {
  margin: 0.4rem 0 0.7rem 0;
  text-align: left;
  hyphens: none;
}

ul {
  margin: 0.35rem 0 0.7rem 0;
  padding-left: 1.1rem;
}

li {
  margin: 0.2rem 0;
}

hr {
  display: block;
  width: 58%;
  height: 0;
  border: 0;
  border-top: 1.5px solid #c9c9c2;
  margin: 1.1rem auto 1.1rem auto;
}

/* =========================
   Page frame
   ========================= */

.cv-page {
  width: 100%;
  max-width: 260mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 14mm 12mm;
  display: grid;
  grid-template-columns: 27% 1fr;
  column-gap: 10mm;
  align-items: start;
}

/* =========================
   Sidebar
   ========================= */

.cv-sidebar {
  font-size: 0.95rem;
  line-height: 1.35;
  padding-right: 0.2rem;
}

.cv-photo-block {
  margin-bottom: 1rem;
}

.cv-photo {
  width: 100%;
  max-width: 42mm;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0 auto 0.8rem auto;
  border-radius: 4px;
}

.LI-photo {
  display: inline;
  /* ou inline-block */
  vertical-align: -7%;
  /* Aligne verticalement le logo avec le texte */
  width: 24px;
  /* Ajustez la taille si nécessaire */
  height: 24px;
  margin-left: 8px;
  /* Espace entre le texte et le logo */
}

.LI-photo-cov {
  display: inline;
  /* ou inline-block */
  vertical-align: -20%;
  /* Aligne verticalement le logo avec le texte */
  width: 20px;
  /* Ajustez la taille si nécessaire */
  height: 20px;
  margin-left: 8px;
  /* Espace entre le texte et le logo */
}

.recipient {
  width: 100%;
  margin-bottom: 1.45rem;
  text-align: right;
  inline-size: none;
}

.cv-identity h1 {
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 0.35rem 0;
}

.cv-target {
  font-size: 1rem;
  font-style: italic;
  margin: 0 0 0.55rem 0;
}

.cv-summary {
  font-size: 0.95rem;
  line-height: 1.35;
}

.cv-sidebar-section {
  margin-bottom: 1.15rem;
}

.cv-sidebar-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.45rem 0;
}

.cv-contact-list,
.cv-sidebar-section ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.cv-sidebar-section li {
  margin: 0.2rem 0;
}

/* =========================
   Main column
   ========================= */

.cv-main {
  font-size: 1rem;
  line-height: 1.4;
}

.cv-section {
  margin-bottom: 1.45rem;
}

.cv-section h2 {
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.7rem 0;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid #cfcfc7;
}

.cv-entry {
  margin-bottom: 1rem;
  list-style: circle;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-entry-header {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.cv-entry-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  font-style: normal;
  margin: 0;
}

.cv-entry-place {
  font-size: 0.95rem;
  font-style: italic;
  margin: 0.1rem 0 0 0;
}

.cv-entry-date {
  font-size: 0.92rem;
  white-space: nowrap;
  margin: 0;
  text-align: right;
}

.cv-entry p:last-child,
.cv-entry ul:last-child {
  margin-bottom: 0;
}

/* =========================
   Optional generic elements
   ========================= */

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

blockquote {
  font-size: 0.92em;
  margin: 0.75rem 1.2rem;
  padding: 0.2rem 0.7rem;
  border-left: 3px solid #999;
  background-color: #efefea;
}

code,
kbd {
  font-family: 'Latin Modern Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.85em;
}

/* =========================
   Responsive screen fallback
   ========================= */

@media screen and (max-width: 500px) {
  .cv-page {
    max-width: 100px;
    min-height: auto;
    padding: 1.5rem 1rem;
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
  }

  .cv-photo {
    max-width: 36mm;
  }

  .cv-entry-header {
    grid-template-columns: 1fr;
  }

  .cv-entry-date {
    text-align: left;
    margin-top: 0.15rem;
  }
}

/* =========================
   Print / PDF
   ========================= */

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #fffff8 !important;
    -webkit-print-color-adjust: exact !important;
    /* Chrome/Safari/Edge */
    print-color-adjust: exact !important;
    /* Firefox */
  }


  .cv-page {
    max-width: none;
    min-height: auto;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 27% 1fr;
    column-gap: 8mm;
  }

  a[href]::after {
    content: none !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .cv-entry,
  .cv-sidebar-section,
  img,
  figure,
  table,
  blockquote {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  p,
  li,
  blockquote {
    widows: 2;
    orphans: 2;
  }
}