/* The visitor shell — templates/errors/_visitor_shell.html, and nothing else.
   ---------------------------------------------------------------------------
   Loaded after app.css, only for someone who is not signed in. Everything here
   is the frame around a public page: the masthead, the menu, the footer and the
   skip link. A page's own styles stay with the page, because a signed-in member
   sees the same page inside the member shell and never loads this file.

   Tokens only. Both themes resolve from the blocks in app.css.
   --------------------------------------------------------------------------- */

/* ---------- type: Roboto and Roboto Slab, served from Kindred itself ----------
   A page that asks Google for its type tells Google that someone opened it, and
   a guest's ticket, counselling request or gift is a private page. So the
   visitor shell links no font from anywhere else: the files are in static/fonts/
   (as Google serves them, unchanged; tools/fetch_type.py fetches them again, and
   the two licences are beside them).

   Both families are variable fonts, so one file carries every weight the site
   uses. Three files each, and a browser fetches one only when a page uses a
   letter in it: `latin` is English; `latin-ext` has the naira sign, the Hausa
   hooked letters and the dotted s; `vietnamese` is Google's name for the block
   with the dotted vowels that Yoruba and Igbo names are written with.

   These rules are here because this is the visitor shell's stylesheet. The
   member shell (templates/base.html) loads its own.
   --------------------------------------------------------------------------- */
@font-face {
  font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/roboto-vietnamese.3860f0d8108e.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/roboto-latin-ext.a6323dda0842.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/roboto-latin.665db5e157d2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto Slab"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/roboto-slab-vietnamese.65c33e36b6a3.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Roboto Slab"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/roboto-slab-latin-ext.8e4e765eb8c3.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto Slab"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/roboto-slab-latin.fee1dc1edf94.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- skip link: the first Tab stop on every public page ---------- */
.vs-skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--surface); color: var(--text); font-weight: 700; font-size: .9rem;
  padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  border: 2px solid var(--brand); text-decoration: none;
}
.vs-skip:focus { top: 12px; text-decoration: none; }
#main:focus { outline: none; }

/* On the navy shell the brand-blue ring disappears; use the shell's own ink. */
.vs-head :focus-visible,
.vs-nav :focus-visible,
.vs-foot :focus-visible { outline: 3px solid var(--on-shell); outline-offset: 2px; }

/* ---------- masthead ---------- */
/* The logo file is the mark with the name set in type too small to read at this
   size, so the picture is cropped to the mark and the name is real text. */
.vs-brand img {
  height: 34px; width: 60px; object-fit: cover; object-position: left center; flex: none;
}
.vs-brand .name b { font-size: 1.02rem; }

.vs-account { display: flex; align-items: center; gap: 10px; flex: none; }
.vs-signin {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  color: var(--on-shell); font-size: .86rem; font-weight: 700; border-radius: var(--radius-pill);
}
.vs-signin:hover, .vs-signin.on { background: color-mix(in srgb, var(--on-shell) 12%, transparent); text-decoration: none; }
.vs-menu-btn { display: none; }

/* ---------- the navigation row (wide screens) ---------- */
.vs-nav {
  border-bottom: 3px solid var(--green);
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--shell) 88%, transparent);
  -webkit-backdrop-filter: var(--blur-strong); backdrop-filter: var(--blur-strong);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .vs-nav { background: var(--shell); }
}
.vs-nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  display: flex; flex-wrap: wrap; gap: 2px;
}
.vs-nav a:not(.btn) {
  padding: 11px 14px; color: var(--shell-muted); font-size: .86rem; font-weight: 500;
  white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.vs-nav a:not(.btn):hover { color: var(--on-shell); text-decoration: none; }
.vs-nav a.on { color: var(--on-shell); border-bottom-color: var(--green); font-weight: 700; }
.vs-nav-foot { display: none; }

/* ---------- the footer ---------- */
.vs-foot {
  background: var(--shell); color: var(--shell-muted); margin-top: 64px; padding: 40px 0 0;
  font-size: .88rem;
}
.vs-foot a { color: var(--on-shell); text-underline-offset: 3px; }
.vs-foot p { margin: 0 0 8px; }
.vs-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.vs-foot h2 {
  color: var(--on-shell); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  margin: 0 0 10px; font-family: var(--sans);
}
.vs-foot li a { display: inline-flex; align-items: center; min-height: 32px; }
.vs-foot-grid { display: grid; gap: 26px; grid-template-columns: 1.5fr 1fr 1fr 1fr; padding-bottom: 28px; }
.vs-foot-logo { height: 46px; width: auto; display: block; margin-bottom: 12px; }
.vs-foot-base {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 14px; padding-bottom: 22px; font-size: .78rem;
  border-top: 1px solid color-mix(in srgb, var(--shell-muted) 30%, transparent);
}
.vs-foot-links { display: inline-flex; gap: 6px 20px; flex-wrap: wrap; align-items: center; }
.vs-foot-links a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; }
@media (max-width: 860px) { .vs-foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .vs-foot-grid { grid-template-columns: 1fr; } }

