/* Styles communs aux pages du blog (blog, post, admin) */

:root {
  --blue: #3a40a0;
  --dark: #0f1124;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* l'attribut hidden doit toujours cacher l'élément */
[hidden] { display: none !important; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: var(--white);
}

a { color: #a5b4fc; }

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo img { width: 30px; height: 30px; border-radius: 7px; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: white; }

/* ── CONTENU ── */
.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 80px 24px;
}
h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 42px;
  margin-bottom: 12px;
}
h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 8px;
}
.intro { color: var(--muted); font-size: 17px; line-height: 1.6; margin-bottom: 48px; }
.message { color: var(--muted); margin-bottom: 24px; }
.error { color: #f87171; margin-top: 12px; font-size: 14px; }

/* ── LISTE D'ARTICLES ── */
.post-card {
  display: block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.2s, transform 0.2s;
}
.post-card:hover { border-color: rgba(58, 64, 160, 0.7); transform: translateY(-3px); }
.post-date { color: #a5b4fc; font-size: 13px; margin-bottom: 8px; }
.post-excerpt { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ── ARTICLE ── */
.post-content p {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  font-size: 17px;
  margin-bottom: 20px;
}
.back-link { display: inline-block; margin-top: 32px; font-size: 14px; }

/* ── ADMIN ── */
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.role-label { color: var(--muted); font-size: 14px; }

.post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.post-row-title { font-weight: 500; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  margin-left: 8px;
}
.badge.published { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge.draft { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.row-actions { display: flex; gap: 8px; }

form label { display: block; margin: 20px 0 6px; font-size: 14px; color: var(--muted); }
form input[type='text'],
form input[type='email'],
form input[type='password'],
form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--white);
  font-family: inherit;
  font-size: 15px;
}
form textarea { min-height: 280px; resize: vertical; line-height: 1.6; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.checkbox-line input { width: auto; }
.checkbox-line label { margin: 0; }
.hint { font-size: 13px; color: rgba(255, 255, 255, 0.35); margin-top: 6px; }

.btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover { background: #2d3280; }
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }
.btn-danger { background: rgba(239, 68, 68, 0.25); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.45); }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 32px 48px;
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
}

@media (max-width: 640px) {
  nav { padding: 16px 20px; }
  h1 { font-size: 32px; }
  .container { padding: 48px 20px; }
}
