/* Remise à zéro */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

:where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, blockquote) {
  margin: 0;
  padding: 0;
}

:where(ul, ol) {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

:where(h1, h2, h3, h4),
.page-title,
.section-title,
.subsection-title {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  font-stretch: var(--heading-stretch);
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
  overflow-wrap: break-word;
}

:where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[tabindex="-1"]:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--acc);
  color: var(--accf);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mise en page : menu latéral et colonne principale */
.layout {
  display: flex;
  min-height: 100vh;
}

.layout__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 36px;
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 30px 32px 48px;
  min-width: 0;
}

.page > * {
  min-width: 0;
}

/* Marque et logo */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
}

.brand__logo--empty {
  border: 1.5px dashed currentcolor;
  font-size: 9.5px;
  line-height: 1.05;
  text-align: center;
}

.brand__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: 44px;
  object-fit: contain;
}

.brand--large {
  flex: none;
}

.brand--large .brand__image {
  height: 96px;
}

.brand--large .brand__logo {
  width: 72px;
  height: 72px;
}

.brand--large .brand__logo--empty {
  font-size: 12px;
}

/* Menu latéral */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: var(--sidebar-width);
  height: 100vh;
  flex: none;
  overflow: auto;
  padding: 20px 14px;
  background: var(--sidebg);
}

.side-nav__list {
  display: grid;
  gap: 2px;
}

.side-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px 0 30px;
  border-radius: var(--radius-nav);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}

.side-nav__link:hover {
  background: var(--hover-veil);
}

.side-nav__item--current > .side-nav__link {
  background: var(--panel);
}

.side-nav__sublist {
  display: grid;
  padding: 2px 0 6px 30px;
}

.side-nav__sublink {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding-left: 12px;
  border-left: 1.5px solid var(--line);
  color: var(--mut);
  font-size: 14.5px;
  text-decoration: none;
}

.side-nav__sublink:hover {
  color: var(--fg);
}

.side-nav__sublink[aria-current] {
  border-left-color: var(--acc);
  color: var(--fg);
  font-weight: 700;
}

/* La balle : placée par le serveur sur la rubrique active,
   elle glisse d'une page à l'autre grâce aux View Transitions. */
.nav-ball {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--ballc);
  view-transition-name: nav-ball;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-group(nav-ball) {
  animation-duration: 0.4s;
  animation-timing-function: var(--ease-bounce);
}

.sidebar__account {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  padding: 0 12px;
  border-radius: var(--radius-nav);
  color: var(--link);
  font-weight: 600;
}

.sidebar__account:hover,
.sidebar__account[aria-current] {
  background: var(--panel);
}

/* En-tête mobile et menu plein écran */
.topbar,
.mobile-menu {
  display: none;
}

.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid currentcolor;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.mobile-menu__list {
  display: grid;
}

.mobile-menu__item {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.mobile-menu__link,
.mobile-menu__sublink {
  display: flex;
  align-items: center;
  color: var(--fg);
  text-decoration: none;
}

.mobile-menu__link {
  min-height: 46px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  font-stretch: 112%;
}

.mobile-menu__sublist {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  padding-bottom: 6px;
}

.mobile-menu__sublink {
  min-height: 40px;
  color: var(--mut);
  font-size: 15px;
}

.mobile-menu [aria-current] {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mobile-menu__close {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 4px;
  font-weight: 600;
}

.mobile-menu__account {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  color: var(--link);
  font-weight: 600;
}

.mobile-menu__cta {
  width: 100%;
  margin-top: 16px;
}

/* Pied de page */
.site-footer {
  background: var(--foot);
  color: var(--footf);
}

.site-footer a {
  color: var(--footf);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 28px;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 36px 32px 20px;
}

.site-footer__column {
  display: grid;
  align-content: start;
  gap: 8px;
  font-size: 15px;
}

.site-footer__column ul {
  display: grid;
  gap: 2px;
}

.site-footer__column a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.site-footer__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.site-footer__row {
  display: flex;
  gap: 8px;
}

.site-footer .site-footer__row input[type="email"] {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1.5px solid var(--footl);
  border-radius: var(--radius-input);
  background: var(--footbg);
  color: var(--footf);
}

.site-footer .site-footer__row input[type="email"]::placeholder {
  color: var(--footm);
}

.site-footer .site-footer__row input[type="email"][aria-invalid="true"] {
  border-color: var(--footerr);
}

.site-footer .button--primary {
  background: var(--footb);
  color: var(--footbf);
}

.site-footer .button--primary:hover {
  background: var(--footbh);
}

.site-footer .field__error {
  color: var(--footerr);
}

.site-footer__legal {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 12px 32px 24px;
  color: var(--footm);
  font-size: 13.5px;
}

/* En-têtes de page et sections */
.page-header {
  display: grid;
  gap: 8px;
}

.page-title {
  font-size: var(--title-page);
  line-height: 1.08;
}

.page-lead {
  max-width: 62ch;
  color: var(--mut);
}

.section {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.section > * {
  min-width: 0;
}

.section-title {
  font-size: var(--title-section);
}

.subsection-title {
  margin-bottom: 6px;
  font-size: 19px;
}

.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.prose {
  display: grid;
  gap: 12px;
  max-width: 66ch;
}

.dotted-list {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  list-style: disc;
}

.dotted-list li::marker {
  color: var(--acc);
}

.notice {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--soft);
}

.notice__title {
  font-weight: 700;
}

.notice ul {
  display: grid;
  gap: 4px;
}

.meta {
  color: var(--mut);
  font-size: 14px;
}

.source {
  color: var(--mut);
  font-size: 13.5px;
}

.more-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--link);
  font-weight: 600;
}

.tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ctl);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.16s,
    color 0.16s,
    border-color 0.16s;
}

.chip:hover {
  border-color: var(--acc);
}

.chip[aria-current],
.chip[aria-pressed="true"] {
  border-color: var(--acc);
  background: var(--acc);
  color: var(--accf);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table th,
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: left;
}

.table thead th {
  color: var(--mut);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.table .number {
  text-align: right;
}

.table tr.is-highlighted th,
.table tr.is-highlighted td {
  background: var(--soft);
  font-weight: 700;
}

.placeholder-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-image);
  background: var(--img1);
}

.placeholder-image svg {
  display: block;
  width: 100%;
  height: 100%;
}

.placeholder-image__floor {
  fill: var(--img2);
}

.placeholder-image__line {
  stroke: var(--img3);
  stroke-width: 3;
}

.placeholder-image__ball {
  fill: var(--img3);
}

.cover-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-image);
  object-fit: cover;
  background: var(--img1);
}

.error-page {
  max-width: 760px;
}

/* Mobile */
@media (max-width: 759.98px) {
  body {
    font-size: 16px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .page {
    gap: 28px;
    padding: 22px 16px 36px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--topbar-height);
    padding: 8px 16px;
    background: var(--sidebg);
  }

  .topbar .brand {
    margin-right: auto;
  }

  .topbar__cta {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .mobile-menu {
    position: fixed;
    inset: var(--topbar-height) 0 0;
    z-index: 15;
    display: block;
    overflow: auto;
    padding: 12px 18px 24px;
    border-top: 1px solid var(--line);
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
      opacity 0.2s,
      transform 0.2s,
      visibility 0.2s;
  }

  .mobile-menu:target,
  .menu-is-open .mobile-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .menu-is-open body {
    overflow: hidden;
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 18px 12px;
  }

  .site-footer__legal {
    padding: 8px 18px 20px;
  }

  .page-title {
    font-size: var(--title-page-mobile);
  }

  .two-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .table th,
  .table td {
    padding: 10px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
