/* =======
  タイトルと日付
   ======== */
.c-single__title {
	font-size: clamp(1.2rem, 1.0362rem + 0.699vw, 1.875rem);
	font-weight: 900;
	line-height: 1.5;
	margin-top: 0.6em;
}
.c-single__meta {
	display: flex;
	align-items: center;
	gap: 1em;
	margin-top: 0.9em;
	font-size: 0.8125rem;
	font-family: var(--font-en);
	letter-spacing: 0.04em;
	color: var(--color-sub);
}
/* 記事冒頭のタグ */
.c-post-terms__list--top {
	margin-top: 0.5em;
}
.c-single__header .c-single__meta {
	margin-top: 0;
}
.c-post-terms__list--top {
	margin-top: 0.6em;
}

.c-post-terms__tag {
	transition: background-color 0.2s, color 0.2s;
}
.c-post-terms__tag:hover,
.c-post-terms__tag:focus-visible {
	background-color: var(--color-accent);
	color: var(--color-white);
}

/* =======
  画像
   ======== */
.c-single__thumb {
	margin-block: 1.5rem;
	overflow: hidden;
	max-width: 100%;
	margin-inline: auto;
}
.c-single__body img,
.c-single__body figure {
	max-width: 100%;
	margin-inline: auto;
}
@media (min-width: 1024px) {
	.c-single__thumb {
		max-width: 75%;
	}
	.c-single__body img,
	.c-single__body figure {
		max-width: 95%;
	}
	.c-single__body figure img {
		max-width: 100%;
	}
}

/* =======
  本文
   ======== */
.c-single__body {
	font-size: 1rem;
	line-height: 1.7;
}
	
.c-single__body h2 {
	position: relative; 
	font-size: 1.25em;
	font-weight: 900;
	margin-block: 3.2em 1em;
	background: var(--color-main);
	padding: .75em 1em;
	color: #fff;
}
.c-single__body h2::before {
	position: absolute;
	display: block;
	pointer-events: none;
	content: "";
	top: -4px;
	height: calc(100% + 8px);
	left: 0;
	width: 100%;
	box-sizing: border-box;
	border-top: solid 2px var(--color-main);
	border-bottom: solid 2px var(--color-main);
}
.c-single__body h3 {
	font-size: 1.0625em;
	font-weight: 900;
	margin-block: 3em 1em;
	padding-bottom: 0.4em;
	border-bottom: 2px solid;
	border-image: linear-gradient(
		to right,
		var(--color-accent) 0 30%,
		#e5e5e5 30% 100%
	) 1;
}
/* 通常のh4 */
.c-single__body h4 {
  font-size: 1em;
  padding: 4px 16px 4px 12px;
  margin-block: 3em 1em;
  position: relative;
  color: #0c192b;
  border-left: 4px solid var(--color-main);
}
.c-single__body h4::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 0;
  width: 4px;
  height: 50%;
  background-color: var(--color-accent);
}

/* トグルのh4 */
.c-single__body summary h4 {
  font-weight: 900;
  padding: 0 0 0 40px;
  margin-block: 3em 1em;
  border-left: none;
  color: inherit;
}
.c-single__body summary h4::before {
  content: "\f13a";
  font-family: FontAwesome;
  left: 0;
  position: absolute;
  color: var(--color-accent);
  font-size: 1.18em;
  transform: translateY(-2px);
}
.c-single__body summary h4::after {
  content: none;
}

