/* =========================================================
   FranceActus — thème principal
   ========================================================= */
:root {
  --blue: #5b8bd0;
  --blue-dark: #3d6faf;
  --steel: #5b7ba5;
  --ink: #0f172a;
  --text: #1f2937;
  --gray: #6b7280;
  --gray-light: #e5e7eb;
  --cream: #FBF7EC;
  --pill-bg: #e8f1fd;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --radius: 1rem;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 1.25rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Bandeau supérieur ---------- */
.topbar { background: #fff; }
.topbar-inner {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0.9rem 1.25rem; gap: 1rem;
}
.topbar-social { display: flex; gap: 0.9rem; justify-content: flex-start; }
.topbar-social a { color: #9ca3af; display: inline-flex; transition: color 0.2s; }
.topbar-social a:hover { color: var(--steel); }
.topbar-social svg { width: 19px; height: 19px; }

.logo {
  text-decoration: none; text-align: center; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center;
}
.logo-main {
  color: var(--steel); font-weight: 800; font-size: 1.9rem;
  letter-spacing: 0.42em; margin-right: -0.42em;
}
.logo-sub {
  color: var(--steel); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.62em; margin-right: -0.62em; margin-top: 0.1rem;
}

.topbar-actions { display: flex; align-items: center; gap: 1.1rem; justify-content: flex-end; }
.login-link { text-decoration: none; font-size: 0.95rem; color: var(--text); }
.login-link:hover { text-decoration: underline; }
.btn-subscribe {
  background: var(--blue); color: #fff; text-decoration: none;
  padding: 0.55rem 1.4rem; border-radius: 0.5rem; font-weight: 600;
  font-size: 0.95rem; transition: background 0.2s;
}
.btn-subscribe:hover { background: var(--blue-dark); }

/* ---------- Navigation ---------- */
.mainnav {
  border-top: 1px solid var(--gray-light);
  border-bottom: 1px solid var(--gray-light);
  background: #fff;
}
.mainnav-inner {
  display: flex; justify-content: center; gap: 2.2rem;
  padding: 0.85rem 1.25rem; flex-wrap: wrap;
}
.nav-item {
  text-decoration: none; font-weight: 500; font-size: 1rem; color: var(--text);
  position: relative;
}
.nav-item:hover { color: var(--blue-dark); }

/* ---------- Hero ---------- */
.hero { margin: 1.75rem auto 0; }
.hero-card {
  display: grid; grid-template-columns: 7fr 5fr;
  border: 1px solid var(--gray-light); border-radius: 1rem;
  overflow: hidden; text-decoration: none; background: #fff;
  transition: box-shadow 0.25s;
}
.hero-card:hover { box-shadow: var(--shadow); }
.hero-media { min-height: 340px; background: var(--bg-soft); }
.hero-media img, .hero-placeholder { width: 100%; height: 100%; object-fit: cover; }
.hero-placeholder { min-height: 340px; background: linear-gradient(135deg, #dbe7f5, #eef4fb); }
.hero-content { padding: 2.25rem; display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.hero-content h1 { font-size: 2rem; line-height: 1.25; color: var(--ink); }
.hero-excerpt { color: var(--gray); font-size: 1.02rem; }
.hero-content time, .card-body time, .popular-item time { color: var(--gray); font-size: 0.85rem; }

.pill {
  display: inline-block; align-self: flex-start;
  background: var(--pill-bg); color: var(--blue-dark);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.3rem 0.85rem; border-radius: 999px;
  text-transform: uppercase;
}
.pill-lg { font-size: 0.8rem; padding: 0.38rem 1rem; }

/* ---------- Édito + populaires ---------- */
.duo {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin: 1.75rem auto 0;
}
.edito-card {
  background: var(--cream); border-radius: 1rem; padding: 1.75rem 2rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.edito-label {
  align-self: flex-start; background: #fff; color: var(--ink);
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 0.32rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--gray-light);
}
.edito-body p { color: #4b5563; margin-bottom: 0.9rem; font-size: 0.98rem; }
.edito-sign { font-style: italic; color: var(--ink); font-weight: 600; }

.popular-card {
  background: #fff; border: 1px solid var(--gray-light);
  border-radius: 1rem; padding: 1.75rem 2rem;
}
.popular-card h2 {
  font-size: 1.25rem; color: var(--ink); font-weight: 800;
  display: flex; align-items: center; gap: 0.6rem;
  border-bottom: 2px solid var(--ink); padding-bottom: 0.7rem; margin-bottom: 1.1rem;
}
.dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: var(--blue); display: inline-block; flex-shrink: 0;
}
.popular-list { display: flex; flex-direction: column; gap: 1.05rem; }
.popular-item {
  display: flex; align-items: center; gap: 0.9rem; text-decoration: none;
}
.popular-item:hover .popular-title { color: var(--blue-dark); }
.popular-rank {
  color: var(--blue); font-weight: 800; font-size: 1.5rem;
  min-width: 1.6rem; text-align: center; line-height: 1;
}
.popular-thumb {
  width: 74px; height: 56px; border-radius: 0.5rem; overflow: hidden;
  background: var(--bg-soft); flex-shrink: 0;
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-title { font-weight: 600; font-size: 0.95rem; color: var(--ink); line-height: 1.4; }

/* ---------- Sections ---------- */
.section { margin: 2.75rem auto 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.section-header h1, .section-header h2 {
  font-size: 1.4rem; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; gap: 0.6rem;
}
.see-all {
  color: var(--blue-dark); font-weight: 700; font-size: 0.9rem;
  text-decoration: none; letter-spacing: 0.03em;
}
.see-all:hover { text-decoration: underline; }

/* ---------- Cartes ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.card {
  background: #fff; border: 1px solid var(--gray-light);
  border-radius: 0.8rem; overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-link { text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.8rem 0.8rem 0 0; }
.card-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
.card-excerpt {
  color: var(--gray); font-size: 0.92rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.empty-note { color: var(--gray); padding: 1.5rem 0; grid-column: 1 / -1; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 1.25rem; margin: 2.25rem 0 3.5rem;
}
.page-link {
  text-decoration: none; color: var(--blue-dark); font-weight: 600;
  border: 1px solid var(--gray-light); border-radius: 0.5rem; padding: 0.45rem 1rem;
}
.page-link:hover { background: var(--pill-bg); }
.page-info { color: var(--gray); font-size: 0.9rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: #cbd5e1; margin-top: 3.5rem; }
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; }

.newsletter {
  padding: 2.75rem 0 2.25rem; border-bottom: 1px solid #1e293b;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 1.1rem;
}
.newsletter-text h2 { color: #fff; font-size: 1.5rem; margin-bottom: 0.4rem; }
.newsletter-text p { color: #94a3b8; }
.newsletter-form { display: flex; gap: 0.6rem; width: 100%; max-width: 480px; }
.newsletter-form input {
  flex: 1; padding: 0.7rem 1rem; border-radius: 0.5rem;
  border: 1px solid #334155; background: #1e293b; color: #fff; font-size: 1rem;
}
.newsletter-form input::placeholder { color: #64748b; }
.newsletter-form button {
  background: var(--blue); color: #fff; border: none; border-radius: 0.5rem;
  padding: 0.7rem 1.5rem; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.newsletter-form button:hover { background: var(--blue-dark); }
.newsletter-msg { font-size: 0.95rem; }
.newsletter-msg.success { color: #86efac; }
.newsletter-msg.error { color: #fca5a5; }

.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 2rem;
  padding: 2.75rem 0;
}
.footer-col h3 {
  color: #fff; font-size: 0.85rem; font-weight: 800;
  letter-spacing: 0.1em; margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col ul a { font-size: 0.95rem; }
.footer-wordmark { color: #fff; font-weight: 800; letter-spacing: 0.18em; font-size: 1.15rem; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.92rem; margin-bottom: 0.6rem; color: #94a3b8; }
.footer-social { display: flex; gap: 0.85rem; margin-top: 1.1rem; }
.footer-social a { color: #94a3b8; display: inline-flex; transition: color 0.2s; }
.footer-social a:hover { color: #fff; }
.footer-social svg { width: 20px; height: 20px; }

.footer-latest-item {
  display: block; padding: 0.55rem 0; border-bottom: 1px solid #1e293b;
}
.footer-latest-item:last-child { border-bottom: none; }
.footer-latest-title { display: block; font-size: 0.9rem; font-weight: 600; color: #e2e8f0; line-height: 1.4; }
.footer-latest-item time { font-size: 0.78rem; color: #64748b; }
.footer-empty { color: #64748b; font-size: 0.9rem; }

.footer-bottom {
  border-top: 1px solid #1e293b; padding: 1.3rem 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; font-size: 0.88rem; color: #94a3b8;
}
.footer-bottom nav { display: flex; gap: 1.4rem; }

/* ---------- Bouton retour en haut ---------- */
.back-to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35); z-index: 100;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top svg { width: 1.4rem; height: 1.4rem; }

/* ---------- Page article ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--gray); margin: 1.6rem 0 1.2rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

.article-title { font-size: 2.1rem; line-height: 1.25; color: var(--ink); margin: 1.1rem 0 0.7rem; }
.article-meta { color: var(--gray); font-size: 0.92rem; margin-bottom: 1.6rem; }

.article-figure { margin: 0 0 1.8rem; }
.article-figure img { width: 100%; border-radius: 1rem; }

.essentiel {
  background: var(--pill-bg); border-left: 4px solid var(--blue);
  border-radius: 0 0.8rem 0.8rem 0; padding: 1.3rem 1.6rem;
  margin: 0 0 1.8rem;
}
.essentiel h2 { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.05em; color: var(--ink); margin-bottom: 0.8rem; }
.essentiel ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.essentiel li { position: relative; padding-left: 1.5rem; font-size: 0.97rem; color: var(--text); }
.essentiel li::before {
  content: "✓"; position: absolute; left: 0; color: var(--blue-dark); font-weight: 800;
}

.sommaire {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 0.8rem; padding: 1.2rem 1.6rem;
  margin: 0 0 1.8rem;
}
.sommaire h2 { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.05em; color: var(--ink); margin-bottom: 0.7rem; }
.sommaire nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.sommaire nav ul ul { margin: 0.35rem 0 0 1.1rem; }
.sommaire a { color: var(--blue-dark); text-decoration: none; font-size: 0.97rem; }
.sommaire a:hover { text-decoration: underline; }
.article-body h2, .article-body h3 { scroll-margin-top: 1rem; }

.article-body { font-size: 1.05rem; color: var(--text); }
.article-body .lede {
  font-weight: 700; font-size: 1.18rem; color: var(--ink);
  line-height: 1.6; margin-bottom: 1.4rem;
}
.article-body p { margin-bottom: 1.15rem; }
.article-body h2 {
  font-size: 1.45rem; color: var(--ink); margin: 2rem 0 0.9rem; line-height: 1.35;
}
.article-body h3 {
  font-size: 1.2rem; color: var(--ink); margin: 1.6rem 0 0.7rem;
}
.article-body ul, .article-body ol { margin: 0 0 1.2rem 1.4rem; }
.article-body li { margin-bottom: 0.5rem; }
.article-body blockquote {
  border-left: 4px solid var(--blue); background: var(--bg-soft);
  padding: 1.1rem 1.4rem; border-radius: 0 0.6rem 0.6rem 0;
  margin: 1.5rem 0; font-size: 1.15rem; font-style: italic; color: var(--ink);
  line-height: 1.6;
}
.article-body a { color: var(--blue-dark); }
.article-body img { border-radius: 0.8rem; margin: 1.2rem 0; }

.tags-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 2rem 0 0; }
.tag {
  background: var(--bg-soft); border: 1px solid var(--gray-light);
  border-radius: 999px; padding: 0.35rem 0.95rem; font-size: 0.88rem;
  text-decoration: none; color: var(--steel);
}
.tag:hover { background: var(--pill-bg); }

.author-box {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--bg-soft); border: 1px solid var(--gray-light);
  border-radius: 1rem; padding: 1.5rem; margin: 2rem 0 3.5rem;
}
.author-avatar {
  width: 3.2rem; height: 3.2rem; border-radius: 50%; flex-shrink: 0;
  background: var(--steel); color: #fff; font-weight: 800; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
}
.author-name { font-weight: 800; color: var(--ink); margin-bottom: 0.3rem; }
.author-bio { font-size: 0.93rem; color: var(--gray); }

/* ---------- Pages statiques ---------- */
.page-title { font-size: 2rem; color: var(--ink); margin: 2rem 0 1.4rem; }
.page .article-body { margin-bottom: 3.5rem; }

/* ---------- Formulaire de contact ---------- */
.contact-form { max-width: 560px; margin: 0 0 3.5rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.7rem 0.95rem; border: 1px solid var(--gray-light);
  border-radius: 0.55rem; font-size: 1rem; font-family: inherit;
}
.form-group textarea { min-height: 150px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus {
  outline: 2px solid var(--blue); border-color: var(--blue);
}
.form-submit {
  background: var(--blue); color: #fff; border: none; border-radius: 0.55rem;
  padding: 0.75rem 2rem; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.form-submit:hover { background: var(--blue-dark); }
.form-msg { margin-top: 1rem; font-weight: 600; }
.form-msg.success { color: #15803d; }

/* ---------- 404 ---------- */
.page-404 { text-align: center; padding: 4rem 1.25rem 5rem; }
.page-404 h1 { font-size: 1.8rem; color: var(--ink); margin-bottom: 0.8rem; }
.page-404 p { color: var(--gray); margin-bottom: 0.5rem; }
.page-404 a { color: var(--blue-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .topbar-inner { grid-template-columns: 1fr; justify-items: center; gap: 0.7rem; padding: 1rem 1.25rem; }
  .topbar-social { order: 2; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-media { min-height: 240px; }
  .hero-content { padding: 1.6rem; }
  .hero-content h1 { font-size: 1.55rem; }
  .duo { grid-template-columns: 1fr; }
  .mainnav-inner { gap: 1.3rem; }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .newsletter-form { flex-direction: column; }
  .article-title { font-size: 1.6rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
