/* もくじ */
/* ページタイトル */
h1 {
    text-align: center;
    margin-bottom: 1em;
}

/* もくじ */
.midashi {
    position: relative;
    padding: 1rem .5rem;
    font-size: 40px;
    display: inline-block;
    text-align: center;
}

.midashi:after {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 6px;
    content: '';
    border-radius: 3px;
    /* 標準の記述のみでOK */
    background-image: linear-gradient(to left, #2af598 0%, #009efd 100%);
    transition: width 1s ease-out;
}

.midashi.loaded::after {
    width: 100%;
}

/* 目次全体 */
.toc-001 {
    padding: 0.9em 1.4em 1em 1.4em;
    border-top: 1px solid #d9d9d9;
    border-bottom: 1px solid #d9d9d9;
    border-left: 24px solid #99ccb7;
    background-color: #f7f7f7;
    color: #333333;
    box-shadow:
        1px 0 0 #959595d4,
        2px 0 0 #fff,
        3px 0 0 #898989de,
        4px 0 0 #fff,
        5px 0 0 #858585de,
        9px 3px 10px #ababab96;
    width: 62%;
	max-width: 480px;
    margin: 0 auto;
}

/* 「目次」タイトル */
.toc-001 > div {
    text-align: center;
    padding: 4px 0;
    font-size: 1.45em;
    font-weight: bold;
    color: #4a4a4a;
    border-bottom: 4px solid #99ccb7;
}

/* リスト全体 */
.toc-001 ol {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

/* 各項目 */
.toc-001 li {
    padding: 8px 0;
    margin-left: 1.8em;
    position: relative;
    font-size: 1.15em;
    color: #5a5a5a;
}

.toc-001 li::before {
    content: "・";
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    color: #99ccb7;
    font-size: 1.35em;
}

/* サブ階層 */
.toc-001 ol ol {
    margin-top: 4px;
    margin-left: 1.4em;
}

/* リンク */
.toc-001 a {
    color: #166c9d;
    text-decoration: none;
    background: linear-gradient(transparent 94%, #d8d8d8 100%);
    background-size: 100% 2em;
    line-height: 2em;
}

.toc-001 a:hover {
    color: #004a6d;
    text-decoration: underline;
}


/* 生徒ナビゲーション */
.student-mokuji {
	display: flex;
	width: fit-content;   /* 要素の内容にぴったりあう幅にする */
    margin: 0 auto;       /* 上下の余白を０にして、左右の余白を自動にする（中央ぞろえ）*/
    font-size: 20px;
}

html {
	scroll-behavior: smooth; /* スムーズスクロール */
}

/* 生徒ナビゲーションここまで */

/*生徒*/

 /* 目次のタイトルのリンクボタン */
.botann{
	display: inline-block;
	padding: 0.5em 1em;
	text-decoration: none;
	background: #668ad8;/*ボタン色*/
	color: #FFF;
	border-bottom: solid 4px #627295;
	border-radius: 3px;
}

/* 続きを読む */
.cp_box1 {
	position: relative;
	width: fit-content;
	margin: 0 auto 50px;
}

.cp_box1 input {
	display: none;
}

/*開くためのボタンとテキストを隠すグラデーションの設定*/
.cp_box1 label {
	position: absolute;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center; /* これが中央揃えのキモ */
	justify-content: flex-end;
	z-index: 10;
	width: 100%;
	height: 140px;
	pointer-events: none;
	background: linear-gradient(to bottom, rgba(224,255,255,0), rgba(224,255,255,.95) 90%);
}

/* 開いた時にグラデーションを消す */
.cp_box1 input:checked + label {
	background: none;
}

.cp_box1 .cp_container {
	overflow: hidden;
	height: 250px;
	transition: .5s;
}

/*続きをよむボタン*/
.cp_box1 label:after,
.cp_box1 label::before {
	content: '';
	position: absolute;
}
/* 続きをよむ 閉じるボタン本体 */
.cp_box1 label:after {
	content: '続きをよむ';
	display: block;
	pointer-events: auto;
	position: relative; /* 中央配置を維持するため relative */
	bottom: 20px;
	width: 13em;
	line-height: 2.5rem;
	color: #fff;
	background: #333;
	border-radius: 20px;
	z-index: 11;
	text-align: center; /* ボタン内の文字を中央に */
}

/* 続きを読むの左の矢印アイコン */
.cp_box1 label::before {
	bottom: 38px;
	left: 50%;
	transform: translateX(-350%); /* calcを使わずtransformで中央からずらす */
	z-index: 12;
	width: 10px;
	height: 5px;
	background: #fff;
	clip-path: polygon(50% 100%, 0 0, 100% 0);
}

/* 閉じるボタンの挙動 */
.cp_box1 input:checked + label:after {
	content: '閉じる';
}

.cp_box1 input:checked + label:before {
	transform: translateX(-250%) scale(1, -1); /* 閉じる時の位置調整と反転を合体 */
}

.cp_box1 input:checked ~ .cp_container {
	height: auto;
	padding-bottom: 80px;
}

/* ユーザーアイコン */
.user-icon {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	flex-shrink: 0;
	background-color: #ccc; /* デフォルト色 */
  
  /* 人の形をSVGで背景に指定 */
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><circle cx="16" cy="11" r="6" fill="white"/><path d="M16 18c-6 0-10 4-10 8v2h20v-2c0-4-4-8-10-8z" fill="white"/></svg>');
	background-position: center;
	background-repeat: no-repeat;
	background-size: 90%; /* アイコンの大きさに合わせて調整 */
}

/* 色バリエーションは背景色を変えるだけ */
.blue   { background-color: #4d9fff; }
.green  { background-color: #4ecb71; }
.purple { background-color: #b28dff; }
.yellow { background-color: #ffd93d; }

/* 生徒の全体のカード */
.comment-card {
	background: #f8f8f8;
	border-radius: 16px;
	border: 1px solid #ddd;
	padding: 16px;
	width: 1000px;
}

/* --- アイコン＋理由を1行にまとめる --- */
.reason-row {
	display: flex;
	align-items: center;
	gap: 10px;          /* アイコンとのスキマ */
	margin-bottom: 10px;
}

/* 理由の文字 */
.reason {
	font-size: 14px;
	line-height: 1.4;
	position: relative;
	z-index: 2; 
}

/* ランキング */
.list_crown {
	list-style: none;
	width: fit-content;
	margin: 12px auto 0; /* margin 0 auto と margin-top を統合 */
}

.list_crown > li {
	position: relative;
	padding: 0 0 20px 2.8em; /* 上 右 下 左 を1行で指定 */
	color: #38d; /* 短縮カラーコード */
	font-size: 30px;
}

.list_crown > li::before,
.list_crown > li::after {
	position: absolute;
	left: 0;
	width: 0;
	height: 0;
	content: "";
}

.list_crown > li::before {
	top: -1.25em;
	border: 1em solid transparent;
	border-bottom: 1.5em solid currentColor;
}

.list_crown > li::after {
	top: .25em;
	border: .5em solid transparent;
	border-left: 1em solid currentColor;
	border-right: 1em solid currentColor;
}

/* 順位カラー */
.list_crown > li:nth-of-type(1) { color: #dbb400; }
.list_crown > li:nth-of-type(2) { color: #6a7f9b; }
.list_crown > li:nth-of-type(3) { color: #c47022; }

/* レイアウト関連 */
.ranking {
	display: flex;
	width: fit-content;
	margin: 0 auto;
}

.sub-ranking {
	margin-left: 30px;
	font-size: 18px;
	color: #738a94;
}

/* 小見出し */
h3 {
	margin: 3% 8% 4%; /* 上 左右 下 の順で統合 */
	padding: 1rem 2rem;
	background: #f4f4f4;
	border-bottom: 3px solid #dcdcdc;
	border-left: 5px solid #000;
	border-radius: 3px;
	box-shadow: 0 0 8px rgba(0,0,0,.4);
	text-align: center;
}

.class-mokuji, .center {
	width: fit-content;
    margin: 0 auto;
}

/* 先生の似顔絵 */
.container {
	width: 420px;
}

input[type="checkbox"] {
	display: none;
}

.slideshow {
	position: relative;
	width: 420px;
	height: 270px;
	padding: 15px;
	margin-bottom: 10px;
}

.img {
	position: absolute;
	inset: 15px;
	width: calc(100% - 30px);
	height: calc(100% - 30px);
	object-fit: contain;
	opacity: 0;
	transition: opacity 1s; /* easeはデフォルトなのでカット */
}

.img1 {
	opacity: 1;
}

/* スイッチ共通：チェック時に1を消して2を出す */
#switch1:checked ~ .slideshow .img1,
#switch2:checked ~ .slideshow .img1,
#switch3:checked ~ .slideshow .img1,
#switch4:checked ~ .slideshow .img1 { opacity: 0; }

#switch1:checked ~ .slideshow .img2,
#switch2:checked ~ .slideshow .img2,
#switch3:checked ~ .slideshow .img2,
#switch4:checked ~ .slideshow .img2 { opacity: 1; }

.btn {
	display: inline-block;
	margin-bottom: 30px;
	padding: 6px 14px;
	background: #ddd;
	border-radius: 5px;
	cursor: pointer;
}

.extreme-teacher {
	display: flex;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
	.extreme-teacher {
		flex-direction: column;
		text-align: center;
	}

	.student-mokuji, .ranking {
		flex-direction: column;
	}
	
	.comment-card, .container {
    	width: fit-content;
    	margin: 0 auto;
	}

	.list_crown > li {
		font-size: 25px;
	}
}