/* The site header (shell.js) on every page. Standalone: the pages use two different stylesheets,
   so it keeps its own colors. On a phone the sections move to a bar along the bottom of the
   screen; --nav-h is its height (0 elsewhere), for anything else docked to the bottom. */
:root {
  --shell-h: 52px; --ps-top: 64px; /* the plant sheet docks below the header */
  --nav-h: 0px;
  --shell-bg: #fcfcfb; --shell-line: #e4e2dc; --shell-ink: #0b0b0b; --shell-muted: #52514e; --shell-hover: #ecebe7; --shell-accent: #1c5cab;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shell-bg: #141413; --shell-line: #383835; --shell-ink: #f0efec; --shell-muted: #b4b2aa; --shell-hover: #2e2e2b; --shell-accent: #86b6ef; }
}
:root[data-theme="dark"] { --shell-bg: #141413; --shell-line: #383835; --shell-ink: #f0efec; --shell-muted: #b4b2aa; --shell-hover: #2e2e2b; --shell-accent: #86b6ef; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

header.shell {
  position: relative; z-index: 30; display: flex; align-items: center; gap: 8px; height: var(--shell-h); padding: 0 24px;
  background: var(--shell-bg); color: var(--shell-ink); border-bottom: 1px solid var(--shell-line);
  font: 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.shell-brand, .shell-nav a { display: flex; align-items: center; min-height: 44px; border-radius: 8px; color: inherit; text-decoration: none; }
.shell-brand { gap: 6px; padding: 0 8px 0 4px; min-width: 0; font-size: 15px; font-weight: 650; white-space: nowrap; }
.shell-nav { display: flex; gap: 2px; margin-left: auto; }
.shell-nav a { gap: 6px; padding: 0 10px; color: var(--shell-muted); white-space: nowrap; }
.shell-nav .icon { width: 18px; height: 18px; }
.shell-nav a:hover { background: var(--shell-hover); color: var(--shell-ink); }
.shell-nav a[aria-current="page"] { background: var(--shell-ink); color: var(--shell-bg); }
.shell-nav .shell-home { display: none; }
header.shell :focus-visible { outline: 3px solid #f0a100; outline-offset: -3px; }

/* Settings: set apart from the sections by a rule, so it reads as a control, not a page. */
.shell-more { position: relative; flex: none; padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--shell-line); }
.shell-more-btn {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--shell-muted); cursor: pointer;
}
.shell-more-btn:hover, .shell-more-btn[aria-expanded="true"] { background: var(--shell-hover); color: var(--shell-ink); }
.shell-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 248px; padding: 12px;
  background: var(--shell-bg); border: 1px solid var(--shell-line); border-radius: 12px; box-shadow: 0 8px 28px rgb(0 0 0 / .18);
}
.shell-menu[hidden] { display: none; }
.shell-menu-label { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--shell-muted); }
.shell-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--shell-hover); }
.shell-themes button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 56px; padding: 6px 4px;
  border: 0; border-radius: 8px; background: none; color: var(--shell-muted); font: inherit; font-size: 12px; cursor: pointer;
}
.shell-themes button[aria-checked="true"] { background: var(--shell-bg); color: var(--shell-ink); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.shell-menu-links { list-style: none; margin: 12px -12px -12px; padding: 6px; border-top: 1px solid var(--shell-line); }
.shell-menu-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--shell-ink); text-decoration: none; }
.shell-menu-links a:hover, .shell-menu-links a[aria-current="page"] { background: var(--shell-hover); }
.shell-menu-links .icon { width: 18px; height: 18px; color: var(--shell-muted); }

/* Links between the pages about one place (shell.js placeLinks). */
.place-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; font: 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; }
.place-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--shell-line); border-radius: 999px; background: var(--shell-bg); color: var(--shell-ink); text-decoration: none;
}
.place-links a:hover { background: var(--shell-hover); }
.place-links .icon { width: 16px; height: 16px; color: var(--shell-accent); }
.place-links a:focus-visible { outline: 3px solid #f0a100; outline-offset: 2px; }

/* Phone: the header keeps the brand and settings; the sections are a bar along the bottom,
   an icon and a short label each, in the same place on every page. */
@media (max-width: 760px) {
  :root { --nav-h: calc(56px + env(safe-area-inset-bottom)); }
  header.shell { padding: 0 8px 0 12px; }
  .shell-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: 0; height: var(--nav-h); margin: 0; padding-bottom: env(safe-area-inset-bottom);
    background: var(--shell-bg); border-top: 1px solid var(--shell-line);
  }
  .shell-nav a, .shell-nav .shell-home { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; border-radius: 0; font-size: 11px; }
  .shell-nav .icon { width: 22px; height: 22px; }
  .shell-nav a span { display: none; }
  .shell-nav a::after { content: attr(data-short); }
  .shell-nav a:hover { background: none; color: var(--shell-muted); }
  .shell-nav a[aria-current="page"], .shell-nav a[aria-current="page"]:hover { background: none; color: var(--shell-accent); font-weight: 600; }
  .shell-more { margin-left: auto; padding-left: 0; border-left: 0; }
  body { padding-bottom: var(--nav-h); }
  .place-links a { min-height: 44px; }
}
