/* 導入事例の個別ページ（single-case.php）。寸法は元サイトの実測値 */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@700&family=Source+Sans+3:wght@700&display=swap');

body.single-case #main { padding-bottom: 0; }
body.single-case #main .tg-page-hero-case > p:first-child { font-family: "Cormorant Garamond", serif; }

/* 日付・題名 */
.tg-case-article { max-width: 900px; margin: 0 auto; padding-top: 96px; font-family: "Noto Sans JP", sans-serif; color: #333; }
.tg-case-article .tg-case-date { margin: 0; font-size: 16px; font-weight: 700; line-height: 24px; color: #757575; }
.tg-case-article .tg-case-title { width: 93.1%; margin: 64px 0 0; padding: 0; border: none; background: none; font-size: 48px; font-weight: 700; line-height: 1.4; color: #333; }

/* 本文 */
/* 元サイトは要素どうしの余白が重ならないため縦並びのflexにする */
body.single-case .tg-case-body { display: flex; flex-direction: column; margin-top: 34px; font-family: "Noto Sans JP", sans-serif; }
body.single-case .tg-case-body > * { margin: 0 0 10px; }
body.single-case .tg-case-body > figure.wp-block-image { margin: 14px 0 24px; }
.tg-case-body > p { font-size: 20px; font-weight: 500; line-height: 32px; color: #333; }
.tg-case-body > p:empty { min-height: 20px; }
.tg-case-body > :is(h2, h3, h4) { padding: 0; border: none; background: none; color: #333; }
.tg-case-body > :is(h2, h3, h4)::before, .tg-case-body > :is(h2, h3, h4)::after { content: none; }
.tg-case-body > h2 { font-size: 24px; font-weight: 700; line-height: 38.4px; }
.tg-case-body > h3 { font-size: 16px; font-weight: 700; line-height: 25.6px; }
.tg-case-body > h4 { font-size: 16px; font-weight: 700; line-height: 25.6px; }
.tg-case-body > :is(h2, h3, h4) strong { font-weight: 900; }
body.single-case .tg-case-body > hr.wp-block-separator { box-sizing: border-box; height: 2px; border: none; border-top: 1px solid #ccc; background: none; opacity: 1; }
.tg-case-body > :is(ul, ol) { padding-left: 20px; }
.tg-case-body li { margin: 0 0 10px; font-size: 16px; font-weight: 500; line-height: 25.6px; color: #333; }
.tg-case-body li:last-child { margin-bottom: 0; }
.tg-case-body li p { margin: 0; font-size: inherit; line-height: inherit; }
.tg-case-body figure.wp-block-image img { display: block; width: 100%; height: auto; }
body.single-case .tg-case-body > figure.wp-block-table { margin: 10px 0 20px; overflow-x: auto; }
.tg-case-body figure.wp-block-table table { width: auto; border-collapse: collapse; font-size: 14px; font-weight: 500; line-height: 19.6px; color: #1a1a1a; }
.tg-case-body figure.wp-block-table :is(th, td) { padding: 12px; border: 1px solid #f2f2f2; background: none; text-align: left; vertical-align: top; }
.tg-case-body a { color: #007cff; }

/* 目次（Cocoonの目次を元サイトの「目次」見出し＋線＋灰色の箱に） */
body.single-case .tg-case-body .toc { display: block; width: 100%; margin: 0 0 10px; padding: 0; border: none; background: none; }
/* 元サイトは目次の後に空行があり、こちらは目次の前に来るため入れ替える */
body.single-case .tg-case-body > p:empty:has(+ .toc) { display: none; }
body.single-case .tg-case-body > p:empty + .toc { margin-bottom: 40px; }
body.single-case .tg-case-body .toc-title { display: block; margin: 0; padding: 0 0 11px; border-bottom: 1px solid #ccc; font-size: 24px; font-weight: 700; line-height: 38.4px; color: #333; text-align: left; }
body.single-case .tg-case-body .toc-checkbox + .toc-title::after, body.single-case .tg-case-body .toc-checkbox:checked + .toc-title::after { content: none; }
body.single-case .tg-case-body .toc-content { margin-top: 11px; padding: 24px 24px 8px; background: #f5f5f5; border-radius: 2px; }
body.single-case .tg-case-body .toc-list, body.single-case .tg-case-body .toc-list ol { display: flow-root; margin: 0; padding-left: 32px; list-style: none; }
body.single-case .tg-case-body .toc-list ol { padding-left: 0; }
body.single-case .tg-case-body .toc-list li { margin: 0 0 8px; padding: 4px 0; list-style: none; font-size: 16px; line-height: 16px; }
body.single-case .tg-case-body .toc-list li::before { content: none; }
body.single-case .tg-case-body .toc-list ol { margin-top: 12px; }
body.single-case .tg-case-body .toc-list a { font-size: 16px; font-weight: 500; line-height: 16px; color: #616161; text-decoration: underline; }
body.single-case .tg-case-body .toc-list a:hover { opacity: .7; }

/* タグ・シェア */
.tg-case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 75px; }
.tg-case-tags span { padding: 2px 8px; border: 1px solid #8d8d8d; border-radius: 1000px; font-size: 16px; line-height: 22.4px; color: #757575; }
.tg-case-article .tg-share { display: flex; gap: 21px; margin-top: 24px; }
.tg-case-article .tg-share a { display: block; width: 27px; height: 27px; }
.tg-case-article .tg-share svg { display: block; width: 100%; height: 100%; }

/* 資料ダウンロード */
.tg-case-dl, .tg-case-related { font-family: "Noto Sans JP", sans-serif; }
.tg-case-dl { max-width: 900px; margin: 56px auto 0; padding: 48px 20px; background: #f6f6f6; border-radius: 8px; text-align: center; color: #333; }
.tg-case-dl .tg-case-dl-icon { display: block; width: 64px; height: 64px; margin: 0 auto; }
.tg-case-dl .tg-case-dl-heading { margin: 24px 0 0; padding: 0; border: none; background: none; font-size: 24px; font-weight: 700; line-height: 1.4; color: #333; }
.tg-case-dl .tg-case-dl-heading::before, .tg-case-dl .tg-case-dl-heading::after { content: none; }
.tg-case-dl-heading span { color: #2eb484; }
.tg-case-dl .tg-case-dl-lead { margin: 23px 0 0; font-size: 16px; line-height: 1.6; }
.tg-dl-form { max-width: 600px; margin: 40px auto 0; text-align: left; }
.tg-dl-form .tg-dl-field { margin: 0 0 20px; }
.tg-dl-form .tg-dl-field .tg-dl-label { display: flex; align-items: baseline; gap: 5px; margin: 0 0 11px; font-size: 16px; font-weight: 600; line-height: 22px; }
.tg-dl-form .tg-dl-field p, .tg-dl-form .tg-dl-agree p { margin: 0; }
.tg-dl-form .tg-dl-req { font-size: 12px; font-weight: 700; line-height: 16.8px; color: #e53935; }
.tg-dl-form :is(input[type="text"], input[type="email"], input[type="tel"]) { box-sizing: border-box; width: 100%; height: 50px; margin: 0; padding: 10px 16px; border: 1px solid #eee; border-radius: 4px; background: #fff; font-size: 16px; line-height: 22.4px; color: #333; }
.tg-dl-form :is(input[type="text"], input[type="email"], input[type="tel"])::placeholder { color: #c4c4c4; }
.tg-dl-form .tg-dl-privacy { margin: 0 0 20px; font-size: 14px; font-weight: 500; line-height: 22.4px; }
.tg-dl-form .tg-dl-agree { margin: 0 0 21px; font-size: 16px; font-weight: 500; line-height: 22.4px; }
.tg-dl-form .tg-dl-agree .wpcf7-list-item { margin: 0; }
.tg-dl-form .tg-dl-agree label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.tg-dl-form .tg-dl-agree input { width: 15px; height: 15px; margin: 0; }
.tg-dl-form p:has(> .tg-dl-submit) { position: relative; margin: 0; }
.tg-case-dl .tg-dl-submit { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 48px; margin: 0; padding: 0 15px; border: none; border-radius: 80px; background: #2eb484; font-family: Lato, "Noto Sans JP", sans-serif; font-size: 16px; font-weight: 700; line-height: 1; color: #fff; text-decoration: none; cursor: pointer; transition: opacity .3s; }
.tg-case-dl .tg-dl-submit:hover { opacity: .8; color: #fff; }
/* 送信後: フォームと案内文を隠し、完了の案内と資料のボタンだけにする */
.tg-case-dl.is-sent :is(.wpcf7, .tg-case-dl-lead) { display: none; }
.tg-case-dl .tg-case-dl-done { max-width: 600px; margin: 32px auto 0; padding: 40px 32px; border-radius: 12px; background: #fff; box-shadow: 0 2px 16px rgba(0, 0, 0, .06); outline: none; }
.tg-case-dl .tg-case-dl-done[hidden] { display: none; }
.tg-case-dl-done-title { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0; font-size: 22px; font-weight: 700; line-height: 1.4; color: #333; }
.tg-case-dl-done-title::before { content: ""; width: 56px; height: 56px; border-radius: 50%; background: #2eb484 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 30px no-repeat; }
.tg-case-dl .tg-case-dl-done-text { margin: 16px 0 0; font-size: 15px; line-height: 1.8; color: #555; }
.tg-case-dl .tg-case-dl-done-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; width: min(100%, 360px); height: 52px; margin-top: 28px; border-radius: 80px; background: #2eb484; font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; transition: opacity .3s; }
.tg-case-dl .tg-case-dl-done-btn:hover { opacity: .8; color: #fff; }
.tg-case-dl-done-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tg-dl-form .wpcf7-spinner { position: absolute; top: 50%; right: 16px; margin: -12px 0 0; }
.tg-dl-form .wpcf7-not-valid-tip { margin-top: 4px; font-size: 13px; }
.tg-dl-form .wpcf7-response-output { margin: 16px 0 0; padding: 10px 14px; font-size: 14px; line-height: 1.6; }

/* 実績一覧 */
.tg-case-related { max-width: 900px; margin: 96px auto 0; padding: 96px 0; }
.tg-case-related .tg-case-related-heading { display: flex; align-items: center; gap: 20px; margin: 0; padding: 0; border: none; background: none; font-size: 40px; font-weight: 600; line-height: 1.4; letter-spacing: 2px; color: #333; }
.tg-case-related .tg-case-related-heading::before, .tg-case-related .tg-case-related-heading::after { content: none; }
.tg-case-related-heading img { width: 20px; height: 20px; }
/* 元サイトはカードの高さがばらばらだが、見やすさのため一番高いカードにそろえる */
.tg-case-related .tg-case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; align-items: stretch; gap: 24px; margin-top: 40px; padding: 0; }
/* 課題・施策・成果のラベルは行の高さを取らないようにして、元サイトの間隔（題名の下23px・文の上1px・項目の間12px）に */
.tg-case-related .tg-case-field-label { display: block; width: fit-content; }
.tg-case-related .tg-case-card-title + .tg-case-field { margin-top: 23px; }
.tg-case-related .tg-case-card .tg-case-field p { margin-top: 1px; }
.tg-case-related .tg-case-viewall { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 63px auto 0; font-family: "Source Sans 3", "Noto Sans JP", sans-serif; font-size: 20px; font-weight: 700; line-height: 28px; color: #333; text-decoration: none; }
.tg-case-related .tg-case-viewall::after { content: "→"; display: flex; align-items: center; justify-content: center; width: 47px; height: 47px; border-radius: 50%; background: #000; color: #fff; font-size: 20px; }
.tg-case-related .tg-case-viewall:hover { color: #333; opacity: .8; }

@media screen and (max-width: 834px) {
  body.single-case #main { padding-left: 20px; padding-right: 20px; }
  body.single-case #main .wp-block-group.tg-page-hero-case { height: 510px; }
  .tg-case-article { padding-top: 56px; }
  .tg-case-dl { padding: 56px 20px; }
  .tg-case-dl .tg-case-dl-heading { font-size: 28px; }
  .tg-dl-form .tg-dl-field .tg-dl-label { margin-bottom: 9px; font-size: 14px; line-height: 20px; }
  .tg-dl-form .tg-dl-req { font-size: 13px; }
  .tg-dl-form :is(input[type="text"], input[type="email"], input[type="tel"]) { font-size: 14px; }
  .tg-dl-form .tg-dl-privacy { font-size: 13px; line-height: 20.8px; }
  .tg-dl-form .tg-dl-agree { font-size: 14px; line-height: 19.6px; }
  .tg-case-dl .tg-dl-submit { height: 46px; font-size: 14px; }
  .tg-case-related .tg-case-related-heading { font-size: 32px; letter-spacing: 1.6px; }
  .tg-case-related-heading img { width: 30px; height: 30px; }
  .tg-case-related .tg-case-grid { grid-template-columns: 1fr; gap: 30px; }
  .tg-case-related .tg-case-card { padding: 12px; }
  .tg-case-related .tg-case-card .tg-case-card-title { font-size: 18px; }
  .tg-case-related .tg-case-tag { font-size: 13px; line-height: 18.2px; }
  .tg-case-related .tg-case-field-label { font-size: 14px; line-height: 19.6px; }
  .tg-case-related .tg-case-card .tg-case-field p { margin-top: 16px; font-size: 14px; line-height: 19.6px; }
}

@media screen and (max-width: 480px) {
  body.single-case #main .wp-block-group.tg-page-hero-case { height: 273px; }
  .tg-case-article .tg-case-title { font-size: 40px; }
  .tg-case-dl { padding: 56px 35px; }
  .tg-case-dl .tg-case-dl-heading { font-size: 24px; }
  .tg-case-article .tg-case-title { margin-top: 48px; }
  .tg-case-dl .tg-case-dl-heading { margin-top: 16px; }
  .tg-case-dl .tg-case-dl-lead { margin-top: 15px; font-size: 13px; }
  .tg-dl-form { margin-top: 22px; }
  .tg-dl-form .tg-dl-field .tg-dl-label { margin-bottom: 10px; font-size: 13px; line-height: 18px; }
  .tg-dl-form :is(input[type="text"], input[type="email"], input[type="tel"]), .tg-dl-form .tg-dl-privacy { font-size: 13px; }
  .tg-dl-form .tg-dl-agree { margin-bottom: 20px; font-size: 13px; line-height: 18px; }
  .tg-case-dl .tg-dl-submit { height: 45px; font-size: 13px; }
  .tg-case-dl .tg-case-dl-done { margin-top: 24px; padding: 32px 20px; }
  .tg-case-dl-done-title { font-size: 18px; }
  .tg-case-dl .tg-case-dl-done-text { font-size: 13px; }
  .tg-case-dl .tg-case-dl-done-text br { display: none; }
  .tg-case-dl .tg-case-dl-done-btn { height: 48px; font-size: 14px; }
  .tg-case-related { padding: 44px 20px; }
  .tg-case-related .tg-case-related-heading { font-size: 24px; letter-spacing: 1.2px; }
  .tg-case-related .tg-case-grid { margin-top: 60px; }
  .tg-case-related .tg-case-card { padding: 10px; }
  .tg-case-related .tg-case-card .tg-case-card-title { font-size: 15px; }
  .tg-case-related .tg-case-field-label { font-size: 13px; line-height: 18.2px; }
  .tg-case-related .tg-case-card-title + .tg-case-field { margin-top: 24px; }
  .tg-case-related .tg-case-card .tg-case-field p { font-size: 13px; line-height: 18.2px; }
}