.c-single__body p,
.c-single__body table,
.c-single__body img,
.c-single__body pre,
.balloon-wrap {
	margin-top: 1.8em;
}
.code-table {
	margin:0 !important;
}
.c-single__body a {
	color: var(--color-accent);
	text-decoration: underline;
}
.c-single__body mark {
	background: linear-gradient(transparent 60%, #FFE08A 60%);
}
.c-single__body small {
      display: inline-block;
    font-size: 0.66em;
    line-height: 1.4;
	color: #636363;
} 

.c-single__body p:has(> small:only-child) + p:has(> small:only-child) {
  margin-top: 0;
}

.c-single__body blockquote {
  font-size: 0.6rem;
  padding: 0.5em 1.2em;
  border-left: 4px solid #c7c7ca;
  background: var(--color-bg);
  color: #444;
  margin-block: 3em;
}
.c-single__body blockquote p {
  margin: 0;
}

.c-single__body + .c-tag-list {
	margin-top: 2.5em;
}

/* 画像の下の空白をなくす */
.c-single__body figure img { display: block; }
.c-single__body figure > br { display: none; }

/* 画像の説明リスト */
.c-single__body ol.img-steps {
  margin: 0.75em 0 2em !important;
  font-size: 0.9em;
}
.c-single__body ol.img-steps > li { margin-top: 0 !important; }
.c-single__body ol.img-steps > li + li { margin-top: 0.4em !important; }
.c-single__body ol.img-steps > li::before { background: #E53935 !important; }


@media (min-width: 1024px) {
	.c-single__body {
	font-size: 1.1rem;
	}
	.c-single__body blockquote {
  font-size: 0.8rem;
	}
	.img-steps {
	font-size:1rem;
}
}

/* =======
  グループ化ボックス（枠線にタイトルが乗るリスト）
   ======== */
.group-box {
  background: #fff;
  border: 1px solid var(--color-accent);
  padding: 0 24px 24px;
  margin-block: 4em !important;
}

/* 枠線に乗るタイトル */
.group-box-title {
  display: block;
  width: fit-content;
  margin: 0 0 6px -12px !important;
  padding: 0 12px;
  transform: translateY(-50%); /* 自分の高さの半分だけ上にずらす */
  background: #fff; /* 記事の背景色と同じ色にする */
  color: var(--color-accent);
  font-size: 1.1em;
  font-weight: bold;
  line-height: 1;
}

/* リストの余白をテーマに左右されないようにする */
.group-box ul {
  margin: 0 !important;
}

.group-box li:last-child {
  margin-bottom: 0 !important;
}
/* ----- 色の使い分け ----- */
/* 注意点（黄） */
.group-box--caution {
  border-color: #E6B422;
}

.group-box--caution .group-box-title {
  color: #8A6500;
}

/* ポイント・おすすめ（青） */
.group-box--point {
  border-color: #5B8FD9;
}

.group-box--point .group-box-title {
  color: #2F5FA8;
}

/* NG・デメリット（赤） */
.group-box--ng {
  border-color: #E07A7A;
}

.group-box--ng .group-box-title {
  color: #B23A3A;
}

/* =======
  この記事でわかること（ul.summary-list）
   ======== */
.c-single__body ul.summary-list {
  border: 1px solid var(--color-accent);
  padding: 0 24px 20px;
  margin-block: 4em;
}
.c-single__body ul.summary-list > span {
  display: block;
  width: fit-content;
  margin: 0 0 6px -12px;
  padding: 0 12px;
  transform: translateY(-50%);
  background: #fff;
  color: var(--color-accent);
  font-size: 1.1em;
  font-weight: bold;
  line-height: 1;
}

/* =======
  リスト
   ======== */
.c-single__body ul:not([class*="ez-toc-list"]) {
  margin-top: 2em;
}
.c-single__body ul:not([class*="ez-toc-list"]) > li {
  padding-left: 1.5em;
  position: relative;
  line-height: 2;
  font-size: 0.9em;
}
.c-single__body ul:not([class*="ez-toc-list"]) > li::before {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.9em;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

.c-single__body ol:not([class*="ez-toc-list"]) {
  list-style: none;
  counter-reset: step;
  margin-block: 2.5em;
}
.c-single__body ol:not([class*="ez-toc-list"]) > li {
  counter-increment: step;
  padding-left: 2em;
  margin-top: 1em;
  position: relative;
}
.c-single__body ol:not([class*="ez-toc-list"]) > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 1.6em;
  height: 1.6em;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1;
}

/* =======
  表
   ======== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1.8em;
}
table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.8rem;
  table-layout: fixed;
  border: 1px solid #e0e3e8;
}
th, td {
  padding: 0.85em 1em;
  text-align: left;
  word-break: break-word;
}
th {
  background: #e9edf2;
  color: inherit;
  font-weight: 700;
  border-bottom: 2px solid var(--color-main);
}
th:not(:last-child) {
  border-right: 1px solid #d5dae1;
}
td:first-child {
  font-weight: 700;
  background: #f7f8fa;
}
td {
  border-bottom: 1px solid #e0e3e8;
}
td:not(:last-child) {
  border-right: 1px solid #e0e3e8;
}
tbody tr:last-child td {
  border-bottom: none;
}

/* コード解説の表 */
.code-table {
  table-layout: auto;
}
.code-table td:first-child {
  width: 3em;
  text-align: center;
  white-space: nowrap;
}
.code-table td:last-child {
  width: 100%;
}

/* 手順の表（STEPのセルを縦に結合する表） */
.step-table {
  table-layout: auto;
}
.step-table th {
  width: 50%;
  border-right: 1px solid #d5dae1;
}
.step-table th:first-child {
  width: 1px;
  white-space: nowrap;
}
.step-table th:last-child {
  border-right: none;
}
.step-table tbody td {
  font-weight: 400;
  background: #fff;
  border-right: 1px solid #e0e3e8;
}
.step-table tbody td:last-child {
  border-right: none;
}
.step-table tbody .step-table__step {
  font-weight: 700;
  background: #f7f8fa;
  vertical-align: middle;
  white-space: nowrap;
}
.step-table a {
  text-decoration: none;
}

.step-table a:hover {
  text-decoration: underline;
}

/* =======
  コード
   ======== */
code {
    display: inline-block;
    background-color: #f5f5f5;
    color: #d6336c;
    padding: 0 6px;
    margin-inline: 5px;
	margin-bottom: 0.2em;
    border-radius: 4px;
    font-size: 0.9em;
    transform: translateY(-2px);
}
pre {
  background-color: #4b4b4b;
  color: #e6e6e6;
  padding: 16px 20px !important;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 0.9rem !important; 
 margin-top: 1.8em !important;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.9rem !important; 
}
@media (max-width: 600px) {
  pre {
    padding: 12px 14px;
  }
}

/* =======
  目次
   ======== */
#ez-toc-container {
    background: var(--color-bg);
    border: 1px solid var(--color-main);
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
	width: 100%;
    margin-inline: auto;
    margin-block: 4em;
}
@media screen and (min-width: 1024px) {
    #ez-toc-container {
        width: 80%;
    }
}

