/* 메인 페이지 전용 (index.html)
   공용 style.css 다음에 불러옵니다.
   ------------------------------------------------------------------ */



.code-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding-inline: 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* --- 메인: 소개 --------------------------------------------------------- */

.home-intro__grid {
  display: grid;
  gap: 28px;
}

.home-intro__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 56ch;
  margin-inline: auto;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.85;
  text-align: center;
}

/* 원고의 줄바꿈을 그대로 살립니다 */
.home-intro__body p {
  white-space: pre-line;
}

/* --- 메인: 핵심 특징 ---------------------------------------------------- */

.points {
  display: grid;
}

.point {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 28px 26px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--shelf);
}

.point__title {
  font-size: 23px;
  color: var(--brand);
}

.point__text {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
}

.points {
  gap: 16px;
}

@media (min-width: 768px) {
  .points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }}


@media (min-width: 1180px) {
  .points {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }}


/* --- 메인: 상품 간략 소개 ----------------------------------------------- */

.home-products {
  display: grid;
  gap: 20px;
}

.home-product {
  display: grid;
  gap: 26px;
  padding: 30px 26px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--shelf);
}

.home-product__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.home-product__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-product__logo {
  width: auto;
  height: 30px;
}

.home-product__name {
  font-size: clamp(26px, 5.4vw, 34px);
}

.home-product__tagline {
  color: var(--brand);
  font-weight: 800;
  font-size: clamp(20px, 4.3vw, 24px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.5;
}

.home-product__summary {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.8;
  max-width: 54ch;
}

.home-product__highlights {
  display: grid;
  gap: 8px;
  margin-block: 4px;
  /* 항목 목록과 버튼 사이 (14px + 34px) */
  margin-bottom: 34px;
}

.home-product__highlight {
  display: flex;
  gap: 10px;
  font-size: 19px;
  color: var(--ink-soft);
}

.home-product__highlight svg {
  flex: none;
  margin-top: 5px;
  color: var(--brand);
}

.home-product__figure {
  margin: 0;
  min-width: 0;
}

.home-product__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  /* 사진마다 인물 위치가 달라 잘리는 기준을 상품별로 지정합니다.
     값은 data/products.json 의 imagePosition 에 있습니다. */
  object-position: var(--img-pos, center);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

@media (min-width: 900px) {
  .home-product {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
    align-items: stretch;
    gap: 48px;
    padding: 56px;
    /* 카드 하나가 화면을 거의 채웁니다.
       답답하면 이 값만 낮추세요. 65vh 로 두면 다음 카드가 살짝 보입니다. */
    min-height: 82vh;
  }

  /* 글은 세로 가운데, 이미지는 카드 높이를 꽉 채웁니다 */
  .home-product__body {
    justify-content: center;
  }

  .home-product__figure {
    display: flex;
  }

  .home-product__image {
    aspect-ratio: auto;
    height: 100%;
    min-height: 320px;
  }

  .home-product__body {
    order: 1;
  }

  .home-product__figure {
    order: 2;
  }

  .home-product--reverse .home-product__body {
    order: 2;
  }

  .home-product--reverse .home-product__figure {
    order: 1;
  }}


.home-product__logo {
  max-height: 54px;
  max-width: 210px;
}


/* --- 리딩 레벨 커버리지 차트 --------------------------------------------
   가로축은 학년 하나뿐이고, 12칸을 똑같은 너비로 나눕니다.
   막대 위치는 data/content.json 의 home.levels 에서 % 로 관리합니다.       */

.lex {
  display: grid;
  gap: 0;
}

.lex__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 6px;
}

.lex__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── 차트 머리 (성장 단계 + 학년) ──────────────────────────
   단계 띠와 학년 줄을 하나의 덩어리로 묶고,
   그 아래로 세로선을 내려 구간을 나눕니다. */

.lex__chart {
  position: relative;
  /* 이름 칸 폭. 세로선이 시작되는 지점입니다. */
  --label-col: 0px;
  --stage-h: 46px;
}

/* 세로선 — 학년 12칸은 옅게, 단계 4칸은 조금 진하게 */
.lex__lines {
  position: absolute;
  left: var(--label-col);
  right: 0;
  top: var(--stage-h);
  bottom: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, #dcdce3 0 1px, transparent 1px),
    linear-gradient(to right, #f0f0f3 0 1px, transparent 1px);
  background-size: 25% 100%, calc(100% / 12) 100%;
  background-repeat: repeat-x;
}

.lex__axis {
  position: relative;
}

/* 단계 띠 */
.lex__stages {
  position: relative;
  height: var(--stage-h);
  border-radius: 6px 6px 0 0;
  background: var(--brand-soft);
  overflow: hidden;
}

.lex__stage {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--from);
  width: var(--span);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
}

