/* Article reading support components */

.article-support-box,
.article-dialogue-box,
.article-summary-box,
.article-guide-box,
.article-remember-box,
.article-in-short-box,
.article-infographic {
  margin: 28px 0;
  border-radius: 26px;
  border: 1px solid rgba(21, 42, 77, 0.12);
  box-shadow: 0 14px 36px rgba(21, 42, 77, 0.07);
  overflow: hidden;
}

.article-support-box {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #fff7ed, #fff1f5);
}

.article-support-box__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(224, 122, 154, 0.22);
  color: #e07a9a;
  font-size: 2rem;
  font-weight: 900;
}

.article-support-box__label,
.article-summary-box__label,
.article-guide-box__label,
.article-remember-box__label,
.article-in-short-box__label,
.article-infographic__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: #e07a9a;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-support-box h3,
.article-summary-box h3,
.article-dialogue-box h3,
.article-guide-box h3,
.article-remember-box h3,
.article-in-short-box h3,
.article-infographic h3 {
  margin: 0 0 8px;
  color: #152a4d;
  font-size: 1.18rem;
  line-height: 1.45;
}

.article-support-box p,
.article-summary-box p,
.article-dialogue-box p,
.article-guide-box p,
.article-remember-box p,
.article-in-short-box p,
.article-infographic p {
  margin: 0;
  color: #243044;
}

.article-infographic {
  background: #ffffff;
}

.article-infographic__body {
  padding: 18px 18px 0;
}

.article-infographic img {
  display: block;
  width: 100%;
  height: auto;
}

.article-infographic figcaption {
  padding: 14px 18px 18px;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.7;
}

.article-dialogue-box {
  padding: 24px;
  background: #ffffff;
}

.article-dialogue-box__rows {
  display: grid;
  gap: 16px;
}

.dialogue-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: start;
}

.dialogue-row--reader {
  grid-template-columns: 1fr 58px;
}

.dialogue-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff1f5;
  border: 1px solid rgba(224, 122, 154, 0.18);
  font-size: 1.4rem;
}

.dialogue-row--teacher .dialogue-avatar {
  background: #fff7ed;
}

.dialogue-bubble {
  position: relative;
  padding: 16px 18px;
  border-radius: 20px;
  background: #fff7ed;
  border: 1px solid rgba(21, 42, 77, 0.10);
  color: #243044;
}

.dialogue-row--reader .dialogue-bubble {
  background: #eef3fb;
}

.dialogue-name {
  display: block;
  margin-bottom: 4px;
  color: #152a4d;
  font-weight: 900;
  font-size: 0.86rem;
}

.article-summary-box,
.article-guide-box,
.article-remember-box,
.article-in-short-box {
  padding: 24px;
}

