/* ==========================================================================
   MARESTRAN — feuille de style unique
   Esprit affiche sérigraphiée : aplats saturés, ciel cobalt, eau turquoise,
   touches saumon et corail. Mobile d'abord.
   Seule ressource externe : la police Archivo (Google Fonts).
   ========================================================================== */

/* --- Variables ----------------------------------------------------------- */

:root {
  /* Palette */
  --cobalt-deep: #0a3a9a;   /* ciel haut : titres, bandeaux, pied de page */
  --cobalt: #0b4fb8;        /* mer : liens, boutons */
  --sky: #3f97e2;           /* ciel à l'horizon (décor) */
  --aqua: #48bfe8;          /* eau de lagune (décor) */
  --aqua-pale: #e3f5fc;
  --salmon: #eda394;        /* murs, filets décoratifs */
  --salmon-pale: #fbe6de;
  --coral: #e8523f;         /* repères, page courante */
  --coral-ink: #b5352a;     /* corail assombri pour le texte (contraste AA) */
  --green: #157a40;         /* pins, étiquettes de thème */
  --ink: #101c3a;           /* texte courant */
  --muted: #4a5675;         /* texte secondaire */
  --rule: #d6deea;          /* filets fins */
  --paper: #ffffff;

  /* Typographie : Archivo, large pour les titres, normale pour le texte */
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;

  /* Mise en page */
  --wrap: 76rem;
  --gutter: 1rem;
  --label-col: 14rem;
  --col-gap: 3rem;
}

@media (min-width: 40em) {
  :root { --gutter: 1.5rem; }
}

@media (min-width: 64em) {
  :root { --gutter: 2rem; }
}

/* --- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

@media (min-width: 40em) {
  body { font-size: 1.0625rem; }
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--font);
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--cobalt-deep);
}

h1 {
  font-size: clamp(1.8rem, 1.25rem + 2.4vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem);
}

h3 {
  font-size: 1.15rem;
  font-stretch: 112%;
  font-weight: 700;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

a {
  color: var(--cobalt);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cobalt-deep);
  text-decoration-thickness: 2px;
}

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

main:focus {
  outline: none;
}

i[lang="la"] {
  font-style: italic;
}

/* --- Accessibilité ------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -10rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--cobalt-deep);
  color: #ffffff;
  font-weight: 700;
}

.skip-link:focus {
  top: 0.5rem;
  color: #ffffff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Conteneurs ---------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Grille éditoriale : une colonne d'intitulés, une colonne de texte */
.split {
  display: grid;
  gap: 0.25rem var(--col-gap);
}

@media (min-width: 60em) {
  .split {
    grid-template-columns: var(--label-col) minmax(0, 1fr);
  }
}

.prose {
  max-width: 40rem;
}

.prose > :last-child {
  margin-bottom: 0;
}

/* --- En-tête ------------------------------------------------------------- */

.site-header {
  background: var(--paper);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cobalt-deep);
  text-decoration: none;
}

.brand:hover {
  color: var(--cobalt-deep);
}

.brand img {
  flex: none;
  width: 2.25rem;
}

.brand-name {
  display: block;
  font-size: 1.3rem;
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
}

.brand-tag {
  display: none;
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (min-width: 40em) {
  .brand-tag { display: block; }
}

.lang-switch ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.lang-switch a,
.lang-switch [aria-current] {
  display: block;
  min-width: 2.75rem;
  padding: 0.45rem 0.6rem;
  text-align: center;
}

.lang-switch [aria-current] {
  background: var(--cobalt-deep);
  color: #ffffff;
}

.lang-switch a {
  color: var(--cobalt);
  text-decoration: none;
}

.lang-switch a:hover {
  background: var(--aqua-pale);
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0 0.55rem;
  border-bottom: 3px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.main-nav a:hover {
  border-bottom-color: var(--aqua);
  color: var(--cobalt-deep);
}

.main-nav a[aria-current="page"] {
  border-bottom-color: var(--coral);
  font-weight: 700;
  color: var(--cobalt-deep);
}

@media (min-width: 48em) {
  .main-nav ul { gap: 0 2rem; }
}

/* --- Annonce ------------------------------------------------------------- */

.notice {
  margin-top: 0.75rem;
  background: var(--salmon-pale);
  font-size: 0.9375rem;
}

.notice p {
  margin: 0;
  padding: 0.75rem 1rem;
}

.notice-label {
  margin-right: 0.6rem;
  font-size: 0.8125rem;
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral-ink);
}

/* --- Bandeaux illustrés (haut de page) ----------------------------------- */

.page-head {
  margin-top: 0.75rem;
  margin-bottom: 3rem;
}

.band {
  background: var(--cobalt-deep);
  color: #ffffff;
}

.band-text {
  padding: 2rem 1.25rem 0.5rem;
}

.band h1 {
  max-width: 22ch;
  color: #ffffff;
}

.band .kicker {
  color: #ffc9bb;
}

.band .lede {
  color: #e8efff;
}

.band a:not(.button) {
  color: #ffffff;
}

.band-art {
  width: 100%;
  height: clamp(7rem, 14vw, 13.75rem);
  object-fit: cover;
  object-position: left bottom;
}

.hero-art {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 30% bottom;
}

@media (min-width: 40em) {
  .hero-art { aspect-ratio: 16 / 7; }
}

@media (min-width: 60em) {
  .band-text { padding: 3.5rem 3rem 1rem; }
  .page-head .band-text .kicker { padding-top: 1rem; }
  .page-head { margin-bottom: 4rem; }
}

/* Accueil : titre à gauche, chapô à droite */
.intro-grid {
  display: grid;
  gap: 0.5rem 4rem;
}

.intro-grid h1 {
  max-width: 20ch;
  margin-bottom: 0.25em;
  font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.6rem);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
}

