/* ==========================================================================
   Gaëtan Rey — Site CSS
   Structure:
   0) CSS Reset & Base
   1) Design Tokens (colors, spacing, radii, shadows, z-index)
   2) Typography Scale & Links
   3) Layout Primitives (container, grid)
   4) Header (topbar, masthead, hamburger)
   5) Navigation (sidebar, vertical menu, drawer behavior)
   6) Main Content (cards, utilities)
   7) Footer
   8) Responsive Rules
   ========================================================================== */

/* == 0) Reset & Base ======================================================= */
* { box-sizing: border-box; }
html { font-size: 62.5%; scroll-padding-top: calc(var(--header-h, 79px) + 8px); min-width: 600px;} /* 1rem = 10px */
body {
  padding-top: var(--header-h, 79px);
  margin: 0;
  font-family: Calibri, Verdana, sans-serif;
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(to bottom, #e6ebee, #bfcace) fixed;
}

/* == 1) Design Tokens ====================================================== */
:root {
  /* Colors */
  --bg: #f7fafb;
  --text: #0e1726;
  --muted: #5b6b7a;
  --brand: #014359;     /* héritage visuel */
  --brand-2: #0E78CB;   /* accent secondaire */
  --surface: #ffffff;

  /* Layout */
  --radius: 7px;
  --shadow: 0 4px 16px rgba(1, 67, 89, 0.25);
  --container-w: 1920px;
  --sidebar-w: 210px;
  --header-h: 79px;    
  --space: 2rem;

  /* Typography scale */
  --font-size-xs: 1.2rem;
  --font-size-sm: 1.4rem;
  --font-size-base: 1.6rem;
  --font-size-lg: 1.8rem;
  --font-size-xl: 2.0rem;
  --font-size-2xl: 2.4rem;
  --font-size-3xl: 3.0rem;
  --font-size-4xl: 3.4rem;
  --masthead-size: 3.2rem; /* Taille fixe et uniforme du titre de page (H1 entête) */
  
}

a { color: var(--brand); text-decoration-color: rgba(1,67,89,.4); }
a:hover { text-decoration-thickness: 2px; }

/* == 2) Typography (Headings, text helpers) =============================== */
h1, h2, h3, h4, h5, h6 { color: var(--text); margin: 0 0 .6rem; line-height: 1.2;  font-family: Cambria, serif;}
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
.lead { color: var(--muted); margin-top: 0; }

/* Helpers */
.muted { color: var(--muted); }
.center { text-align: center; }

/* == 3) Layout Primitives ================================================== */
.container { max-width: var(--container-w); margin: 0 auto; padding: 1.5rem; }
.grid { display: grid; gap: 2rem; }
.two-columns { grid-template-columns: 1.5fr 1fr; }
@media (max-width: 900px) { .two-columns { grid-template-columns: 1fr; } }

/* == 4) Header ============================================================= */
.topbar {
  position: fixed; top: 0; left: 0;
  width: 100%; z-index: 200;
  background: var(--brand); color: #fff; box-shadow: var(--shadow);
}
/* Logo dans la topbar */
.header-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-left: 2rem;   
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 48px;          /* ajuste selon ton image */
  width: auto;
  vertical-align: middle;
  margin-right: 0.8rem;  /* petit espace entre le logo et le texte */
}

