/* ============================================================
   Design System — Inspiré du Monde
   Palette : beige chaud, quasi-noir, bleu discret
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --color-bg:        #faf9f7;
  --color-bg-alt:    #f2efe9;
  --color-border:    #e0dbd2;
  --color-text:      #1a1919;
  --color-text-muted:#6b6560;
  --color-accent:    #1a518b;
  --color-accent-bis: #b2c3d4;
  --color-accent-dk: rgb(20, 58, 109);
  --color-white:     #ffffff;

  --font-serif: 'Lora', 'Georgia', serif;
  --font-sans:  'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --container-wide: 960px;
  --container-prose: 720px;
  --container-login: 400px;
  --container-ot: 100%;

  --radius-sm: 2px;
  --radius:    4px;

  --transition: 0.15s ease;
}

@media (min-width: 960px) {
  :root {
    --container-ot: 60%;
  }
}

/* ── Reset minimaliste ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: #1a1919;
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;

  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

img, iframe { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; }
p { margin-bottom: 0; }
time { font-variant-numeric: tabular-nums; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1919;
  /* border-bottom: 1px solid var(--color-border); */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-bg);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav .nav-link {
  color: var(--color-bg);
}

.nav-link {
  font-size: 0.875rem;
  color: var(--color-bg);
  transition: color var(--transition);
}
.nav-link:hover { color: var(--color-accent); }

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.logout-form { display: flex; }

/* Hamburger — masqué sur desktop */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-bg);
  transition: var(--transition);
}

/* Navigation mobile */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--color-text);
  border-top: 1px solid var(--color-border);
  padding: 0.75rem 1.25rem;
}
.mobile-nav .nav-link {
  padding: 0.6rem 0;
  font-size: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav .nav-link:last-child { border-bottom: none; }
.mobile-nav.is-open { display: flex; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  padding: 2rem 0;
  /* border-top: 1px solid var(--color-border); */
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  background-color: #1a1919;
  max-height: fit-content;
}

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-height: 44px;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-dk); border-color: var(--color-accent-dk); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg-alt); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-bg-alt); }

.btn-danger {
  background: transparent;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-danger:hover { background: #fee2e2; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; min-height: 36px; }
.btn-full { width: 100%; }

/* ── Formulaires ─────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input,
.form-input-sm {
  padding: 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus,
.form-input-sm:focus {
  outline: none;
  border-color: var(--color-text-muted);
}
textarea.form-input-sm { resize: vertical; }

/* ============================================================
   Page : Accueil
   ============================================================ */
.page-home { padding-bottom: 0; background-color: #353333; flex: 1; display: flex; flex-direction: column;}
.page-home-alt { padding-bottom: 4rem; width: 100%; max-width: var(--container-ot); background-color: var(--color-bg); margin-left: auto; margin-right: auto; box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px; flex: 1;}

.home-hero {
  padding-top: 3rem;
  padding-bottom: 1rem;
}
.home-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.home-divider {
  margin-top: 1.25rem;
  height: 2px;
  background: var(--color-text);
  width: 3rem;
}

/* Article à la une */
.featured-section {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.featured-title a:hover { color: var(--color-accent); }

/* Side-by-side layout */
.featured-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.featured-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
}

.featured-bullets li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text);
}

.featured-bullets li::before {
  content: "•";
  color: var(--color-accent);
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.featured-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-bg-alt);
}

.featured-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color var(--transition);
}

.read-more:hover { color: var(--color-accent-dk); }

.article-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  background: var(--color-accent-bis);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}
.article-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Grille d'articles */
.articles-grid-section { padding-top: 2.5rem; }
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 2 columns instead of 3 */
  gap: 2rem 2.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
}

.article-card-cover-link { display: block; margin-top: 1rem;}

.article-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.article-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.article-card-cover-link:hover .article-card-cover img {
  transform: scale(1.03);
}

.article-card-body {
  padding-top: 1.25rem;
  flex: 1;
}

.article-card-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }

.article-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.article-card-title a:hover { color: var(--color-accent); }
.article-card-excerpt { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.6; }

