/* ====================================== */
/* base */
/* ====================================== */
:root {
  --c-base: #fff;
  --c-txt:  #333;
  --c-surface: color-mix(in srgb, var(--c-txt), transparent 95%);
  --fs-body: clamp(0.8125rem, 0.69rem + 0.4667vw, 1.25rem);
}

/* ====================================== */
/* rewrite */
/* ====================================== */
body:has( .block_translation ) {
  /* -------- */
  /* 配置調整 */
  @media (width < 1100px) {
    .hbWrap { margin: 0; }
  }
  .lang {
    padding:0; border: 0;
    background-color: transparent;
    border-radius: 0;
    @media (width < 1100px) { margin-inline: auto 10px; }
  }
}
/* ナビバー被りfixed調整 */
body:has( > iframe:first-child ) {
  header { position: sticky !important; }
  article { padding-top: 0 !important; }
}

/* ====================================== */
/* translate */
/* ====================================== */
.block_translation {
  position: relative;
  font-family: sans-serif;
  display: inline-block;
  color: var(--c-txt);
  font-size: var(--fs-body);
  text-align: center;
  * { font: inherit; color: inherit; }
  /* ======================= */
  /* ボタン＆リスト */
  /* ======================= */
  > :is( .btn_translate, ul ) {
    border-radius: 8px;
    font-size: 0.8em;
    overflow: clip;
    background-color: var(--c-base);
  }
  /* ======================= */
  /* ボタン */
  /* ======================= */
  > .btn_translate {
    appearance: none; border: 0;
    cursor: pointer;
    /* ------------ */
    display: inline-flex; align-items: center; justify-content: center; gap: 1ic;
    padding: 1em;
    /* ------------ */
    @media (width < 500px) {
      padding: 0.5em;
      font-size: 1.5em;
      font-weight: 400;
      line-height: 1; aspect-ratio: 1;
      > :not( i[class*="global"] ) { display: none; }
    }
  }
  /* ======================= */
  /* リスト */
  /* ======================= */
  > ul {
    list-style: none;
    > li {
      list-style: none !important; margin: 0 !important;
      &::marker { display: none; }
    }
    /* ------------ */
    position: absolute; left: 50%; translate: -50% 0; z-index: 3;
    display: none;
    /* ------------ */
    margin: 5px 0 0 0 !important; padding: 0 !important;
    border: 1px solid var(--c-surface);
    @media (width >= 500px) { width: 100%; }
    @media (width < 500px)  { width: fit-content; min-width: 9ic; }
  }
  &.show {
    > ul { display: block !important; }
  }
  .lang-option {
    display: block;
    padding: 0.8em 1em;
    cursor: pointer;
    &:hover{ background-color: var(--c-surface); }
  }
}