/* Ajuste un peu le titre */
.masthead {
  color: #fff;
  font-weight: 800;
  font-size: var(--masthead-size);
  line-height: 1.2;
  margin: .4rem 0 .6rem;
}
.masthead {
  color: #fff; font-weight: 800; line-height: 1.2;
  font-size: var(--masthead-size);
  margin: .4rem 0 .6rem;
}
.masthead .site-name { color: #fff; text-decoration: none; }
.masthead .sep { opacity: .85; margin: 0 .4rem; }


/* Spécifique au header: ne pas laisser une ancienne règle (.page-title) altérer la taille */
.topbar .page-title { font: inherit; color: inherit; }

/* == 5) Navigation (Sidebar / Drawer) ===================================== */
.sidebar {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-right: 1px solid #e5eef3;
  top: var(--header-h, 79px);
  height: calc(100dvh - var(--header-h, 79px));
}

/* Un padding régulier dans le conteneur du menu (toutes tailles) */
.sidebar .container{
  padding: 1rem 1.25rem;            /* évite que le 1er item soit collé/masqué */
}

/* Large (paysage) : sidebar fixe sous header */
@media (min-width: 1000px) and (orientation: landscape) {
  body {
    padding-left: var(--sidebar-w);
    padding-top: var(--header-h); /* décaler le contenu sous la topbar */
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: var(--sidebar-w);
    height: calc(100dvh - var(--header-h));
    overflow: auto;
    box-shadow: var(--shadow);
    border-right: 1px solid #e5eef3;
    background: var(--surface);
  }
}

/* Petit écran : menu réduit à une colonne (36px), s’ouvre au clic */
@media (max-width: 999.98px), (orientation: portrait) {

  body {
    padding-left: 36px; /* laisse la marge de la barre réduite */
  }

  .sidebar{
    position: fixed;
    left: 0;
    top: var(--header-h, 79px);
    height: calc(100dvh - var(--header-h, 79px));
    background: var(--surface);
    border-right: 1px solid #e5eef3;
    box-shadow: var(--shadow);
    z-index: 150;
    overflow: hidden;                 
    width: 36px;                      /* ← colonne réduite */
    transition: width .25s ease;
    cursor: pointer;                  /* indique que c'est cliquable */
  }

  /* Aspect visuel de la poignée : icône hamburger en fond, sinon ≡ */
  .sidebar::before{
    content:"";
    position:absolute;
    top: 8px; left: 0;
    width: 36px; height: 36px;
    background: url("../icons/menu.webp") no-repeat center/24px 24px;
  } 


  /* contenu interne du menu, caché quand réduit */
  .sidebar .container{
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease;
  }

  /* état OUVERT : tiroir large, contenu visible et scrollable */
  body.nav-open .sidebar{
    width: var(--sidebar-w);
    cursor: default;
    overflow: hidden;            /* le scroll se fait sur .container */
  }
  body.nav-open .sidebar .container{
    opacity: 1; visibility: visible;
    overflow: auto;
    height: 100%;
    padding-right: 1rem;         /* pour éviter le collage à droite */
  }

  body.nav-open .sidebar::before {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  /* Overlay (backdrop) pour fermer au clic */
  .backdrop{
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease;
    z-index: 140;                /* sous la sidebar, au-dessus du contenu */
  }
 
  body:not(.nav-open) .sidebar .container > * { display: none; }

  body.nav-open .backdrop { opacity: 1; visibility: visible; }
  
}

/* Petit espace de scroll pour que le 1er lien ne soit jamais sous le bord supérieur */
#site-nav{
  scroll-padding-top: .75rem;
}

/* Menu vertical */
.menu-title {
  margin: 0 0 .6rem;
  font-size: var(--font-size-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.nav-vertical { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.nav-vertical > li > a, .nav-vertical summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.0rem; border-radius: .6rem; cursor: pointer;
}
.nav-vertical > li > a:hover, .nav-vertical summary:hover { background: #eef6f9; }
.nav-vertical details { padding: .2rem 0; }
.nav-vertical details[open] > summary { font-weight: 600; }
.nav-vertical details ul { list-style: none; margin: .3rem 0 .6rem 0; padding-left: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.nav-vertical details a { padding: .5rem .8rem; border-radius: .4rem; display: block; }
.nav-vertical details a:hover { background: #f3f8fb; }

/* Ajoute un chevron aux menus (summary) */
.nav-vertical summary {
  position: relative;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* flèche fermée */
.nav-vertical summary::after {
  content: "▸";
  font-size: 1.2em;
  color: var(--brand);
  margin-left: auto;
  transition: transform .2s ease, color .2s ease;
}

/* flèche ouverte */
.nav-vertical details[open] > summary::after {
  transform: rotate(90deg);
  color: var(--brand-2);
}

/* Lien courant */
a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }



/* == 6) Main Content ======================================================= */

/* Espace vertical uniforme entre les sections du contenu principal */
.grid { gap: var(--space); }
main.container > section { margin-bottom: var(--space); }
main.container { padding-top: var(--space); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.meta { margin: 1rem 0 0; padding-left: 1.2rem; }
.meta li { margin: .3rem 0; }
.avatar { border-radius: 10px; }
.button {
  display: inline-block; padding: .8rem 1.2rem; border: 1px solid #e5eef3; border-radius: .8rem;
  margin: .4rem; text-decoration: none;
}
.button:hover { background: #eef6f9; }

/* == 7) Footer ============================================================= */
.logos { display: flex; align-items: center; gap: 2rem; justify-content: center; }
.footnote { font-size: 1.4rem; color: var(--muted); text-align: center; padding-bottom: 2rem; }

/* == 8) Responsive helpers ================================================= */
/* (Ajoutez ici les overrides spécifiques si nécessaires) */
/* Intro : texte + photo à droite */
.intro-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;            /* même espace que ta grille */
  flex-wrap: nowrap;        /* ne plus autoriser la 2e colonne à passer dessous */
  align-items: flex-start;  /* éviter la centration verticale qui peut forcer des hauteurs inutiles */    
}

.intro-flex > :first-child {
  flex: 1 1 0;              /* le texte prend la place dispo mais peut rétrécir */
  min-width: 0;             /* autorise le shrink du contenu */
}

.intro-photo {
  flex: 0 0 auto;           /* l'image garde sa largeur naturelle */
  margin-left: 2rem;        /* petit espace à gauche si besoin */
}

.intro-photo avatar {
  display: block;
  max-width: 200px;
  height: auto;
}


/* === Section Réseaux sociaux (accueil) === */
.social-title {
  font-size: var(--font-size-xl);
  
  margin-bottom: 1rem;
  text-align: center;
}

/* Conteneur des boutons */
.profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 2 colonnes dès que possible */
  gap: 1rem;
  justify-items: center;
}

/* Boutons uniformes */
.profiles .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: 1rem 1.6rem;
  border: 1px solid #d0dde2;
  border-radius: var(--radius);
  min-width: 250px;              /* assure la même largeur */
  text-decoration: none;
  color: var(--brand);
  font-weight: 600;
  background: #fff;
  box-shadow: var(--shadow);
  transition: background .2s ease, transform .2s ease;
}

.profiles .button:hover {
  background: #e6f0f3;
  transform: translateY(-2px);
}

/* Icônes */
.profiles .icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.alignMiddle {
  vertical-align:middle;
  padding-bottom: 10px;
}

.describe {
  display: grid;
  grid-template-columns: max-content 1fr; /* col. 1 à la largeur du libellé */
  column-gap: 1rem;
  row-gap: .5rem;
  align-items: start;
  margin: 0;
  padding: 0;
}

/* On neutralise le <div> wrapper pour qu'il n'affecte pas la grille */
.describe > div { display: contents; }

.describe dt {
  font-weight: 600;
  margin: 0;
  justify-self: end;  /* libellés alignés à droite */
  white-space: nowrap; /* évite les retours gênants sur petits libellés */
  padding-right: .75rem; 
  border-right: 1px solid rgba(0,0,0,.1);
}

.describe dd {
  margin: 0;
  padding-left: .75rem;
}

/* Sur très petit écran, on peut repasser en 1 colonne si tu préfères */
@media (max-width: 480px) {
  .describe {
    grid-template-columns: 1fr;
  }
  .describe dt {
    justify-self: start;
  }
}

/* Formation / Expérience : deux colonnes date + description */
.list-spaced {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  row-gap: .5rem;
}

.list-spaced li {
  display: grid;
  grid-template-columns: 8rem 1fr;  /* colonne 1 = date, colonne 2 = texte */
  column-gap: 1rem;
  align-items: start;
}

/* Le <strong> qui contient la période/dates */
.list-spaced li > strong {
  grid-column: 1;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.list-spaced li > .desc {
  grid-column: 2;           /* tout le texte descriptif ici */
  min-width: 0;             /* évite les débordements */
}

/* Empêche les retours à la ligne intempestifs dans les titres en italique */
.list-spaced li > .desc em {
  font-style: italic;
  white-space: nowrap;    /* reste sur une seule ligne */
}

/* Bouton "Retour en haut" toujours visible */
.to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 900; /* sous le backdrop du menu si tu veux qu’il passe derrière, monte-la si besoin */
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.12));
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.to-top img { display: block; }
.to-top:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.to-top:active { transform: translateY(0); }

@media (max-width: 1000px) {
  /* Sur petit écran, garde l’icône seule pour gagner de la place */
  .to-top span { display: none; }
}

/* TOC locale années */
.local-toc { margin-bottom: 1rem; }
.local-toc ul { list-style: none; padding: 0; margin: .25rem 0 0; }

/* Listes de news */
.news { margin: .5rem 0 0; padding-left: 1.25rem; }
.news li { margin: .25rem 0; }

/* Détails/summary confort */
details.year > summary { cursor: pointer; padding: .25rem 0; }
details.month > summary { cursor: pointer; color: var(--muted, #555); }

/* Petites classes utilitaires existantes */
.cluster { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.muted { opacity: .7; font-size: .9em; }

/* mise en forme */
.year .h5{
  font-size: var(--font-size-2xl);
  color: var(--brand); 
}
.year .month summary{
  font-size: var(--font-size-xl);
  color: var(--brand-2); 
  padding-left: 20px;
}

.year .month ul{ 
  padding-left: 60px;
}

ul.cluster{
    font-size: var(--font-size-2xl);
    color: var(--brand); 
     justify-content: center; /* aligne les items au centre dans le flex */
    text-align: center;       /* au cas où tu veux centrer le texte des liens */
    width: 100%;              /* occupe toute la largeur du parent */
    margin: 0 auto;           /* centre le bloc lui-même si besoin */
}

ul.cluster li {
    background: var(--bg);
    border-right: 1px solid var(--muted);
    box-shadow: var(--shadow);
    padding: 2px 5px 2px 5px;
    border-radius: var(--radius);

}


/* Étapes de fabrication de la bière */
.etapes-biere {
  counter-reset: etape;
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.etapes-biere li {
  counter-increment: etape;
  background: var(--surface-1, #fff);
  border-left: 4px solid var(--accent, var(--brand-2));
  padding: 1rem 1rem 1rem 2rem;
  margin-bottom: 1rem;
  border-radius: .5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  position: relative;
  padding: 1rem 1rem 1rem 1.5rem; /* un peu plus large à gauche */
  transition: transform .2s ease;
}

.etapes-biere li:hover {
  transform: translateY(-3px);
}

.etapes-biere li::before {
  content: counter(etape);
  position: absolute;
  top: 50%;                 /* centre verticalement */
  transform: translateY(-50%); /* corrige l’alignement vertical */
  left: -1.8rem;            /* décale un peu vers la gauche */
  background: var(--accent, var(--brand-2));
  color: #fff;
  font-weight: bold;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.etapes-biere h3 {
  margin-top: 0;
  margin-bottom: .4rem;
}


/* Masonry */
.gallery-fun {
  column-count: 8;
  column-gap: 1rem;
  margin: 0 auto;
}

@media (max-width: 1750px) { .gallery-fun { column-count: 7; } }
@media (max-width: 1500px) { .gallery-fun { column-count: 6; } }
@media (max-width: 1250px) { .gallery-fun { column-count: 5; } }
@media (max-width: 1000px) { .gallery-fun { column-count: 4; } }
@media (max-width: 750px) { .gallery-fun { column-count: 3; } }
@media (max-width: 500px) { .gallery-fun { column-count: 2; } }


.gallery-fun figure {
  margin: 0 0 1rem;
  break-inside: avoid;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  cursor: zoom-in;
  transition: transform .3s ease, box-shadow .3s ease;
}
.gallery-fun figure:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}
.gallery-fun img {
  width: 100%;
  height: auto;
  display: block;
}
.gallery-fun figcaption {
  display: none; /* la légende ne s’affiche pas dans la galerie, seulement au zoom */
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.lightbox.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;  /* capte les clics quand visible */
  z-index: 3000; 
}
.lightbox figure {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox img {
  max-height: 90vh; /* ne dépasse jamais 90% de la hauteur de l’écran */
  max-width: 90vw;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: .5rem;
  box-shadow: 0 0 25px rgba(0,0,0,.5);
  cursor: zoom-out;
}
.lightbox figcaption {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 1.5rem;
  padding: .5rem 1rem;
  border-radius: .5rem;
  text-align: center;
  max-width: 80%;
}


/* Galerie de bières avec effet polaroid */
.beer-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}
.beer-gallery figure {
  background: #fff8e1;
  padding: .75rem;
  border-radius: .75rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  transition: transform .3s ease;
}
.beer-gallery figure:hover {
  transform: translateY(-5px) rotate(1deg);
}
.beer-gallery img {
  width: 220px;
  border-radius: .5rem;
}
.beer-gallery figcaption {
  text-align: center;
  margin-top: .5rem;
  font-size: .9rem;
}

.logoB{
    background: var(--brand);
    padding: 20px;
    border-radius: 100px;
}

img.lienIcon{
  margin-left: 5px;
}