.public-header {
  --header-ink: #152630;
  --header-light: #fcfbf8;
  --header-gold: #d7bf97;
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--header-ink);
  color: var(--header-light);
  border-bottom: 1px solid #ffffff19;
}
.public-header-inner {
  max-width: 1264px;
  min-height: 76px;
  margin-inline: auto;
  padding-inline: clamp(24px, 3.2vw, 40px);
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  align-items: center;
}
.header-identity { display: flex; flex: none; align-items: center; gap: 10px; }
.header-market {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  color: var(--header-gold);
}
.header-market:hover, .header-market:focus-visible { background: #ffffff12; color: var(--header-light); }
.header-market svg { display: block; }
.header-brand { display: flex; align-items: center; min-height: 44px; flex: none; }
.header-brand img { display: block; width: clamp(145px, 13.3vw, 178px); height: auto; filter: brightness(0) invert(1); }
/* Site pages share one primary row at every viewport width. */
.header-primary {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 24px);
}
.header-primary a, .header-portals summary, .header-panel a, .header-book {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: .9375rem;
  font-weight: 550;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
}
.header-primary a:hover, .header-primary a[aria-current="page"],
.header-portals summary:hover, .header-portals[open] summary { color: var(--header-gold); }
.header-portals {
  position: relative;
  flex: none;
  border-inline-start: 1px solid #ffffff35;
  padding-inline-start: clamp(12px, 1.6vw, 24px);
}
.header-portals summary { gap: 8px; list-style: none; cursor: pointer; }
.header-portals summary::-webkit-details-marker { display: none; }
.header-portals summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.header-portals[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.header-panel {
  position: absolute;
  z-index: 1;
  inset: calc(100% + 4px) -6px auto auto;
  min-width: 172px;
  padding: 6px;
  border: 1px solid #dedbd3;
  border-radius: 8px;
  background: var(--header-light);
  color: var(--header-ink);
  box-shadow: 0 10px 24px #10202926;
}
.header-panel a { padding-inline: 12px; border-radius: 4px; }
.header-panel a:hover, .header-panel a:focus-visible { background: #efe9dd; }
.header-book {
  justify-content: center;
  flex: none;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--header-gold);
  color: var(--header-ink);
  font-weight: 700;
}
.header-book:hover { background: #e4ceaa; }
.public-header :is(a, summary):focus-visible { outline: 2px solid #d7af71; outline-offset: 2px; }
.header-book-mobile { display: none; }

@media (max-width: 64em) {
  .public-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand portals book" "pages pages pages";
    align-items: center;
    column-gap: clamp(6px, 2.5vw, 18px);
    row-gap: 0;
    padding: 6px clamp(10px, 3vw, 24px) 0;
  }
  .header-identity { grid-area: brand; gap: 2px; }
  .header-brand img { width: clamp(96px, 27vw, 160px); }
  .header-market { width: 40px; }
  .header-book-desktop { display: none; }
  .header-book-mobile { grid-area: book; display: flex; min-height: 44px; padding-inline: 10px; font-size: .875rem; }
  .header-portals { grid-area: portals; border: 0; padding: 0; }
  .header-portals summary { font-size: .875rem; }
  .header-primary {
    grid-area: pages;
    justify-content: safe center;
    gap: clamp(8px, 3vw, 28px);
    padding: 0 3px;
    border-top: 1px solid #ffffff20;
    overflow-x: auto;
  }
  .header-primary a { flex: none; font-size: clamp(.8125rem, 2.7vw, .9375rem); }
  .header-primary a:focus-visible { outline-offset: -2px; }
}
@media (max-width: 22.5em) {
  .header-primary { gap: 4px; padding-inline: 0; }
  .header-primary a { font-size: .78125rem; }
}
