:root {
  --taproot-logo-fill: #efb200;
  --taproot-logo-filter: drop-shadow(1px 1px 2px oklch(15% 0.25 216));
}

.center-content {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-content: center;
}

.center-content.center-content--scroll {
  box-sizing: border-box;
  min-block-size: 100dvh;
  padding: var(--esp-size-padding);
  position: static;
}

esp-header {
  --esp-header-brand-placement: baseline;
}

/* A centered, contained esp-page can place its surface edge on a fractional
   device pixel. Chromium occasionally leaves the underlying page background
   visible between the sticky header and the right canvas at that shared grid
   line. Let the header paint one pixel past the contained surface so its final
   button remains flush with the canvas without changing page geometry. */
esp-page[contained] > esp-header[slot="header"] {
  inline-size: calc(100% + 1px);
}

/* ── Side menu icon sizing ──────────────────────────────────── */

esp-menu#side-menu {
  --taproot-side-menu-icon-size: var(--esp-size-medium-to-big);
  --taproot-side-menu-icon-padding: calc(var(--esp-size-padding) / 2);
  --taproot-side-menu-icon-column-width: calc(
    var(--taproot-side-menu-icon-size) + var(--taproot-side-menu-icon-padding) +
      var(--taproot-side-menu-icon-padding)
  );
  --taproot-side-menu-max-width: min(32rem, 32vw);
  --esp-avatar-size: var(--taproot-side-menu-icon-size);
  --esp-menu-item-icon-min-width: var(--taproot-side-menu-icon-column-width);
  --esp-menu-item-icon-padding: var(--taproot-side-menu-icon-padding);
  --esp-menu-item-icon-size: var(--taproot-side-menu-icon-size);
  --esp-menu-group-icon-min-width: var(--taproot-side-menu-icon-column-width);
  --esp-menu-group-icon-padding: var(--taproot-side-menu-icon-padding);
  --esp-menu-group-icon-size: var(--taproot-side-menu-icon-size);
}

esp-menu#side-menu[mode="vertical"] > esp-menu-group,
esp-menu#side-menu[mode="vertical"] > esp-menu-item {
  width: max-content;
  min-width: 100%;
  max-width: var(--taproot-side-menu-max-width);
}

/* Espalier hooks use a CSS custom-property fallback at the consumption
   site and are declared once on esp-root so the value inherits through
   every shadow boundary (including esp-profile-chip's inner avatar,
   esp-header's brand slot, taproot-nav-logo's sizing, and anywhere else a
   Lit component reads them).

   --esp-avatar-border-radius: Taproot uses a rounded-square avatar
     shape platform-wide rather than the Espalier default circle.

   --esp-header-height: Espalier >= (the version that ships this
     hook) no longer sets a default on esp-header's :host. Setting
     the documented default here keeps every consumer that doesn't
     ship its own fallback (taproot-nav-logo's SVGs, the
     authenticated-header brand img) sized correctly. */
esp-root {
  --esp-avatar-border-radius: var(--esp-size-border-radius);
  --esp-header-height: calc(4.5 * var(--esp-size-small));
}

.site-icon {
  display: block;
  border-radius: var(--esp-size-border-radius);
}

.site-fallback-icon {
  display: block;
  border-radius: var(--esp-size-border-radius);
}

.site-link-icon {
  display: grid;
  place-items: center;
  width: var(--taproot-side-menu-icon-size, var(--esp-size-medium-to-big));
  height: var(--taproot-side-menu-icon-size, var(--esp-size-medium-to-big));
  margin: calc(var(--esp-size-padding) / -2);

  .site-icon,
  .site-fallback-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