@media (min-width: 60em) {
  .intro-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
    padding-bottom: 2.5rem;
  }
}

/* --- Éléments récurrents ------------------------------------------------- */

.kicker {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral-ink);
}

.lede {
  max-width: 38rem;
  font-size: 1.15rem;
  line-height: 1.55;
}

@media (min-width: 40em) {
  .lede { font-size: 1.25rem; }
}

.button {
  display: inline-block;
  padding: 0.75rem 1.2rem;
  border: 2px solid var(--cobalt);
  background: var(--cobalt);
  font-size: 0.9375rem;
  font-stretch: 112%;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
}

.button:hover {
  background: #ffffff;
  color: var(--cobalt);
}

.band .button {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--cobalt-deep);
}

.band .button:hover {
  background: transparent;
  color: #ffffff;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.meta .theme {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Figures et illustrations */

.figure {
  margin: 0;
}

.figure img,
.thumb {
  width: 100%;
}

.figure figcaption {
  margin-top: 0.6rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--salmon);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin-top: 0.35rem;
}

.legend b {
  color: var(--cobalt-deep);
}

.legend .accent {
  color: var(--coral);
}

/* --- Sections ------------------------------------------------------------ */

.section {
  padding-bottom: 3rem;
}

/* Filet de section aligné sur le contenu (et non sur la marge du conteneur) */
.section > .wrap {
  padding-top: 1.5rem;
  background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

.section--strong > .wrap {
  background-image: linear-gradient(var(--cobalt-deep), var(--cobalt-deep));
  background-size: calc(100% - 2 * var(--gutter)) 4px;
}

.split > h2:not(.year-label) {
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  font-stretch: 112%;
}

@media (min-width: 60em) {
  .section { padding-bottom: 4rem; }
  .section > .wrap { padding-top: 2rem; }
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0;
}

/* --- Accueil : dernières études ------------------------------------------ */

.latest {
  display: grid;
  gap: 2rem;
}

.latest .thumb {
  margin-bottom: 1rem;
}

.latest-lead h3 {
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
}

.latest-side {
  display: grid;
  gap: 2rem;
}

.latest-side h3 {
  font-size: 1.1rem;
}

.latest p:last-child {
  margin-bottom: 0;
}

@media (min-width: 40em) {
  .latest-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 60em) {
  .latest {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--col-gap);
  }
  .latest-side {
    grid-template-columns: 1fr;
    align-content: start;
  }
  .latest-side article {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 0 1.25rem;
  }
  .latest-side .thumb {
    grid-row: span 3;
    margin: 0;
  }
}

/* Thématiques : liste en tableau */
.theme-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 4px solid var(--cobalt-deep);
}

.theme-list > li {
  display: grid;
  gap: 0.35rem var(--col-gap);
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.theme-list h3 {
  margin: 0;
}

.theme-list p {
  max-width: 40rem;
  margin: 0 0 0.4rem;
}

.theme-list .theme-count {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

.species {
  font-size: 0.875rem;
  color: var(--muted);
}

@media (min-width: 60em) {
  .theme-list > li {
    grid-template-columns: var(--label-col) minmax(0, 1fr) 7rem;
  }
  .theme-list .theme-count {
    text-align: right;
  }
}

/* Carnet de terrain + autres pages */
.columns {
  display: grid;
  gap: 3rem;
}

@media (min-width: 60em) {
  .columns {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 5rem;
  }
}

.notes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes li {
  display: grid;
  gap: 0.15rem 1.5rem;
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
}

.notes time,
.notes .ref {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--green);
}

.notes p {
  margin: 0;
}

@media (min-width: 40em) {
  .notes li { grid-template-columns: 9rem minmax(0, 1fr); }
  .notes time,
  .notes .ref { padding-top: 0.15rem; }
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  padding: 1rem 0 1rem 1rem;
  border-left: 4px solid var(--aqua);
  background: var(--aqua-pale);
}

.link-list li + li {
  margin-top: 0.5rem;
}

.link-list li:nth-child(2) {
  border-left-color: var(--salmon);
  background: var(--salmon-pale);
}

.link-list li:nth-child(3) {
  border-left-color: var(--green);
  background: #e6f3ea;
}

.link-list a {
  font-size: 1.15rem;
  font-stretch: 125%;
  font-weight: 800;
  color: var(--cobalt-deep);
}

.link-list p {
  margin: 0.2rem 1rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink);
}

/* --- Listes éditoriales -------------------------------------------------- */

