/*
  WordPress compatibility shim. Loaded AFTER site.css.

  site.css comes verbatim out of the Astro build and every rule in it is scoped to a
  per-component attribute, e.g.

      .nav-item[data-astro-cid-nen7h5rs] > a[data-astro-cid-nen7h5rs] { … }

  The templates reproduce those attributes on markup they own, so almost everything
  matches. What cannot is markup WordPress generates itself: `wp_nav_menu()` emits its
  own `<li class="menu-item">` and there is no filter that puts an arbitrary attribute
  on the `<li>`. Getting one there needs a custom Walker whose entire job would be to
  add a string that exists only to satisfy a selector.

  So the handful of affected rules are restated here without the scope, keyed on
  `.nav-list` instead. This file is deliberately separate from site.css: site.css is
  regenerated from the Astro build and anything added to it would be lost on the next
  export.

  Keep this file small. If it grows past a few rules, that is the signal that the CSS
  should be un-scoped properly at export time rather than patched here.
*/

/* wp_nav_menu items, matching `.nav-item > a` in site.css */
.nav-list > li > a {
  position: relative;
  padding-block: 0.25rem;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.16s;
}
.nav-list > li > a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-end: -0.125rem;
  block-size: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform 0.2s;
}
.nav-list > li > a:hover,
.nav-list > li > a:focus-visible {
  color: var(--text);
}
.nav-list > li > a:hover::after,
.nav-list > li > a:focus-visible::after {
  transform: scaleX(1);
}
@media (prefers-reduced-motion: reduce) {
  .nav-list > li > a::after {
    transition: none;
  }
}

/*
  WordPress list markup. `wp_nav_menu` and `the_posts_pagination` both emit <ul>s that
  inherit the browser default list styling, which the Astro build never had to reset
  because it never produced an unstyled list.
*/
.nav-list,
.nav-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Editor content. The Astro build had no rich-text region; WordPress does. */
.prose > * + * {
  margin-block-start: 1em;
}
.prose img,
.prose iframe {
  max-inline-size: 100%;
  block-size: auto;
}
.prose a {
  color: var(--accent-hi);
}

/* Admin bar, when logged in: the header is sticky at top 0 and would sit under it. */
body.admin-bar .site-header {
  inset-block-start: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    inset-block-start: 46px;
  }
}