/* ヘッダー */
#ez-toc-container .ez-toc-title-container {
    background: var(--color-main);
    padding: 14px 20px;
    margin: 0;
}
.ez-toc-title {
    color: var(--color-white) ;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
#ez-toc-container .ez-toc-list {
    padding: 20px 30px;
    margin: 0;
    list-style: none;
}
#ez-toc-container .ez-toc-list a {
    color: #333;
    text-decoration: none;
	margin-top: 0.4em;
}
#ez-toc-container .ez-toc-list a:hover {
    color: var(--color-accent);
}
#ez-toc-container .ez-toc-toggle {
    display: none;
}
.ez-toc-counter nav ul li a::before {
	margin-right: 1em;
	color: var(--color-accent);
}

/* =======
  吹き出し
   ======== */

.balloon-wrap {
  display: flex;
  align-items: center;
  margin: 20px 0 40px;
}

.balloon-icon {
  display: flex;
   flex-direction: column;
    align-items: center;
	    width: 100px;
    height: 100px;
    aspect-ratio: 1;
}

.balloon-icon img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
	margin:0;
	margin-top:1.5em;
  object-fit: cover;
  border: 2px solid #eee;
}

.balloon-name {
  font-size: 12px;
  font-weight: bold;
  color: #333;
	margin:0 !important;
}

