:root {
  --bg: #f4f1ec;
  --ink: #0f1a23;
  --muted: #5e6b75;
  --card: #ffffff;
  --line: rgba(15,26,35,.10);
  --navy: #0e2433;
  --teal: #1e7a7a;
  --sand: #d4a843;
  --sand-hover: #c49a38;
  --rust: #b8623b;
}

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

/* Keyboard accessibility: visible focus ring for all interactive elements */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

body {
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Nav rules live in nav.css (shared by all pages). */

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 16px; padding: 20px clamp(16px, 4vw, 44px) 16px;
  align-items: stretch;
}

.hero-main {
  border-radius: 28px;
  color: #fff; padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 500px; position: relative; overflow: hidden;
  background-color: #0e2433;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-main::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14,36,51,.72) 0%,
    rgba(14,36,51,.40) 35%,
    rgba(14,36,51,.55) 65%,
    rgba(14,36,51,.85) 100%
  );
}

.hero-main > * { position: relative; z-index: 1; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .16em;
  color: #7dd8d8; font-size: .72rem; font-weight: 800;
}

.hero-main h1 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: .95; margin: 10px 0 16px; font-weight: 400;
  max-width: 520px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hero-main p {
  color: #e2eef0; font-size: 1rem; max-width: 460px; line-height: 1.5;
}

/* Latest post card (inline) */
.latest-card {
  display: flex; align-items: center; gap: 16px;
  margin-top: 18px;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 16px; padding: 18px 22px;
  max-width: 560px;
  transition: .2s;
  position: relative;
  overflow: hidden;
}
.latest-card::before {
  content: '📰 Dernier post';
  position: absolute;
  top: 8px;
  left: 22px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sand);
  opacity: .9;
}
.latest-card:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.latest-card img {
  width: 80px; height: 60px; object-fit: cover;
  border-radius: 10px; flex-shrink: 0;
  margin-top: 12px;
}
.lc-thumb-empty {
  width: 80px; height: 60px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(126,216,216,.22), rgba(212,168,67,.20));
  margin-top: 12px;
}
.lc-body { flex: 1; min-width: 0; margin-top: 12px; }
.lc-label {
  display: block; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; color: var(--sand);
  margin-bottom: 2px;
}
.lc-title {
  font-weight: 700; font-size: 1rem; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-date {
  font-size: .78rem; color: #b0cdd4; margin-top: 2px;
}
.lc-arrow {
  color: var(--sand); font-weight: 800; font-size: 1.2rem; flex-shrink: 0;
  transition: transform .15s;
}
.latest-card:hover .lc-arrow { transform: translateX(3px); }
.lc-loading { color: #b0cdd4; font-size: .88rem; }

/* Stats bar */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-top: 16px;
}

.stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 14px 10px; text-align: center;
}