/* ============================================================
   Page : Article individuel
   ============================================================ */
.post-page { padding-bottom: 0rem; background-color: #353333; flex: 1; display: flex; flex-direction: column;}
.post-page-alt { padding-bottom: 4rem; width: 100%; max-width: var(--container-ot); background-color: var(--color-bg); margin-left: auto; margin-right: auto; box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px; flex: 1;}


.post-header {
  max-width: 92%;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 3rem;
  padding-bottom: 0rem;
  margin-left: 4%;
  margin-right: 4%;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3.66vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.post-meta-sep { color: var(--color-border); }
.post-author { font-weight: 600; }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.post-tag {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}
.post-header-divider {
  margin-top: 1.5rem;
  height: 1px;
  background: var(--color-border);
}

/* Prose */
.prose {
  width: 100%;
  padding-top: 2.5rem;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  padding-left: 8%;
  padding-right: 20%;
  padding-top: 0 !important;
  margin-left: 0;
  margin-right: 0;
}

.block-heading { font-family: var(--font-serif); margin: 2rem 0 0.75rem; }
.block-heading-1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.block-heading-2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
.block-heading-3 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); }

.block-paragraph {
  margin-bottom: 1.4rem;
  line-height: 1.8;
  color: var(--color-text);
}
.block-paragraph a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }

.block-quote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg-alt);
}
.block-quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--color-text);
}
.block-quote-attribution {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.block-image {
  margin: 2rem 0;
}
.block-image img {
  width: 100%;
  border-radius: var(--radius);
}
.block-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

.block-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

.block-map {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  z-index: 1;
}

.block-embed {
  margin: 2rem 0;
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius);
  overflow: hidden;
}
.block-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.post-footer {
  max-width: var(--container-prose);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.back-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.back-link:hover { color: var(--color-accent); }

/* ============================================================
   Page : Connexion
   ============================================================ */
.login-page {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: var(--container-login);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}
.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo a {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
}
.login-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}
.login-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.login-form label { color: var(--color-text); }

/* ============================================================
   Page : Erreur
   ============================================================ */
.error-page {
  padding: 10rem 0;
  text-align: center;
}
.error-code {
  font-family: var(--font-serif);
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 1rem;
}
.error-title {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.error-message {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* ============================================================
   Page : Administration
   ============================================================ */
.admin-page { padding-bottom: 2rem; flex: 1;}

.admin-header {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}
.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--color-border);
}
.admin-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--color-bg-alt); }

.col-title { font-weight: 600; }
.table-link { color: var(--color-text); }
.table-link:hover { color: var(--color-accent); }
.table-view-link {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: 0.5rem;
}
.col-date { color: var(--color-text-muted); font-size: 0.85rem; white-space: nowrap; }
.col-actions { width: 1%; white-space: nowrap; }
.action-buttons { display: flex; gap: 0.4rem; align-items: center; }

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.status-published { background: #dcfce7; color: #166534; }
.status-draft     { background: var(--color-bg-alt); color: var(--color-text-muted); }

/* ============================================================
   Éditeur de blocs
   ============================================================ */
.editor-toolbar {
  position: sticky;
  top: 3.5rem; /* hauteur du site-header */
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
}
.editor-toolbar-left  { flex: 1; }
.editor-toolbar-center { flex: 1; text-align: center; }
.editor-toolbar-right { flex: 1; display: flex; justify-content: flex-end; gap: 0.5rem; }

.save-status {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.save-status.saving { color: var(--color-accent); }
.save-status.saved  { color: #166534; }
.save-status.error  { color: #b91c1c; }

.editor-body { padding-top: 2rem; padding-bottom: 9.5rem; max-width: var(--container-prose); }

.editor-title-input {
  width: 100%;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  padding: 0;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}
.editor-title-input::placeholder { color: var(--color-border); }

.editor-meta { margin-bottom: 1.5rem; }
.editor-meta-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}
.meta-field { display: flex; flex-direction: column; gap: 0.3rem; }
.meta-field-full { grid-column: span 2; }
.meta-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--color-text-muted); font-size: 0.75rem; }

.editor-divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: 2rem;
}

