/* 全アプリ共通のシェア欄。ここが正本で、各アプリの shared/ へは `npm run shared:sync` が複製する。

   10個のアプリは配色もモードもばらばらなので、色を自分で決めない。
   currentColor から作った半透明だけを使い、置かれたページの色に従わせる。 */

.share {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(128, 128, 128, 0.28);
  border-top-color: color-mix(in srgb, currentColor 22%, transparent);
  font-size: 0.85rem;
  /* 置かれる場所はアプリごとにばらばらなので、親の癖に引きずられないよう自分で足場を固める。
     Day003は footer が white-space:nowrap の中央寄せ絶対配置で、これが無いと画面からはみ出した */
  box-sizing: border-box;
  max-width: min(100%, 92vw);
  /* 幅が中身で決まる親（Day003の絶対配置フッター）に置かれると、ボタンが1列に縦積みされる。
     最低幅を持たせて、狭い画面でも横に並ぶだけの幅を親から引き出す */
  min-width: min(92vw, 420px);
  white-space: normal;
  text-align: start;
}

.share__label {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
}

.share__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(128, 128, 128, 0.45);
  border-color: color-mix(in srgb, currentColor 32%, transparent);
  background: rgba(128, 128, 128, 0.08);
  background: color-mix(in srgb, currentColor 7%, transparent);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.share__button:hover {
  background: rgba(128, 128, 128, 0.16);
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.share__button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.share__button--primary {
  border-color: rgba(128, 128, 128, 0.7);
  border-color: color-mix(in srgb, currentColor 55%, transparent);
  font-weight: 600;
}

/* コピーできた合図。色を持たないので、どのアプリに置いても浮かない */
.share__button[data-done="true"] {
  border-color: currentColor;
}

.share__said {
  display: block;
  min-height: 1.6em;
  margin-top: 8px;
  opacity: 0.85;
}

.share__note {
  margin: 4px 0 0;
  opacity: 0.7;
  line-height: 1.6;
  max-width: 60ch;
}