.stat strong {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal), var(--sand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat span { display: block; color: #d9e7e9; font-size: .8rem; margin-top: 6px; }

.stat + .stat {
  border-left: 1px solid rgba(255,255,255,.15);
}

/* ── Quick tiles ── */
.quick {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 236px;
  box-shadow: 0 6px 24px rgba(15,26,35,.04);
  transition: .18s; position: relative; overflow: hidden;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(15,26,35,.08);
}

.tile.photo {
  background: linear-gradient(180deg, rgba(14,36,51,.30) 0%, rgba(14,36,51,.72) 100%),
              url(/fr/images/2023/996932641416158.webp) center/cover;
  color: #fff; border-color: transparent;
}

.tile.boat {
  background: linear-gradient(180deg, rgba(14,36,51,.22) 0%, rgba(14,36,51,.52) 42%, rgba(14,36,51,.90) 100%),
              url(/fr/images/boat-tile.webp) center/cover;
  color: #fff; border-color: transparent;
}

.tile.route-tile {
  background: linear-gradient(180deg, rgba(6,18,30,.12) 0%, rgba(6,18,30,.46) 42%, rgba(6,18,30,.88) 100%),
              url('/fr/images/route-map-thumb.webp?v=20260526a') center/cover;
  color: #fff; border-color: transparent;
}

.tile.refit-tile {
  background: linear-gradient(180deg, rgba(14,36,51,.22) 0%, rgba(14,36,51,.52) 42%, rgba(14,36,51,.90) 100%),
              url(/fr/images/2026/2026-travaux-v2-04.webp) center/cover;
  color: #fff; border-color: transparent;
}

.tile.crew-tile {
  background: linear-gradient(180deg, rgba(14,36,51,.30) 0%, rgba(14,36,51,.55) 40%, rgba(14,36,51,.90) 100%),
              url(/fr/images/crew-family.webp) center/cover;
  color: #fff; border-color: transparent;
}

.tile h2 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.4rem; line-height: 1.1; margin: 0; font-weight: 400;
}

.tile p { color: var(--muted); margin: 6px 0 0; font-size: .9rem; line-height: 1.4; }
.tile.photo p, .tile.boat p, .tile.route-tile p, .tile.refit-tile p, .tile.crew-tile p { color: #d6e7ea; }

.badge {
  align-self: start;
  background: rgba(255,255,255,.92); color: var(--navy);
  border-radius: 999px; padding: 5px 11px;
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}

.tile-arrow {
  position: absolute; bottom: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(15,26,35,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--muted);
  transition: .15s;
}

.tile:hover .tile-arrow { background: var(--teal); color: #fff; }
.tile.photo .tile-arrow, .tile.boat .tile-arrow, .tile.route-tile .tile-arrow, .tile.refit-tile .tile-arrow, .tile.crew-tile .tile-arrow {
  background: rgba(255,255,255,.14); color: #fff;
}
.tile.photo:hover .tile-arrow, .tile.boat:hover .tile-arrow, .tile.route-tile:hover .tile-arrow, .tile.refit-tile:hover .tile-arrow, .tile.crew-tile:hover .tile-arrow {
  background: var(--sand); color: #1a1205;
}

/* ── Below section ── */
.below {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 16px; padding: 4px clamp(16px, 4vw, 44px) 48px;
}

/* Feed */
.feed {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 22px;
}

.feed-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}

.feed-head h2 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.feed-head a { color: var(--teal); font-weight: 700; font-size: .9rem; }
.feed-head a:hover { text-decoration: underline; }

/* Filter chips */
.filter {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); border-radius: 999px;
  padding: 6px 12px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: .15s; font-family: inherit;
}

.chip:hover { background: rgba(15,26,35,.04); }
.chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(30,122,122,.3);
  transform: translateY(-2px);
}
.chip.active::before {
  content: '✓ ';
  margin-right: 2px;
}

/* Log rows */
.row {
  display: grid; grid-template-columns: 80px 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
  transition: .15s;
}

.row:hover {
  background: rgba(15,26,35,.02);
  margin: 0 -10px; padding-left: 10px; padding-right: 10px;
  border-radius: 12px;
}

.row img, .row-thumb {
  width: 80px; height: 62px; object-fit: cover;
  border-radius: 12px; display: block;
  background: var(--bg);
}

.row-thumb-empty {
  background: linear-gradient(135deg, rgba(30,122,122,.14), rgba(212,168,67,.18));
  border: 1px solid var(--line);
}

.row h3 { margin: 0 0 2px; font-size: 1rem; font-weight: 700; }
.row p { margin: 0; color: var(--muted); font-size: .88rem; }
.row .meta {
  color: var(--teal); font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px;
}
.arrow { color: var(--teal); font-weight: 800; font-size: 1.1rem; }

/* ── Timeline ── */
.timeline-aside {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 18px;
}
.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
}
/* continuous vertical line */
.timeline::before {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px;
  left: 38px;
  width: 2px;
  background: var(--line);
  border-radius: 1px;
}
.tl-row {
  display: grid;
  grid-template-columns: 36px 20px 1fr;
  align-items: start;
  gap: 0;
  padding: 5px 0;
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s;
}
.tl-row:hover {
  background: rgba(0,0,0,.04);
}
.tl-year {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.tl-active .tl-year {
  color: var(--navy);
  font-weight: 800;
  font-size: .78rem;
}
.tl-active .tl-year::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 6px;
  animation: pulse 2s infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}