.blocks-container { min-height: 200px; }

/* Bloc générique */
.block-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.25rem 0;
  margin-bottom: 0.25rem;
}
.block-wrapper:hover .block-controls { opacity: 1; }

.block-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
  padding-top: 2px;
}
.block-drag-handle {
  cursor: grab;
  color: var(--color-border);
  font-size: 1rem;
  padding: 2px 3px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  line-height: 1;
}
.block-drag-handle:hover { background: var(--color-bg-alt); color: var(--color-text-muted); }
.block-drag-handle:active { cursor: grabbing; }
.block-delete-btn {
  cursor: pointer;
  color: var(--color-border);
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.block-delete-btn:hover { background: #fee2e2; color: #b91c1c; }

.block-content { flex: 1; min-width: 0; }

/* Blocs contenteditable dans l'éditeur */
.editor-block-heading,
.editor-block-paragraph {
  width: 100%;
  outline: none;
  border: none;
  background: transparent;
  font: inherit;
  padding: 0.25rem 0;
  word-break: break-word;
  white-space: pre-wrap;
}
.editor-block-heading { font-family: var(--font-serif); }
.editor-block-heading[data-level="1"] { font-size: 2rem; font-weight: 700; }
.editor-block-heading[data-level="2"] { font-size: 1.5rem; font-weight: 600; }
.editor-block-heading[data-level="3"] { font-size: 1.2rem; font-weight: 600; }
[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--color-border);
  pointer-events: none;
}

.block-heading-controls {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.level-btn {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  color: var(--color-text-muted);
  min-height: unset;
}
.level-btn.active { background: var(--color-text); color: var(--color-white); border-color: var(--color-text); }

/* Bloc quote dans l'éditeur */
.editor-block-quote {
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.editor-block-quote .quote-text,
.editor-block-quote .quote-attribution {
  outline: none;
  background: transparent;
  border: none;
  width: 100%;
  font: inherit;
  padding: 0;
}
.editor-block-quote .quote-text { font-family: var(--font-serif); font-style: italic; }
.editor-block-quote .quote-attribution { font-size: 0.875rem; color: var(--color-text-muted); }

/* Bloc image dans l'éditeur */
.editor-block-image { display: flex; flex-direction: column; gap: 0.5rem; }
.editor-block-image input {
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  outline: none;
  color: var(--color-text);
}
.editor-block-image input:focus { border-color: var(--color-text-muted); }
.image-preview {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg-alt);
  min-height: 80px;
}
.image-preview img { max-height: 300px; object-fit: cover; }

/* Bloc divider dans l'éditeur */
.editor-block-divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0.5rem 0;
}

/* Bloc map dans l'éditeur */
.editor-block-map { display: flex; flex-direction: column; gap: 0.6rem; }
.map-inputs { display: grid; grid-template-columns: 1fr 1fr 0.5fr 1fr; gap: 0.5rem; }
.map-inputs input {
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  outline: none;
}
.map-inputs input:focus { border-color: var(--color-text-muted); }
.map-inputs label { font-size: 0.7rem; display: block; margin-bottom: 2px; }
.map-preview {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  z-index: 1;
}
.geocode-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  align-self: flex-end;
}

/* Bloc embed dans l'éditeur */
.editor-block-embed { display: flex; flex-direction: column; gap: 0.5rem; }
.editor-block-embed input {
  font-size: 0.875rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  outline: none;
  color: var(--color-text);
}
.editor-block-embed input:focus { border-color: var(--color-text-muted); }
.embed-preview { position: relative; padding-top: 56.25%; background: var(--color-bg-alt); border-radius: var(--radius); }
.embed-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* Bouton ajout de bloc */
.add-block-area { margin-top: 2rem; }
.add-block-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  cursor: pointer;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition), color var(--transition);
  width: 100%;
  justify-content: center;
  min-height: 44px;
}
.add-block-btn:hover { border-color: var(--color-text-muted); color: var(--color-text); }
.add-block-icon { font-size: 1.1rem; line-height: 1; }