.lex__stage + .lex__stage {
  border-left: 1px solid rgba(0, 72, 168, 0.18);
}

.lex__stage-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
  white-space: nowrap;
}

.lex__stage-sub {
  font-size: 12px;
  color: var(--brand-mid);
  white-space: nowrap;
}

/* 학년 줄 */
.lex__grades {
  position: relative;
  height: 30px;
  border-bottom: 2px solid var(--shelf-dark);
}

.lex__grade {
  position: absolute;
  top: 0;
  left: var(--from);
  width: var(--span);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
}

/* 좁은 화면에서는 라벨을 걸러 냅니다 (세로선은 그대로) */
.lex__grade--minor {
  color: transparent;
}

/* 막대 한 줄 */
.lex__row {
  display: grid;
  gap: 6px;
  padding-block: 26px;
  border-top: 1px solid var(--shelf);
}

.lex__row:last-of-type {
  border-bottom: 1px solid var(--shelf);
}

.lex__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  align-self: center;
}

.lex__track {
  position: relative;
  height: 38px;
}

.lex__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--from);
  width: var(--span);
  border-radius: 999px;
  background: var(--bar);
  box-shadow: inset 0 0 0 1px rgba(36, 21, 84, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 10px;
  overflow: hidden;
}

.lex__bar span {
  font-size: 14px;
  font-weight: 700;
  color: var(--bar-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 좁은 화면에서는 막대가 짧아 역할 문구가 들어가지 않습니다.
   그때는 막대에 학년만 넣고, 역할은 프로그램 이름 아래에 둡니다. */
.lex__bar .lex__role {
  display: none;
}

.lex__role-under {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.lex__note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

@media (min-width: 760px) {
  .lex__grade--minor {
    color: var(--brand);
  }

  .lex__grade {
    font-size: 15px;
  }}


@media (min-width: 820px) {
  .lex__bar .lex__role {
    display: inline;
  }

  .lex__bar .lex__grade-text {
    display: none;
  }

  .lex__role-under {
    display: none;
  }

  .lex__stage-label {
    font-size: 16px;
  }

  .lex__stage-sub {
    font-size: 13px;
  }

  .lex__chart {
    --label-col: 180px;
    --stage-h: 52px;
  }

  .lex__grid,
  .lex__row {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
  }

  .lex__name {
    font-size: 19px;
  }

  .lex__track {
    height: 42px;
  }}



/* --- 상품 카드의 '학습 사이트 바로 가기' -------------------------------
   자세히 보기 버튼보다 가볍게 두어, 처음 온 방문자의 동선을 흐리지 않습니다. */

.home-product__site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.home-product__site:hover {
  color: var(--cta);
}

.home-product__site svg {
  flex: none;
  opacity: 0.8;
}


/* --- 학교 · 학원 안내 섹션 ---------------------------------------------
   교실 사진을 화면 전체에 깔고 그 위에 검정 막을 균일하게 덮습니다.
   사진이 밝아서 막을 얇게 하면 흰 글자 대비가 떨어집니다.
   지금 60% 는 사진을 살리는 쪽을 택한 값입니다. */

.cross-site {
  position: relative;
  background-color: #111;
  background-image: url("../../common/img/hero/cross-site-sm.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  padding-block: 64px;
}

.cross-site::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.cross-site > .container {
  position: relative;
}

/* 어두운 바탕에 맞춘 글자 */
.cross-site .eyebrow {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.cross-site .section-title {
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.cross-site .section-lead {
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.cross-site__foot {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.cross-site .btn--primary {
  background: #fff;
  color: var(--brand-ink);
}

.cross-site .btn--primary:hover {
  background: rgba(255, 255, 255, 0.86);
}

@media (min-width: 760px) {
  .cross-site {
    background-image: url("../../common/img/hero/cross-site-lg.jpg");
    display: flex;
    align-items: center;
    min-height: 420px;
    padding-block: 80px;
  }

  .cross-site > .container {
    width: 100%;
  }}



/* --- 프로그램 찾기 (진단) ----------------------------------------------
   시작 화면에서 무엇을 하는 것인지 먼저 알리고, 누른 사람만 질문으로 들어갑니다.
   흐름과 문구는 data/content.json 의 home.finder 에서 관리합니다.          */

.finder {
  max-width: 720px;
  margin-inline: auto;
}