/**
 * The site frame: the header and footer around every page. Sections are
 * toolbox's and so is their stylesheet; this is the one piece of page
 * structure Eventstead draws itself. It paints only from the custom properties
 * the toolbox stylesheet derives from the page root, so it needs that
 * stylesheet loaded first and follows every tenant's theme with no rules of
 * its own per tenant.
 */

/* A published page is the root and nothing else, so it runs edge to edge.
 * Only when the root is the body's own child: the portal loads this file
 * around its canvas, and its body keeps its own rules. */
body:has(> tbx-site-root) {
  margin: 0;
}

tbx-site-root .es-site-header {
  background: var(--tbx-site-background);
  border-bottom: 1px solid
    color-mix(in srgb, var(--tbx-site-text) 12%, var(--tbx-site-background));
  position: relative;
}

tbx-site-root .es-site-header-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--tbx-site-measure-wide);
  min-height: 4rem;
  padding: 0.75rem var(--tbx-site-gutter);
}

tbx-site-root .es-site-brand {
  align-items: center;
  color: var(--tbx-site-text);
  display: inline-flex;
  min-height: 2.5rem;
  text-decoration: none;
}

tbx-site-root .es-site-name {
  font-family: var(--tbx-site-font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}

tbx-site-root .es-site-logo {
  display: block;
  height: 2.5rem;
  max-width: 12rem;
  object-fit: contain;
  object-position: left center;
  width: auto;
}

tbx-site-root .es-site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

tbx-site-root .es-site-nav a {
  color: var(--tbx-site-muted);
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 0;
  text-decoration: none;
  text-underline-offset: 0.35em;
}

tbx-site-root .es-site-nav a:hover,
tbx-site-root .es-site-nav a[aria-current='page'] {
  color: var(--tbx-site-text);
}

tbx-site-root .es-site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-color: var(--tbx-site-accent);
  text-decoration-thickness: 2px;
}

tbx-site-root .es-site-brand:focus-visible,
tbx-site-root .es-site-nav a:focus-visible,
tbx-site-root .es-site-footer a:focus-visible,
tbx-site-root .es-site-skip:focus-visible {
  outline: 2px solid var(--tbx-site-accent);
  outline-offset: 3px;
}

/* Out of sight until a keyboard reaches it, then over the header's top edge. */
tbx-site-root .es-site-skip {
  background: var(--tbx-site-background);
  color: var(--tbx-site-text);
  left: var(--tbx-site-gutter);
  padding: 0.5rem 1rem;
  position: absolute;
  top: 0.5rem;
  transform: translateY(-200%);
  z-index: 1;
}

tbx-site-root .es-site-skip:focus {
  transform: none;
}

tbx-site-root .es-site-main {
  display: block;
}

tbx-site-root .es-site-footer {
  background: var(--tbx-site-soft);
  border-top: 1px solid
    color-mix(in srgb, var(--tbx-site-text) 12%, var(--tbx-site-background));
  color: var(--tbx-site-muted);
  font-size: 0.875rem;
}

tbx-site-root .es-site-footer-inner {
  margin: 0 auto;
  max-width: var(--tbx-site-measure);
  padding: 1.5rem var(--tbx-site-gutter);
  text-align: center;
}

tbx-site-root .es-site-footer p {
  margin: 0;
}

/* Footer text is written in a text box, so its line breaks are the author's. */
tbx-site-root .es-site-footer-text {
  white-space: pre-line;
}

tbx-site-root .es-site-footer-contact {
  margin-top: 0.5rem;
}

tbx-site-root .es-site-footer a {
  color: inherit;
}
