/* Drawer menu shared by the home, disclaimer and 404 pages. Uses each page's own theme variables. */
button.menu-btn {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  color: var(--ink); cursor: pointer; align-self: center; flex: none;
  position: relative; transition: transform .15s ease;
}
button.menu-btn::before { content: ""; position: absolute; inset: -3px; } /* 40px hit area */
button.menu-btn:active { transform: scale(.96); }

dialog.menu-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: min(320px, 86vw); max-width: none; height: 100dvh; max-height: none;
  border: 0; border-left: 1px solid var(--border);
  background: var(--card); color: var(--ink); font-family: var(--font);
}
dialog.menu-drawer::backdrop { background: rgba(0, 0, 0, .4); }
dialog.menu-drawer[open] { animation: menu-in .2s cubic-bezier(.2, 0, 0, 1); }
@keyframes menu-in { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { dialog.menu-drawer[open] { animation: none; } }
html:has(dialog.menu-drawer[open]) { overflow: hidden; }

.menu-panel { height: 100%; display: flex; flex-direction: column; }
.menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em;
}
.menu-close {
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: none;
  color: var(--ink-2); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.menu-close:hover { color: var(--ink); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.menu-drawer nav { display: flex; flex-direction: column; overflow-y: auto; }
.menu-drawer nav a {
  padding: 14px 18px; color: var(--ink); text-decoration: none;
  font-size: 1.05rem; line-height: 1.3; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.menu-drawer nav a:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.menu-drawer nav a[aria-current="page"] { font-weight: 700; color: var(--blue); border-left-color: var(--blue); }

/* BETA pill: hangs from the header line, straddling it, like the random-post tab on the right */
.header-inner { position: relative; padding-bottom: 14px; }
.logo .beta { position: absolute; left: 24px; top: calc(100% - 7px); margin: 0; background: var(--card); }

/* phones: smaller controls and the BETA pill out of the row give the logo the room (and the emphasis) */
@media (max-width: 640px) {
  .header-inner { gap: 6px; padding-inline: 12px; }
  .logo { font-size: min(1.7rem, 7.5vw); }
  .logo .beta { left: 12px; }
  button.menu-btn, button.theme-btn { width: 30px; height: 30px; }
  button.menu-btn::before, button.theme-btn::before { inset: -5px; } /* keeps a 40px hit area */
  .pill { padding-inline: 7px; min-height: 30px; font-size: .64rem; }
}
