/* ========================================
   ページトップ画像
======================================== */

.lesson-top-image {
  width: 100%;
  margin: 0 auto 0px;
  text-align: center;
}

.lesson-top-image img {
  display: block;
  width: 100%;
  max-width: 1180px;
  height: auto;
  margin: 0 auto;
}

/* ========================================
   基本設定
======================================== */

.lesson-page,
.lesson-page * {
  box-sizing: border-box;
}

.lesson-page {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  color: #111;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.9;
  background: #fff;
}

.lesson-page img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========================================
   左サイドバー
======================================== */

.lesson-sidebar {
    flex: 0 0 220px;
    width: 220px;
    color: #476c63;
    background: #476c63;
　　padding: 32px 0px 0px;
　　
}

.lesson-sidebar-nav {
  position: sticky;
  top: 0;
　padding-top: 150px;
}

.lesson-sidebar-top {
    background: #8fd3bf;
    padding: 150px 0 35px;
}


.lesson-sidebar-bottom {
  background: #476c63;
}

.lesson-sidebar-bottom {
  border-top: 14px solid #476c63;
}

.lesson-anchor-list,
.lesson-index-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-anchor-list {
  padding: 0 28px;
}

.lesson-anchor-list li,
.lesson-index-list li {
  margin: 0;
  padding: 0;
}

.lesson-anchor-list li + li {
  margin-top: 14px;
}

