/* Pawthority - site-wide base. Every page loads this file.
 *
 * It holds the fonts, the Direction A colour and type tokens, and the shared header
 * and footer (partials/header.html, partials/footer.html).
 *
 * Until the borough and provider templates move to Direction A, most pages also
 * load css/styles.css after this file, and some load Tailwind's reset on top. So
 * every rule here that styles the header or footer is written to hold on its own:
 * it states what it needs instead of leaning on a page reset, and it is prefixed
 * with the element (header.site-head, footer.foot) so that it out-ranks the bare
 * `header a`, `h2` and `.homepage h2` rules in styles.css whichever file loads last.
 */

/* ── Fonts ──────────────────────────────────────────────────────────────────────
 * Self-hosted: the two files in /fonts/, latin subset, both variable on weight, so
 * one file serves every weight a page asks for. Nothing is requested from Google.
 *
 * The file names carry a hash of their contents, because netlify.toml serves
 * /fonts/* with a one-year immutable cache. To change a font, add the new file
 * under a new name and point the rule here at it; never overwrite a file in place,
 * or returning visitors keep the old one for a year.
 */

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-latin-e9201edd.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-c1df4596.woff2') format('woff2');
}

/* ── Tokens ─────────────────────────────────────────────────────────────────────
 * --muted is also defined by styles.css, as a pale background rather than a text
 * colour. On the pages that load styles.css its value wins, which is what those
 * layouts expect. So nothing in the header or footer rules below may use --muted.
 */

:root {
  --ink: #13201E;
  --ink-2: #34423F;
  --muted: #55635F;
  --teal: #0E7C71;
  --teal-d: #0A5A52;
  --teal-dd: #083B36;
  --teal-l: #D3E9E4;
  --mist: #EEF4F2;
  --line: #D6E0DD;
  --paper: #fff;
  --amber: #F2B33D;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1180px;
  --gut: clamp(1.1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

.wrap {
  box-sizing: border-box;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

header.site-head,
header.site-head *,
footer.foot,
footer.foot * {
  box-sizing: border-box;
}

/* backdrop-filter is switched off because styles.css sets one on every <header>.
   Left on, it would make the header its own stacking context and the phone menu
   could drop behind the page content below it. */
header.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font: 400 1.0625rem/1.6 var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

header.site-head .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 70px;
}

header.site-head a,
header.site-head a:hover {
  color: inherit;
  transition: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -.02em;
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
}

header.site-head .nav {
  display: flex;
  gap: clamp(.9rem, 2.6vw, 1.9rem);
  font-size: .95rem;
  font-weight: 500;
}

header.site-head .nav a,
header.site-head .nav a:hover {
  text-decoration: none;
  white-space: nowrap;
  padding: .35rem 0;
  background: linear-gradient(var(--teal), var(--teal)) 0 100% / 0 2px no-repeat;
  transition: background-size .25s var(--ease);
}

header.site-head .nav a:hover {
  background-size: 100% 2px;
}

header.site-head .menu-btn {
  display: none;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: .4rem .9rem;
  border: 1.5px solid #B7C6C2;
  border-radius: 10px;
  background: #fff;
  font: 600 .95rem var(--sans);
  color: var(--ink);
  cursor: pointer;
}

header.site-head :focus-visible,
footer.foot :focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

/* On a phone the links fold into a menu, but only once the script in the header
   has marked the page as having JavaScript. Without it they stay in the row. */
@media (max-width: 620px) {
  html:not(.js) header.site-head .nav .hide-sm {
    display: none;
  }

  .brand {
    font-size: 1.25rem;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .js header.site-head .menu-btn {
    display: inline-flex;
  }

  .js header.site-head .nav {
    display: none;
    position: absolute;
    right: var(--gut);
    top: calc(100% - 4px);
    flex-direction: column;
    gap: 0;
    min-width: 13rem;
    padding: .3rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 22px 40px -20px rgba(8, 59, 54, .5);
    z-index: 40;
  }

  .js header.site-head .nav.open {
    display: flex;
  }

  .js header.site-head .nav a,
  .js header.site-head .nav a:hover {
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
    background: none;
  }

  .js header.site-head .nav a:last-child {
    border-bottom: 0;
  }
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

footer.foot {
  margin: 0;
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
  background: var(--ink);
  color: #C3CECB;
  font: 400 .95rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.foot-grid {
  display: grid;
  gap: 2.25rem 2rem;
  grid-template-columns: 1fr 1fr;
}

.foot-brand {
  grid-column: 1 / -1;
}

@media (min-width: 860px) {
  .foot-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }

  .foot-brand {
    grid-column: auto;
  }
}

footer.foot p {
  margin: 0;
}

footer.foot .foot-brand p {
  margin-top: .8rem;
  max-width: 30ch;
}

footer.foot h2 {
  margin: 0 0 .8rem;
  font: 700 .92rem/1.4 var(--sans);
  letter-spacing: 0;
  color: #fff;
}

footer.foot ul {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

footer.foot a {
  text-decoration: none;
  color: #C3CECB;
}

footer.foot a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer.foot .foot-brand .brand {
  color: #fff;
}

footer.foot :focus-visible {
  outline-color: #fff;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid #2B3A37;
}

footer.foot .foot-base a {
  color: #fff;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  header.site-head .nav a,
  header.site-head .nav a:hover {
    transition: none;
  }
}
