/* Foundry Bakehouse — element defaults */

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

/* The hidden attribute has to win. Its browser default is display:none at the
   very bottom of the cascade, so any author rule setting display beats it: a
   menu card is display:flex, so hiding one with JS did nothing and the menu's
   search box looked broken. !important is the only way an attribute selector
   can outrank a class, and it is what normalize.css and friends do here. Set
   display on a hidden element only via [hidden] itself. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--fbh-ground);
  color: var(--fbh-ink);
  font-family: var(--fbh-font-text);
  font-size: var(--fbh-step-0);
  line-height: var(--fbh-leading-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--fbh-space-s);
  font-family: var(--fbh-font-display);
  font-weight: 600;
  line-height: var(--fbh-leading-head);
  letter-spacing: -0.012em;
  text-wrap: balance;
}

/* H1 and H2 only. Charcuterie is unicase, so these set in caps and small
   caps; the tracking is opened slightly because caps need the air, and the
   negative tracking inherited above is wrong for them. H3-H6 stay on the
   display serif, where sentence case and an italic still matter. */
h1, h2 {
  font-family: var(--fbh-font-heading);
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1 { font-size: var(--fbh-step-5); line-height: var(--fbh-leading-tight); }
h2 { font-size: var(--fbh-step-4); }
h3 { font-size: var(--fbh-step-2); }
h4 { font-size: var(--fbh-step-1); }

p, ul, ol, dl, blockquote, figure, table { margin: 0 0 var(--fbh-space-m); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: from-font; }
a:hover { color: var(--fbh-brand); }

:focus-visible {
  outline: 3px solid var(--fbh-focus);
  outline-offset: 2px;
  border-radius: var(--fbh-radius);
}

img, svg, video { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--fbh-line); margin: var(--fbh-space-xl) 0; }

blockquote {
  font-family: var(--fbh-font-display);
  font-size: var(--fbh-step-2);
  font-style: italic;
  line-height: 1.34;
}

small { font-size: var(--fbh-step--1); }

address { font-style: normal; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--fbh-space-xs) 0; border-bottom: 1px solid var(--fbh-line); }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--fbh-brand); color: var(--fbh-on-brand); }

/* Skip link */
.fbh-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--fbh-space-xs) var(--fbh-space-m);
  background: var(--fbh-ink);
  color: var(--fbh-ground);
}
.fbh-skip:focus { left: var(--fbh-space-s); top: var(--fbh-space-s); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The display face in Fraunces benefits from a softer optical size at large
   sizes; the other pairings ignore these gracefully. */
.fbh-type-a .fbh-display,
.fbh-type-a h1 { font-variation-settings: "SOFT" 20, "WONK" 1; }