.lesson-anchor-list a,
.lesson-index-list a {
  display: block;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.lesson-anchor-list a {
  position: relative;
  padding-left: 14px;
  font-size: 15px;
  line-height: 1.5;
}

.lesson-anchor-list a::before {
  position: absolute;
  top: 0.2em;
  left: 0;
  font-size: 10px;
  content: "▼";
}

.lesson-index-list a {
  padding: 14px 24px;
  font-size: 12px;
  line-height: 1.45;
}

.lesson-index-list a:hover,
.lesson-index-list a:focus-visible {
  background: #5a8177;
}

.lesson-index-list li:first-child a {
  color: #35574f;
  background: #f4dc92;
}

.lesson-index-list span {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

/* ========================================
   メインコンテンツ
======================================== */

.lesson-main {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 32px 140px 80px 56px;
  background: #fff;
}

/* 右側の方眼背景 */
.lesson-main::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 84px;
  border-left: 1px solid #dce6c8;
  background-color: #fbfcf5;
  background-image:
    linear-gradient(#dce6c8 1px, transparent 1px),
    linear-gradient(90deg, #dce6c8 1px, transparent 1px),
    linear-gradient(#edf2df 1px, transparent 1px),
    linear-gradient(90deg, #edf2df 1px, transparent 1px);
  background-size:
    32px 32px,
    32px 32px,
    8px 8px,
    8px 8px;
  content: "";
  pointer-events: none;
}

/* ========================================
   ページ上部のタイトル
======================================== */

.lesson-hero {
  width: 100%;
  margin: 0 0 46px;
  padding: 10px 28px;
  border-radius: 15px;
  background: #b1e3f3;
  max-height: 195px
}

.lesson-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lesson-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.lesson-hero-label {
  display: inline-block;
  margin: 0;
  padding: 0px 20px;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  background: #f32735;
}

.lesson-hero h1 {
  margin: 0;
  padding: 0;
  border: 0;
  color: #111;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  background: transparent;
  box-shadow: none;
}

.lesson-hero-title-row .lesson-hero-icon {
  flex: 0 0 140px;
  width: 80px;
  height: auto;
}

.lesson-hero-title-row .lesson-hero-icon img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

/* 画像がまだない間はアイコンを非表示 */
.lesson-hero-icon:empty {
  display: none;
}

/* ========================================
   共通セクション
======================================== */

.lesson-section {
  position: relative;
  margin: 0 0 42px;
  scroll-margin-top: 24px;
}

.lesson-heading {
  display: inline-block;
  padding: 10px 74px 10px 34px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(
    to right,
    #d78ebc 0%,
    #d78ebc 82%,
    #c45b99 82%,
    #c45b99 100%
  );
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
}

.lesson-large-heading {
  margin: 0 0 24px;
  padding: 12px 18px;
  border-left: 8px solid #6bbf83;
  color: #45665d;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  background: #e6f5e9;
}

.lesson-text {
  max-width: 650px;
  margin: 0 auto;
}

.lesson-text p,
.lesson-section > p {
  margin: 0 0 28px;
  text-align: justify;
}

.lesson-page h2 {
  border-left: none !important;
}

/* ========================================
   はじめに
======================================== */

.lesson-introduction {
  padding: 0 28px;
}

.lesson-message-box {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 760px;
  margin: 36px auto 0;
  padding: 10px 28px;
  border: 4px solid #9bdff1;
  border-radius: 14px;
  background: #fffdec;
}

.lesson-message-image {
  flex: 0 0 110px;
  min-height: 92px;
}

.lesson-message-box p {
  margin: 0;
  line-height: 1.8;
}

/* ========================================
   プロフィール
======================================== */



.lesson-ribbon {
  display: inline-block;
  padding: 5px 42px 5px 22px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(
    to right,
    #f4c531 0%,
    #f4c531 84%,
    #e9ae00 84%,
    #e9ae00 100%
  );
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
  transform: rotate(-10deg);
}

.lesson-profile-box {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  padding: 25px 50px 0px;
  border: 1px solid #47675f;
  background: #fff;
}

.lesson-profile-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.lesson-profile-image {
  align-self: flex-end;
}

.lesson-profile-text {
  flex: 1;
  min-width: 0;
}

.lesson-profile-text h2 {
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  color: #111;
  font-size: 18px;
  line-height: 1.5;
  background: transparent;
  box-shadow: none;
}

.lesson-profile-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  text-align: justify;
}

.lesson-profile-image {
  flex: 0 0 120px;
}

/* ========================================
   授業ブロック
======================================== */

.lesson-content-block {
  width: 100%;
  margin: 42px 0;
  border: 3px solid #47675f;
  background: #fff;
}

.lesson-content-header {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 24px 80px 20px 30px;
  background: linear-gradient(
    to bottom,
    #aee0c0 0%,
    #d8efdf 75%,
    #f8fbf8 100%
  );
}

.lesson-content-header .lesson-number {
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 18px;
  color: #42665c;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  background: #ffffff;
  box-shadow: 10px 8px 0 rgba(49, 100, 81, 0.2);
}

.lesson-content-header h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: #42665c;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  background: transparent;
  box-shadow: none;
}

.lesson-content-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 45px 15px 54px;
}

.lesson-content-body > p {
  margin: 0 50px 27px;
  font-size: 15px;
  line-height: 1.9;
  text-align: justify;
}

.lesson-comment-box {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 30px 0;
  padding: 10px 24px;
  border: 4px solid #9bdff1;
  border-radius: 13px;
  background: #fffdec;
}

.lesson-comment-image {
  flex: 0 0 92px;
  min-height: 82px;
}

.lesson-comment-image img {
  width: 100%;
  max-width: 92px;
  margin: 0 auto;
}

.lesson-comment-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}

/* ========================================
   次回予告
======================================== */

.lesson-preview {
  max-width: 660px;
  margin: 50px auto;
}

.lesson-preview-top {
  display: flex;
  align-items: flex-start;
  gap: 36px;
}

.lesson-preview-content {
  flex: 1;
  min-width: 0;
}

.lesson-preview-content h2 {
  display: inline-block;
  margin: 0 0 28px;
  padding: 10px 58px 10px 18px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(
    to right,
    #7cc8f4 0%,
    #7cc8f4 86%,
    #4f9fda 86%,
    #4f9fda 100%
  );
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
}

.lesson-preview-content p,
.lesson-preview-bottom p {
  margin: 0 0 24px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.9;
}

.lesson-preview-image {
  flex: 0 0 180px;
}

.lesson-preview-image img {
  display: block;
  width: 80%;
  height: auto;
}

.lesson-preview-bottom {
  width: 100%;
  margin-top: 28px;
}

@media screen and (max-width: 767px) {
  .lesson-preview-top {
    flex-direction: column;
    gap: 24px;
  }

  .lesson-preview-image {
    flex: none;
    width: 180px;
    margin: 0 auto;
  }

  .lesson-preview-bottom {
    margin-top: 20px;
  }
}

/* ========================================
   次の授業へのボタン
======================================== */

.lesson-next-navigation {
  max-width: 760px;
  margin: 24px auto 54px;
}

.lesson-next-navigation a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 74px;
  padding: 12px 20px;
  border-radius: 5px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  background: #5fc34d;
  box-shadow: 0 3px 0 #429d35;
}

