/* EN / 日本語 switch (header, ☰ menu, footer) and the one-time Japanese suggestion card.
   Shared by / and /ja/. Loaded after styles.css. */

/* Header gains one column for the switch: brand | nav | switch | CTA (| ☰). */
.header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.lang-switch--pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  font: 500 14px/1 var(--font);
  white-space: nowrap;
}

.lang-switch--pill a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 160ms, color 160ms;
}

.lang-switch--pill a[aria-current] {
  background: var(--ink);
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .lang-switch--pill a:not([aria-current]):hover {
    background: var(--bg-2);
  }
}

.lang-switch--pill a:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.menu-lang {
  display: none;
}

@media (max-width: 1023px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .menu-lang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--mute);
  }
}

/* On phones the header switch moves into the ☰ menu. */
@media (max-width: 519px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .header-lang {
    display: none;
  }
}

/* Footer: plain text links on the dark band. */
.foot-bottom-end {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.lang-switch--footer {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.lang-switch--footer a {
  color: inherit;
}

.lang-switch--footer a + a::before {
  content: '/';
  display: inline-block;
  margin: 0 8px;
  color: var(--dark-mute);
}

.lang-switch--footer a[aria-current] {
  color: var(--dark-text);
  text-decoration: none;
}

/* ---------- one-time suggestion card (English page, Japanese browsers) ----------
   Sits just under the header, top right, so it never covers the hero's buttons (bottom of the hero). */
.lang-suggest {
  position: fixed;
  top: calc(clamp(64px, 6vw, 88px) + 12px);
  right: max(var(--pad), env(safe-area-inset-right));
  z-index: 45;
  width: min(360px, calc(100vw - 32px));
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.06);
  font-family: var(--font), 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
  animation: lang-suggest-in 320ms var(--ease) 600ms both;
}

.lang-suggest-title {
  margin: 0 32px 4px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.lang-suggest-text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--mute);
}

.lang-suggest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-suggest-actions .btn {
  min-height: 44px;
  padding: 12px 18px;
  font-size: 15px;
}

.lang-suggest-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
}

.lang-suggest-close:hover {
  background: var(--bg-2);
  color: var(--ink);
}

@keyframes lang-suggest-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 519px) {
  .lang-suggest {
    top: calc(clamp(64px, 6vw, 88px) + 8px);
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
  }

  .lang-suggest-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-suggest {
    animation-name: lang-suggest-fade;
    animation-duration: 150ms;
  }
}

@keyframes lang-suggest-fade {
  from {
    opacity: 0;
  }
}
