/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #1a6b5a;
  --accent-light: #e8f4f1;
  --accent-dark: #124d40;
  --sidebar-bg: #1e2a26;
  --sidebar-text: #d4e8e3;
  --sidebar-heading: #7ecfba;
  --body-bg: #f4f6f5;
  --text: #1c2b27;
  --text-muted: #5a7068;
  --border: #d0ddd9;
  --white: #ffffff;
  --tag-bg: #2e4a42;
  --tag-text: #a8d8cc;
  --period-color: #7ecfba;
  --radius: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 2rem;
}

/* === TOP NAV === */
.top-nav {
  width: 100%;
  max-width: 1060px;
  background: var(--white);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

.top-nav-inner {
  padding: 0.6rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.nav-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #000970;
  letter-spacing: 0.02em;
}

.nav-logo {
  height: 32px;
  width: auto;
  border-radius: 4px;
  display: block;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.15s;
}

.nav-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* === LAYOUT === */
.cv-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-width: 1060px;
  width: 100%;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
  align-items: start;
}

/* === SIDEBAR === */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 2.5rem 1.6rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100%;
}

/* Profile */
.profile {
  text-align: center;
}

.portrait {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: grayscale(10%);
  transition: filter 0.3s;
}

.portrait:hover {
  filter: grayscale(0%);
}

.profile h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.tagline {
  font-size: 0.82rem;
  color: var(--sidebar-heading);
  margin-top: 0.35rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  background: var(--accent);
  color: var(--white);
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 0.6rem;
}

/* Sidebar headings */
.sidebar h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-heading);
  font-weight: 700;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Contact */
.contact ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.contact li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--sidebar-text);
}

.contact li svg {
  width: 14px;
  height: 14px;
  fill: var(--sidebar-heading);
  flex-shrink: 0;
}

.contact a {
  color: var(--sidebar-text);
  text-decoration: none;
  transition: color 0.2s;
}

.contact a:hover {
  color: var(--sidebar-heading);
}

/* Skills */
.skill-group {
  margin-bottom: 0.9rem;
}

