/* TAG3 Mobile Hamburger (navOffcanvas)
   - Isolated file to avoid interference
   - Uses Bootstrap's built-in .showing/.hiding for stagger animation (no custom backdrop logic)
*/

/* Toggle button (dark/light) */
.navbar-auth .tag3-burger-btn{
  border: 1px solid color-mix(in oklab, var(--brand, #F50000) 55%, transparent 45%);
  border-radius: .85rem;
  padding: .55rem .7rem;
  background: transparent;
  color: #111;
  box-shadow: 0 10px 22px rgba(15,23,42,0.10);
}
html[data-theme="dark"] .navbar-auth .tag3-burger-btn{
  background: rgba(10,10,10,0.55);
  color: #fff;
  box-shadow: 0 0 18px rgba(245,0,0,.12);
}
.navbar-auth .tag3-burger-btn:focus{
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand, #F50000) 28%, transparent 72%), 0 0 18px rgba(245,0,0,.16);
}

.navbar-auth .tag3-burger{
  width: 26px;
  height: 16px;
  display: inline-block;
  position: relative;
}
.navbar-auth .tag3-burger::before,
.navbar-auth .tag3-burger::after{
  content:'';
  position:absolute;
  left:0;
  right:0;
  height:2px;
  background: currentColor;
  border-radius: 3px;
  transition: transform .18s ease, top .18s ease, bottom .18s ease, box-shadow .18s ease;
}
.navbar-auth .tag3-burger::before{ top:0; box-shadow: 0 7px 0 currentColor; }
.navbar-auth .tag3-burger::after{ bottom:0; }
.navbar-auth .tag3-burger-open .tag3-burger::before{
  top: 7px;
  transform: rotate(45deg);
  box-shadow: none;
}
.navbar-auth .tag3-burger-open .tag3-burger::after{
  bottom: 7px;
  transform: rotate(-45deg);
}

/* Offcanvas stage: transparent background, floating items */
.navbar-auth #navOffcanvas.tag3-oc{
  --oc-brand: var(--brand, #F50000);
  --oc-w: min(380px, 92vw);
  width: var(--oc-w);
  --bs-offcanvas-width: var(--oc-w);
  /* 横方向のスライドは使わない */
  --bs-offcanvas-transition: none;
  transform: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* 非表示時に横スクロールが出るブラウザ対策：
   - navOffcanvas が閉じている時は display:none にして、レイアウト幅に影響させない */
.navbar-auth #navOffcanvas.tag3-oc:not(.show):not(.showing):not(.hiding){
  display: none !important;
}
.navbar-auth #navOffcanvas.tag3-oc.showing,
.navbar-auth #navOffcanvas.tag3-oc.show,
.navbar-auth #navOffcanvas.tag3-oc.hiding{
  display: flex !important;
  transform: none !important;
}

.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-body{
  background: transparent !important;
  padding: 1rem 1rem 1rem;
}
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-stack{
  display: grid;
  gap: .65rem;
}

.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-card,
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link{
  border-radius: 1.05rem;
  backdrop-filter: blur(12px);
  will-change: transform, opacity;
}

/* Floating card (welcome + theme / CTA) */
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.92);
  color: #111;
  box-shadow: 0 18px 40px rgba(15,23,42,0.16);
}
html[data-theme="dark"] .navbar-auth #navOffcanvas.tag3-oc .tag3-oc-card{
  background: rgba(10,10,10,0.78);
  border-color: rgba(255,0,0,0.22);
  color: #fff;
  box-shadow: 0 0 24px rgba(255,0,0,0.14), 0 0 60px rgba(0,0,0,0.55);
}

/* Nav links */
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-nav{
  display:grid;
  gap:.6rem;
}
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.92);
  color: #111;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: .02em;
  box-shadow: 0 18px 40px rgba(15,23,42,0.14);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
html[data-theme="dark"] .navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link{
  border-color: rgba(255,255,255,0.12);
  background: rgba(10,10,10,0.72);
  color:#fff;
  box-shadow: 0 10px 22px rgba(0,0,0,0.40);
}
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link:hover,
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link:focus-visible{
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--oc-brand) 35%, rgba(0,0,0,0.10) 65%);
  box-shadow: 0 22px 46px rgba(15,23,42,0.18);
  text-decoration: none;
}
html[data-theme="dark"] .navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link:hover,
html[data-theme="dark"] .navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link:focus-visible{
  border-color: rgba(255,0,0,0.30);
  box-shadow: 0 0 22px rgba(255,0,0,0.14), 0 16px 36px rgba(0,0,0,0.55);
}
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link.is-active{
  border-color: var(--oc-brand);
  background: linear-gradient(180deg, color-mix(in oklab, var(--oc-brand) 94%, white 6%), var(--oc-brand));
  color:#fff;
  box-shadow: 0 20px 46px rgba(245,0,0,0.22);
}

/* Dark mode: active item must stay clearly "brand red" */
html[data-theme="dark"] .navbar-auth #navOffcanvas.tag3-oc .tag3-oc-link.is-active{
  border-color: var(--oc-brand);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--oc-brand) 92%, white 8%),
    color-mix(in oklab, var(--oc-brand) 78%, black 22%)
  );
  color: #fff;
  box-shadow: 0 0 22px rgba(255,0,0,0.18), 0 16px 36px rgba(0,0,0,0.55);
}

/* CTA center */
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-cta-link{
  justify-content: center;
  font-weight: 800;
}

/* Stagger slide (<= 0.5s total) */
.navbar-auth #navOffcanvas.tag3-oc .tag3-oc-item{
  opacity: 0;
  transition:
    opacity .16s ease;
}
.navbar-auth #navOffcanvas.tag3-oc.showing .tag3-oc-item{
  transition-delay: calc(var(--i, 0) * 0.025s);
}
.navbar-auth #navOffcanvas.tag3-oc.showing .tag3-oc-item,
.navbar-auth #navOffcanvas.tag3-oc.show .tag3-oc-item{
  opacity: 1;
}
.navbar-auth #navOffcanvas.tag3-oc.hiding .tag3-oc-item{
  opacity: 0;
  transition-delay: calc(var(--ri, 0) * 0.02s);
}

@media (prefers-reduced-motion: reduce) {
  .navbar-auth #navOffcanvas.tag3-oc .tag3-oc-item{
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* While open: prevent accidental horizontal overflow */
body.tag3-nav-open{
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* Offcanvas open: keep the navbar (hamburger/×) above backdrop/offcanvas so it stays clickable */
body.tag3-nav-open .navbar-auth{
  z-index: 1060; /* > offcanvas(1045) & backdrop(1040) */
}


