/* ===============================
   STYLE GLOBAL DU BLOG / ADMIN
   =============================== */

/* ---- Palette principale ---- */
:root {
  --primary: #0078ff;
  --primary-light: #eaf3ff;
  --danger: #ff4b5c;
  --success: #2ecc71;
  --text: #1e1e1e;
  --muted: #777;
  --bg: #f8f9fb;
  --card-bg: #fff;
  --border: #e0e0e0;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ---- Reset de base ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    max-width: 1200px;
    margin: auto;
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  line-height: 1.6;
}

/* ---- Liens ---- */
a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
}

/* ---- Boutons ---- */
button,
input[type="submit"] {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s, transform 0.1s;
}
button:hover,
input[type="submit"]:hover {
  background: #005fd4;
  transform: scale(1.03);
}
button.danger {
  background: var(--danger);
}

/* ---- Cartes / Conteneurs ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.container {
  max-width: 900px;
  margin: auto;
}

/* ---- Titres ---- */
h1, h2, h3 {
  color: var(--primary);
  margin-bottom: 10px;
}
h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
}

/* ---- Tableaux (admin) ---- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover {
  background: var(--primary-light);
}

/* ---- Posts / Commentaires ---- */
.post {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.2s;
}
.post:hover {
  transform: scale(1.01);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.post-header img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
}
.comment img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.comments summary {
  cursor: pointer;
  background: var(--primary-light);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 600;
}

/* ---- Formulaires ---- */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
textarea,
select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%;
  font-size: 1rem;
}
textarea {
  resize: vertical;
  min-height: 80px;
}

/* ---- Messages d’alerte ---- */
.alert {
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 15px;
}
.alert.success { background: var(--success); color: white; }
.alert.error { background: var(--danger); color: white; }
.alert.info { background: var(--primary); color: white; }

/* ---- Header & Footer ---- */
header, footer {
  text-align: center;
  padding: 10px 0;
  color: var(--muted);
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
  body {
    padding: 10px;
  }
  .post-header {
    flex-direction: column;
    align-items: flex-start;
  }
  table {
    font-size: 0.9rem;
  }
}
