/* The 英文學習 global nav: one thin dark strip across the top of every page in
   this family -- /learn/, /learn/check/, /reading/, /reading/vocab/,
   /reading/junior-vocab/ and /learn/writing/ -- the way apple.com runs one global nav above each
   product's own local bar. It scrolls away; each page's own bar below it stays
   pinned. Self-contained: it reads none of the page's tokens, so it looks the
   same on all five, light theme or dark.

   Only these six pages carry it, all general material with no student in it.
   學測寫作 (/exam-writing/, since 2026-11-10 /learn/writing/) joined at Lewis's request on 2026-11-08. The rest of the site
   stays unlinked on purpose (students must not find each other's material). */

.fam {
  position: relative; z-index: 40;
  background: rgb(22 22 23 / .94);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  font: 13px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial,
        "PingFang TC", "Heiti TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  letter-spacing: 0;
}
/* On /learn/ and the check page there is no bar below it, so it stays pinned. */
.fam-pin { position: sticky; top: 0; }
/* The strip carries the notch inset itself, so a page's own bar can stay at top: 0. */
.fam-in {
  max-width: 1080px; margin: 0 auto;
  min-height: 44px;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.fam-in::-webkit-scrollbar { display: none; }
.fam a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: rgb(232 232 237 / .8); text-decoration: none; white-space: nowrap;
  transition: color .2s cubic-bezier(.4, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.fam a:hover, .fam a:focus-visible { color: #fff; }
.fam a:focus-visible { outline: 2px solid #2997ff; outline-offset: -4px; border-radius: 8px; }
.fam a[aria-current="page"] { color: #fff; font-weight: 600; }
.fam .fam-home { padding-left: 0; margin-right: auto; color: #fff; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
/* On a phone the home name keeps its place and the four links scroll beside it. */
@media (max-width: 560px) {
  .fam .fam-home { margin-right: 6px; }
  .fam a { padding: 0 9px; }
}
/* On every iPhone up to the 440-point Pro Max all six fit without scrolling,
   the current one included: 12px, the size apple.com's own global nav uses.
   Narrower than 375 (an iPhone SE) the row scrolls sideways. */
@media (max-width: 480px) {
  .fam { font-size: 12px; }
  .fam-in { gap: 0; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  .fam a { padding: 0 5px; }
  .fam .fam-home { padding-left: 0; margin-right: 2px; font-size: 13px; }
}
/* The Lewis Biz English mark in the footer of the family pages that had none
   (/learn/, 程度檢測, 國中單字, 高中單字), the same 34px circle, public/logo.png,
   that the rest of the site carries in its footer. */
.fam-foot { display: flex; align-items: center; gap: 12px; }
.fam-foot p { margin: 0 !important; }
.fam-mark { flex: none; line-height: 0; border-radius: 50%; transition: opacity .12s; }
.fam-mark img { display: block; width: 34px; height: 34px; }
@media (hover: hover) { .fam-mark:hover { opacity: .78; } }

/* Teacher tools show only on a teacher's device (learn/teacher.js puts
   is-teacher on <html>). */
html:not(.is-teacher) .teacher-only { display: none !important; }
@media print { .fam { display: none; } }
