/* =========================================================
   BASE
========================================================= */

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.45;
}

.cv {
  max-width: 900px;
  margin: 20px auto 40px;
  padding: 20px;
}


/* =========================================================
   HEADER
========================================================= */

header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.header-flex {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.header-text {
  flex: 1;
}

.profile-photo img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

p {
  text-align: justify;
  margin-top: 3px;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #1f4fd8;
}

h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #1f4fd8;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.subtitle {
  margin-top: 6px;
  font-size: 15px;
  color: #555;
}

section {
  margin-top: 20px;
}


/* =========================================================
   EXPERIENCE BLOCK
========================================================= */

.experience {
  margin-bottom: 10px;
  padding: 14px 16px;

  border-left: 4px solid var(--accent-color);
  background: var(--block-bg);

  border-radius: 4px;
  font-size: 14px;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.experience:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}


/* =========================================================
   EXPERIENCE HEADER
========================================================= */

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.experience h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-color);
}

.exp-date {
  font-size: 13px;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
}


/* =========================================================
   META
========================================================= */

.exp-meta {
  font-size: 14px;
  margin-top: 2px;
}

.meta-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px;
}

.meta-label {
  color: var(--accent-color);
  font-weight: 500;
  text-align: right;
}

.meta-label::after {
  content: " :";
}

.meta-value {
  color: #000;
}


/* =========================================================
   DESCRIPTION
========================================================= */

.exp-desc {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;

  font-size: 13.5px;
  line-height: 1.5;
  color: #333;
  text-align: justify;
}


/* =========================================================
   SKILLS
========================================================= */

.exp-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.full-width {
  grid-column: 1 / -1;
}

.skills-block {
  background: var(--skills-bg);
  padding: 10px 12px;
  border-radius: 6px;
}

.skills-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 6px;
}

.skills-block ul {
  margin: 0;
  padding-left: 16px;
}

.skills-block li {
  font-size: 13px;
  margin-bottom: 2px;
}


/* =========================================================
   THEMES
========================================================= */

.theme-exp {
  --accent-color: #1f4fd8;
  --block-bg: #f4f7ff;
  --skills-bg: #e9efff;
}

.theme-educ {
  --accent-color: #2a9d8f;
  --block-bg: #eefaf8;
  --skills-bg: #e3f5f2;
}

.theme-motivation {
  --accent-color: #6c4df6;
  --block-bg: #f4f2ff;
  --skills-bg: #ebe8ff;
}


/* =========================================================
   MOTIVATION SPECIFIC
========================================================= */

.theme-motivation .skills-block {
  padding: 14px 16px;
}

.theme-motivation p {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.theme-motivation .skills-title {
  margin-top: 10px;
  letter-spacing: 0.02em;
  position: relative;
  padding-left: 14px;
}

.theme-motivation .skills-title:first-child {
  margin-top: 0;
}

.theme-motivation .skills-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
}


/* =========================================================
   TRANSITION BLOCK
========================================================= */

.transition {
  margin-top: 50px;
  margin-bottom: 18px;
  padding: 12px 16px;

  border-left: 4px solid #999;
  background: #f9f9fb;

  font-size: 13px;
  font-style: italic;
  color: #444;

  border-radius: 4px;
}

.transition.exp {
  border-left-color: #1f4fd8;
  background: #f4f7ff;
}

.transition.educ {
  border-left-color: #2a9d8f;
  background: #eefaf8;
}


/* =========================================================
   LINKS
========================================================= */

a {
  color: #000 !important;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* =========================================================
   TOOLBAR / TOGGLES
========================================================= */

.toolbar {
  max-width: 900px;
  margin: 10px auto;
  display: flex;
  gap: 10px;
}

.toolbar label {
  display: inline-block;
}

/* ===============================
   BUTTONS
================================= */

.toggle-btn {
  position: relative;
  padding: 6px 14px;

  background: linear-gradient(180deg, #f5f7ff, #e6ecff);
  border: 1px solid #d0d8ff;
  border-radius: 20px;

  font-size: 13px;
  font-weight: 500;
  color: #1f4fd8;

  cursor: pointer;
  user-select: none;

  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: linear-gradient(180deg, #e9efff, #dce5ff);
  transform: translateY(-1px);
}

.toggle-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* ===============================
   TOGGLE TEXT
================================= */

.toggle-btn .long,
.toggle-btn .reverse {
  display: none;
}

#toggleView:checked~.cv .toolbar .short {
  display: none;
}

#toggleView:checked~.cv .toolbar .long {
  display: inline;
}

#toggleOrder:checked~.cv .toolbar .chrono {
  display: none;
}

