/*
  Bitcoin Canon — Chrome
  Topbar, brand, navigation, mode buttons, footer, block clock.
  NO monospace for UI chrome — Inter throughout.
*/

/* — Topbar ————————————————————————————————————— */
.masthead {
  width: min(var(--content-max), calc(100% - 3rem));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--c-line);
}

/* — Brand ——————————————————————————————————————— */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--f-serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--c-ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--c-line-strong);
  border-radius: 50%;
  color: var(--c-ink);
  font-size: .72rem;
  font-family: var(--f-sans);
  font-weight: 700;
  background: transparent;
  flex-shrink: 0;
}

/* — Top actions ————————————————————————————————— */
.top-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--c-muted);
}

.top-actions a,
.top-actions button,
.top-nav button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line);
  background: transparent;
  color: var(--c-muted);
  border-radius: 999px;
  padding: .4rem .72rem;
  font-size: .78rem;
  font-family: var(--f-sans);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.top-actions a:hover,
.top-actions button:hover,
.top-nav button:hover {
  color: var(--c-ink);
  border-color: var(--c-line-strong);
  background: rgba(220, 226, 236, .06);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: .22rem;
}

.top-nav button {
  border: 0;
  padding: .28rem .62rem;
  font-size: .76rem;
}

.top-nav button.active,
.top-nav button[data-active] {
  color: var(--c-bg);
  background: var(--c-ink);
  border-radius: 999px;
}

.source-link { font-size: .78rem; }

/* Search is apparatus, not native form chrome: rectangular, ruled, and
   explicitly themed. Its focus ring is the one gold chrome in the edition. */
.top-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: min(23rem, 30vw);
  min-width: 13rem;
  padding: .35rem .5rem .35rem .65rem;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-none);
  background: var(--c-panel);
  color: var(--c-dim);
  font-family: var(--f-mono);
  font-size: var(--type-2xs);
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.top-search:focus-within {
  border-color: var(--c-seal);
  outline: 2px solid var(--c-seal);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--c-seal-ground);
}

.top-search input {
  min-width: 0;
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: var(--radius-none);
  outline: 0;
  background: transparent;
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--type-sm);
  letter-spacing: normal;
  text-transform: none;
}

.top-search input:focus-visible { outline: none; }
.top-search input::placeholder { color: var(--c-dim); opacity: 1; }

.top-search .top-search-clear {
  flex: 0 0 auto;
  min-width: 1.5rem;
  padding: .15rem;
  border: 0;
  border-radius: var(--radius-none);
  background: transparent;
  color: var(--c-muted);
  line-height: 1;
}

.top-search .top-search-clear:hover { color: var(--c-ink); }

/* — Mode buttons (the big section nav) ——————————— */
.mode-button {
  border: 1px solid var(--c-line);
  background: transparent;
  color: var(--c-muted);
  border-radius: 999px;
  padding: .55rem .85rem;
  font-size: .8rem;
  font-family: var(--f-sans);
  font-weight: 500;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.mode-button:hover {
  color: var(--c-ink);
  border-color: var(--c-line-strong);
  background: rgba(220, 226, 236, .06);
}

.mode-button.active {
  color: var(--c-bg);
  background: var(--c-ink);
  border-color: transparent;
}

/* — Block clock ————————————————————————————————— */
.block-clock,
#footerBlockClock {
  font-family: var(--f-mono);
  font-size: .65rem;
  letter-spacing: .06em;
  color: var(--c-dim);
}

.block-clock {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: .4rem .7rem;
  color: var(--c-muted);
}

.block-clock::before {
  content: "◧ ";
  color: var(--c-seal);
  margin-right: .3rem;
}

@media (max-width: 1100px) {
  .block-clock { display: none; }
}

/* — Focus toggle ————————————————————————————— */
#readerFocusToggle { font-size: .76rem; }

/* — Footer ————————————————————————————————————— */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3.5rem;
  border-top: 1px solid var(--c-line);
  color: var(--c-dim);
  font-size: .82rem;
}

.footer p { margin: 0; }

.footer a {
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-line);
  transition: color var(--fast) var(--ease);
}
.footer a:hover { color: var(--c-ink); }

#footerBlockClock {
  border: 0;
  background: transparent;
  padding: 0;
}

/* — Reader focus toggle ————————————————————————— */
[data-reader-focus][aria-pressed="true"] {
  color: var(--c-ink);
  border-color: var(--c-line-strong);
  background: rgba(220, 226, 236, .07);
}

/* — Reader tools (A+/A-) ——————————————————————— */
.reader-tools {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .75rem;
  color: var(--c-dim);
  font-size: .78rem;
}

.reader-tools span { margin-right: .25rem; }

.reader-tools button {
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: transparent;
  color: var(--c-muted);
  padding: .28rem .55rem;
  font-size: .72rem;
}

.reader-tools button:hover {
  color: var(--c-ink);
  border-color: var(--c-line-strong);
}
