/* Food System Map — guided tour furniture. Paired with fsm-tour.js.
   Colors are Design System tokens; nothing new enters the palette. */

.map-stage { position: relative; }

/* The invitation sits above the map, not on it. It used to be an absolute overlay at the top
   left, which landed on the outer ring at desktop widths (Kirk 2026-09-07). */
.fsm-tour-start {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 16px;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: var(--soil, #3D3D35);
  border: 0; border-radius: 3px; padding: 11px 16px 11px 14px;
  cursor: pointer; transition: background .18s ease, transform .18s ease;
}
.fsm-tour-start:hover { background: #2E2E28; transform: translateY(-1px); }
.fsm-tour-start:focus-visible { outline: 2px solid var(--honey, #F2C06A); outline-offset: 3px; }
.fsm-tour-start .ico { font-size: 10px; opacity: .9; }
.fsm-tour-start .mins {
  font-weight: 400; letter-spacing: 0.08em; opacity: .62; padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.28);
}
/* while touring, Close in the dock is the way out; the invitation would only be clutter */
body.fsm-touring .fsm-tour-start { display: none; }

/* the map, while touring */
#fsm .fsm-veil { fill: var(--paper, #FAF7F0); opacity: .82; transition: opacity .4s ease; }
#fsm.fsm-tour-on { transition: none; }
body.fsm-touring .map-stage .rail { opacity: .3; transition: opacity .3s ease; pointer-events: none; }
body.fsm-touring .map-caption { opacity: .3; transition: opacity .3s ease; }


/* While touring, the map column becomes a stage that fits the screen with the dock on it, so
   the reader never has to scroll to reach the controls. */
body.fsm-touring .map-wrap { height: calc(100vh - 56px); }
/* where the site header stays pinned, the stage sits below it and takes what is left (Kirk, 20 Oct 2026) */
body.fsm-touring .map-wrap { height: calc(100vh - max(56px, var(--nk-head, 0px) + 24px)); }
body.fsm-touring .map-scroll { height: 100%; overflow: hidden; }
body.fsm-touring .map-wrap #fsm { width: 100%; height: 100%; max-width: none; margin: 0; }

/* the dock */
.fsm-tour-dock {
  position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 7;
  /* the Exhibits' tour treatment (Kirk, 20 Oct 2026, B): Soil-dark at 84% with a slight blur, so the map shows
     faintly through; solid Soil was heavy on the pale map */
  background: rgba(43,43,37,.84); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F4F1EA;
  border-radius: 4px; box-shadow: 0 14px 40px rgba(0,0,0,.22);
  overflow: hidden;
}
.fsm-tour-bar { height: 3px; background: rgba(255,255,255,.16); }
.fsm-tour-bar .p { display: block; height: 100%; width: var(--p, 0%); background: var(--honey, #F2C06A); transition: width .5s ease; }

.fsm-tour-panel { padding: 20px 24px 4px; max-height: 32vh; overflow-y: auto; }
.fsm-tour-panel:focus-visible { outline: 2px solid var(--honey, #F2C06A); outline-offset: -4px; }
.fsm-tour-eyebrow {
  margin: 0 0 8px; font-family: var(--sans); font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--honey, #F2C06A);
}
.fsm-tour-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.2; color: #fff; }
.fsm-tour-text { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.62; color: #E6E1D6; max-width: 74ch; }

.fsm-tour-ctl { display: flex; align-items: center; gap: 8px; padding: 14px 24px 16px; flex-wrap: wrap; }
.fsm-tour-ctl button {
  font-family: var(--sans); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #F4F1EA; background: rgba(255,255,255,.10); border: 0; border-radius: 3px;
  padding: 9px 14px; cursor: pointer; transition: background .16s ease;
}
.fsm-tour-ctl button:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.fsm-tour-ctl button:focus-visible { outline: 2px solid var(--honey, #F2C06A); outline-offset: 2px; }
.fsm-tour-ctl button:disabled { opacity: .32; cursor: default; }
.fsm-tour-ctl .t-play { background: var(--honey, #F2C06A); color: #3D3D35; }
.fsm-tour-ctl .t-play:hover { background: #F6CE86; }
.fsm-tour-ctl .t-narr[aria-pressed="true"] { background: rgba(242,192,106,.24); color: var(--honey, #F2C06A); }
.fsm-tour-ctl .t-count { font-family: var(--sans); font-size: 12.5px; letter-spacing: .08em; color: rgba(244,241,234,.62); margin: 0 4px; }
.fsm-tour-ctl .t-exit { margin-left: auto; }

@media (max-width: 700px) {
  .fsm-tour-start { font-size: 12px; padding: 10px 13px; margin-bottom: 12px; }
  .fsm-tour-dock { left: 8px; right: 8px; bottom: 8px; }
  /* the whole step shows: no inner scroll on phones; fit() measures the dock, so the map takes what is left (Kirk, 8 Oct) */
  .fsm-tour-panel { padding: 16px 16px 2px; max-height: none; overflow-y: visible; }
  .fsm-tour-title { font-size: 21px; }
  .fsm-tour-text { font-size: 15px; }
  .fsm-tour-ctl { padding: 12px 16px 14px; gap: 6px; }
  .fsm-tour-ctl button { padding: 10px 12px; font-size: 12px; }
  /* on a phone the tour drives the viewport, which is the whole point: stop the sideways scroll */
  body.fsm-touring .map-wrap { overflow: hidden !important; }
  body.fsm-touring .map-wrap #fsm { width: 100% !important; min-width: 0 !important; }
  body.fsm-touring .map-hint { display: none; }
}

/* Short phones (iPhone SE and the like): a tighter panel, so the zoomed map keeps 200 px or more (Kirk, 8 Oct) */
@media (max-width: 700px) and (max-height: 760px) {
  .fsm-tour-panel { padding: 12px 14px 0; }
  .fsm-tour-eyebrow { display: none; }
  .fsm-tour-title { font-size: 18px; margin-bottom: 4px; }
  .fsm-tour-text { font-size: 14px; line-height: 1.5; }
  .fsm-tour-ctl { padding: 8px 14px 10px; }
  .fsm-tour-ctl button { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .fsm-tour-start { transition: none; }
  .fsm-tour-bar .p, #fsm .fsm-veil { transition: none; }
}

/* Listen / Read, the Exhibits' two ways in (Kirk, 18 Oct 2026, "buttons A") */
.fsm-tour-start-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.fsm-tour-start-row .fsm-tour-start { margin: 0; }
.fsm-tour-start.fsm-tour-listen { background: var(--honey, #F2C06A); color: #2B2B25; }
.fsm-tour-start.fsm-tour-listen:hover { background: #F6CE86; }
.fsm-tour-start.fsm-tour-listen .mins { border-left-color: rgba(43,43,37,.3); opacity: .7; }
.fsm-tour-start .ico-spk, .fsm-tour-ctl .ico-spk { width: 16px; height: 16px; flex: none; }
.fsm-tour-ctl .t-narr { display: inline-flex; align-items: center; gap: 7px; }
.fsm-tour-ctl .t-narr[aria-pressed="false"] .ico-spk .w { opacity: .3; }
body.fsm-touring .fsm-tour-start-row { display: none; }
@media (max-width: 700px) { .fsm-tour-start-row { margin-bottom: 12px; gap: 8px; } }

/* 18 Oct 2026 (Kirk): no progress line, and no outline on the text box. The text box still takes focus when the tour
   opens, so a screen reader starts at the stop; the buttons keep their focus rings. */
.fsm-tour-bar { display: none !important; }
.fsm-tour-panel:focus, .fsm-tour-panel:focus-visible { outline: none !important; }
