/* === Reset global === */
* {
  box-sizing: border-box;
}

/* === Base === */
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f1f8e9, #e0f7fa);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === Header === */
header {
  background: #00bcd4;
  color: white;
  padding: 20px;
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* === Layout principal === */
.page-index main {
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
  padding: 30px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  text-align: center;
  flex: 1;
}

.page-historique main {
  width: 100%;
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  flex: 1;
  background: transparent; /* pas de fond */
  box-shadow: none;        /* pas d’ombre */
  text-align: left;
}

/* === Titres / citations === */
h1 {
  font-size: 1.6em;
  margin-bottom: 25px;
  line-height: 1.5;
  color: #222;
  font-weight: 500;
  background: #f9f9f9;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
  position: relative;
}
h1::before, h1::after {
  font-size: 3em;
  color: #00bcd4;
  position: absolute;
  font-weight: bold;
}
h1::before { content: "“"; left: 10px; top: 0; }
h1::after  { content: "”"; right: 10px; bottom: 0; }

/* === Métadonnées === */
.category {
  display: inline-block;
  background: #e0f2f1;
  color: #00695c;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9em;
  margin-bottom: 20px;
}
.date {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 5px;
}
.author {
  margin-top: 10px;
  font-size: 0.95em;
  color: #555;
  font-style: italic;
}

/* === Boutons === */
.buttons {
  margin-top: 20px;
}
.btn {
  display: inline-block;
  padding: 10px 18px;
  margin: 6px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: transform 0.2s, background 0.3s;
  color: white;
}
.btn:hover { transform: scale(1.05); }

.btn-share { background: #0077b5; }
.btn-share:hover { background: #005582; }
.btn-up { background: #4caf50; }
.btn-up:hover { background: #388e3c; }
.btn-down { background: #f44336; }
.btn-down:hover { background: #c62828; }

/* === Votes et compteur === */
.votes {
  margin-top: 8px;
  font-size: 0.9em;
  color: #555;
}
.counter {
  margin-top: 20px;
  font-weight: 600;
  font-size: 1.1em;
  color: #444;
}

/* === Liens === */
a.link, .back-home a, footer a {
  color: #0077b5;
  text-decoration: none;
  font-weight: 500;
}
a.link:hover, .back-home a:hover, footer a:hover {
  text-decoration: underline;
}
.back-home {
  text-align: center;
  margin: 20px 0;
}

/* === Historique (phrases) === */
.phrase {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin: 20px 0;
  padding: 20px;
}
.content {
  font-size: 1.2em;
  margin-bottom: 15px;
  line-height: 1.4;
}

/* === Pagination === */
.pagination {
  text-align: center;
  margin: 30px 0;
}
.pagination a, .pagination strong, .pagination span {
  margin: 0 6px;
  color: #0077b5;
  text-decoration: none;
  font-weight: 500;
}
.pagination strong {
  color: #fff;
  background: #0077b5;
  padding: 5px 10px;
  border-radius: 6px;
}
.pagination span { color: #999; }

/* === Footer === */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  font-size: 0.9em;
  color: #666;
}

/* === Responsive === */
@media (max-width: 768px) {
  .page-index main, 
  .page-historique main {
    width: 95%;
    margin: 20px auto;
    padding: 15px;
  }

  h1 {
    font-size: 1.3em;
    padding: 20px;
  }

  h1::before, h1::after {
    font-size: 2em;
  }

  .content {
    font-size: 1em;
  }

  .buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .btn {
    width: 100%;
    max-width: 250px;
    margin: 8px 0;
    font-size: 1em;
  }

  .votes, .counter, .author {
    font-size: 0.85em;
  }

  .pagination {
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  header {
    font-size: 1.2em;
    padding: 12px;
  }

  h1 {
    font-size: 1.1em;
    padding: 15px;
  }

  .btn {
    font-size: 0.9em;
    padding: 10px;
  }
}
.share-text {
  margin: 10px 0;
  font-size: 0.9em;
  color: #555;
  font-style: italic;
}
/* === Burger menu === */
.burger {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 1.8em;
  cursor: pointer;
}

nav#menu {
  display: none;
  flex-direction: column;
  background: #00bcd4;
  position: absolute;
  top: 60px;
  right: 20px;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

nav#menu a {
  color: white;
  text-decoration: none;
  padding: 8px 0;
  font-weight: 500;
}

nav#menu a:hover {
  text-decoration: underline;
}
/* === Burger menu === */
.burger {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 1.8em;
  cursor: pointer;
  z-index: 20;
}

/* === Side menu === */
#side-menu {
  position: fixed;
  left: -250px; /* caché par défaut */
  top: 0;
  height: 100%;
  width: 250px;
  background: #00bcd4;
  display: flex;
  flex-direction: column;
  padding: 60px 20px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  transition: left 0.3s ease;
  z-index: 1001; /* plus haut que l'overlay */
}

#side-menu a {
  color: white;
  text-decoration: none;
  padding: 12px 0;
  font-size: 1.1em;
  font-weight: 500;
}
#side-menu a:hover {
  text-decoration: underline;
}

/* === Overlay (fond gris quand menu ouvert) === */
#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000; /* en-dessous du menu */
}