.ruled-list {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.ruled-list li {
  padding-block: 0.75rem;
  border-top: 1px solid var(--rule);
}

.ruled-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.ruled-list strong {
  color: var(--cobalt-deep);
}

/* Étapes numérotées */
.steps {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 1rem 0 1rem 3.25rem;
  border-top: 1px solid var(--rule);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0.9rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--cobalt);
  font-stretch: 125%;
  font-weight: 800;
  color: #ffffff;
}

.steps h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.steps p {
  margin: 0;
}

/* Chronologie */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
}

.timeline p {
  margin: 0;
}

.timeline .year {
  font-size: 1.1rem;
  font-stretch: 125%;
  font-weight: 800;
  color: var(--cobalt);
}

/* Équipe */
.team {
  display: grid;
  gap: 0 var(--col-gap);
  margin: 0 0 1rem;
}

.team div {
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
}

.team dt {
  font-size: 1.05rem;
  font-stretch: 112%;
  font-weight: 700;
  color: var(--cobalt-deep);
}

.team dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (min-width: 40em) {
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Études -------------------------------------------------------------- */

.theme-index {
  max-width: 44rem;
  font-size: 0.9375rem;
}

.year-label {
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.6rem);
  color: var(--cobalt);
}

.study {
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.study:first-child {
  padding-top: 0;
  border-top: 0;
}

.study:last-child {
  padding-bottom: 0;
}

.study h3 {
  max-width: 34em;
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
}

.study .authors {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.study .summary {
  max-width: 42rem;
}

.study .subtitle {
  max-width: 42rem;
  margin: -0.25rem 0 0.75rem;
  font-style: italic;
  color: var(--muted);
}

.study-cite {
  max-width: 42rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.study .download {
  margin: 0;
}

.download a {
  font-weight: 700;
}

.file-info {
  font-weight: 400;
  color: var(--muted);
}

.cite {
  max-width: 44rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--aqua);
  background: var(--aqua-pale);
  font-size: 0.875rem;
}

/* --- Contact ------------------------------------------------------------- */

.email-link {
  font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.4rem);
  font-stretch: 125%;
  font-weight: 800;
  color: var(--cobalt);
  text-decoration-color: var(--coral);
  text-decoration-thickness: 3px;
  overflow-wrap: anywhere;
}

/* --- Pied de page -------------------------------------------------------- */

.site-footer {
  padding-block: 2.5rem 1.5rem;
  border-top: 8px solid var(--salmon);
  background: var(--cobalt-deep);
  font-size: 0.9375rem;
  color: #ffffff;
}

.site-footer a {
  color: #ffffff;
}

.site-footer a:hover {
  color: #ffc9bb;
}

.site-footer :focus-visible {
  outline-color: #ffc9bb;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 48em) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--col-gap);
  }
}

.footer-brand {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.footer-about p:not(.footer-brand) {
  max-width: 28rem;
  color: #e8efff;
}

.site-footer h2 {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffc9bb;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.8125rem;
  color: #cfdcf5;
}

.footer-bottom p {
  margin: 0;
}

/* --- Impression ---------------------------------------------------------- */

/* --- Accueil : mesures clés ---------------------------------------------- */

.key-figures {
  display: grid;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 4px solid var(--cobalt-deep);
}

.key-figures li {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.key-figures p {
  max-width: 30rem;
  margin: 0 0 0.5rem;
}

.key-figures .key-value {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.9rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  color: var(--cobalt-deep);
  font-variant-numeric: tabular-nums;
}

.key-figures .key-source {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--green);
}

@media (min-width: 40em) {
  .key-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }
}

@media (min-width: 60em) {
  .key-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Publications : tableaux des mesures citées --------------------------- */

.data {
  width: 100%;
  max-width: 54rem;
  margin: 1.25rem 0 1.25rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.45;
}

.data caption {
  padding-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--cobalt-deep);
}

.data th,
.data td {
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.data thead th {
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 2px solid var(--cobalt-deep);
}

.data tbody th { font-weight: 700; }

.data .value {
  font-weight: 700;
  color: var(--cobalt-deep);
  font-variant-numeric: tabular-nums;
}

.data .source { color: var(--muted); }

/* Petits écrans : chaque ligne devient une fiche */
@media (max-width: 47.99em) {
  .data thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .data,
  .data caption,
  .data tbody,
  .data tr,
  .data th,
  .data td { display: block; }
  .data tr {
    padding-block: 0.75rem;
    border-top: 1px solid var(--rule);
  }
  .data th,
  .data td {
    padding: 0.1rem 0;
    border: 0;
  }
  .data td::before {
    content: attr(data-label) ": ";
    font-weight: 400;
    color: var(--muted);
  }
  :lang(fr) .data td::before { content: attr(data-label) "\00a0: "; }
}

@media print {
  .skip-link,
  .main-nav,
  .lang-switch,
  .band-art,
  .hero-art {
    display: none;
  }
  .band,
  .site-footer {
    background: none;
    color: var(--ink);
  }
  .band h1,
  .band .lede,
  .site-footer a {
    color: var(--ink);
  }
}