.skill-group h3 {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tags span {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.tags span:hover {
  background: var(--accent);
  color: var(--white);
}

/* Languages */
.lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.lang-name {
  color: var(--white);
  font-weight: 600;
}

.lang-level {
  color: var(--sidebar-heading);
  font-size: 0.75rem;
}

/* === MAIN === */
.main {
  padding: 2.5rem 2.4rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: var(--white);
}

/* Positioning */
.positioning {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}

.positioning strong {
  color: var(--accent-dark);
}

/* Section titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}

.section-title svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  flex-shrink: 0;
}

/* Missions */
.mission-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.mission-list li {
  font-size: 0.87rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.mission-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* Jobs */
.job {
  border-left: 3px solid var(--border);
  padding-left: 1.2rem;
  margin-bottom: 1.4rem;
  position: relative;
  transition: border-color 0.25s;
}

.job::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  transition: border-color 0.25s, background 0.25s;
}

.job:hover {
  border-color: var(--accent);
}

.job:hover::before {
  border-color: var(--accent);
  background: var(--accent-light);
}

.job:last-child {
  margin-bottom: 0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.job h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.company {
  color: var(--accent);
}

.job-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.job-period {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.job ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.job li {
  font-size: 0.85rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.job li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.job strong {
  color: var(--accent-dark);
}

/* Education */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.edu-item {
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.edu-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(26,107,90,0.08);
}

.edu-degree {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.edu-school {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* === PRINT === */
@media print {
  @page {
    size: A4;
    margin: 1.2cm 1.5cm;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    transition: none !important;
  }

  .top-nav {
    display: none !important;
  }

  body {
    background: white;
    padding: 0;
    font-size: 9.5pt;
  }

  /* Single-column layout */
  body {
    min-height: 0 !important;
  }

  .cv-wrapper {
    display: block;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    min-height: 0 !important;
    height: auto !important;
  }

  /* Sidebar → compact header band */
  .sidebar {
    background: white;
    color: #1c2b27;
    padding: 0 0 0.5cm;
    border-bottom: 2px solid #1a6b5a;
    margin-bottom: 0.5cm;
    display: block;
    min-height: 0 !important;
    height: auto !important;
    gap: 0;
  }

  .main {
    padding: 0;
    gap: 0.3cm;
    background: white;
    display: flex !important;
    flex-direction: column;
    min-height: 0 !important;
    height: auto !important;
  }

  /* Profile: photo + name side by side */
  .profile {
    display: flex;
    align-items: center;
    gap: 0.6cm;
    text-align: left;
    margin-bottom: 0.35cm;
  }

  .portrait {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    filter: none;
    margin: 0;
  }

  .profile h1 {
    color: #1c2b27;
    font-size: 15pt;
    font-weight: 700;
  }

  .tagline {
    color: #1a6b5a;
    font-size: 8.5pt;
    margin-top: 0.1cm;
  }

  .status {
    font-size: 7.5pt;
    background: #1a6b5a;
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.2cm;
  }

  /* Contact: single horizontal row, no heading */
  .contact {
    margin-bottom: 0.3cm;
  }

  .contact h2 { display: none; }

  .contact ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.1cm 0.55cm;
  }

  .contact li {
    color: #1c2b27;
    font-size: 8.5pt;
  }

  .contact li svg {
    fill: #1a6b5a;
  }

  .contact a {
    color: #1a6b5a;
    text-decoration: none;
  }

  /* Skills: pill grid, 4 columns */
  .skills-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.15cm 0.4cm;
    margin-bottom: 0.2cm;
  }

  .skills-section h2 {
    grid-column: 1 / -1;
    color: #1a6b5a;
    font-size: 6.5pt;
    border-bottom: 1px solid #d0ddd9;
    margin-bottom: 0.1cm;
    padding-bottom: 0.08cm;
    display: block;
  }

  .skills-section h2::after { content: ''; }

  .skill-group {
    display: block;
    margin: 0;
  }

  .skill-group::after { content: ''; }

  .skill-group h3 {
    display: block;
    color: #5a7068;
    font-size: 6.5pt;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    margin-bottom: 0.1cm;
  }

  .skill-group h3::after { content: ''; }

  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1cm;
  }

  .tags span {
    display: inline-block;
    background: #e8f4f1;
    color: #124d40;
    font-size: 6.5pt;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    font-weight: 500;
  }

  .tags span::after { content: ''; }

  /* Languages: inline horizontal row */
  .languages-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.1cm 0.5cm;
  }

  .languages-section h2 {
    color: #1a6b5a;
    font-size: 6.5pt;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .lang-item {
    flex-direction: row;
    gap: 0.2cm;
    border-bottom: none;
    padding: 0;
    font-size: 7.5pt;
  }

  .lang-name { color: #1c2b27; }
  .lang-level { color: #5a7068; font-size: 7.5pt; }

  .positioning {
    background: #e8f4f1;
    border-left: 3px solid #1a6b5a;
    border-radius: 0 4px 4px 0;
    font-size: 8.5pt;
    padding: 0.2cm 0.5cm;
  }

  .section-title {
    color: #1a6b5a;
    font-size: 7pt;
    border-bottom-color: #e8f4f1;
    margin-bottom: 0.2cm;
  }

  .section-title svg { fill: #1a6b5a; }

  .mission-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .mission-list li { font-size: 8pt; }
  .mission-list li::before { background: #1a6b5a; }

  .job {
    border-left-color: #d0ddd9;
    margin-bottom: 0.25cm;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .job::before { border-color: #d0ddd9; background: white; }

  .job h3  { color: #1c2b27; font-size: 9pt; }
  .job-meta { font-size: 7pt; color: #5a7068; }

  .job-period {
    background: #e8f4f1;
    color: #1a6b5a;
    font-size: 6.5pt;
  }

  .job li { font-size: 8pt; }
  .job li::before { color: #1a6b5a; }
  .job strong { color: #124d40; }

  .edu-list { gap: 0.18cm; }

  .edu-item {
    border-color: #d0ddd9;
    padding: 0.18cm 0.4cm;
    box-shadow: none;
    break-inside: avoid;
  }

  .edu-degree { font-size: 8.5pt; }
  .edu-school  { font-size: 7.5pt; }

  /* Hide interactive elements */
  button[aria-label="Imprimer le CV"] { display: none !important; }
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
  .top-nav-inner { padding: 0.5rem 1rem; }
  .nav-logo { height: 28px; }

  .cv-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 2rem 1.4rem;
  }

  .mission-list {
    grid-template-columns: 1fr;
  }

  .job-header {
    flex-direction: column;
    gap: 0.3rem;
  }
}
