:root {
  --sidebar-width: 280px;
  --sidebar-bg: #84a92dfa;
  --sidebar-border: rgb(4, 4, 251);
  --sidebar-title: #041022;
  --sidebar-link: #0b40a2;
  --sidebar-active: #ffc857;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: #f4f4f4;
  color: #333;
  display: flex;
  min-height: 100vh;
}

html.sidebar-open,
.sidebar-shell {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: #fff;
  box-shadow: 0 10px 30px rgba(14, 58, 116, 0.35);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10000;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar__panel {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.sidebar-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  background: #759a1e;
  color: #fff;
  border: 1px solid var(--sidebar-border);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(14, 58, 116, 0.3);
}

.sidebar-toggle__icon {
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
  display: inline-block;
}

.sidebar-toggle__icon::before,
.sidebar-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease;
}

.sidebar-toggle__icon::before {
  top: -6px;
}

.sidebar-toggle__icon::after {
  top: 6px;
}

.sidebar-toggle__label {
  font-size: 0.8rem;
}

.sidebar__logo {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 1rem;
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar__section--highlight {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1rem;
}

.sidebar__section--highlight--convergences {
  border: 1px solid rgb(19, 8, 114);
  background: rgb(155, 190, 211);
  border-radius: 10px;
  padding: 1rem;
}

.sidebar__section--spacing {
  margin-top: 5rem;   /* espace avant la section */
  margin-bottom: 0;     /* ou autre valeur si besoin après */
}

.sidebar__title {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--sidebar-title);
  font-weight: 600;
}

.sidebar__title-button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--sidebar-title);
  font-weight: 600;
  cursor: pointer;
}

.sidebar__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.sidebar__section--collapsible.is-open .sidebar__chevron {
  transform: rotate(-135deg);
}

.sidebar__section--collapsible .sidebar__links[hidden] {
  display: none;
}

.sidebar__title--convergences {
    text-align: center;
}


.sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--sidebar-border);
}

.sidebar__links a,
.sidebar__links button {
  all: unset;
  cursor: pointer;
  color: var(--sidebar-link);
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar__links a:hover,
.sidebar__links a:focus-visible,
.sidebar__links button:hover,
.sidebar__links button:focus-visible {
  color: #fff;
  transform: translateX(4px);
}

.sidebar__links a.active,
.sidebar__links button.active {
  color: var(--sidebar-active);
}

.sidebar__links span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(232, 240, 255, 0.7);
}

.sidebar__links--social {
  gap: 0.2rem;
  border-left: none;
  padding-left: 0;
  margin-left: 0;
}

.sidebar__social-links {
  display: flex;
  gap: 0.6rem;
  margin-left: 0.4rem;
}

.sidebar__footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid var(--sidebar-border);
  padding-top: 1rem;
}

main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  position: relative;
  z-index: 0;
}

.sidebar-spacer {
  display: none;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar-shell {
    width: 100%;
    height: auto;
    min-height: auto;
    background: transparent;
    border-right: none;
    box-shadow: none;
    position: static;
    align-self: stretch;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    z-index: 1100;
    background: var(--sidebar-bg);
    box-shadow: none;
    border-right: none;
    transform: none;
    transition: none;
    overflow: visible;
    display: none;
  }

  .sidebar__panel {
    padding: 2rem 1.5rem;
    height: auto;
    overflow: visible;
  }

  .sidebar-shell.is-open .sidebar {
    transform: none;
    display: block;
  }

  .sidebar-shell.is-open .sidebar-toggle__icon {
    background: transparent;
  }

  .sidebar-shell.is-open .sidebar-toggle__icon::before {
    transform: translateY(6px) rotate(45deg);
  }

  .sidebar-shell.is-open .sidebar-toggle__icon::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .sidebar__links {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }

  main {
    margin-top: 0;
    padding-top: 5rem;
  }

  .sidebar-spacer {
    display: none;
  }

}

@media (hover: none) and (pointer: coarse) {
  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    z-index: 1100;
    background: var(--sidebar-bg);
    box-shadow: none;
    border-right: none;
    transform: none;
    transition: none;
    overflow: visible;
    display: none;
  }

  .sidebar__panel {
    padding: 2rem 1.5rem;
    height: auto;
    overflow: visible;
  }

  .sidebar-shell.is-open .sidebar {
    display: block;
  }

  main {
    margin-top: 0;
    padding-top: 5rem;
  }
}
