/* ═══════════════════════════════════════════════════════════
   Morgane Zemmali · DA tokens partagés
   Source unique pour tout le site portfolio
   Synced from Bible/colors_and_type.css
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,400&family=Rethink+Sans:wght@400;500;600&display=swap');

:root {
  /* Foundation */
  --bg: #F9F5EF;             /* cream · page background */
  --surface: #FFFFFF;        /* cards, dialogs, inputs */
  --ink: #1E1E1E;            /* text, hairlines, borders */
  --muted: rgba(30,30,30,0.52);
  --muted-strong: #6B6B6B;
  --rule: rgba(30,30,30,0.14);
  --rule-strong: rgba(30,30,30,0.24);

  /* Accents */
  --yellow: #FAFAA0;         /* signature · pivots et CTAs décisifs */
  --lav: #D4CFEE;            /* accent doux · fond de bloc */
  --sky: #DEE8F0;            /* accent frais · fond de bloc */

  /* Typo */
  --sans: 'Rethink Sans', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* ── Reset minimal ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; letter-spacing: -0.005em;
}

/* ── Playfair italique accent ──────────────────────────── */
.pf {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── Common · header nav partagé ───────────────────────── */
.site-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  position: relative;
  background: var(--bg);
}
.site-header .brand {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.site-header .brand .pf { font-size: 1em; }
.site-header .nav {
  display: flex; gap: 24px; align-items: baseline;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase;
}
.site-header .nav a {
  color: var(--muted); text-decoration: none;
  transition: color 0.15s;
}
.site-header .nav a:hover, .site-header .nav a.active { color: var(--ink); }

/* Burger button · invisible desktop, visible mobile */
.site-header .burger {
  display: none;
  background: transparent; border: 0; padding: 0;
  width: 28px; height: 22px;
  position: relative;
  cursor: pointer;
}
.site-header .burger span {
  display: block;
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.site-header .burger span:nth-child(1) { top: 4px; }
.site-header .burger span:nth-child(2) { top: 10px; }
.site-header .burger span:nth-child(3) { top: 16px; }
.site-header.is-open .burger span:nth-child(1) {
  top: 10px; transform: rotate(45deg);
}
.site-header.is-open .burger span:nth-child(2) { opacity: 0; }
.site-header.is-open .burger span:nth-child(3) {
  top: 10px; transform: rotate(-45deg);
}

@media (max-width: 760px) {
  .site-header { padding: 20px 24px; }
  .site-header .burger { display: block; z-index: 110; }
  .site-header .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 24px;
    gap: 20px;
    z-index: 100;
    font-size: 13px;
  }
  .site-header.is-open .nav {
    display: flex;
  }
  .site-header.is-open .nav a {
    color: var(--ink);
  }
}

/* ── Common · footer partagé ───────────────────────────── */
.site-footer {
  padding: 64px 32px 80px;
  border-top: 1px solid var(--rule); margin-top: 96px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  font-size: 12px; color: var(--muted); line-height: 1.55;
  letter-spacing: 0;
}
.site-footer a {
  color: var(--ink); text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer .right { text-align: right; }
.site-footer .right .wm {
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
@media (max-width: 700px) {
  .site-footer { grid-template-columns: 1fr; }
  .site-footer .right { text-align: left; }
}

/* ── Common · wrap container ───────────────────────────── */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ── Common · section labels ───────────────────────────── */
.section-label {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 12px; margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
.section-label .num {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 14px; letter-spacing: -0.01em; color: var(--muted);
  text-transform: none;
}

/* ── Common · card pour grilles ────────────────────────── */
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(30,30,30,0.04);
}
.card .card-meta {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: baseline;
}
.card .card-title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.15; text-wrap: balance;
}
.card .card-title .pf { font-size: 1em; }
.card .card-summary {
  font-size: 14px; color: var(--muted); line-height: 1.5;
  letter-spacing: 0;
}
.card .card-tags {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  padding-top: 8px; border-top: 1px solid var(--rule);
}

/* ── Common · CTA buttons ──────────────────────────────── */
.btn {
  display: inline-block;
  background: var(--ink); color: var(--bg);
  border: 0; padding: 14px 28px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border-radius: 0;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-yellow { background: var(--yellow); color: var(--ink); }

/* ═══════════════════════════════════════════════════════════
   Edit mode · floating buttons + editable states
   ═══════════════════════════════════════════════════════════ */
.edit-toggle {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--ink); color: var(--bg);
  border: 0; padding: 11px 22px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; z-index: 10000;
  border-radius: 0;
  transition: opacity 0.15s, transform 0.1s, background 0.15s, color 0.15s;
  box-shadow: 0 2px 12px rgba(30,30,30,0.12);
}
.edit-toggle:hover { opacity: 0.9; }
.edit-toggle:active { transform: scale(0.97); }
.edit-toggle.edit-active { background: var(--yellow); color: var(--ink); }

.edit-toggle.edit-export {
  bottom: 70px; right: 24px;
  background: var(--yellow); color: var(--ink);
  box-shadow: 0 2px 12px rgba(30,30,30,0.12);
}
.edit-toggle.edit-export:hover { background: var(--ink); color: var(--yellow); }

.edit-toggle.edit-images {
  bottom: 116px; right: 24px;
  background: var(--lav); color: var(--ink);
  box-shadow: 0 2px 12px rgba(30,30,30,0.12);
}
.edit-toggle.edit-images:hover { background: var(--ink); color: var(--lav); }

.edit-toggle.edit-reset {
  bottom: 162px; right: 24px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: none;
}
.edit-toggle.edit-reset:hover { background: var(--ink); color: var(--bg); }

.edit-hint {
  position: fixed;
  bottom: 24px; left: 24px;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.04em;
  z-index: 10000;
  max-width: 320px;
  line-height: 1.55;
}
.edit-hint strong {
  color: var(--yellow); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}

.edit-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: var(--bg);
  padding: 12px 24px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: transform 0.3s ease;
  pointer-events: none; z-index: 10001;
  max-width: 80vw; text-align: center;
}
.edit-toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 700px) {
  .edit-hint { display: none !important; }
  .edit-toggle { padding: 10px 16px; font-size: 10px; }
  .edit-toggle.edit-export { bottom: 64px; }
  .edit-toggle.edit-images { bottom: 104px; }
  .edit-toggle.edit-reset { bottom: 144px; }
}

