/* ============================================================
   VARIABLES — Palette Bauhaus + typo
   ============================================================ */
:root {
  --yellow: #f8dd3d;
  --red: #e63946;
  --blue: #1d3557;
  --black: #000000;
  --white: #f1f1f1;
  --gray: #6c757d;

  --font-sans: "IBM Plex Sans", sans-serif;
  --font-serif: "IBM Plex Serif", serif;
  --font-mono: "IBM Plex Mono", monospace;

  --t--1: clamp(0.92rem, 0.7vw, 1rem);
  --t0: clamp(1rem, 1vw, 1.15rem);
  --t1: clamp(1.35rem, 2vw, 1.7rem);
  --t2: clamp(2rem, 3vw, 2.4rem);
  --t3: clamp(2.5rem, 4vw, 3rem);

  --reading-width: 69ch;
  --lh-body: 1.65;
  --lh-title: 1.2;
  --space-m: 1.2rem;

  --color-text: #000000;
  --color-muted: #6c757d;
  --color-strong: #1d3557;
  --color-highlight: #e63946;

  --sidebar-width: 260px;
  --content-padding: 2rem;
}


/* ============================================================
   RESET & BASE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--white);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: var(--lh-body);
  font-size: var(--t0);
}

a {
  text-decoration: none;
  color: var(--color-strong);
}

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

/* Icône lien externe façon Wikipédia : petite flèche nord-est dans un carré */
a[href^="http"]:not([href^="mailto:"]):not([href^="tel:"]):not([href^="#"]):not([href*="localhost"]):not([href*="127."]):not([href*="11ty-jardin"]):not(.no-external-icon)::after {
  content: "";
  display: inline-block;
  margin-left: 0.3em;
  width: 0.75em;
  height: 0.75em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M7.25 1.25h3.5v3.5h-1V3.06L5.56 7.25 4.75 6.44 8.94 2.25H7.25v-1ZM2.25 2.25H6v1H3.25v5.5h5.5V6h1v3.75a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: text-top;
  opacity: 0.85;
}

/* ============================================================
   TYPOGRAPHIE
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: var(--lh-title);
  margin: 1.2em 0 0.4em;
  color: var(--color-strong);
  font-weight: 600;
}

h1 { font-size: var(--t3); }
h2 { font-size: var(--t2); }
h3 { font-size: var(--t1); }
h4 { font-size: var(--t0); }
h5 { font-size: var(--t--1); }
h6 { font-size: var(--t--1); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

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

p {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.55;
  max-width: 65ch;
  margin: 0 0 var(--space-m) 0;
  color: var(--text-primary, #111);
  hyphens: auto;
  text-rendering: optimizeLegibility;
}

p.intro {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.45rem);
  line-height: 1.45;
  max-width: 60ch;
}

.note-body,
.apropos-body {
  font-family: var(--font-serif);
  max-width: var(--reading-width);
  margin: 0 auto;
  font-size: var(--t0);
  line-height: var(--lh-body);
  color: var(--color-text);
}

.notes-list
{width:auto}

.notes-list a {
  text-decoration: underline dotted;
}

.small,
.smallprint {
  font-size: var(--t--1);
  color: var(--color-muted);
  line-height: 1.5;
}

ul, ol {
  margin: 0 0 1.2em 1.6em;
  line-height: var(--lh-body);
}

li {
  padding-left: 0.3em;
  margin-bottom: 0.3em;
}

blockquote {
  font-family: var(--font-serif);
  font-size: var(--t1);
  margin: 1.5em auto;
  padding: 1em 1.25em;
  max-width: var(--reading-width);
  border-left: 6px solid var(--color-strong);
  color: var(--color-strong);
  background: #f8f9fa;
  line-height: 1.5;
}

blockquote footer {
  margin-top: 0.8em;
  font-size: var(--t--1);
  color: var(--color-muted);
}

code {
  font-family: var(--font-mono);
  background: #f1f1f1;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.95em;
}

pre code {
  display: block;
  padding: 1em;
  background: #f1f1f1;
  border-radius: 4px;
  overflow-x: auto;
  border-left: 4px solid var(--color-strong);
}

figure {
  margin: 2rem auto;
  max-width: 75%;
  text-align: center;
}

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

/* Ratios d'image (proportion divine) */
img.horizontal,
img.landscape {
  aspect-ratio: 1 / 1.618; /* largeur / hauteur */
}

img.vertical,
img.portrait {
  aspect-ratio: 1.618 / 1; /* largeur / hauteur */
}

