/* The page header: the one stylesheet for the controls /site-header.js builds (Tour, Guide, intro video, language, theme, user, sign-out).
   Rules of this file:
   - every round icon button is 28px (26px on narrow screens), same border, same colour, same centre line;
   - the language / theme pills and the sign-out button are 28px tall too;
   - a page never restyles these controls: if one looks wrong, fix it here, for every page at once. */

/* ---- the control row ---- */
.hdr-ctl { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; }

/* ---- the standard top bar ( <div data-site-header> ) ---- */
.topbar.site-hdr {
  display: flex; align-items: center; gap: 14px; box-sizing: border-box; min-height: 60px;
  padding: 10px 20px; flex-wrap: wrap;
}
@media (max-width: 720px) { .topbar.site-hdr { padding: 8px 12px; gap: 10px; min-height: 52px; } }

/* ---- everything in the control row sits on one centre line ---- */
.ic-tour, .ic-guide, .vid-btn, .sw2 { vertical-align: middle; align-self: center; }
/* the box that holds the video / language / theme buttons: a centred row, not a text line (a text line staggers them by a few pixels) */
#prefs, .prefs { display: inline-flex !important; align-items: center; gap: 8px; }
/* the language / theme pills and the sign-out button are the same 28px tall as the round buttons */
#prefs .seg, .prefs .seg { height: 28px; box-sizing: border-box; align-items: stretch; }
/* (not the one-button toggles from switch.js, .sw2: their sun / moon / EN is centred by their own grid) */
#prefs .seg button:not(.sw2), .prefs .seg button:not(.sw2) { display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; line-height: 1; }
#signout { height: 28px; box-sizing: border-box; display: inline-flex; align-items: center; padding-top: 0 !important; padding-bottom: 0 !important; }
#signout[hidden] { display: none; }

/* ---- Tour (compass) and Guide (open book): icon-only round buttons ---- */
.ic-tour, .ic-guide {
  display: inline-grid !important; place-items: center; flex: none; box-sizing: border-box;
  width: 28px; height: 28px; min-width: 0 !important; min-height: 0 !important; margin: 0; padding: 0 !important;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent) !important; border-radius: 50% !important;
  background: transparent !important; box-shadow: none !important;
  font-size: 0 !important; line-height: 0; text-decoration: none; cursor: pointer;
}
.ic-tour[hidden], .ic-guide[hidden], .ic-tour.hidden, .ic-guide.hidden { display: none !important; }
.ic-tour, .ic-guide { color: var(--ink, inherit) !important; }
.ic-tour:hover, .ic-guide:hover { border-color: var(--accent, #d9772b) !important; color: var(--accent-text, var(--accent, #d9772b)) !important; }
.ic-tour:focus-visible, .ic-guide:focus-visible { outline: 2px solid var(--accent, #d9772b); outline-offset: 2px; }
.ic-tour::before, .ic-guide::before {
  content: ""; width: 15px; height: 15px; background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.ic-tour  { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M16.2 7.8l-2.1 6.3-6.3 2.1 2.1-6.3z'/%3E%3C/svg%3E"); }
.ic-guide { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10.5 5.2 8.3 4.6 5 4.6c-.6 0-1 .4-1 1V17c0 .6.4 1 1 1 3.3 0 5.5.6 7 1.9 1.5-1.3 3.7-1.9 7-1.9.6 0 1-.4 1-1V5.6c0-.6-.4-1-1-1-3.3 0-5.5.6-7 1.9z'/%3E%3Cpath d='M12 6.5v13.4'/%3E%3C/svg%3E"); }

/* ---- the intro-video button and the one-button toggles use the same colour ---- */
.vid-btn, .sw2 { color: var(--ink, inherit) !important; }
.vid-btn:hover, .sw2:hover { color: var(--accent-text, var(--accent, #d9772b)) !important; }
@media (max-width: 720px) { .ic-tour, .ic-guide, .vid-btn { width: 26px !important; height: 26px !important; } }
