 @font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Regular.woff2') format('woff2'),
       url('../fonts/Lora-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Variables et couleurs pour le mode jour/nuit */
:root {
  --gap: 1.5rem;
  --pad: 1.5rem;
  --bg: #f8f5ef;
  --text: #111;
  --col-bg: #f8f5ef;
  --shadow: 0 1px 6px rgba(16, 24, 40, 0.06);
}
[data-theme="dark"] {
  --bg: #1a1a1a;
  --text: #f3f4f6;
  --col-bg: #2a2a2a;
  --shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Lora', serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  line-height: 1.6;
}

/* --- Taille de texte adaptative --- */
body {
  font-size: clamp(16px, 1.1vw + 15px, 19px);
}

/* --- Indentation du texte continu --- */
p + p {
  text-indent: 1.5em;
  margin-top: 0;
}

/* --- Menu navigation haut/bas --- */
.menu {
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--col-bg);
  box-shadow: var(--shadow);
}
.menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s;
  font-size: 0.95rem;
}
.menu a:hover,
.menu a:focus {
  background: rgba(0, 0, 0, 0.1);
}
.menu .title {
  font-weight: 700;
}
.menu .chapters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

/* --- Grille principale 3 colonnes --- */
.container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: var(--pad);
  min-height: calc(100vh - 100px);
  align-items: stretch;
}
@media (max-width: 1000px) {
  .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { grid-template-columns: 1fr; }
}

.column {
  background: var(--col-bg);
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  transition: background 0.3s, color 0.3s;
}

.lang-label {
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.content {
  text-align: justify;
}

/* --- Pied de page --- */
footer {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--col-bg);
  box-shadow: var(--shadow);
  position: sticky;
  bottom: 0;
  z-index: 10;
}
button {
  cursor: pointer;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #0077cc;
  color: #fff;
  font-size: 0.9rem;
  transition: background 0.2s;
}
button:hover {
  background: #005fa3;
}

/* --- Boutons flottants haut/bas --- */
.float-btn {
  position: fixed;
  right: 1rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s, background 0.2s;
  z-index: 20;
}
.float-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}
#scrollTop { bottom: 80px; }
#scrollBottom { bottom: 30px; }

/* --- Barres de défilement douces --- */
.column::-webkit-scrollbar {
  width: 0.6rem;
}
.column::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 0.3rem;
}