.tl-active .tl-label {
  color: var(--navy);
  font-weight: 700;
}
.tl-active {
  background: rgba(14,42,58,.06);
}
.tl-bar {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--teal);
  margin: 3px auto 0;
  position: relative;
  z-index: 1;
}
.tl-bar-accent {
  background: #e8a838;
  box-shadow: 0 0 0 2px #e8a838;
  width: 12px; height: 12px;
  margin-top: 2px;
}
.tl-bar-dim {
  background: var(--line);
  box-shadow: 0 0 0 2px var(--line);
}
.tl-highlight .tl-year {
  color: var(--navy);
  font-weight: 800;
}
.tl-label {
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.35;
  padding-left: 6px;
}
.tl-highlight .tl-label {
  color: var(--navy);
  font-weight: 600;
}

.refit-link { display: inline-block; margin-top: 8px; }

.loading-state { padding: 20px; color: var(--muted); }

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer {
  padding: 48px clamp(16px, 4vw, 44px) 28px;
  color: var(--muted);
  font-size: .88rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.footer-col a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  transition: color .15s;
}

.footer-col a:hover {
  color: var(--teal);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  margin: 0;
  font-size: .82rem;
}

.back-to-top {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top:hover {
  background: var(--sand);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.back-to-top:active {
  transform: translateY(-1px);
}

/* Print styles */
@media print {
  .topbar, .footer, #nl-f, #nl-o, .lightbox, .post-navigation, .back-to-top {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .post-full {
    max-width: 100%;
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
    color: #000;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: .8em;
  }
  
  .hero {
    page-break-after: always;
  }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { min-height: 440px; }
  .below { grid-template-columns: 1fr; }
  .side { flex-direction: row; }
  .side .panel { flex: 1; }
  .stats-bar { grid-template-columns: repeat(4, 1fr); }
  .timeline-aside { order: 2; }
}

@media (max-width: 680px) {
  .menu-btn { display: block; }
  .quick { grid-template-columns: 1fr; }
  .hero-main { min-height: 420px; border-radius: 20px; }
  .tile, .feed, .panel { border-radius: 18px; }
  .row { grid-template-columns: 64px 1fr; }
  .row img, .row-thumb { width: 64px; height: 52px; }
  .arrow { display: none; }
  .side { flex-direction: column; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .hero-main h1 { font-size: 2.4rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .tile, .row, .latest-card, .chip, .tl-row { transition: none; }
  .tile:hover, .row:hover, .latest-card:hover { transform: none; }
  .latest-card:hover .lc-arrow { transform: none; }
  .loading-spinner { animation: none; }
  html { scroll-behavior: auto; }
}

@media screen and (prefers-color-scheme: dark) {
  :root {
    --bg: #121820;
    --ink: #e4eaf0;
    --muted: #9aabb8;
    --card: #1e2a38;
    --line: rgba(200, 215, 230, .10);
    --navy: #8ab4d6;
    --teal: #58b9d6;
    --sand: #e8a838;
    --sand-hover: #d99a22;
    --rust: #d98a66;
  }

  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(232, 168, 56, .08), transparent 30%),
      radial-gradient(circle at 86% 12%, rgba(88, 185, 214, .08), transparent 32%),
      linear-gradient(180deg, #1a2430 0%, var(--bg) 58%, #0e141a 100%);
  }

  .tile:not(.boat):not(.route-tile):not(.refit-tile):not(.crew-tile):not(.photo),
  .feed,
  .timeline-aside,
  .panel {
    background: rgba(30, 42, 56, .78);
    border-color: rgba(200, 215, 230, .10);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .24);
  }

  .tile:hover,
  .row:hover {
    box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
  }

  .row:hover,
  .tl-row:hover,
  .tl-active {
    background: rgba(200, 215, 230, .06);
  }

  .chip {
    background: rgba(30, 42, 56, .56);
    border-color: rgba(200, 215, 230, .12);
    color: var(--ink-soft, var(--muted));
  }

  .chip:hover {
    background: rgba(40, 55, 72, .84);
    color: var(--ink);
  }

  .chip.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #0e141a;
  }

  .badge {
    background: rgba(228, 234, 240, .92);
    color: #0e141a;
  }

  .tile:not(.boat):not(.route-tile):not(.refit-tile):not(.crew-tile):not(.photo) .tile-arrow {
    background: rgba(200, 215, 230, .08);
    color: var(--ink);
  }

  .row-thumb-empty {
    background: linear-gradient(135deg, rgba(88, 185, 214, .16), rgba(232, 168, 56, .16));
    border-color: rgba(200, 215, 230, .10);
  }

  .tl-bar {
    border-color: var(--card);
  }

  .tl-active .tl-year,
  .tl-active .tl-label,
  .tl-highlight .tl-year,
  .tl-highlight .tl-label {
    color: var(--navy);
  }

  .route-link {
    background: rgba(10, 22, 34, .78);
    border: 1px solid rgba(200, 215, 230, .10);
  }
}