figcaption {
  margin-top: 0.5rem;
  font-size: var(--t--1);
  font-family: var(--font-sans);
  color: var(--color-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: var(--t--1);
}

th, td {
  border: 1px solid #ddd;
  padding: 0.6em;
}

th {
  background: #f8f9fa;
  font-weight: 600;
}

hr {
  border: none;
  border-top: 2px solid var(--color-strong);
  margin: 2rem auto;
  max-width: var(--reading-width);
}

.sc {
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
}

.footnotes {
  font-size: var(--t--1);
  max-width: var(--reading-width);
  margin: 3rem auto 0;
}

.footnotes ol {
  margin-left: 1em;
}

.footnotes li {
  margin-bottom: 0.4rem;
}


/* ============================================================
   LAYOUT GLOBAL
   ============================================================ */
.page-container {
  display: flex;
  min-height: 100vh;
  align-items: stretch; /* ensure sidebar and main column take full available height */
}



/* ------------------------------
   Zone principale (contenu)
   ------------------------------ */
.main-area {
  flex: 1;
  padding-left: 2rem;
  padding-right: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* ensure footer can sit at bottom */
}

/* Navigation ---------------------------------------------------- */
.main-nav ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-color, #000);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.main-nav a:hover {
  text-decoration: underline;
}

.nav-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-block;
}

/* Ligne rouge --------------------------------------------------- */
.header-border {
  width: 100%;
  height: 4px;
  background: var(--red);
  margin-bottom: 1.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .page-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: column;
    padding: 1rem 1.25rem;
  }

  .sidebar .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
  }

  .sidebar .tag-cloud li {
    margin: 0;
  }

  .main-area {
    padding: 1rem;
  }

  .site-header {
    padding: 1rem;
  }

  .header-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .site-logo {
    grid-column: 1;
    grid-row: 2;
    width: 60vw;
    max-width: 260px;
    justify-self: start;
  }

  .site-title-block {
    grid-column: 1;
    grid-row: 1;
  }

  .main-nav {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    margin-top: 0.2rem;
  }

  .main-nav ul {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-border {
    margin-top: 0.5rem;
  }
}


/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  padding: 2rem 1.5rem;
  background: var(--blue);
  color: var(--yellow);
  flex-shrink: 0;
  align-self: stretch;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-title {
  margin-bottom: 0.3rem;
}

.sidebar-tag-cloud {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar a {
  color: var(--yellow);
  text-decoration: none;
}

.sidebar a:hover {
  color: var(--white);
  text-decoration: underline dotted;
}

.sidebar h2 {
  color: var(--yellow);
}


/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  width: 100%;
  padding: 1rem var(--content-padding);
  background: var(--white);
  border-bottom: 2px dotted var(--red);
}

.site-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0;
}

.site-baseline {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  margin: 0.2rem 0 0 0;
  color: var(--text-muted, #444);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.7rem 1rem;
  align-items: start;
}

.site-logo {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  max-width: 220px;
  width: 32vw;
}

.site-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.site-title-block {
  grid-column: 1;
  grid-row: 1;
}

.top-nav ul {
  list-style: none;
  display: flex;
  gap: 1.4rem;
}

.main-nav {
  grid-column: 1;
  grid-row: 2;
  align-self: end; /* align nav bottom with logo bottom */
}


/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px; /* allow home columns to match header/footer width */
  margin-left: auto;
  margin-right: auto;
  padding: var(--content-padding);
}

/* Bloc héro de la page d'accueil */
.home-hero {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.home-section {
  width: 100%;
  max-width: none; /* allow home columns to take full grid width */
}

.header-title .brand,
.home-title {
  font-size: clamp(2.5rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--blue);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.home-baseline {
  font-size: clamp(1.1rem, 1.2vw, 1.35rem);
  color: var(--gray);
}


/* ============================================================
   PAGE D'ACCUEIL — 3 colonnes pleine largeur
   ============================================================ */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 900px) {
  .home-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.section-title {
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--black);
}

.status-icon {
  margin-left: 0.4rem;
  font-size: 0.95em;
}

/* ----------------------------------------------------------
   Mise en page : élargissement du contenu de la page d'accueil
   ---------------------------------------------------------- */
.home-columns {
  width: 100%;
  max-width: 1400px;       /* largeur maximale plus large */
  margin: 0 auto;          /* centré */
  padding: 1rem 2rem;      /* respiration */
}

.home-columns .col {
  flex: 1;
  min-width: 260px;        /* protection pour petit écran */
}



/* ============================================================
   NOTES — Structure uniquement
   ============================================================ */
.note {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.note a {
  text-decoration: underline dotted;
  font-weight: 600;       /* slightly heavier for note links */
}

.note p {
  font-family: var(--font-serif);
  margin: 1rem 0;
}

.note-header,
.note-body,
.note-tags,
.note-backlinks {
  margin-bottom: 2rem;
}

.note-tags a {
  display: inline-block;
  background: var(--yellow);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  margin-right: 0.3rem;
}

.note-tags a:hover {
  background: var(--red);
  color: var(--white);
}

.note-backlinks ul,
.note-tags ul {
  list-style: none;
}


/* ============================================================
   PAGE TAGS
   ============================================================ */
.tag-note-list ul {
  list-style: none;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--white);
  color: var(--black);
  text-align: center;
  padding: 1rem var(--content-padding);
  border-top: 2px dotted var(--black);
  margin-top: auto; /* pushes footer to bottom of main column */
}

.site-footer p {
  margin-bottom: 0.4rem;
  max-width: none; /* match the full width of the dotted lines */
}


/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */
a:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