.lesson-next-navigation a:hover,
.lesson-next-navigation a:focus-visible {
  background: #51b541;
}

.lesson-next-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #5fc34d;
  font-size: 12px;
  background: #fff;
}


/* ========================================
   ruby
======================================== */

.lesson-page rt {
  font-size: 0.65rem;
  margin-bottom: -4px;
}

/* ========================================
   タブレット
======================================== */

@media screen and (max-width: 1024px) {
  .lesson-page {
    max-width: 100%;
  }

  .lesson-sidebar {
    flex-basis: 190px;
    width: 190px;
  }

  .lesson-main {
    padding-right: 34px;
    padding-left: 34px;
  }

  .lesson-main::after {
    display: none;
  }

  .lesson-hero {
    grid-template-columns: 70px minmax(0, 1fr) 70px;
  }

  .lesson-content-body {
    padding-right: 38px;
    padding-left: 38px;
  }
}

/* ========================================
   スマホ
======================================== */

@media screen and (max-width: 767px) {
  .lesson-page {
    display: block;
  }

  .lesson-sidebar {
    width: 100%;
  }

  .lesson-sidebar-bottom {
    display: none;
  }

  .lesson-sidebar-nav {
    position: static;
  }

  .lesson-sidebar-top {
    padding: 20px 0;
  }

  .lesson-anchor-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 0 16px;
  }

  .lesson-anchor-list li + li {
    margin-top: 0;
  }

  .lesson-anchor-list a {
    padding: 8px 8px 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 13px;
  }

  .lesson-index-list a {
    padding: 12px 18px;
  }

  .lesson-main {
    width: 100%;
    padding: 24px 16px 50px;
  }

  .lesson-main::after {
    display: none;
  }

  .lesson-hero {
    display: block;
    margin-bottom: 34px;
    padding: 20px 16px;
  }

  .lesson-hero-icon {
    display: none;
  }

  .lesson-hero-label {
    margin-bottom: 14px;
    font-size: 22px;
  }

  .lesson-hero h1 {
    font-size: 18px;
  }

  .lesson-introduction {
    padding: 0;
  }

  .lesson-heading {
    min-width: 150px;
    font-size: 18px;
  }

  .lesson-message-box {
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-width: 3px;
  }

  .lesson-message-image {
    flex-basis: 74px;
    min-height: 65px;
  }

  .lesson-profile-box {
    display: block;
    padding: 24px 20px 0;
  }

  .lesson-profile-image {
    width: 150px;
    margin: 20px auto 0;
  }

  .lesson-content-block {
    margin: 30px 0;
    border-width: 2px;
  }

  .lesson-content-header {
    display: block;
    padding: 20px 16px;
  }

  .lesson-content-header .lesson-number {
    display: inline-block;
    margin-bottom: 16px;
    padding: 9px 14px;
    font-size: 17px;
  }

  .lesson-content-header h2 {
    font-size: 19px;
  }

  .lesson-content-body {
    padding: 28px 16px 34px;
  }

  .lesson-content-body > p {
    font-size: 15px;
    line-height: 1.85;
  }

  .lesson-comment-box {
    gap: 14px;
    padding: 14px;
    border-width: 3px;
  }

  .lesson-comment-image {
    flex-basis: 70px;
    min-height: 65px;
  }

  .lesson-comment-image img {
    max-width: 70px;
  }

  .lesson-comment-box p {
    font-size: 13px;
    line-height: 1.7;
  }

  .lesson-preview {
    display: block;
    padding: 0;
  }

  .lesson-preview-image {
    width: 150px;
    margin: 24px auto 0;
  }

@media screen and (max-width: 767px) {
  .lesson-next-navigation {
    margin: 24px auto 40px;
  }

  .lesson-next-navigation a {
    gap: 10px;
    min-height: 64px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.6;
  }

  .lesson-next-navigation a > span:last-child {
    min-width: 0;
    text-align: center;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .lesson-next-navigation ruby {
    white-space: nowrap;
  }

  .lesson-next-navigation rt {
    font-size: 0.5rem;
    line-height: 1;
  }

  .lesson-next-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
  }
}

.lesson-page h2 {
    border-left: none !important;
}

.lesson-preview-image {
  flex: 0 0 180px;
}

.lesson-preview-image img {
  width: 100%;
  height: auto;
}