/* ===========================================================================
   PHONE
   One row of eight links does not fit 390px: three of them, the three a person
   in need is most likely looking for, sat off-screen with nothing to say so.
   So the row becomes a menu. "Sign in" stays in the header at every width.
   =========================================================================== */
@media (max-width: 760px) {
  /* No tab bar in this shell, so no room is kept for one. */
  body.visitor { padding-bottom: 0; }

  .vs-head { border-bottom: 3px solid var(--green); }
  .vs-head .masthead-inner { gap: 10px; }
  .vs-brand { gap: 9px; }
  .vs-brand .name b { font-size: .92rem; line-height: 1.15; white-space: normal; }
  .vs-brand .name span { display: none; }

  .vs-account { gap: 8px; }
  .vs-join, .vs-theme { display: none; }
  .vs-signin {
    min-height: 42px; padding: 0 14px; font-size: .84rem;
    border: 1px solid color-mix(in srgb, var(--on-shell) 34%, transparent);
  }

  /* Without scripts the menu cannot open, so it is simply left open (below). */
  .vs-js .vs-menu-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 13px 0 11px;
    background: var(--on-shell); color: var(--shell); border: 0; border-radius: var(--radius-pill);
    font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer;
  }
  .vs-menu-btn .cross { display: none; }
  .vs-menu-btn[aria-expanded="true"] .bars { display: none; }
  .vs-menu-btn[aria-expanded="true"] .cross { display: inline; }

  .vs-nav {
    position: static; border-bottom: 1px solid color-mix(in srgb, var(--shell-muted) 30%, transparent);
    background: var(--shell); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .vs-js .vs-nav { display: none; }
  .vs-js .vs-nav.open { display: block; box-shadow: var(--shadow-lg); }

  .vs-nav-inner { display: grid; grid-template-columns: 1fr; gap: 0; padding: 6px 16px 18px; }
  .vs-nav a:not(.btn) {
    display: flex; align-items: center; justify-content: space-between; min-height: 50px;
    padding: 0 4px; margin: 0; font-size: 1rem; color: var(--on-shell);
    border-bottom: 1px solid color-mix(in srgb, var(--shell-muted) 22%, transparent);
    white-space: normal;
  }
  .vs-nav a:not(.btn)::after {
    content: ""; width: 8px; height: 8px; flex: none; margin-right: 4px;
    border-right: 2px solid var(--shell-muted); border-top: 2px solid var(--shell-muted);
    transform: rotate(45deg);
  }
  .vs-nav a.on { border-bottom-color: color-mix(in srgb, var(--shell-muted) 22%, transparent); color: var(--green); }
  .vs-nav a.on::after { border-color: var(--green); }

  .vs-nav-foot { display: grid; gap: 10px; padding-top: 16px; }
  .vs-nav-theme {
    min-height: 46px; border-radius: var(--radius-pill); cursor: pointer; font: inherit;
    font-size: .88rem; font-weight: 700; background: transparent; color: var(--on-shell);
    border: 1px solid color-mix(in srgb, var(--on-shell) 34%, transparent);
  }
  .vs-nav-theme .moon { display: none; }
  :root[data-theme="dark"] .vs-nav-theme .sun { display: none; }
  :root[data-theme="dark"] .vs-nav-theme .moon { display: inline; }

  /* Without scripts: the same links, always open, two to a row so the page
     itself still starts on the first screen. A theme switch needs a script. */
  html:not(.vs-js) .vs-nav-inner { grid-template-columns: 1fr 1fr; column-gap: 18px; padding-bottom: 10px; }
  html:not(.vs-js) .vs-nav a:not(.btn) { min-height: 46px; font-size: .92rem; }
  html:not(.vs-js) .vs-nav-foot { display: none; }

  /* Footer links are tapped with a thumb. */
  .vs-foot { margin-top: 44px; }
  .vs-foot li a, .vs-foot-links a { min-height: 44px; }
  .vs-foot-base { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}

/* No-JS floor for the theme label, to match app.css's own floor. */
@media (max-width: 760px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vs-nav-theme .sun { display: none; }
  :root:not([data-theme="light"]) .vs-nav-theme .moon { display: inline; }
}

/* A very narrow phone: the name gives way before Sign in does. */
@media (max-width: 350px) {
  .vs-brand .name { display: none; }
}

@media print {
  .vs-head, .vs-nav, .vs-foot, .vs-skip { display: none !important; }
}
