/**
 * ------------------------------
 * tl-certificate.css
 * ------------------------------
 * @purpose
 * Tutor LMS 修了証ページ用css
 *
 * @pages
 * ・修了証ページ
 *
 * @note
 * ・テスト結果画面と同じ、薄いグレー背景とカード型の閲覧画面
 * ・修了証CTAは成果受け取り用の水色を使用
 *
 * @version
 * 1.4.0
 */

/**
 * ----------------------------------------
 *  # 修了証カード [pc,sp]
 * ----------------------------------------
 */
body.wm-certificate-page {
  background: #f3f5f7;
}

body.wm-certificate-page #content {
  padding-top: 32px;
  padding-bottom: 104px;
}

body.wm-certificate-page .tutor-single-certificate-wrapper {
  max-width: 1040px;
  margin: 0 auto;
}

body.wm-certificate-page .tutor-certificate-wrapper {
  position: relative;
  padding: 18px 28px 28px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.09);
}

/** 見出しは読み上げ用に維持し、画面上では操作列と修了証を優先する。 */
body.wm-certificate-page .wm-certificate-heading {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.wm-certificate-page .tutor-certificate-header {
  margin-top: 0 !important;
}

/** Selected SWELL blog part, placed immediately after the certificate detail card. */
body.wm-certificate-page .wm-certificate-message,
body.wm-certificate-page .wm-certificate-complete-drops,
body.wm-certificate-page .wm-certificate-review-drops {
  margin-top: 32px;
}

/** Review drops stay visually distinct while their server-side link state remains authoritative. */
body.wm-certificate-page .wm-certificate-review-drops [data-wm-review-benefit-locked="true"] {
  cursor: default;
}

body.wm-certificate-page .wm-certificate-review-drops [data-wm-review-submitted="true"] {
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
}

/** Do not extend Tutor LMS's certificate-info frame around WaterMe-only CTA. */
body.wm-certificate-page .wm-certificate-info-has-next-course {
  border: 0 !important;
  background: transparent !important;
}

/** Next course CTA, mounted after the certificate's WaterMe content. */
body.wm-certificate-page .wm-certificate-next-course {
  margin-top: 32px;
}

body.wm-certificate-page .wm-certificate-next-course-heading {
  margin: 0 0 12px;
  color: #26354d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

body.wm-certificate-page .wm-certificate-next-course-list {
  display: grid;
  gap: 8px;
}

body.wm-certificate-page .wm-certificate-next-course-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  background: #fff;
  color: #26354d;
  font: inherit;
  line-height: 1.45;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.wm-certificate-page .wm-certificate-next-course-card:hover {
  border-color: #c8d0da;
  background: #f7f9fb;
}

body.wm-certificate-page .wm-certificate-next-course-card:focus-visible {
  outline: 3px solid rgba(74, 103, 232, 0.35);
  outline-offset: 3px;
}

body.wm-certificate-page .wm-certificate-next-course-title {
  min-width: 0;
}

body.wm-certificate-page .wm-certificate-next-course-arrow {
  flex: 0 0 auto;
  margin-left: 16px;
  color: #64748b;
  font-size: 18px;
}

body.wm-certificate-page .wm-certificate-actions {
  margin-left: auto;
  margin-right: 58px;
  justify-content: flex-end;
}

/** テスト結果画面と同系統の×ボタンをカード右上へ浮かせて配置。 */
body.wm-certificate-page .wm-certificate-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(84, 116, 163, 0.94);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 5px 15px rgba(48, 67, 96, 0.24),
    0 1px 3px rgba(48, 67, 96, 0.16);
  transition: background 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

body.wm-certificate-page .wm-certificate-close:hover {
  background: rgba(63, 87, 122, 0.98);
  transform: translateY(-2px);
  box-shadow:
    0 8px 20px rgba(48, 67, 96, 0.28),
    0 2px 4px rgba(48, 67, 96, 0.18);
}

body.wm-certificate-page .wm-certificate-close:active {
  transform: translateY(0);
}

body.wm-certificate-page .wm-certificate-close:focus-visible,
body.wm-certificate-page .wm-certificate-download-cta:focus-visible,
body.wm-certificate-page .wm-certificate-download-menu:focus-visible {
  outline: 3px solid rgba(74, 103, 232, 0.35);
  outline-offset: 3px;
}

/**
 * ----------------------------------------
 *  # 修了証ダウンロードCTA [pc,sp]
 * ----------------------------------------
 */
body.wm-certificate-page .wm-certificate-download-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 7px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.wm-certificate-page .wm-certificate-download-group:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

body.wm-certificate-page .wm-certificate-download-group:active {
  opacity: 0.94;
  transform: translateY(0);
}

body.wm-certificate-page .wm-certificate-download-cta,
body.wm-certificate-page .wm-certificate-download-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  background: #56b6de !important;
  color: #fff !important;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

body.wm-certificate-page .wm-certificate-download-cta {
  padding: 11px 18px;
  gap: 7px;
  border-radius: 7px 0 0 7px;
}

body.wm-certificate-page .wm-certificate-download-menu {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0 7px 7px 0;
}

body.wm-certificate-page .wm-certificate-download-cta:hover,
body.wm-certificate-page .wm-certificate-download-cta:active,
body.wm-certificate-page .wm-certificate-download-cta:focus,
body.wm-certificate-page .wm-certificate-download-menu:hover,
body.wm-certificate-page .wm-certificate-download-menu:active,
body.wm-certificate-page .wm-certificate-download-menu:focus {
  background: #56b6de !important;
  color: #fff !important;
  filter: none;
  transform: none;
}

body.wm-certificate-page .wm-certificate-download-cta svg {
  flex: 0 0 auto;
}

@media screen and (max-width: 768px) {
  body.wm-certificate-page #content {
    padding-top: 18px;
  }

  body.wm-certificate-page .tutor-certificate-wrapper {
    padding: 12px 14px 20px;
    border-radius: 10px;
  }

  body.wm-certificate-page .wm-certificate-close {
    top: 10px;
    right: 10px;
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  body.wm-certificate-page .wm-certificate-message,
  body.wm-certificate-page .wm-certificate-complete-drops,
  body.wm-certificate-page .wm-certificate-review-drops {
    margin-top: 24px;
  }

  body.wm-certificate-page .wm-certificate-actions {
    margin-right: 52px;
  }

  body.wm-certificate-page .wm-certificate-next-course {
    margin-top: 24px;
  }

  body.wm-certificate-page .wm-certificate-next-course-heading {
    font-size: 17px;
  }

  body.wm-certificate-page .wm-certificate-next-course-card {
    align-items: flex-start;
    min-height: 46px;
  }

  body.wm-certificate-page .wm-certificate-download-cta,
  body.wm-certificate-page .wm-certificate-download-menu {
    min-height: 46px;
    font-size: 14px;
  }

  body.wm-certificate-page .wm-certificate-download-cta {
    padding: 10px 14px;
  }

  body.wm-certificate-page .wm-certificate-download-menu {
    width: 42px;
    min-width: 42px;
  }
}

@media print {
  body.wm-certificate-page {
    background: #fff;
  }

  body.wm-certificate-page #wm-site-header,
  body.wm-certificate-page #wm-learning-subheader,
  body.wm-certificate-page #wm-sp-under-menu,
  body.wm-certificate-page .wm-certificate-close {
    display: none !important;
  }

  body.wm-certificate-page #content,
  body.wm-certificate-page .tutor-certificate-wrapper {
    padding: 0;
    box-shadow: none;
  }
}