/* ── Manual dark mode toggle (body.theme-dark) ──
   Duplicates the prefers-color-scheme rules above so the nav
   toggle works independently of the OS setting. Keep in sync. */
body.theme-dark {
  --bg: #121820;
  --ink: #e4eaf0;
  --muted: #9aabb8;
  --card: #1e2a38;
  --line: rgba(200, 215, 230, .10);
  --navy: #8ab4d6;
  --teal: #58b9d6;
  --sand: #e8a838;
  --sand-hover: #d99a22;
  --rust: #d98a66;
  color: #e4eaf0;
  background:
    radial-gradient(circle at 10% 0%, rgba(232, 168, 56, .08), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(88, 185, 214, .08), transparent 32%),
    linear-gradient(180deg, #1a2430 0%, #121820 58%, #0e141a 100%);
}

body.theme-dark .tile:not(.boat):not(.route-tile):not(.refit-tile):not(.crew-tile):not(.photo),
body.theme-dark .feed,
body.theme-dark .timeline-aside,
body.theme-dark .panel {
  background: rgba(30, 42, 56, .78);
  border-color: rgba(200, 215, 230, .10);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .24);
}

body.theme-dark .tile:hover,
body.theme-dark .row:hover {
  box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
}

body.theme-dark .row:hover,
body.theme-dark .tl-row:hover,
body.theme-dark .tl-active {
  background: rgba(200, 215, 230, .06);
}

body.theme-dark .chip {
  background: rgba(30, 42, 56, .56);
  border-color: rgba(200, 215, 230, .12);
  color: var(--muted);
}

body.theme-dark .chip:hover {
  background: rgba(40, 55, 72, .84);
  color: var(--ink);
}

body.theme-dark .chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #0e141a;
}

body.theme-dark .badge {
  background: rgba(228, 234, 240, .92);
  color: #0e141a;
}

body.theme-dark .tile:not(.boat):not(.route-tile):not(.refit-tile):not(.crew-tile):not(.photo) .tile-arrow {
  background: rgba(200, 215, 230, .08);
  color: var(--ink);
}

body.theme-dark .row-thumb-empty {
  background: linear-gradient(135deg, rgba(88, 185, 214, .16), rgba(232, 168, 56, .16));
  border-color: rgba(200, 215, 230, .10);
}

body.theme-dark .tl-bar {
  border-color: var(--card);
}

body.theme-dark .tl-active .tl-year,
body.theme-dark .tl-active .tl-label,
body.theme-dark .tl-highlight .tl-year,
body.theme-dark .tl-highlight .tl-label {
  color: var(--navy);
}

body.theme-dark .footer {
  background: #121820;
  border-top-color: rgba(200, 215, 230, .10);
}

body.theme-dark .footer-col a {
  color: var(--muted);
}

body.theme-dark .footer-col a:hover {
  color: var(--teal);
}

body.theme-dark .footer-bottom {
  border-top-color: rgba(200, 215, 230, .10);
}

body.theme-dark .footer-col h4 {
  color: var(--ink);
}
