/* Ashgrove Medical Group staff apps: the front door.

   The four colours are the practice logo's own: the wordmark's navy, the
   two leaves' teal and green, and the drop's blue. The green and the blue
   are a step deeper than the logo's so white text on them passes AA
   (logo green #62A353 is 3.1:1 with white; #3D7D3B is 5.0:1).

   White on each sign: navy 12.3, teal 6.2, green 5.0, blue 5.4.
   No script and no inline style: the Content-Security-Policy in
   vercel.json allows neither. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  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;
}

/* Latin Extended carries the Welsh ŵ and ŷ. Only fetched if the page uses them. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  --ground:   #FFFFFF;
  --ink:      #06283D;
  --ink-soft: #3D5566;
  --rule:     #C9D6DC;
  --link:     #1570A6;

  --navy:  #013856;
  --teal:  #096E5E;
  --green: #3D7D3B;
  --blue:  #1570A6;

  --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:   #06141F;
    --ink:      #EEF4F6;
    --ink-soft: #A9BCC6;
    --rule:     #24404F;
    --link:     #7CC0EA;

    /* The logo's navy is nearly the dark ground itself; lifted so the sign
       still reads as a sign. White on it is 8.7:1. */
    --navy: #174F73;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Layout ---------- */

.page {
  display: grid;
  gap: 1.5rem;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

@media (min-width: 60rem) {
  /* The block as a whole sits in the middle of the screen. Inside it the
     logo lines up with the top of the board and the help with its foot. */
  body {
    display: grid;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .page {
    grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr);
    grid-template-areas:
      "intro board"
      "help  board";
    grid-template-rows: auto 1fr;
    column-gap: 4.5rem;
    row-gap: 2.5rem;
    width: 100%;
    max-width: 72rem;
    padding: 3rem 2.5rem;
  }

  .intro { grid-area: intro; }
  .board { grid-area: board; }
  .help  { grid-area: help; align-self: end; }
}

/* ---------- Intro ---------- */

.logo {
  display: block;
  width: 11.5rem;
  height: auto;
}

/* The logo's wordmark is navy, which the dark ground would swallow, so
   there it sits on a white plate of its own. */
@media (prefers-color-scheme: dark) {
  .logo {
    box-sizing: content-box;
    padding: 0.625rem 0.875rem;
    border-radius: 6px;
    background: #FFFFFF;
  }
}

h1 {
  margin: 1rem 0 0;
  font-size: clamp(2rem, 1.55rem + 2vw, 2.875rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0.375rem 0 0;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

@media (min-width: 60rem) {
  .logo { width: 16.5rem; }
  h1    { margin-top: 2.5rem; }
  .lead { font-size: 1.25rem; }
}

/* ---------- The board ---------- */

.signs {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sign {
  --sign: var(--navy);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  padding: 0.875rem 1.125rem 0.9375rem 1.25rem;
  border: 2px solid var(--sign);
  border-radius: 6px;
  background: var(--sign);
  color: #FFFFFF;
  text-decoration: none;
}

.sign-navy  { --sign: var(--navy); }
.sign-teal  { --sign: var(--teal); }
.sign-green { --sign: var(--green); }
.sign-blue  { --sign: var(--blue); }

.sign-text {
  display: grid;
  min-width: 0;
}

.sign-name {
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.sign-what {
  margin-top: 0.25rem;
  font-size: 1.0625rem;
  line-height: 1.35;
  text-wrap: balance;
}

.sign-where {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* The address is a second line of reassurance, not the way in. On a phone
   it is dropped so that all four signs fit on the first screen. */
@media (min-width: 30rem) {
  .sign-where { display: block; }
}

.sign-arrow {
  flex: none;
  transition: transform 140ms ease-out;
}

@media (min-width: 60rem) {
  .signs { gap: 0.75rem; }

  .sign {
    padding: 1.375rem 1.5rem 1.4375rem 1.75rem;
  }

  .sign-what  { font-size: 1.125rem; }
  .sign-where { font-size: 0.9375rem; }
}

/* An open app: darkens under the pointer, and the arrow leans in. */
.sign[href]:hover {
  border-color: color-mix(in srgb, var(--sign) 84%, #000000);
  background: color-mix(in srgb, var(--sign) 84%, #000000);
}

.sign[href]:hover .sign-arrow {
  transform: translateX(4px);
}

.sign[href]:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* An app that is not open yet: no href, so no fill. The sign is an outline
   waiting to be put up. */
.sign:not([href]) {
  grid-template-areas:
    "name  tag"
    "what  what"
    "where where";
  align-items: start;
  border: 2px dashed var(--ink-soft);
  background: transparent;
  color: var(--ink);
}

.sign:not([href]) .sign-text  { display: contents; }
.sign:not([href]) .sign-name  { grid-area: name; }
.sign:not([href]) .sign-what  { grid-area: what; }
.sign:not([href]) .sign-where { grid-area: where; }

.sign-tag {
  grid-area: tag;
  margin-top: 0.1875rem;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--ground);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- Help ---------- */

.help {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.help h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 750;
  line-height: 1.3;
}

.help p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
}

.help a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  display: inline-block;
  white-space: nowrap;
}

.help a:hover {
  text-decoration-thickness: 2.5px;
}

.help a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sign-arrow {
    transition: none;
  }

  .sign[href]:hover .sign-arrow {
    transform: none;
  }
}

@media print {
  .sign,
  .sign:not([href]) {
    border: 1.5px solid #000000;
    background: none;
    color: #000000;
  }
}
