/* "Balades du jour" card on the map — see js/map-today.js.
   Desktop: top-right, under the IGN/OSM/Satellite switch.
   Phone: a sheet above the bottom nav; folded, a pill above the legend. */

.today-root { position: fixed; z-index: 1150; font-family: var(--font-sans, Inter, system-ui, sans-serif); }
.today-root.is-open,
.today-root.is-closed { top: calc(var(--header-h, 56px) + 64px); right: 12px; }

body.planner-open .today-root,
body.measuring-active .today-root { display: none; }

/* ── Pill (folded) ── */
.today-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-pill, 999px);
  background: var(--surface-0, #fff);
  color: var(--text-strong, #111827);
  font: 700 0.86rem/1 var(--font-sans, Inter, system-ui, sans-serif);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.18));
  cursor: pointer;
}
.today-pill .ic { color: var(--forest-600, #2f7d46); }
.today-pill:hover { background: var(--surface-1, #f9fafb); }

/* ── Card ── */
.today-card {
  width: 330px;
  max-height: calc(100vh - var(--header-h, 56px) - 150px);
  max-height: calc(100dvh - var(--header-h, 56px) - 150px);
  display: flex; flex-direction: column;
  background: var(--surface-0, #fff);
  color: var(--text, #1f2937);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.22));
  overflow: hidden;
  animation: today-in .22s var(--ease-out, ease-out);
}
@keyframes today-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .today-card { animation: none; } }

.today-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 14px 14px 10px 16px;
  background: var(--forest-700, #1f5130);
  color: #fff;
}
.today-kicker { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 1rem; }
.today-date { margin-top: 2px; font-size: 0.8rem; opacity: .85; }
.today-date::first-letter { text-transform: uppercase; }
.today-close {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; margin: -6px -6px 0 0;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
}
.today-close:hover { background: rgba(255,255,255,.24); }

.today-body { padding: 12px; overflow-y: auto; overscroll-behavior: contain; }

/* Weekly state of the paths */
.today-cond {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 10px;
  border-radius: var(--radius-md, 12px);
  font-size: 0.84rem; line-height: 1.4;
}
.today-cond > .ic { flex: none; margin-top: 1px; }
.today-cond.is-warn { background: var(--orange-50, #fff7ed); color: var(--orange-700, #c2410c); }
a.today-hunt { text-decoration: none; }
a.today-hunt:hover span { text-decoration: underline; }
.today-sub { flex-wrap: wrap; }
.today-cond.is-ok   { background: var(--green-50, #f0fdf4);  color: var(--green-800, #166534); }
.today-cond.is-wait { background: var(--surface-1, #f9fafb); color: var(--text-muted, #6b7280); }
.today-cond-latest {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px; padding: 0;
  border: none; background: none; color: inherit;
  font: inherit; font-size: 0.8rem; text-align: left; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}

/* Walks */
.today-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.today-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  background: var(--surface-0, #fff);
  overflow: hidden;
}
.today-item.is-selected { border-color: var(--forest-500, #3c9a5a); box-shadow: 0 0 0 2px var(--forest-200, #c5e4cf); }
.today-hike {
  width: 100%; display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px 4px;
  border: none; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.today-hike:hover { background: var(--surface-1, #f9fafb); }
.today-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface-0, #fff), 0 0 0 3px rgba(0,0,0,.12); }
.today-hike-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.today-hike-main strong { font-size: 0.92rem; line-height: 1.3; color: var(--text-strong, #111827); }
.today-meta { font-size: 0.8rem; color: var(--text-muted, #6b7280); }
.today-warn, .today-okline { display: flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; }
.today-warn   { color: var(--orange-700, #c2410c); }
.today-okline { color: var(--green-700, #15803d); }
.today-go { flex: none; margin-top: 2px; color: var(--forest-600, #2f7d46); }
.today-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px 9px 34px;
}
.today-more {
  flex: none; display: flex; align-items: center; gap: 1px;
  margin-left: auto; padding: 4px 0;
  font-size: 0.8rem; font-weight: 600;
  color: var(--forest-600, #2f7d46); text-decoration: none;
}
.today-more:hover { text-decoration: underline; }

.today-empty { margin: 4px 2px 10px; font-size: 0.86rem; color: var(--text-muted, #6b7280); }

.today-plan {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 11px 14px;
  border-radius: var(--radius-md, 12px);
  background: var(--forest-700, #1f5130); color: #fff;
  font-weight: 700; font-size: 0.9rem; text-decoration: none;
}
.today-plan:hover { background: var(--forest-800, #173d24); }
.today-foot { margin: 8px 0 0; text-align: center; font-size: 0.74rem; color: var(--text-faint, #9ca3af); }

.today-root :focus-visible { outline: 3px solid var(--lime-500, #84cc16); outline-offset: 2px; }

/* ── Dark theme ── */
[data-theme="dark"] .today-cond.is-warn { background: rgba(249,115,22,.14); color: #fdba74; }
[data-theme="dark"] .today-cond.is-ok   { background: rgba(34,197,94,.13);  color: #86efac; }
[data-theme="dark"] .today-warn   { color: #fdba74; }
[data-theme="dark"] .today-okline { color: #86efac; }
[data-theme="dark"] .today-more,
[data-theme="dark"] .today-go,
[data-theme="dark"] .today-pill .ic { color: var(--lime-400, #a3e635); }
[data-theme="dark"] .today-item.is-selected { border-color: var(--lime-500, #84cc16); box-shadow: 0 0 0 2px rgba(132,204,22,.25); }

/* ── Phone ── */
@media (max-width: 640px) {
  /* A sheet resting on the bottom nav (56 px): with a gap, half a line of the
     map credits showed through under the card. */
  .today-root.is-open {
    top: auto; left: 8px; right: 8px;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .today-root.is-closed {
    top: auto; right: 8px;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
  }
  .today-root.is-open .today-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .today-card { width: auto; max-height: 64vh; max-height: 64dvh; }
  .today-hike { padding: 12px 12px 4px; }
  .today-more { padding: 8px 0; }
  /* Room for thumbs: the GPS tool row folded out stays usable. */
  body:has(.map-bottom-btns.open) .today-root.is-closed { visibility: hidden; }
  /* Another bottom box has its turn (js/map-surfaces.js): the pill would sit under it. */
  body.surface-grade .today-root.is-closed,
  body.surface-notif .today-root.is-closed { visibility: hidden; }
}
