/* ========================================
   DESIGN MAGAZINE — CSS pur
   ======================================== */

/* --- Palette large --- */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --primary: #0f172a;
  --primary-light: #1e3a5f;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 4px 10px -6px rgba(0,0,0,0.04);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 820px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* --- Layout principal --- */
.main-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Navigation fixe --- */
.top-menu {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  padding: 14px 0;
  margin-bottom: 2em;
  box-shadow: var(--shadow-lg);
}
.top-menu .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: center;
}
.top-menu a {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
}
.top-menu a:hover {
  color: #fff;
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* --- Hero section --- */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5em;
  background: var(--primary);
  box-shadow: var(--shadow-lg);
}
.hero img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  opacity: 0.4;
  border-radius: 0;
  margin: 0;
}
.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(transparent, rgba(15,23,42,0.95));
}
.hero-overlay h1 {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero-overlay p {
  color: #cbd5e1;
  margin-top: 8px;
  font-size: 0.95rem;
  max-width: 90%;
}

/* --- Section headers --- */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2.5em 0 1.4em;
}
.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  white-space: nowrap;
}
.section-header .line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* --- Cartes piliers (accueil) --- */
.grille-piliers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 0 0 2em;
}
.carte-pilier {
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 4px solid var(--accent);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.carte-pilier:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.carte-pilier .categorie {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.carte-pilier h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--primary);
}
.carte-pilier h2 a { color: inherit; }
.carte-pilier p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 16px;
}
.carte-pilier .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.carte-pilier .btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  text-decoration: none;
}

/* --- Cartes articles (page pilier) --- */
.grille-articles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0 0 2em;
}
.carte-article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--teal);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.carte-article:hover {
  box-shadow: var(--shadow-lg);
  border-left-color: var(--primary);
}
.carte-article h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.4;
}
.carte-article h3 a { color: var(--primary); }
.carte-article h3 a:hover { color: var(--primary-light); }
.carte-article p {
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 10px;
}
.carte-article .badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 2px 10px;
  border-radius: 20px;
}

/* --- Layout article --- */
.contenu-article {
  max-width: 680px;
  margin: 0 auto;
}
.contenu-article p {
  font-size: 1.02rem;
  line-height: 1.85;
  margin: 1.3em 0;
  color: #1e293b;
}
.contenu-article p.intro {
  font-size: 1.12rem;
  color: #334155;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 2em;
  font-weight: 450;
}
.contenu-article h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.2em 0 0.6em;
  padding-top: 0.5em;
  color: var(--primary);
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

/* --- Encarts --- */
.sommaire {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 1.8em;
  box-shadow: var(--shadow);
}
.sommaire strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sommaire ol {
  margin: 0;
  padding-left: 20px;
}
.sommaire li {
  margin: 5px 0;
  font-size: 0.9rem;
}

.encart-cles {
  background: var(--teal-soft);
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 1.8em;
}
.encart-cles strong {
  display: block;
  margin-bottom: 8px;
  color: #115e59;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.encart-cles ul {
  margin: 0;
  padding-left: 20px;
}
.encart-cles li {
  font-size: 0.9rem;
  color: #134e4a;
  margin: 4px 0;
}

/* --- Alertes --- */
.alert {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 8px;
  margin: 1.3em 0;
  font-size: 0.93rem;
  color: #92400e;
}

/* --- Tableaux --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td {
  border: none;
  padding: 12px 14px;
  text-align: left;
  font-size: 0.9rem;
}
th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}
tr:nth-child(even) { background: #f8fafc; }

/* --- Images --- */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.2em 0;
}

/* --- Listes --- */
ul, ol { margin: 0.8em 0 0.8em 1.6em; }
li { margin-bottom: 0.35em; }

/* --- Navigation entre articles --- */
.nav-articles {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 2.5em 0;
  flex-wrap: wrap;
}
.nav-article {
  flex: 1;
  min-width: 130px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-soft) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-article:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--primary) !important;
}
.nav-article.next { text-align: right; }

/* --- Footer --- */
footer {
  margin-top: 3.5em;
  padding: 2em 0 1.5em;
  border-top: 2px solid var(--border);
  text-align: center;
}
footer a {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin: 0 10px;
}
footer a:hover { color: var(--primary); }
footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* --- Bouton générique --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--primary-light);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--primary) !important;
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
}

/* --- Sous-titre --- */
.sous-titre {
  color: var(--text-soft);
  font-size: 1rem;
  margin: 0.5em 0 2em;
  line-height: 1.6;
}

/* --- Article subtitle / meta --- */
.article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5em;
  display: flex;
  gap: 16px;
  align-items: center;
}
.article-meta .tag {
  background: var(--bg);
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .hero img { height: 180px; }
  .hero-overlay { padding: 20px; }
  .hero-overlay h1 { font-size: 1.4rem; }
  .hero-overlay p { font-size: 0.85rem; max-width: 100%; }
  .grille-piliers { grid-template-columns: 1fr; }
  .grille-articles { grid-template-columns: 1fr; }
  .top-menu .inner { gap: 4px 16px; }
  .top-menu a { font-size: 0.78rem; }
  .section-header h2 { font-size: 1.1rem; }
  .contenu-article { padding: 0 4px; }
  body { padding: 0; }
  .main-wrap { padding: 0 14px; }
}
