/* The almanac family's shared page styles, over Pico. Every page of every
   service links this file from almanac.observer, so a change here is one
   deploy of the site. A page's own <style> comes after it and wins.
   The standard these serve is in docs/contract.md, A thing's page. */

main {
  padding-top: 1.5rem;
}
h1,
h2,
h3 {
  margin-bottom: 0.2em;
}
/* A lander's title carries its service's icon. */
h1:has(> img) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
h1 > img {
  width: 1.15em;
  height: 1.15em;
}
pre {
  margin-bottom: 1rem;
}
.lede {
  font-size: 1.1em;
}
.muted {
  color: var(--pico-muted-color);
  font-size: 0.875em;
}

/* The way back to almanac, above the title on every page of the family.
   Each link is a 44px tap target; the negative margins keep it compact. */
nav.crumbs {
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.4rem;
  font-size: 0.875rem;
  margin: -0.7rem 0 -0.45rem;
}
nav.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0;
  color: var(--pico-muted-color);
  text-decoration: none;
}
nav.crumbs a:hover,
nav.crumbs a:focus-visible {
  color: var(--pico-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
nav.crumbs img {
  width: 1.15rem;
  height: 1.15rem;
}
nav.crumbs span {
  color: var(--pico-muted-border-color);
}
nav.crumbs + h1 {
  margin-top: 0;
}

/* Every table sits flush with the text around it: Pico's cell padding stays
   between columns, never at the edges, and no cell paints the page
   background over a card. A value's time sits under it, so cells top-align. */
th:first-child,
td:first-child {
  padding-left: 0;
}
th:last-child,
td:last-child {
  padding-right: 0;
}
th,
td {
  background-color: transparent;
  vertical-align: top;
}

/* A thing's page (docs/contract.md, A thing's page). Its tables share one
   first-column width, so they line up down the page: fields lead with a
   label, a series with a time. A value's note, like its time, sits under it. */
table.fields,
table.series {
  table-layout: fixed;
}
table.fields th[scope="row"],
table.series th[scope="row"] {
  width: 11em;
  font-weight: 400;
}
/* The last row has no rule of its own: the next heading or the footer draws one. */
table.fields tr:last-child > *,
table.series tr:last-child > * {
  border-bottom: 0;
}
table.fields small,
table.series small {
  display: block;
  color: var(--pico-muted-color);
}
.headline {
  font-size: 1.15em;
  margin-bottom: 0.25rem;
}
.page-map {
  height: 20rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: var(--pico-spacing);
}
@media (min-width: 64rem) {
  .page-map {
    height: 26rem;
  }
}
footer.page {
  padding-top: var(--pico-spacing);
  font-size: 0.875em;
  border-top: var(--pico-border-width) solid var(--pico-muted-border-color);
}

/* Reference tables: a term beside its meaning when wide; stacked, the term
   above its meaning, when narrow, at the landers' one breakpoint. */
table.ref code {
  overflow-wrap: anywhere;
}
@media (min-width: 64rem) {
  table.ref td:first-child {
    white-space: nowrap;
    padding-right: 1.25rem;
  }
}
@media (max-width: 63.99rem) {
  table.ref thead {
    display: none;
  }
  table.ref tr,
  table.ref td {
    display: block;
  }
  table.ref td {
    padding: 0;
    border: 0;
  }
  table.ref tr {
    padding: 0.6rem 0;
    border-bottom: var(--pico-border-width) solid var(--pico-table-border-color);
  }
  table.ref tr:last-child {
    border-bottom: 0;
  }
  table.ref td:first-child {
    margin-bottom: 0.2rem;
  }
  table.ref td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--pico-muted-color);
  }
}

/* A lander's examples: a row of buttons, the chosen one filled. */
.presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.presets button {
  margin-bottom: 0;
  width: auto;
}
.preset[aria-pressed="true"] {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}
#preset-desc {
  min-height: 1.5em;
}

/* A dot in a series colour, ringed in ink so it holds on any map. */
.dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #0b0b0b;
  margin-right: 0.4rem;
  vertical-align: -0.05rem;
}

/* Leaflet maps. A name on a map sits on the tiles, which stay light in dark
   mode. Pico styles role=button, and Leaflet's zoom links carry it. */
.leaflet-tooltip.pin small {
  display: block;
  color: #555;
}
.leaflet-control-zoom a[role="button"] {
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  color: #0b0b0b;
  font: bold 18px/30px sans-serif;
  text-align: center;
}
