/*
  Base stylesheet for /{company_id}/ dataset pages.

  These pages are rendered by Astro and include Tailwind "preflight" which
  resets default HTML styles (margins, list markers, etc.). The dataset pages
  historically relied on browser defaults, so we restore readable typography
  with selectors that override preflight even if preflight is loaded later.
*/

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
}

body header,
body main,
body footer {
  padding: 1.5rem;
}

body main {
  line-height: 1.6;
}

body main h3 {
  margin: 1.5rem 0 0.75rem;
}

body main h4 {
  margin: 1.25rem 0 0.5rem;
  line-height: 1.35;
}

body main p {
  margin: 0.85rem 0;
}

body main ul,
body main ol {
  margin: 0.85rem 0 1.1rem;
  padding-left: 1.5rem;
}

body main ul {
  list-style: disc;
}

body main ol {
  list-style: decimal;
}

body main li {
  margin: 0.4rem 0;
}

body main a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

body .pagination {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

body .pagination .all-pages {
  width: 100%;
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
}

body .pagination a,
body .pagination strong,
body .pagination span {
  font-size: 0.95rem;
}

/*
  Tailwind preflight resets heading sizes. For datasets without a dedicated
  theme stylesheet, restore something close to the browser defaults.
*/

body.unthemed h1 {
  font-size: 2em;
  font-weight: 700;
  margin: 0.67em 0;
}

body.unthemed h2 {
  font-size: 1.5em;
  font-weight: 700;
  margin: 0.83em 0;
}

body.unthemed h3 {
  font-size: 1.17em;
  font-weight: 700;
}

body.unthemed h4 {
  font-size: 1em;
  font-weight: 700;
}

/*
  Guardrail: if a themed stylesheet gets accidentally bundled into the shared
  CSS chunk, force unthemed datasets back to the default HTML look.
*/

body.unthemed {
  display: block;
}

body.unthemed header,
body.unthemed main,
body.unthemed footer {
  background: transparent;
  color: inherit;
}

body.unthemed header {
  font-size: initial;
  letter-spacing: initial;
  line-height: normal;
}

body.unthemed h1,
body.unthemed h2 {
  color: inherit;
}