#toggleOrder:checked~.cv .toolbar .reverse {
  display: inline;
}


/* ===============================
   ACTIVE STATE (ONLY TOGGLES)
================================= */

#toggleView:checked~.cv .toolbar label.toggle[for="toggleView"],
#toggleOrder:checked~.cv .toolbar label.toggle[for="toggleOrder"] {
  background: #1f4fd8;
  color: #fff;
  border-color: #1f4fd8;
}


/* ===============================
   TOOLTIP
================================= */

/* base : tous les boutons */
.toggle-btn::after {
  content: attr(data-tooltip-off);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);

  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;

  font-size: 12px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

/* flèche */
.toggle-btn::before {
  content: "";
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);

  border: 6px solid transparent;
  border-top-color: #333;

  opacity: 0;
  transition: all 0.2s ease;
}

/* affichage tooltip */
.toggle-btn:hover::after,
.toggle-btn:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ===============================
   TOOLTIP DYNAMIQUE (TOGGLES ONLY)
================================= */

#toggleView:checked~.cv .toolbar label.toggle[for="toggleView"]::after,
#toggleOrder:checked~.cv .toolbar label.toggle[for="toggleOrder"]::after {
  content: attr(data-tooltip-on);
}


/* =========================================================
   TOGGLE VISIBILITY
========================================================= */

.toggle-soft {
  transition: opacity 0.2s ease;
}

.toggle-hard {
  transition: opacity 0.2s ease;
}

#toggleView:checked~.cv .toggle-hard {
  display: none;
}

#toggleView:checked~.cv .toggle-soft {
  opacity: 0.35;
}


/* =========================================================
   ORDER EXPERIENCE
========================================================= */

.exp-list {
  display: flex;
  flex-direction: column;
}

#toggleOrder:checked~.cv .exp-list {
  flex-direction: column-reverse;
}

#toggleOrder:checked~.cv .transition {
  margin-top: 0;
  margin-bottom: 50px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 700px) {

  .header-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo img {
    width: 110px;
    height: 110px;
  }

  .exp-skills {
    grid-template-columns: 1fr;
  }

  .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    line-height: 1.4;
  }

  .meta-label {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
  }

  .meta-value {
    flex: 1;
    font-size: 13px;
  }
}


/* =========================================================
   PRINT (optimisé CV)
========================================================= */

@media print {

  /* supprimer UI interactive */
  .toolbar {
    display: none;
  }

  /* supprimer effets visuels */
  .experience {
    box-shadow: none !important;
    transform: none !important;
  }

  /* couleurs adaptées impression */
  .experience {
    background: #fff !important;
    border-left: 3px solid #1f4fd8 !important;
  }

  .skills-block,
  .exp-desc {
    background: #fff !important;
  }

  /* lisibilité */
  body {
    font-size: 12px;
    line-height: 1.4;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 14px;
  }

  h3 {
    font-size: 13px;
  }

  /* éviter coupures */
  .experience,
  .skills-block,
  .transition {
    page-break-inside: avoid;
  }

  /* liens propres */
  a {
    color: #000 !important;
    text-decoration: none;
  }

  /* header cohérent */
  .header-flex {
    flex-direction: row !important;
  }

  .profile-photo img {
    width: 110px;
    height: 110px;
  }

  /* marges papier */
  @page {
    margin: 2cm 1cm;
  }

  /* =========================================================
   PRINT - SPACING SYSTEM (COMPACT & COHERENT)
========================================================= */



  /* --- bloc principal --- */
  .experience {
    margin-bottom: 10px !important;
    padding: 6px 8px !important;
  }

  /* --- structure interne --- */
  .exp-meta,
  .exp-desc,
  .exp-skills {
    margin-top: 0px !important;
  }

  /* --- meta --- */
  .meta-row {
    margin-bottom: 2px !important;
    line-height: 1.2;
  }

  /* --- description --- */
  .exp-desc {
    padding: 0px 6px !important;
    line-height: 1.25;
  }

  /* --- skills container --- */
  .exp-skills {
    gap: 6px !important;
  }

  /* --- skills blocks --- */
  .skills-block {
    padding: 0px 6px !important;
  }

  /* --- titles --- */
  .skills-title {
    margin: 0px !important;
    line-height: 1.2;
  }

  /* --- text --- */
  .skills-block p {
    margin: 2px 0 4px !important;
    line-height: 1.25;
  }

  /* --- lists --- */
  .skills-block ul {
    margin: 0px !important;
    padding-left: 14px;
  }

  .skills-block li {
    margin-bottom: 2px;
  }

  /* --- transition blocks --- */
  .transition {
    margin: 10px 0 !important;
    padding: 6px 8px !important;
  }

}