/* Menu de sélection de blocs */
.block-menu {
  position: fixed;
  z-index: 9999;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  width: 280px;
  max-height: 360px;
  overflow-y: auto;
}
.block-menu-search { padding: 0.5rem; border-bottom: 1px solid var(--color-border); }
.block-menu-search input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
}
.block-menu-list { list-style: none; padding: 0.25rem 0; }
.block-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: background var(--transition);
  min-height: 44px;
}
.block-menu-item:hover,
.block-menu-item.focused { background: var(--color-bg-alt); }
.block-menu-item strong { display: block; font-weight: 600; }
.block-menu-item small { display: block; color: var(--color-text-muted); font-size: 0.75rem; }
.block-menu-icon {
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-weight: 700;
}

/* Glisser-déposer */
.block-wrapper.dragging { opacity: 0.4; }
.block-wrapper.drag-over { border-top: 2px solid var(--color-accent); }

/* ============================================================
   Responsive — Pages publiques
   ============================================================ */
@media (max-width: 768px) {
  html { font-size: 17px; }

  .site-nav { display: none; }
  .hamburger { display: flex; }

  .articles-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .post-header { padding-top: 1.75rem; }
  .prose { padding-top: 1.5rem; }

  .featured-body {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .featured-cover { order: -1; }

  .featured-bullets { order: 1; }
}

@media (max-width: 480px) {
  html { font-size: 16px; }

  .header-inner { padding-left: 1rem; padding-right: 1rem; }

  .featured-title { font-size: 1.5rem; }

  .block-embed { padding-top: 56.25%; }

  .block-map { height: 250px !important; }
}

/* ============================================================
   Fonction Recherche
   ============================================================ */

.logo-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Bouton trigger ── */
.search-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: none;
  background: #1a1919;
  color: #ffffff;
  transition: color 180ms ease;
}
.search-trigger:hover { color: #1a518b; background: #1a1919; }

/* ── Overlay ── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.search-overlay.is-open { display: flex; }

.search-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0 0 0 / 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Modal ── */
.search-modal {
  position: relative;
  z-index: 1;
  width: min(580px, 90vw);
  background: #353333;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.5);
  overflow: hidden;
}

/* ── Champ de saisie ── */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #353333;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.search-icon { flex-shrink: 0; color: #faf9f7; opacity: 0.5; }
.search-input {
  flex: 1;
  font-size: 1rem;
  background: transparent;
  border: none;
  outline: none;
  color: #faf9f7;
}
.search-input::placeholder { color: rgba(250, 249, 247, 0.35); }
.search-esc {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.3rem;
  color: rgba(250, 249, 247, 0.5);
  flex-shrink: 0;
}

/* ── Résultats ── */
.search-results { list-style: none; padding: 0.4rem 0; margin: 0; background: #353333; }
.search-result-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.9375rem;
  color: #faf9f7;
  transition: background 120ms ease;
}
.search-result-item:hover,
.search-result-item.is-active {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
.search-empty {
  padding: 0.75rem 1rem;
  color: rgba(250, 249, 247, 0.45);
  font-size: 0.875rem;
  background: #353333;
}

/* Empêche le scroll du body quand le spotlight est ouvert */
body.search-is-open { overflow: hidden; }


/* ============================================================
   alt top bar, categories 
   ============================================================ */


/* ── Wrapper commun header + barre catégories ── */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Barre catégories ── */
.categories-bar {
  position: absolute;
  left: 0;
  right: 0;
  background: #1a1919;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 280ms ease, opacity 240ms ease;
}

/* Révèle la barre dès que la souris est sur le header-wrap
   (couvre à la fois le header et la barre elle-même) */
@media (hover: hover) {
  .header-wrap:hover .categories-bar {
    max-height: 52px;
    opacity: 1;
  }
}

.categories-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding-block: 0.5rem;
}

/* ── Lien catégorie ── */
.category-link {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-bg);
  text-decoration: none;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full, 9999px);
  transition: color 180ms ease, background 180ms ease;
  white-space: nowrap;
}

