/* The site's own chrome. Page bodies bring their own markup from the editor and
   from the previous platform's HTML, so this file styles the frame and the
   typographic defaults a body inherits - it does not try to restyle content.

   Written as one plain stylesheet rather than a utility framework because the
   public site ships no client bundle and no build step beyond Next's own, and
   because the 306-address comparison (D125) is measured in pixels: a diff here
   should be readable as a diff. */

:root {
  --ink: #16202c;
  --ink-soft: #52627a;
  --rule: #dfe5ec;
  --ground: #ffffff;
  --ground-soft: #f6f8fa;
  --accent: #0b5cab;
  --accent-ink: #ffffff;
  --measure: 72ch;
  --page: 1140px;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

img,
video,
iframe,
table {
  max-width: 100%;
}

img,
video {
  height: auto;
}

a {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 4px;
}

/* ------------------------------------------------------------------ chrome */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.menu,
.submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu > li {
  position: relative;
}

.menu a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.menu a:hover,
.menu a:focus {
  border-bottom-color: var(--accent);
}

.submenu {
  gap: 0 0.9rem;
  padding-left: 0.75rem;
}

.submenu a {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.copyright {
  margin: 0.25rem 0 0;
}

/* ----------------------------------------------------------------- content */

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}

.body,
.status p {
  max-width: var(--measure);
}

.body table {
  border-collapse: collapse;
}

.body th,
.body td {
  border: 1px solid var(--rule);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.post-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.category::before {
  content: "·";
  margin-right: 0.75rem;
}

.post-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card {
  padding: 1.25rem;
  background: var(--ground-soft);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.post-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.post-card h2 a {
  text-decoration: none;
}

.status code {
  background: var(--ground-soft);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* ------------------------------------------------------------------ search */

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.5rem;
}

.search-form label {
  flex: 0 0 100%;
  font-weight: 600;
}

.search-form input[type="search"] {
  flex: 1 1 18rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 1rem;
}

.search-form button {
  padding: 0.5rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.search-count {
  color: var(--ink-soft);
}

.search-hits {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-hit {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.search-hit h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.search-address {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--ink-soft);
}
