/* 링크 공유(share-link.js): 접속 화면·머리말의 '공유' 버튼과 공유 창. */

/* 접속 화면: 안내 문구 아래 */
body #gate .sb-share-btn {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; margin: 14px auto 0; min-height: 40px; padding: 4px 16px;
  font: inherit; font-size: calc(14px * var(--reading-scale, 1)); font-weight: 700; color: #3a3f62; background: #fffdf8;
  border: 2px solid #3a3f62; border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; cursor: pointer;
}
body #gate .sb-share-btn:hover { background: #fff8e6; box-shadow: 2px 3px 0 #3a3f62; }
body #gate .sb-share-btn:focus-visible { outline: 3px dashed #7d6bc7; outline-offset: 4px; }
html.sb-intro-pending body.sb-theme #gate.sb-gate .sb-share-btn { visibility: hidden; animation: sbRevealFailsafe .001s step-end 4s forwards !important; }
body.sb-theme.sb-intro-on #gate.sb-gate .sb-share-btn { opacity: 0; }

/* 머리말: '앱 설치' 다음, '사용법' 앞 */
body.curriculum-app .app-utilities .app-share-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 12px;
  font: inherit; font-size: calc(13px * var(--reading-scale, 1)); font-weight: 800; color: #3a3f62;
  background: #fff; border: 2px solid #3a3f62; border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px; cursor: pointer;
}
body.curriculum-app .app-utilities .app-share-btn:hover { background: #fff8e6; box-shadow: 2px 3px 0 #3a3f62; }
body.curriculum-app .app-utilities .app-share-btn:focus-visible { outline: 3px dashed #7d6bc7; outline-offset: 3px; }

/* 공유 창 */
body.share-open { overflow: hidden; }
body #shareModal { z-index: 60; padding: 16px; background: rgb(28 30 52 / 52%); }
body #shareModal.hidden { display: none; }
body #shareModal .share-panel {
  box-sizing: border-box; width: min(360px, 100%); max-height: calc(100dvh - 32px); padding: 0; overflow: auto;
  color: #2c3566; background: #fffdf8; border: 2px solid #3a3f62; border-radius: 14px 6px 12px 7px / 7px 12px 6px 14px;
  box-shadow: 4px 6px 0 rgb(44 53 102 / 18%);
}
body #shareModal .share-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px;
  color: #2c3566; background: #fff7df; border-bottom: 2px dashed #e2d3a6;
  font-size: calc(18px * var(--reading-scale, 1)); line-height: 1.35;
}
body #shareModal .share-head strong { min-width: 0; word-break: keep-all; }
body #shareModal .share-head .btn {
  flex: 0 0 auto; width: auto; min-height: 36px; padding: 2px 14px; font-size: 14px; font-weight: 800;
  color: #fff !important; background: #e0533d !important; border: 2px solid #3a3f62 !important;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; box-shadow: 2px 3px 0 #3a3f62;
}
body #shareModal .share-body { display: grid; gap: 10px; padding: 18px; }
body #shareModal .share-body > button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 6px 16px;
  font: inherit; font-size: calc(16px * var(--reading-scale, 1)); font-weight: 800; cursor: pointer;
  border: 2px solid #3a3f62; border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; box-shadow: 2px 3px 0 #3a3f62;
}
body #shareModal .share-body > button[hidden] { display: none; }
/* 카카오톡 버튼은 카카오 노란색과 말풍선 모양을 그대로 씁니다(카카오 디자인 가이드). SDK를 받는 동안에는 자리만 잡고 흐리게. */
body #shareModal .share-kakao { color: rgb(0 0 0 / 85%); background: #fee500; }
body #shareModal .share-kakao:hover { background: #f5dc00; }
body #shareModal .share-kakao:disabled { cursor: progress; opacity: .6; box-shadow: none; }
body #shareModal .share-copy { color: #3a3f62; background: #fff; }
body #shareModal .share-copy:hover { background: #fff8e6; }
body #shareModal .share-status { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.5; color: #23703f; text-align: center; word-break: break-all; user-select: text; }
body #shareModal .share-status:empty { display: none; }
body #shareModal .share-status[data-tone="error"] { color: #b3261e; }
body #shareModal .share-copy-field { position: fixed; left: -9999px; top: 0; opacity: 0; }
body #shareModal button:focus-visible { outline: 3px dashed #7d6bc7; outline-offset: 2px; }

@media (max-width: 640px) {
  body #gate .sb-share-btn { min-height: 36px; padding: 2px 12px; font-size: 13px; }
  body.curriculum-app .app-utilities .app-share-btn { padding: 2px 10px; }
  body #shareModal { padding: 0; align-items: end; }
  body #shareModal .share-panel { width: 100%; max-height: 92dvh; border-width: 2px 0 0; border-radius: 16px 16px 0 0; }
  body #shareModal .share-head { padding: 10px 14px; font-size: 17px; }
  body #shareModal .share-body { padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
}