.category-link:hover {
  color: var(--color-accent);
  background: var(--color-accent-bis);
}

/* ─── Map Container ─────────────────────────────────────────── */
.map-container {
  position: relative;
  left: 5%;
  width: 90%;           /* fills parent width */
  aspect-ratio: auto;    /* overridden below once map.png is known */
  /* If your bg.png is e.g. 1600×900, set: aspect-ratio: 16 / 9;  */
  /* For a square map: aspect-ratio: 1 / 1;                        */
  aspect-ratio: 4752 / 3297;  /* ← adjust to match your actual bg.png dimensions */
  overflow: hidden;
  border-radius: var(--radius-lg, 0.75rem);
  user-select: none;
  padding-top: 5rem;
}

/* Base map image — fills container exactly */
.map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  z-index: 0;
}

/* ─── Layers ────────────────────────────────────────────────── */
.map-layers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Active layer — shown when its matching dot is hovered/focused */
.map-layer.is-active {
  opacity: 1;
}

/* ─── Dots ──────────────────────────────────────────────────── */
.map-dots {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.map-phase {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.map-dot.is-dimmed {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.map-dot {
  position: absolute;
  left: var(--dot-x, 50%);
  top:  var(--dot-y, 50%);
  transform: translate(-50%, -50%);

  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(80, 80, 80, 0.85);
  background: rgba(90, 90, 90, 0.45);
  backdrop-filter: blur(2px);
  cursor: pointer;
  padding: 0;

  box-shadow:
    0 0 0 0 rgba(80, 80, 80, 0.7),
    0 2px 10px rgba(0, 0, 0, 0.35);

  transition:
    opacity 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

@keyframes dot-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0   rgba(80, 80, 80, 0.75), 0 2px 10px rgba(0,0,0,0.35);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 0 7px rgba(80, 80, 80, 0.2),  0 2px 10px rgba(0,0,0,0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(80, 80, 80, 0),   0 2px 10px rgba(0,0,0,0.35);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0   rgba(80, 80, 80, 0),    0 2px 10px rgba(0,0,0,0.35);
  }
}

.map-dot {
  animation: dot-pulse 2s ease-out infinite;
}

.map-dot:hover,
.map-dot:focus-visible {
  background: rgba(60, 60, 60, 0.75);
  transform: translate(-50%, -50%) scale(1.35);
  animation: none;
  outline: none;
  box-shadow:
    0 0 0 6px rgba(80, 80, 80, 0.2),
    0 4px 14px rgba(0, 0, 0, 0.4);
}

.map-dot:focus-visible {
  box-shadow:
    0 0 0 3px var(--color-primary, #01696f),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

.map-dot:active {
  transform: translate(-50%, -50%) scale(1.1);
}

.map-dot.is-selected {
  background: var(--color-accent-bis);
  border-color: rgba(255, 255, 255, 0.95);
  animation: none;
  box-shadow: 0 0 0 4px rgba(26, 81, 139, 0.28), 0 3px 12px rgba(0,0,0,0.35);
}

/* ============================================
   PROJET - PHASAGE: Interactive Map Page
   Theme: "Du Monde" — beige chaud, quasi-noir, bleu discret
   ============================================ */

/* ── Map Container ─────────────────────────── */
.proj-map-container {
  position: relative;
  left: 5%;
  width: 90%;
  aspect-ratio: 4752 / 3297; /* adjust to your bg.jpg */
  overflow: hidden;
  border-radius: var(--radius-lg, 0.75rem);
  user-select: none;
  background: var(--color-bg-alt, #f2efe9);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  margin-bottom: 0;
  margin-top: 2rem;
}

.proj-map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  z-index: 0;
}

/* ── Map Layers ────────────────────────────── */
.map-layers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.proj-map-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 380ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.proj-map-layer.is-active {
  opacity: 1;
}

/* ── Map Phase Groups ──────────────────────── */
.map-phase {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.map-phase.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Phase Buttons Bar ─────────────────────── */
.proj-btn-container {
  display: flex;
  align-items: stretch;
  left: 5%;
  width: 90%;
  position: relative;
  background: var(--color-text, #1a1919);
  border-radius: 0 0 var(--radius, 4px) var(--radius, 4px);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  margin-bottom: 2.5rem;
}

.phase-btn {
  flex: 1;
  position: relative;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(250, 249, 247, 0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  transition:
    color 220ms cubic-bezier(0.16, 1, 0.3, 1),
    background 220ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  min-height: 52px;
}

/* Separator between buttons */
.phase-btn:not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
  transition: opacity 220ms ease;
}

.phase-btn:hover {
  color: rgba(250, 249, 247, 0.85);
  background: rgba(255, 255, 255, 0.05);
}

.phase-btn.is-active {
  color: var(--color-bg, #faf9f7);
  background: var(--color-accent-bis);
}

.phase-btn.is-active:hover {
  opacity: 0.95;
}

/* Hide separator when the previous button is active */
.phase-btn.is-active + .phase-btn::before,
.phase-btn.is-active::before {
  opacity: 0;
}

/* Sliding indicator underline */
.phase-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--color-accent-bis, #b2c3d4);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phase-btn:hover::after {
  transform: scaleX(0.6);
}

.phase-btn.is-active::after {
  transform: scaleX(0);
}

/* ── Text Phase Panels ─────────────────────── */
[class^="text-phase-"] {
  display: none; /* hidden by default */
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 320ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.5rem 2rem;
  left: 5%;
  position: relative;
  width: 90%;
  background: var(--color-bg-alt, #f2efe9);
  border-radius: var(--radius, 4px);
  border: 1px solid var(--color-border, #e0dbd2);
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[class^="text-phase-"].is-visible {
  display: block;
}

[class^="text-phase-"].is-animating {
  opacity: 1;
  transform: translateY(0);
}

.sous-titre {
  font-size: clamp(1.1rem, 3vw, 1.6rem) !important;
}

.liste {
  margin-left: 2rem;
}

.ligne-proj {
  text-align: justify;
  hyphens: auto;
}

[class^="text-phase-"] h1 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--color-text, #1a1919);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 600px) {
  .proj-map-container,
  .proj-btn-container,
  [class^="text-phase-"] {
    left: 0;
    width: 100%;
    border-radius: 0;
  }

  .phase-btn {
    font-size: 0.8rem;
    padding: 0.7rem 0.5rem;
    min-height: 44px;
  }
}


/* ── Language Picker ─────────────────────────────────────────── */
.lang-picker {
  position: relative;
}

/* ── header-controls (mobile wrapper: flag + hamburger) ── */
.header-controls {
  display: none; /* hidden on desktop */
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 768px) {
  /* Show the mobile group, hide desktop nav entirely */
  .header-controls { display: flex; }

  /* Hide the desktop lang-picker (it lives inside .site-nav which is already hidden) */
  .site-nav .lang-picker { display: none; }

  /* Hide code + chevron on mobile — flag only */
  .header-controls .lang-code    { display: none; }
  .header-controls .lang-chevron { display: none; }

  .header-controls .lang-trigger {
    padding: 0.25rem 0.3rem;
    font-size: 1.15rem;
  }

  /* Dropdown anchors left so it doesn't clip off screen */
  .header-controls .lang-dropdown {
    right: auto;
    left: 0;
  }
}

/* Shared trigger styles */
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius);
  color: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color var(--transition), background var(--transition);
  min-height: 44px;
}

.lang-trigger:hover { color: var(--color-accent); }

.lang-flag   { font-size: 1rem; line-height: 1; }
.lang-code   { font-size: 0.75rem; }

.lang-chevron {
  color: currentColor;
  opacity: 0.6;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.lang-picker.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 90px;
  background: #2a2929;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  list-style: none;
  padding: 0.3rem 0;
  z-index: 200;
  overflow: hidden;
}

.lang-picker.is-open .lang-dropdown { display: block; }

.lang-option {
  display: block;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(250, 249, 247, 0.7);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-bg);
}

.lang-option--active {
  color: var(--color-bg);
  background: rgba(178, 195, 212, 0.12);
}