.article-summary-box {
  background: linear-gradient(135deg, #eef3fb, #fffaf5);
}

.article-guide-box {
  background: #ffffff;
  border-left: 7px solid #e07a9a;
}

.article-in-short-box {
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  border-left: 7px solid #b99a5b;
}

.article-remember-box {
  background: linear-gradient(135deg, #eef3fb, #fff1f5);
  border-left: 7px solid #152a4d;
}

.article-summary-box ul,
.article-summary-box ol,
.article-guide-box ul,
.article-remember-box ul,
.article-in-short-box ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.article-summary-box li,
.article-guide-box li,
.article-remember-box li,
.article-in-short-box li {
  position: relative;
  padding-left: 28px;
  color: #152a4d;
  font-weight: 800;
}

.article-summary-box li::before,
.article-guide-box li::before,
.article-remember-box li::before,
.article-in-short-box li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #e07a9a;
  font-weight: 900;
}

.article-in-short-box li::before {
  content: "→";
  color: #b99a5b;
}

.article-remember-box li::before {
  content: "★";
  color: #152a4d;
}

.article-summary-box--cta {
  background: linear-gradient(135deg, #fff1f5, #fff7ed);
}

.article-summary-box--cta .btn {
  margin-top: 18px;
}

/* SEO-friendly teacher/student conversation component */
.article-conversation-block {
  margin: 30px 0;
  padding: clamp(20px, 4vw, 34px);
  border-radius: 30px;
  background: linear-gradient(135deg, #fffaf5, #eef3fb);
  border: 1px solid rgba(21, 42, 77, 0.12);
  box-shadow: 0 16px 40px rgba(21, 42, 77, 0.08);
  overflow: visible;
}

.article-conversation-block__title {
  margin: 0 0 20px;
  color: #152a4d;
  font-size: 1.24rem;
  line-height: 1.45;
  font-weight: 900;
  text-align: center;
}

.conversation-row-v2 {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0;
  overflow: visible;
}

.conversation-row-v2--teacher {
  grid-template-columns: minmax(0, 1fr) 108px;
}

.conversation-person {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.conversation-person__image {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(224, 122, 154, 0.18);
  box-shadow: 0 10px 22px rgba(21, 42, 77, 0.10);
}

.conversation-person__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #152a4d;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.conversation-row-v2--teacher .conversation-person__label {
  background: #e07a9a;
}

.conversation-bubble-v2 {
  position: relative;
  overflow: visible;
  padding: 20px 22px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(21, 42, 77, 0.12);
  color: #243044;
  font-size: 1.02rem;
  line-height: 1.95;
  box-shadow: 0 8px 20px rgba(21, 42, 77, 0.05);
}

.conversation-row-v2--student .conversation-bubble-v2 {
  background: #f6f9ff;
}

.conversation-row-v2--teacher .conversation-bubble-v2 {
  background: #fff7ed;
}

.conversation-bubble-v2::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: inherit;
  transform: rotate(45deg);
  z-index: 1;
}

.conversation-row-v2--student .conversation-bubble-v2::after {
  left: -10px;
  top: 28px;
  border-left: 1px solid rgba(21, 42, 77, 0.12);
  border-bottom: 1px solid rgba(21, 42, 77, 0.12);
}

.conversation-row-v2--teacher .conversation-bubble-v2::after {
  right: -10px;
  top: 28px;
  border-right: 1px solid rgba(21, 42, 77, 0.12);
  border-top: 1px solid rgba(21, 42, 77, 0.12);
}

.conversation-bubble-v2 p {
  position: relative;
  z-index: 2;
  margin: 0 0 0.85em;
}

.conversation-bubble-v2 p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .article-support-box,
  .article-dialogue-box,
  .article-summary-box,
  .article-guide-box,
  .article-remember-box,
  .article-in-short-box,
  .article-infographic {
    margin: 22px 0;
    border-radius: 22px;
  }

  .article-support-box {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .article-summary-box,
  .article-guide-box,
  .article-remember-box,
  .article-in-short-box {
    padding: 20px;
  }

  .article-infographic__body {
    padding: 14px 14px 0;
  }

  .article-infographic figcaption {
    padding: 12px 14px 16px;
    font-size: 0.86rem;
  }

  .article-support-box__icon {
    width: 58px;
    height: 58px;
    font-size: 1.5rem;
  }

  .article-support-box h3,
  .article-summary-box h3,
  .article-dialogue-box h3,
  .article-guide-box h3,
  .article-remember-box h3,
  .article-in-short-box h3,
  .article-infographic h3 {
    font-size: 1.08rem;
  }

  .dialogue-row,
  .dialogue-row--reader {
    grid-template-columns: 44px 1fr;
  }

  .dialogue-row--reader .dialogue-avatar {
    order: 0;
  }

  .dialogue-row--reader .dialogue-bubble {
    order: 1;
  }

  .dialogue-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .dialogue-bubble {
    padding: 14px 15px;
  }

  .article-conversation-block {
    margin: 24px 0;
    padding: 18px 14px;
    border-radius: 24px;
  }

  .article-conversation-block__title {
    font-size: 1.1rem;
    text-align: left;
  }

  .conversation-row-v2,
  .conversation-row-v2--teacher {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 20px 0;
  }

  .conversation-row-v2--teacher .conversation-person {
    order: 0;
  }

  .conversation-row-v2--teacher .conversation-bubble-v2 {
    order: 1;
  }

  .conversation-person {
    grid-template-columns: 58px 1fr;
    justify-items: start;
    align-items: center;
  }

  .conversation-person__image {
    width: 58px;
    height: 58px;
  }

  .conversation-person__label {
    min-width: auto;
    font-size: 0.78rem;
  }

  .conversation-bubble-v2 {
    padding: 17px 16px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.9;
  }

  .conversation-row-v2--student .conversation-bubble-v2::after,
  .conversation-row-v2--teacher .conversation-bubble-v2::after {
    left: 24px;
    right: auto;
    top: -13px;
    width: 0;
    height: 0;
    background: transparent;
    transform: none;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 13px solid currentColor;
    border-top: none;
  }

  .conversation-row-v2--student .conversation-bubble-v2::after {
    color: #f6f9ff;
  }

  .conversation-row-v2--teacher .conversation-bubble-v2::after {
    color: #fff7ed;
  }
}

/* Final mobile override: keep conversation bubbles beside the speaker */
@media (max-width: 640px) {
  .article-conversation-block .conversation-row-v2 {
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
    margin: 18px 0 !important;
  }

  .article-conversation-block .conversation-row-v2--teacher {
    grid-template-columns: minmax(0, 1fr) 54px !important;
  }

  .article-conversation-block .conversation-row-v2--teacher .conversation-person,
  .article-conversation-block .conversation-row-v2--teacher .conversation-bubble-v2 {
    order: initial !important;
  }

  .article-conversation-block .conversation-person {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 54px !important;
  }

  .article-conversation-block .conversation-person__image {
    width: 52px !important;
    height: 52px !important;
  }

  .article-conversation-block .conversation-person__label {
    min-width: 0 !important;
    padding: 4px 6px !important;
    font-size: 0.62rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .article-conversation-block .conversation-bubble-v2 {
    position: relative !important;
    padding: 14px 15px !important;
    border-radius: 18px !important;
    font-size: 0.96rem !important;
    line-height: 1.85 !important;
    overflow: visible !important;
  }

  .article-conversation-block .conversation-bubble-v2::after {
    content: "" !important;
    position: absolute !important;
    width: 14px !important;
    height: 14px !important;
    top: 22px !important;
    background: inherit !important;
    transform: rotate(45deg) !important;
    z-index: 1 !important;
  }

  .article-conversation-block .conversation-row-v2--student .conversation-bubble-v2::after {
    left: -7px !important;
    right: auto !important;
    border-left: 1px solid rgba(21, 42, 77, 0.12) !important;
    border-bottom: 1px solid rgba(21, 42, 77, 0.12) !important;
    border-right: none !important;
    border-top: none !important;
  }

  .article-conversation-block .conversation-row-v2--teacher .conversation-bubble-v2::after {
    right: -7px !important;
    left: auto !important;
    border-right: 1px solid rgba(21, 42, 77, 0.12) !important;
    border-top: 1px solid rgba(21, 42, 77, 0.12) !important;
    border-left: none !important;
    border-bottom: none !important;
  }
}