/* Editable element states · only when body.editing */
body.editing [contenteditable="true"] {
  cursor: text;
  transition: outline 0.1s, background 0.1s;
}
body.editing [contenteditable="true"]:hover {
  outline: 1px dashed rgba(30,30,30,0.25);
  outline-offset: 2px;
}
body.editing [contenteditable="true"]:focus {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  background: rgba(250, 250, 160, 0.18);
}

/* ── Slot · click to upload image (only in edit mode) ─── */
body.editing .slot {
  cursor: pointer;
  position: relative;
  transition: outline 0.15s ease, background 0.15s ease;
}
body.editing .slot:hover {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  background: rgba(250, 250, 160, 0.18);
}
body.editing .slot:not(.has-image)::before {
  content: "Click · upload image";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  pointer-events: none;
}
body.editing .slot.has-image { overflow: hidden; }
body.editing .slot.has-image::after {
  content: "Click · changer";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30,30,30,0.78); color: var(--bg);
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0; transition: opacity 0.15s ease;
  pointer-events: none;
}
body.editing .slot.has-image:hover::after { opacity: 1; }

/* ── Drag handle · repositionner (only in edit mode) ───── */
.drag-handle {
  position: absolute;
  top: -10px; left: -10px;
  width: 22px; height: 22px;
  background: var(--ink); color: var(--yellow);
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  line-height: 22px; text-align: center;
  cursor: grab; user-select: none;
  z-index: 9998;
  display: none;
  border-radius: 0;
  box-shadow: 0 1px 6px rgba(30,30,30,0.18);
}
body.editing .drag-handle { display: block; touch-action: none; }
/* Override · forcer pointer-events pour rendre les blocs draggables clicables */
body.editing .milestone,
body.editing .anno,
body.editing .image-frame,
body.editing .draggable { pointer-events: auto !important; }
body.editing .milestone .drag-handle,
body.editing .anno .drag-handle,
body.editing .draggable .drag-handle { pointer-events: auto !important; }
.drag-handle:hover { background: var(--yellow); color: var(--ink); }
.drag-handle:active, .drag-active > .drag-handle { cursor: grabbing; }
body.editing .drag-active {
  outline: 2px dashed var(--yellow);
  outline-offset: 4px;
}

.edit-hint .dh-icon {
  display: inline-block;
  width: 14px; height: 14px; line-height: 14px;
  background: var(--yellow); color: var(--ink);
  text-align: center; font-weight: 600;
  vertical-align: middle;
}
.edit-hint .dh-yellow { color: var(--yellow); }
.edit-hint .dh-lav { color: var(--lav); }

/* ── SVG Curve editor · handles + tangents ─────────────── */
svg .curve-handles { pointer-events: auto; }
svg .curve-tangent {
  stroke: rgba(30,30,30,0.45);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  fill: none;
  pointer-events: none;
}
svg .curve-handle {
  cursor: grab;
  stroke: var(--ink);
  stroke-width: 1.5;
  transition: r 0.1s ease;
}
svg .curve-handle:hover { stroke-width: 2.5; }
svg .curve-handle:active { cursor: grabbing; }
svg .curve-anchor  { fill: var(--yellow); }
svg .curve-control { fill: var(--lav); }

/* Print · hide all edit chrome */
@media print {
  .edit-toggle, .edit-hint, .drag-handle { display: none !important; }
  svg .curve-handles { display: none !important; }
  [contenteditable="true"] { outline: none !important; background: transparent !important; }
}
