/* Language Controller by SG Group — シェアポップアップ（3.1.0 §14）。
   TCD の #js-modal-content / .c-footer-bar__share を流用し、11 対象・a11y・レスポンシブに拡張。 */

.sglc-share-modal {
  box-sizing: border-box;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 560px;
  width: calc(100% - 24px);
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
.sglc-share-modal.u-hidden { display: none !important; }

.sglc-share-heading {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.sglc-share-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: inherit;
  border-radius: 8px;
}
.sglc-share-close:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* 共有先グリッド。PC 4–6 列、モバイル 3–4 列（auto-fill で自然に）。 */
.sglc-share-list.c-footer-bar__share {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  float: none !important;
}
@media (min-width: 600px) {
  .sglc-share-list.c-footer-bar__share {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }
}

.sglc-share-btn.c-footer-bar__share-btn {
  float: none !important;
  margin: 0 !important;
  width: auto !important;
  list-style: none;
}

.sglc-share-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 64px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.sglc-share-target:hover { background: rgba(0, 0, 0, 0.05); }
.sglc-share-target:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.sglc-share-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 最低 44px のタップ領域はボタン全体（min-height 64px + padding）で確保。 */
}
.sglc-share-icon-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}

.sglc-share-label {
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  max-width: 80px;
}

/* toast（コピー結果通知）。フッターバー・CookieYes より前面。 */
.sglc-share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  max-width: 88vw;
  padding: 10px 16px;
  background: rgba(20, 20, 22, 0.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 8px;
  z-index: 2147483000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}
.sglc-share-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-color-scheme: dark) {
  .sglc-share-target:hover { background: rgba(255, 255, 255, 0.08); }
}
@media (prefers-reduced-motion: reduce) {
  .sglc-share-toast { transition: none; }
}
