/* ============================================================
   VARIABLES CSS
   ============================================================ */
:root {
  --color-orange:       #F79000;
  --color-black:        #000000;
  --color-white:        #FFFFFF;
  --color-gray-dark:    #383838;
  --color-gray-light:   #7F7F7F;

  --font-main: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;

  --fs-body:    15px;
  --fs-title:   17px;
  --fs-nav:     15px;
  --fs-subnav:  13px;

  --fw-light: 200;
  --fw-regular: 400;
  --fw-semibold: 600;

  --max-width: 1200px;
  --page-padding: 1.5rem;
}

/* ============================================================
   RESET MINIMAL
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  color: var(--color-black);
  background-color: var(--color-white);
  line-height: 1.2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--color-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-orange);
}

a:active {
  color: #EE0000;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   LAYOUT DE PAGE
   ============================================================ */
.site-main {
  flex: 1;
  max-width: 1050px;
  margin: 0 auto;
  padding: 2rem var(--page-padding);
}

/* Listes à puces dans le contenu des pages */
.site-main ul {
  list-style: disc;
  padding-left: 1.5rem;
}

/* ============================================================
   HEADER
   ------------------------------------------------------------
   Le header est "sticky" : il reste collé en haut de l'écran
   quand on scrolle. Il est composé de deux parties :
     1. .site-header__top  : ligne du logo + "Belle-Île-en-Mer"
        → se rétracte (disparaît) quand on scrolle vers le bas
     2. .nav               : barre de navigation
        → toujours visible

   La classe .site-header--scrolled est ajoutée/retirée par
   nav.js selon la position de scroll.
   ============================================================ */
.site-header {
  background: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* --- Rétraction du logo au scroll ---
   Technique : max-height + opacity pour une transition douce.
   max-height part de 200px (valeur > hauteur réelle du contenu)
   et va à 0. overflow:hidden cache ce qui dépasse.
   → Pour ajuster la vitesse : changer "0.3s" ci-dessous. */
.site-header__top {
  overflow: hidden;
  max-height: 200px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.site-header--scrolled .site-header__top {
  max-height: 0;
  opacity: 0;
  padding-bottom: 0; /* évite un résidu d'espace en bas */
}

/* --- Suppression du padding-top au scroll ---
   Le .site-header__inner a un grand padding-top (3rem) qui
   centre visuellement le logo. Quand le logo disparaît, ce
   padding doit aussi disparaître pour ne pas laisser d'espace
   blanc au-dessus de la navbar.
   → Pour ajuster l'espace au-dessus du logo : changer "3rem". */
.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--page-padding) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: padding-top 0.3s ease;
}

.site-header--scrolled .site-header__inner {
  padding-top: 0;
}

/* --- Ligne du haut : logo + lieu --- */
.site-header__top {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding-bottom: 2rem; /* espace entre le logo et la navbar */
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* → Pour changer la taille du logo : modifier ces hauteurs */
.site-logo__texte {
  height: 62px;
  width: auto;
}

.site-logo__abeille {
  height: 48px;
  width: auto;
}

.site-header__lieu {
  font-size: 17px;
  font-weight: var(--fw-light);
  white-space: nowrap;
  line-height: 0.75rem;
  padding-left: 10px;
}

/* --- Espaceur anti-glitch ---
   Problème sans cet espaceur : quand le header sticky rétrécit,
   le contenu de la page remonte, ce qui modifie scrollY, ce qui
   peut ré-ouvrir le header → boucle d'oscillation visible.
   Solution : cet élément (invisible, sans contenu) reçoit via
   nav.js une hauteur égale à ce que le header vient de perdre.
   Le total (header + espaceur) reste constant → scrollY stable.
   Sa hauteur est calculée et injectée dynamiquement par nav.js. */
.site-header-spacer {
  height: 0; /* valeur par défaut ; nav.js prend le relais */
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 0;
  padding: 2rem var(--page-padding);
  background: var(--color-white);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Colonne gauche : logo bio */
.site-footer__left {
  flex: 1;
  display: flex;
  align-items: center;
}

.site-footer__logo {
  height: 50px;
  width: auto;
}

/* Colonne centrale : informations */
.site-footer__info {
  flex: 2;
  font-size: 13px;
  color: var(--color-black);
  line-height: 1.1;
  text-align: center;
}

.site-footer__info a {
  color: var(--color-black);
}

.site-footer__info a:hover {
  color: var(--color-orange);
}

/* Colonne droite : année */
.site-footer__right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.site-footer__year {
  font-size: 13px;
}

/* ============================================================
   TYPOGRAPHIE COMMUNE
   ============================================================ */
h1, h2, h3 {
  font-weight: var(--fw-semibold);
  line-height: 1.1;
}

h1 { font-size: 1.6rem; }
h2 { font-size: var(--fs-title); }
h3 { font-size: var(--fs-body); }

/* Classe utilitaire pour les titres de section */
.page-title {
  font-size: 1.4rem;
  font-weight: var(--fw-semibold);
  color: var(--color-black);
  margin-bottom: 1.5rem;
  display: inline-block;
}

/* ============================================================
   COMPOSANT : BLOC TEXTE + IMAGE (utilisé sur plusieurs pages)
   ============================================================ */
.text-image-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.text-image-block__image {
  width: 300px;
  flex-shrink: 0;
}

.text-image-block__image img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.text-image-block__content h2 {
  margin-bottom: 0.75rem;
}

.text-image-block__content p {
  margin-bottom: 0.75rem;
}

.text-image-block__content ul {
  margin-bottom: 0.75rem;
}

.text-image-block__content ul li {
  margin-bottom: 0.25rem;
}

/* ============================================================
   COMPOSANT : LECTEUR AUDIO
   ============================================================ */
.audio-player {
  width: 100%;
  margin-top: 1rem;
}

.audio-caption {
  font-size: 13px;
  color: var(--color-gray-light);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  /* Header : passe en ligne logo + hamburger */
  .site-header__inner {
    flex-direction: row;
    align-items: center;
    padding: 1.5rem var(--page-padding);
  }

  .site-header__top {
    padding-bottom: 0;
  }

  .site-logo__texte {
    height: 36px;
  }

  .site-logo__abeille {
    height: 28px;
  }
}

@media (max-width: 768px) {
  /* Footer : colonne unique centrée */
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .site-footer__left,
  .site-footer__right {
    display: none;
  }

  .site-footer__info {
    text-align: center;
  }

  .text-image-block {
    grid-template-columns: 1fr;
  }

  .text-image-block__image {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
  }
}
