/* Carnet de voyage — une colonne façon application de téléphone, centrée sur ordinateur.
   Deux espaces : Rédaction (les rédacteurs) et Lecture (la famille). */
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap; src: url('/vendor/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: italic; font-display: swap; src: url('/vendor/fonts/source-sans-3/source-sans-3-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap; src: url('/vendor/fonts/source-sans-3/source-sans-3-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 700; font-style: normal; font-display: swap; src: url('/vendor/fonts/source-sans-3/source-sans-3-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 500; font-display: swap; src: url('/vendor/fonts/bricolage-grotesque/bricolage-grotesque-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url('/vendor/fonts/bricolage-grotesque/bricolage-grotesque-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #F4F7F8; --surface: #FFFFFF; --ink: #18252C; --muted: #53626A; --line: #D9E1E5;
  --sea: #1F5F78; --sea-soft: #DCEBF0; --sun: #B94E26; --sun-soft: #F7E2D7; --land: #E4EDE1;
  --on-accent: #FFFFFF; --danger: #A3261F; --danger-soft: #F8E1DF;
  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', sans-serif;
  --body: 'Source Sans 3', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F171B; --surface: #172329; --ink: #E7EEF1; --muted: #9DADB5; --line: #2A3A42;
    --sea: #79B9D3; --sea-soft: #1B3441; --sun: #EE9068; --sun-soft: #3B2419; --land: #1C2B25;
    --on-accent: #1A0E08; --danger: #F08A80; --danger-soft: #3A1B19;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}
.app { max-width: 600px; margin: 0 auto; padding: 16px 0 48px; display: flex; flex-direction: column; gap: 18px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.12; }
h1 { font-size: 32px; font-weight: 700; } h2 { font-size: 22px; font-weight: 700; } h3 { font-size: 19px; font-weight: 500; }
p { margin: 0; }
a { color: var(--sea); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sea); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 4px; }

/* Protection des photos : pas d'enregistrement par clic droit, glisser ou appui long. */
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; max-width: 100%; }

.btn {
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--sun); border-color: var(--sun); color: var(--on-accent); }
.btn.sea { background: var(--sea); border-color: var(--sea); color: var(--on-accent); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; padding: 0 8px; }
.btn.big { min-height: 54px; font-size: 18px; width: 100%; }
.btn.small { min-height: 38px; font-size: 15px; padding: 0 12px; }
.icon-btn { width: 44px; padding: 0; }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav .brand { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.nav .links { display: flex; gap: 4px; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tabs button { flex: 1; min-height: 40px; border: none; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=date], input[type=password], input[type=search], textarea, select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
textarea { min-height: 140px; line-height: 1.55; resize: vertical; }
.title-input { font-family: var(--display); font-size: 21px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.panel { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.list-btn { display: flex; gap: 14px; align-items: center; padding: 12px; text-align: left; width: 100%; color: var(--ink); text-decoration: none; }
.thumb { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--sea-soft); display: block; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.draft { background: var(--sun-soft); color: var(--sun); } .badge.live { background: var(--sea-soft); color: var(--sea); }
.note { padding: 10px 14px; border-radius: 12px; background: var(--sea-soft); font-size: 15px; }
.error { padding: 10px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 15px; }

/* Rédaction : blocs */
.block { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.block-kind { font-size: 13px; font-weight: 700; color: var(--sea); text-transform: uppercase; letter-spacing: .05em; }
.tools { display: flex; gap: 2px; }
.tools button { width: 40px; height: 40px; border: none; background: transparent; border-radius: 8px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.tools button:hover:not(:disabled) { background: var(--bg); }
.block img.wide { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; display: block; }
.upload { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 1.5px dashed var(--muted); border-radius: 12px; color: var(--sea); font-weight: 600; cursor: pointer; background: var(--surface); text-align: center; padding: 8px 12px; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.insertbar {
  position: sticky; bottom: 0; z-index: 500; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px;
}
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--bg); padding: 6px 0; }
.save-state { font-size: 13px; color: var(--muted); }
.save-state.err { color: var(--danger); font-weight: 600; }

.map { width: 100%; height: 240px; border-radius: 12px; overflow: hidden; background: var(--land); z-index: 0; }
.map.tall { height: 300px; }
.places { display: flex; flex-direction: column; gap: 8px; }
.place { display: flex; gap: 8px; align-items: center; }
.num { width: 26px; height: 26px; border-radius: 13px; background: var(--sun); color: var(--on-accent); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.num.off { background: var(--muted); }
.results { display: flex; flex-direction: column; gap: 4px; }
.results button { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; }
.pin { background: none; border: none; }
.pin span { width: 28px; height: 28px; border-radius: 14px; background: var(--sun); color: #fff; border: 2px solid #fff; font: 700 13px var(--body); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

/* Lecture */
.hero { position: relative; border-radius: 20px; overflow: hidden; min-height: 300px; display: flex; align-items: flex-end; background: var(--sea); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,16,20,.78), rgba(8,16,20,0) 65%); }
.hero .txt { position: relative; padding: 22px; color: #FFFFFF; display: flex; flex-direction: column; gap: 6px; }
.hero h1 { font-size: 38px; color: #FFFFFF; }
.readcard { overflow: hidden; text-align: left; padding: 0; width: 100%; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.readcard img { width: 100%; height: 190px; object-fit: cover; display: block; }
.readcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 16px; }

.carousel { background: #101A1F; border-radius: 18px; overflow: hidden; color: #FFFFFF; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.car-view { position: relative; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }
.car-track img { flex: 0 0 100%; width: 100%; height: min(66vw, 400px); object-fit: contain; background: #0A1114; scroll-snap-align: center; }
.car-count { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(10,18,22,.75); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.car-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px; border: none; background: rgba(255,255,255,.92); color: #18252C; display: flex; align-items: center; justify-content: center; }
.car-arrow.prev { left: 10px; } .car-arrow.next { right: 10px; }
.car-caption { padding: 0 16px; font-style: italic; min-height: 1.5em; color: #E8EEF0; }
.car-thumbs { display: flex; gap: 6px; padding: 0 16px; overflow-x: auto; }
.car-thumbs button { flex: 0 0 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; opacity: .55; background: none; }
.car-thumbs button.on { border-color: #FFFFFF; opacity: 1; }
.car-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.story { display: flex; flex-direction: column; gap: 18px; font-size: 18px; line-height: 1.65; }
.story figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.story figure img { width: 100%; border-radius: 12px; max-height: 480px; object-fit: cover; display: block; }
figcaption { font-size: 15px; font-style: italic; color: var(--muted); }
.comment { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.comment.writer { background: var(--sea-soft); border-color: transparent; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 2000;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px);
}
.center-page { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.leaflet-container { font-family: var(--body); }
@media (prefers-reduced-motion: no-preference) { .car-track { scroll-behavior: smooth; } }

/* Version 0.2.0 : emoji de la journée, frise du voyage, réponses aux commentaires */
.emoji-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.emoji-trigger { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 16px 6px 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); font-weight: 600; color: var(--ink); }
.emoji-trigger:hover { border-color: var(--sea); }
.emoji-big { width: 44px; height: 44px; border-radius: 12px; background: var(--sea-soft); color: var(--sea); display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1; }
.emoji-panel { margin-top: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 28px rgba(16, 32, 40, .10); }
.emoji-search { position: relative; }
.emoji-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.emoji-search input { padding-left: 40px; border-radius: 999px; background: var(--bg); border-color: transparent; }
.emoji-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tabs button { flex: 1 0 44px; height: 44px; border: none; background: transparent; font-size: 22px; position: relative; border-radius: 10px 10px 0 0; filter: grayscale(.55); opacity: .75; }
.emoji-tabs button[aria-selected="true"] { filter: none; opacity: 1; }
.emoji-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--sea); }
.emoji-cat-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#emojiGrid { display: flex; flex-direction: column; gap: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 2px; max-height: 248px; overflow-y: auto; }
.emoji-grid button { aspect-ratio: 1; max-width: 100%; font-size: 26px; border: none; border-radius: 50%; background: transparent; padding: 0; line-height: 1; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--sea-soft); }
.emoji-grid button.on { background: var(--sun-soft); box-shadow: inset 0 0 0 2px var(--sun); }
@media (prefers-reduced-motion: no-preference) { .emoji-grid button { transition: transform .12s ease, background-color .12s ease; } .emoji-grid button:hover { transform: scale(1.15); } }
.emoji-empty { padding: 12px 4px; }
.emoji-foot { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.emoji-foot input { flex: 1; min-width: 0; }
.link-box { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.frise { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.frise a { flex: 0 0 auto; min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.frise a .e { font-size: 24px; line-height: 1.15; font-family: var(--display); font-weight: 700; }
.frise a .n { font-size: 12px; font-weight: 700; color: var(--muted); }
.frise a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.frise a[aria-current] .n { color: var(--bg); }
.replies { margin-left: 24px; display: flex; flex-direction: column; gap: 8px; }