.balloon-speech {
  position: relative;
  background: var(--color-white);
  border: 2px solid #ddd;
  border-radius: 16px;
  padding: 18px 24px;
  max-width: 80%;
	margin: 0;
	    transform: translateY(12px);
}
.balloon-speech p {
	margin: 0;
	line-height:1.4;
	font-size:0.8rem;
}

.balloon-speech::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: #ddd;
}

/* =======
  Faq
   ======== */


.faq-item {
  margin-top: 2em;
}
.faq-item summary {
  list-style: none;    /* ① */
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker {
  display: none;       /* ② */
}
.c-single__body .faq-item h4 {
  margin: 0;           /* ③ */
}
.c-single__body .faq-item h4::before {
  transition: transform 0.2s;
}
.c-single__body .faq-item[open] h4::before {
  transform: translateY(-2px) rotate(180deg);  /* ④ */
}


/* =======
  吹き出し（新デザイン：細い濃紺の線・角丸なし）
   ======== */
.balloon-icon img {
  border: 1px solid var(--color-main);
}
.balloon-speech {
  border: 1px solid var(--color-main);
  border-radius: 0;
}
.balloon-speech::before {
  border-right-color: var(--color-main);
}
.balloon-speech::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -18.5px;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: var(--color-white);
}

/* =======
  表（スマホ）：3列以上は横スクロール
   ======== */
.c-single__body table code {
  white-space: nowrap;
}
@media (max-width: 767px) {
  th, td {
    padding: 0.7em 0.75em;
  }

  /* 3列以上の表は最低幅を持たせて、横に動かせるようにする */
  .table-scroll table:has(tr > :nth-child(3)) {
    table-layout: auto;
    min-width: 520px;
  }
  .table-scroll table:has(tr > :nth-child(4)) {
    min-width: 680px;
  }

  /* スクロールできることの案内 */
  .table-scroll:has(tr > :nth-child(3))::after {
    content: "※ 横にスクロールできます";
    display: block;
    position: sticky;
    left: 0;
    width: fit-content;
    margin-top: 0.5em;
    font-size: 0.625rem;
    line-height: 1.4;
    color: var(--color-sub);
  }

  /* 1列目を左に固定（セルを縦に結合する手順の表は除く） */
  .table-scroll table:has(tr > :nth-child(3)):not(.step-table) th:first-child,
  .table-scroll table:has(tr > :nth-child(3)):not(.step-table) td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 1px 0 0 #d5dae1;
  }
}

/* =======
  記事カード（[blogcard slug="…"]）
   ======== */
.c-single__body a.wk-card {
  display: flex;
  align-items: center;
  margin-top: 4em;
  border: 1px solid var(--color-main);
  background: var(--color-white);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.wk-card__thumb {
  display: block;
  flex: 0 0 112px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.c-single__body .wk-card__thumb img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}
.wk-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35em;
  align-self: stretch;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6em 1em;
  border-left: 1px solid var(--color-main);
}
.wk-card__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-accent);
}
.wk-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}
.c-single__body a.wk-card:hover,
.c-single__body a.wk-card:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-bg);
}
.c-single__body a.wk-card:hover .wk-card__title,
.c-single__body a.wk-card:focus-visible .wk-card__title {
  color: var(--color-accent);
}
@media (min-width: 768px) {
  .wk-card__thumb {
    flex-basis: 168px;
  }
  .wk-card__body {
    padding: 0.8em 1.4em;
  }
  .wk-card__label {
    font-size: 0.75rem;
  }
  .wk-card__title {
    -webkit-line-clamp: 3;
    font-size: 1rem;
  }
}

/* カードが出ていないときの案内（ログイン中だけ表示） */
.wk-card-notice {
  display: block;
  margin-top: 1.8em;
  padding: 0.6em 1em;
  border: 1px dashed #E6B422;
  background: #FFF8E6;
  color: #8A6500;
  font-size: 0.75rem;
  line-height: 1.5;
}
