/* ============================================================
   bell-menu.css — the Menu bell + side panel for pages that carry
   legal.css only (features, schools, articles, printables, legal…).
   Tom, 2026-10-17: "every page gets the bell menu so a visitor is never
   stuck". A port of the adults page's bell (.adults-sign) and parents
   panel from styles.css, with its tokens written literally because these
   pages don't load styles.css. Scoped under .bm- so it can never collide
   with a page's own classes. Markup: see any page's <!-- Bell menu --> block.
   ============================================================ */
.bm-bell {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: top center;
  animation: bm-sway 2s ease-in-out infinite;
  min-width: 44px;
  min-height: 44px;
}
.bm-bell:hover { animation-play-state: paused; }
.bm-bell:focus-visible { outline: 2px solid #F5A623; outline-offset: 4px; border-radius: 8px; }
.bm-bell img {
  display: block;
  width: clamp(50px, 4.6vw, 64px);
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(10, 15, 40, 0.5));
}
.bm-bell-label {
  display: block;
  margin-top: 1px;
  font-family: 'Fredoka', 'M PLUS Rounded 1c', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(250, 246, 239, 0.85);
  text-shadow: 0 1px 6px rgba(10, 15, 40, 0.7);
}
@keyframes bm-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@keyframes bm-ring {
  0% { transform: rotate(0); } 25% { transform: rotate(8deg); }
  55% { transform: rotate(-6deg); } 80% { transform: rotate(2.5deg); } 100% { transform: rotate(0); }
}
.bm-bell.bm-ringing img { animation: bm-ring 650ms cubic-bezier(0.23, 1, 0.32, 1); transform-origin: top center; }

/* Keep the page's EN|JP switch clear of the bell (same top-right corner). */
body.has-bell .page-lang-toggle { right: 92px; }
@media (max-width: 600px) {
  .bm-bell { top: 8px; right: 10px; }
  .bm-bell img { width: 48px; }
  .bm-bell-label { font-size: 0.6875rem; } /* 11px: the floor for any label (10-03 walk) */
  body.has-bell .page-lang-toggle { right: 68px; }
}

.bm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 26, 66, 0.70);
  z-index: 399;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slower) var(--ease-out);
}
.bm-overlay.active { opacity: 1; pointer-events: all; }

.bm-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 360px;
  max-width: 100vw;
  background: #1B2A6B;
  border-left: 2px solid rgba(245, 166, 35, 0.30);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.40);
  border-radius: 16px 0 0 16px;
  z-index: 400;
  transform: translateX(100%);
  transition: transform var(--duration-slower) var(--ease-out);
  display: flex;
  flex-direction: column;
  padding: 32px;
  gap: 32px;
  overflow: hidden;
  font-family: 'Nunito', 'M PLUS Rounded 1c', sans-serif;
  line-height: 1.5;
}
.bm-panel.bm-open { transform: translateX(0); }
.bm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bm-heading {
  position: relative;
  max-width: 220px;
  padding-bottom: 10px;
  font-family: 'Fredoka', 'M PLUS Rounded 1c', sans-serif;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.4;
  color: #FAF6EF;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.bm-heading::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 34px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.85), rgba(245, 166, 35, 0));
}
.bm-gold { color: #F5A623; }
.bm-close {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(250, 246, 239, 0.20);
  background: none;
  color: rgba(250, 246, 239, 0.60);
  cursor: pointer;
  transition: background-color var(--duration-normal) var(--ease-standard), color var(--duration-normal) var(--ease-standard), border-color var(--duration-normal) var(--ease-standard);
}
.bm-close:hover { border-color: rgba(250, 246, 239, 0.45); color: #FAF6EF; background: rgba(250, 246, 239, 0.08); }
.bm-nav { display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 1; }
.bm-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  font-family: 'Fredoka', 'M PLUS Rounded 1c', sans-serif;
  font-size: 1.04rem;
  font-weight: 600;
  color: rgba(250, 246, 239, 0.88);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
}
.bm-link::before {
  content: '';
  flex: 0 0 14px;
  width: 14px; height: 14px;
  background: url('/Assets/sections/star-dot-unlit.webp') center / contain no-repeat;
  opacity: 0.7;
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard);
}
.bm-link:hover { color: #FFD479; transform: translateX(3px); }
.bm-link:hover::before { background-image: url('/Assets/sections/star-dot-lit.webp'); opacity: 1; transform: scale(1.15); }
.bm-divider { border: none; height: 1px; background: linear-gradient(90deg, rgba(245, 166, 35, 0.45), rgba(245, 166, 35, 0.05)); }
.bm-try {
  font-family: 'Fredoka', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: #F5A623;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.bm-try:hover { color: #FFD479; }
.bm-hoshi {
  position: absolute;
  right: -6px;
  bottom: 90px;
  width: 190px;
  height: 194px;
  overflow: hidden;
  pointer-events: none;
}
.bm-hoshi canvas { width: 190px; height: 190px; object-fit: contain; }
.bm-hoshi.idle canvas { animation: bm-bob 3.8s ease-in-out infinite; }
@keyframes bm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.bm-star {
  position: absolute;
  width: 10px; height: 10px;
  background: url('/Assets/sections/star-dot-unlit.webp') center / contain no-repeat;
  opacity: 0.4;
  pointer-events: none;
  animation: bm-twinkle 5s ease-in-out infinite;
}
.bm-s1 { right: 38px; bottom: 227px; }
.bm-s2 { right: 120px; bottom: 277px; width: 7px; height: 7px; animation-delay: 1.6s; }
.bm-s3 { right: 70px; bottom: 182px; width: 8px; height: 8px; animation-delay: 3.1s; }
@keyframes bm-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.7; } }

@media (max-width: 480px) {
  .bm-panel {
    width: 100vw;
    height: auto;
    max-height: 90vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 2px solid rgba(245, 166, 35, 0.30);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .bm-panel.bm-open { transform: translateY(0); }
}
/* One sheet on every page (Tom, 2026-10-23): the same spacing, link pitch
   and full-size Hoshi as the adults page's menu (styles.css .parents-panel).
   On a short screen (an iPhone SE is 375 x 667) the LINKS close up so the
   「無料で10冊読む →」 link is on screen without scrolling inside the sheet;
   Hoshi keeps his size. Same rule in styles.css. */
@media (max-height: 880px) {
  .bm-panel { gap: 20px; padding-top: 24px; padding-bottom: 24px; }
  .bm-nav { gap: 2px; }
  .bm-link { padding: 6px 0; }
}
@media (max-height: 700px) {
  .bm-panel { gap: 12px; padding-top: 18px; padding-bottom: 16px; }
  .bm-nav { gap: 0; }
  .bm-link { padding: 4px 0; }
}
/* iPad (P26, Tom 2026-10-31): on a touch screen the sheet is as tall as the
   VISIBLE screen, not 100vh. In iPad Safari 100vh is the height with the
   toolbars collapsed, so a 100vh sheet ran under the toolbar and the
   「無料で10冊読む →」 link and the EN|JP switch sat below the fold. Hoshi, the
   link and the switch are anchored to the sheet's bottom, so the dvh height
   takes the difference out of the empty band between the gold divider and
   Hoshi. Touch only, and not the phone's bottom sheet (max-width 480px): a
   desktop renders byte-identical. */
@media (hover: none) and (pointer: coarse) and (min-width: 481px) {
  .bm-panel { height: 100dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-bell, .bm-star, .bm-hoshi.idle canvas, .bm-bell.bm-ringing img { animation: none; }
  .bm-panel, .bm-overlay { transition: none; }
}
